diff --git a/Add-Nuzlocke-Challenge.md b/Add-Nuzlocke-Challenge.md index 2f27e17..f391d32 100644 --- a/Add-Nuzlocke-Challenge.md +++ b/Add-Nuzlocke-Challenge.md @@ -550,6 +550,24 @@ struct BoxPokemon }; -------------------------------- src/pokemon.c -------------------------------- +void BoxMonToMon(const struct BoxPokemon *src, struct Pokemon *dest) +{ + u32 value = 0; + dest->box = *src; + SetMonData(dest, MON_DATA_STATUS, &value); + SetMonData(dest, MON_DATA_HP, &value); + SetMonData(dest, MON_DATA_MAX_HP, &value); + value = MAIL_NONE; + SetMonData(dest, MON_DATA_MAIL, &value); + CalculateMonStats(dest); ++ if (GetMonData(dest, MON_DATA_DEAD) && FlagGet(FLAG_NUZLOCKE)) ++ { ++ value = 0; ++ SetMonData(dest, MON_DATA_HP, &value); ++ } +} + + @@ -4150,13 +4150,15 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) } case MON_DATA_LANGUAGE: