Exemplo n.º 1
0
        public void PutBlock(ref byte[] buffer)
        {
            EBMethods.PutString(name, ref buffer, 5, 0);

            buffer[5] = level;

            buffer[6] = (byte)(exp & 0xff);
            buffer[7] = (byte)((exp & 0xff00) >> 8);
            buffer[8] = (byte)((exp & 0xff0000) >> 16);
            buffer[9] = (byte)((exp & 0xff000000) >> 24);

            buffer[10] = (byte)(maxHP & 0xff);
            buffer[11] = (byte)((maxHP & 0xff00) >> 8);
            buffer[12] = (byte)(maxPP & 0xff);
            buffer[13] = (byte)((maxPP & 0xff00) >> 8);

            for (int i = 0; i < 7; i++)
            {
                buffer[21 + i] = statsAfter[i];
                buffer[28 + i] = statsBefore[i];
            }

            for (int i = 0; i < 14; i++)
            {
                buffer[i + 35] = items[i];
            }

            for (int i = 0; i < 4; i++)
            {
                buffer[i + 49] = equip[i];
            }

            buffer[69] = (byte)(currHP & 0xff);
            buffer[70] = (byte)((currHP & 0xff00) >> 8);
            buffer[71] = (byte)(rollHP & 0xff);
            buffer[72] = (byte)((rollHP & 0xff00) >> 8);

            buffer[75] = (byte)(currPP & 0xff);
            buffer[76] = (byte)((currPP & 0xff00) >> 8);
            buffer[77] = (byte)(rollPP & 0xff);
            buffer[78] = (byte)((rollPP & 0xff00) >> 8);
        }
Exemplo n.º 2
0
        public void LoadBlock(byte[] buffer)
        {
            byte ch = 0;

            name = "";
            for (int i = 0; i < 5; i++)
            {
                ch = buffer[i];
                if (ch > 0)
                {
                    name += EBMethods.GetChar(ch);
                }
            }

            level = buffer[5];
            exp   = (buffer[9] << 24) + (buffer[8] << 16) + (buffer[7] << 8) + buffer[6];
            maxHP = (buffer[11] << 8) + buffer[10];
            maxPP = (buffer[13] << 8) + buffer[12];

            for (int i = 0; i < 7; i++)
            {
                statsAfter[i]  = buffer[21 + i];
                statsBefore[i] = buffer[28 + i];
            }

            for (int i = 0; i < 14; i++)
            {
                items[i] = buffer[i + 35];
            }

            for (int i = 0; i < 4; i++)
            {
                equip[i] = buffer[i + 49];
            }

            currHP = (buffer[70] << 8) + buffer[69];
            rollHP = (buffer[72] << 8) + buffer[71];
            currPP = (buffer[76] << 8) + buffer[75];
            rollPP = (buffer[78] << 8) + buffer[77];
        }
Exemplo n.º 3
0
        public void LoadBlock(byte[] buffer)
        {
            byte ch = 0;

            byte[] subbuffer;

            playerName = "";
            for (int i = 0; i < 24; i++)
            {
                ch = buffer[i + 0x2c];
                if (ch > 0)
                {
                    playerName += EBMethods.GetChar(ch);
                }
            }

            petName = "";
            for (int i = 0; i < 6; i++)
            {
                ch = buffer[i + 0x44];
                if (ch > 0)
                {
                    petName += EBMethods.GetChar(ch);
                }
            }

            favFood = "";
            for (int i = 0; i < 6; i++)
            {
                ch = buffer[i + 0x4a];
                if (ch > 0)
                {
                    favFood += EBMethods.GetChar(ch);
                }
            }

            favThing = "";
            for (int i = 0; i < 7; i++)
            {
                ch = buffer[i + 0x54];
                if (ch > 0)
                {
                    favThing += EBMethods.GetChar(ch);
                }
            }

            moneyHand = (buffer[0x5f] << 24) + (buffer[0x5e] << 16) + (buffer[0x5d] << 8) + buffer[0x5c];
            moneyATM  = (buffer[0x63] << 24) + (buffer[0x62] << 16) + (buffer[0x61] << 8) + buffer[0x60];

            for (int i = 0; i < 36; i++)
            {
                escargoItems[i] = buffer[i + 0x76];
            }

            locX = (buffer[0xa3] << 8) + buffer[0xa2];
            locY = (buffer[0xa7] << 8) + buffer[0xa6];

            for (int i = 0; i < 6; i++)
            {
                partyMembers[i] = buffer[i + 0xb6];
            }

            for (int i = 0; i < 4; i++)
            {
                controlledMembers[i] = buffer[i + 0xbc];
            }

            numPartyMembers      = buffer[0xce];
            numControlledMembers = buffer[0xcf];

            exitMouseX = (buffer[0xde] << 8) + buffer[0xdd];
            exitMouseY = (buffer[0xe0] << 8) + buffer[0xdf];

            textSpeed    = buffer[0xe1];
            soundSetting = buffer[0xe2];
            inGameTimer  = (buffer[0x1f7] << 24) + (buffer[0x1f6] << 16) + (buffer[0x1f5] << 8) + buffer[0x1f4];
            textPal      = buffer[0x1f8];

            for (int i = 0; i < 4; i++)
            {
                subbuffer = new byte[0x5f];
                for (int j = 0; j < subbuffer.Length; j++)
                {
                    subbuffer[j] = buffer[(i * 0x5f) + 0x1f9 + j];
                }

                chars[i] = new PartyMember();
                chars[i].LoadBlock(subbuffer);
            }

            int flagCounter = 0;

            for (int i = 0; i < 205; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    flags[flagCounter++] = ((buffer[i + 0x433] & (1 << j)) == 0) ? false : true;
                }
            }
        }
