コード例 #1
0
ファイル: GCNPlayerMail.cs プロジェクト: Jhynjhiruu/ACSE
        public GcnPlayerMail(Save saveFile, Player owner, int index)
        {
            Index = index;
            switch (saveFile.SaveType)
            {
            case SaveType.DoubutsuNoMoriPlus:
                break;

            case SaveType.AnimalCrossing:
                Offset        = owner.Offset + 0x4E0 + index * 0x12A;
                RecipientInfo = new GCMailName(saveFile, Offset);
                SenderInfo    = new GCMailName(saveFile, Offset + 0x16);
                Present       = new Item(saveFile.ReadUInt16(Offset + 0x2C, true)); // TODO: There has to be a flag that tells the game if the item is wrapped or a quest item.
                LetterType    = (LetterType)saveFile.ReadByte(Offset + 0x2E);       // "Font"
                HeaderReceipiantStartOffset = saveFile.ReadByte(Offset + 0x2F);     // How many characters until the recipient's name should be inserted
                SenderType     = (LetterSenderType)saveFile.ReadByte(Offset + 0x30);
                StationaryType = new Item((ushort)(0x2000 | saveFile.ReadByte(Offset + 0x31)));
                Header         = saveFile.ReadString(Offset + 0x32, 0x18);
                Contents       = saveFile.ReadString(Offset + 0x4A, 0xC0);
                Footer         = saveFile.ReadString(Offset + 0x10A, 0x20);
                break;

            case SaveType.DoubutsuNoMoriEPlus:
                break;
            }
        }
コード例 #2
0
        public GcnPlayerMail(Save saveFile, int offset, int index = -1)
        {
            Index  = index;
            Offset = offset;
            var stringSize = -1;


            switch (saveFile.SaveType)
            {
            case SaveType.DoubutsuNoMoriPlus:
                break;

            case SaveType.AnimalCrossing:
                stringSize = 8;

                Header   = saveFile.ReadString(Offset + 0x32, 0x18);
                Contents = saveFile.ReadString(Offset + 0x4A, 0xC0);
                Footer   = saveFile.ReadString(Offset + 0x10A, 0x20);
                break;

            case SaveType.DoubutsuNoMoriEPlus:
            case SaveType.AnimalForestEPlus:
                stringSize = 6;

                Header   = saveFile.ReadString(Offset + 0x2A, 0xA);
                Contents = saveFile.ReadString(Offset + 0x38, 0x60);
                Footer   = saveFile.ReadString(Offset + 0xA6, 0x10);
                break;
            }

            var mailNameSize = stringSize * 2 + 6;

            RecipientInfo = new GCMailName(saveFile, Offset);
            SenderInfo    = new GCMailName(saveFile, Offset + mailNameSize);

            var mailInfoStart = Offset + mailNameSize * 2;

            Present    = new Item(saveFile.ReadUInt16(mailInfoStart, true));
            LetterType = (LetterType)saveFile.ReadByte(mailInfoStart + 2);
            HeaderReceipiantStartOffset = saveFile.ReadByte(mailInfoStart + 3);
            SenderType     = (LetterSenderType)saveFile.ReadByte(mailInfoStart + 4);
            StationaryType = new Item((ushort)(0x2000 | saveFile.ReadByte(mailInfoStart + 5)));
        }