diff options
author | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2017-05-09 02:36:30 -0400 |
---|---|---|
committer | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2017-05-09 02:36:30 -0400 |
commit | fc761599b412206f80d961a6052dce49b9998689 (patch) | |
tree | 1f3eb8f01ae005b8b509d1f120ce5d7bce230992 /src/egg_hatch.c | |
parent | d343d1f19a74657489d987dbd97b84e7389ae295 (diff) | |
parent | 4b4f716ae0c582068928a4ae7b31d9d10ac89eb5 (diff) |
Merge branch 'master' of https://github.com/pret/pokeruby
Diffstat (limited to 'src/egg_hatch.c')
-rw-r--r-- | src/egg_hatch.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/egg_hatch.c b/src/egg_hatch.c new file mode 100644 index 000000000..32fbe1547 --- /dev/null +++ b/src/egg_hatch.c @@ -0,0 +1,52 @@ +#include "global.h" +#include "pokemon.h" + +void CreatedHatchedMon(struct Pokemon *egg, struct Pokemon *temp) { + u16 species; + u32 personality, pokerus; + u8 i, friendship, language, gameMet, markings; + u16 moves[4]; + u32 ivs[6]; + + + species = GetMonData(egg, MON_DATA_SPECIES); + + for (i = 0; i < 4; i++) + { + moves[i] = GetMonData(egg, MON_DATA_MOVE1 + i); + } + + personality = GetMonData(egg, MON_DATA_PERSONALITY); + + for (i = 0; i < 6; i++) + { + ivs[i] = GetMonData(egg, MON_DATA_HP_IV + i); + } + + gameMet = GetMonData(egg, MON_DATA_MET_GAME); + markings = GetMonData(egg, MON_DATA_MARKINGS); + pokerus = GetMonData(egg, MON_DATA_POKERUS); + + CreateMon(temp, species, 5, 32, TRUE, personality, 0, 0); + + for (i = 0; i < 4; i++) + { + SetMonData(temp, MON_DATA_MOVE1 + i, (const u8 *) &moves[i]); + } + + for (i = 0; i < 6; i++) + { + SetMonData(temp, MON_DATA_HP_IV + i, (const u8 *) &ivs[i]); + } + + language = GAME_LANGUAGE; + SetMonData(temp, MON_DATA_LANGUAGE, &language); + SetMonData(temp, MON_DATA_MET_GAME, &gameMet); + SetMonData(temp, MON_DATA_MARKINGS, &markings); + + friendship = 120; + SetMonData(temp, MON_DATA_FRIENDSHIP, &friendship); + SetMonData(temp, MON_DATA_POKERUS, (const u8 *) &pokerus); + + *egg = *temp; +} |