From 9992d17fe6e8005a1aaddb3f2e304abf5f09ebae Mon Sep 17 00:00:00 2001 From: voloved <36523934+voloved@users.noreply.github.com> Date: Mon, 30 Oct 2023 17:21:51 -0400 Subject: [PATCH] PC does not revive dead mon --- Add-Nuzlocke-Challenge.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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: