Beispiel #1
0
        void SetParty()
        {
            int tO = 0x38; // Team offset in section

            for (int i = 0; i < TEAM_SIZE * 100; i += 100)
            {
                PokeData newMon = new PokeData();
                newMon.persVal  = gs.GetUInt(tO + 0x00 + i);
                newMon.otId     = gs.GetUInt(tO + 0x04 + i);
                newMon.nickname = PkmString.GetString(gs.GetBytes(tO + 0x08 + i, NICK_LEN));
                newMon.lang     = gs.GetUShort(tO + 0x12 + i);
                newMon.otName   = PkmString.GetString(gs.GetBytes(tO + 0x14 + i, NAME_SIZE));
                newMon.checksum = gs.GetUShort(tO + 0x1C + i);
                newMon.data     = gs.GetBytes(tO + 0x20 + i, 48);
                newMon.status   = gs.GetUInt(tO + 0x50 + i);
                newMon.level    = gs.GetByte(tO + 0x54 + i);
                newMon.hp       = gs.GetUShort(tO + 0x56 + i);
                newMon.maxHp    = gs.GetUShort(tO + 0x58 + i);
                newMon.atk      = gs.GetUShort(tO + 0x5A + i);
                newMon.def      = gs.GetUShort(tO + 0x5C + i);
                newMon.spd      = gs.GetUShort(tO + 0x5E + i);
                newMon.sp_a     = gs.GetUShort(tO + 0x60 + i);
                newMon.sp_d     = gs.GetUShort(tO + 0x62 + i);
                newMon.Init();

                TeamInfo.pokeTeam[i / 100] = newMon;
            }
        }
Beispiel #2
0
        void StoreParty()
        {
            int tO = 0x38; // Team offset in section

            for (int i = 0; i < TEAM_SIZE; i++)
            {
                PokeData sDat = TeamInfo.pokeTeam[i];
                sDat.Store();
                int j = i * 100;
                gs.StoreUInt(tO + 0x00 + j, sDat.persVal);
                gs.StoreUInt(tO + 0x04 + j, sDat.otId);
                gs.StoreBytes(tO + 0x08 + j, NICK_LEN, PkmString.GetBytes(sDat.nickname));
                gs.StoreUShort(tO + 0x12 + j, sDat.lang);
                gs.StoreBytes(tO + 0x14 + j, NAME_SIZE, PkmString.GetBytes(sDat.otName));
                gs.StoreUShort(tO + 0x1C + j, sDat.checksum);
                gs.StoreBytes(tO + 0x20 + j, 48, sDat.data);
                gs.StoreUInt(tO + 0x50 + j, sDat.status);
                gs.StoreByte(tO + 0x54 + j, sDat.level);
                gs.StoreUShort(tO + 0x56 + j, sDat.hp);
                gs.StoreUShort(tO + 0x58 + j, sDat.maxHp);
                gs.StoreUShort(tO + 0x5A + j, sDat.atk);
                gs.StoreUShort(tO + 0x5C + j, sDat.def);
                gs.StoreUShort(tO + 0x5E + j, sDat.spd);
                gs.StoreUShort(tO + 0x60 + j, sDat.sp_a);
                gs.StoreUShort(tO + 0x62 + j, sDat.sp_d);
            }
        }
Beispiel #3
0
 void SetTrainerInfo()
 {
     TrainerInfo.playerName       = PkmString.GetString(gs.GetBytes(0x00, NAME_SIZE));
     TrainerInfo.playerGender     = (Gender)gs.GetByte(0x08);
     TrainerInfo.playerId.Public  = gs.GetUShort(0x0A);
     TrainerInfo.playerId.Secret  = gs.GetUShort(0x0C);
     TrainerInfo.playTime.hours   = gs.GetUShort(0x0E);
     TrainerInfo.playTime.minutes = gs.GetByte(0x10);
     TrainerInfo.playTime.seconds = gs.GetByte(0x11);
 }
Beispiel #4
0
 void StoreTrainerInfo()
 {
     gs.StoreBytes(0x00, NAME_SIZE, PkmString.GetBytes(TrainerInfo.playerName));
     gs.StoreByte(0x08, (byte)TrainerInfo.playerGender);
     gs.StoreUShort(0x0A, TrainerInfo.playerId.Public);
     gs.StoreUShort(0x0C, TrainerInfo.playerId.Secret);
     gs.StoreUShort(0x0E, TrainerInfo.playTime.hours);
     gs.StoreByte(0x10, TrainerInfo.playTime.minutes);
     gs.StoreByte(0x11, TrainerInfo.playTime.seconds);
 }