Exemplo n.º 4
0
        public void PutBlock(ref byte[] buffer)
        {
            EBMethods.PutString(playerName, ref buffer, 24, 0x2c);
            EBMethods.PutString(petName, ref buffer, 6, 0x44);
            EBMethods.PutString(favFood, ref buffer, 6, 0x4a);
            EBMethods.PutString(favThing, ref buffer, 7, 0x54);

            buffer[0x5c] = (byte)(moneyHand & 0xff);
            buffer[0x5d] = (byte)((moneyHand & 0xff00) >> 8);
            buffer[0x5e] = (byte)((moneyHand & 0xff0000) >> 16);
            buffer[0x5f] = (byte)((moneyHand & 0xff000000) >> 24);

            buffer[0x60] = (byte)(moneyATM & 0xff);
            buffer[0x61] = (byte)((moneyATM & 0xff00) >> 8);
            buffer[0x62] = (byte)((moneyATM & 0xff0000) >> 16);
            buffer[0x63] = (byte)((moneyATM & 0xff000000) >> 24);

            for (int i = 0; i < 36; i++)
            {
                buffer[i + 0x76] = escargoItems[i];
            }

            buffer[0xa2] = (byte)(locX & 0xff);
            buffer[0xa3] = (byte)((locX & 0xff00) >> 8);
            buffer[0xa6] = (byte)(locY & 0xff);
            buffer[0xa7] = (byte)((locY & 0xff00) >> 8);

            for (int i = 0; i < 6; i++)
            {
                buffer[i + 0xb6] = partyMembers[i];
            }

            for (int i = 0; i < 4; i++)
            {
                buffer[i + 0xbc] = controlledMembers[i];
            }

            buffer[0xce] = numPartyMembers;
            buffer[0xcf] = numControlledMembers;

            buffer[0xdd] = (byte)(exitMouseX & 0xff);
            buffer[0xde] = (byte)((exitMouseX & 0xff00) >> 8);
            buffer[0xdf] = (byte)(exitMouseY & 0xff);
            buffer[0xe0] = (byte)((exitMouseY & 0xff00) >> 8);

            buffer[0xe1] = textSpeed;
            buffer[0xe2] = soundSetting;

            buffer[0x1f4] = (byte)(inGameTimer & 0xff);
            buffer[0x1f5] = (byte)((inGameTimer & 0xff00) >> 8);
            buffer[0x1f6] = (byte)((inGameTimer & 0xff0000) >> 16);
            buffer[0x1f7] = (byte)((inGameTimer & 0xff000000) >> 24);

            buffer[0x1f8] = textPal;

            byte[] subbuffer;
            for (int i = 0; i < 4; i++)
            {
                subbuffer = new byte[0x5f];
                for (int j = 0; j < subbuffer.Length; j++)
                {
                    subbuffer[j] = buffer[j + 0x1f9 + (i * 0x5f)];
                }
                chars[i].PutBlock(ref subbuffer);
                for (int j = 0; j < subbuffer.Length; j++)
                {
                    buffer[j + 0x1f9 + (i * 0x5f)] = subbuffer[j];
                }
            }

            byte ch          = 0;
            int  flagCounter = 0;

            for (int i = 0; i < 205; i++)
            {
                ch = 0;
                for (int j = 0; j < 8; j++)
                {
                    ch += (byte)((flags[flagCounter++] ? 1 : 0) << j);
                }
                buffer[i + 0x433] = ch;
            }
        }