Ejemplo n.º 1
0
        public Island(int offset, IEnumerable <Player> players, Save saveFile)
        {
            _saveFile = saveFile;
            _offset   = offset;

            Name = new Utilities.AcString(saveFile.ReadByteArray(offset + IslandName, 6), saveFile.SaveType).Trim();
            Id   = saveFile.ReadUInt16(offset + IslandId, true);

            TownName = new Utilities.AcString(saveFile.ReadByteArray(offset + TownNameOffset, 6), saveFile.SaveType).Trim();
            TownId   = saveFile.ReadUInt16(offset + TownIdOffset, true);

            var identifier = saveFile.ReadUInt16(offset - 0x2214, true);

            foreach (var player in players)
            {
                if (player != null && player.Data.Identifier == identifier)
                {
                    Owner = player;
                }
            }

            BuriedDataArray = saveFile.ReadByteArray(offset + BuriedData, 0x40);

            Items = new WorldItem[2][];
            for (var acre = 0; acre < 2; acre++)
            {
                Items[acre] = new WorldItem[0x100];
                var i = 0;
                foreach (var itemId in saveFile.ReadUInt16Array(offset + WorldData + acre * 0x200, 0x100, true))
                {
                    Items[acre][i] = new WorldItem(itemId, i % 256);
                    SetBuried(Items[acre][i], acre, BuriedDataArray, saveFile.SaveType);
                    i++;
                }
            }

            Cabana = new House(-1, offset + CottageData, 1, 0);
            Cabana.Data.Rooms[0].Name = "Cabana";

            FlagPattern = new Pattern(offset + FlagData, 0, saveFile);
            Islander    = new Villager(offset + IslanderData, 0, saveFile);
            Purchased   = IsPurchased();

            IslandLeftAcreIndex  = saveFile.ReadByte(offset + IslandLeftAcreData);
            IslandRightAcreIndex = saveFile.ReadByte(offset + IslandRightAcreData);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        public AcPlayerRelation(Save saveFile, Villager villager, int dataOffset)
        {
            SaveFile = saveFile;
            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;
        }