diff options
author | yenatch <yenatch@gmail.com> | 2017-10-08 23:54:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-08 23:54:46 -0400 |
commit | b0d49dbbfbfcf39c2a9f88572437b6af77c8f709 (patch) | |
tree | be0dadd4cb3a6c36e27233836a6f104359d49949 /src/script_pokemon_util_80C4BF0.c | |
parent | b21c159b08c57a948edb268ac9b9b5baf6b4332d (diff) | |
parent | 3776a9fb4f0531535b0b5879dab7b3b6bd231736 (diff) |
Merge branch 'master' into scaninc
Diffstat (limited to 'src/script_pokemon_util_80C4BF0.c')
-rw-r--r-- | src/script_pokemon_util_80C4BF0.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index cbca07011..f98293a90 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -18,7 +18,7 @@ #include "pokedex.h" #include "pokemon.h" #include "rng.h" -#include "rom4.h" +#include "overworld.h" #include "script_pokemon_80C4.h" #include "species.h" #include "task.h" @@ -433,7 +433,7 @@ void ShowContestEntryMonPic(void) gUnknown_081FAF4C[1], species, var1); - palette = sub_80409C8(species, var2, var1); + palette = GetMonSpritePalStructFromOtIdPersonality(species, var2, var1); LoadCompressedObjectPalette(palette); GetMonSpriteTemplate_803C56C(species, 1); gUnknown_02024E8C.paletteTag = palette->tag; @@ -511,7 +511,7 @@ void ScriptRandom(void) *scriptPtr = random % *scriptPtr; } -void HealPlayerParty(void) +void ScrSpecial_HealPlayerParty(void) { u8 i, j; u8 ppBonuses; @@ -542,41 +542,39 @@ void HealPlayerParty(void) } } -u8 ScriptGiveMon(u16 species, u8 var, u16 item, u32 var3, u32 var4, u8 var5) +u8 ScriptGiveMon(u16 species, u8 level, u16 item, u32 unused1, u32 unused2, u8 unused3) { - u16 nationalSpecies; + u16 nationalDexNum; int sentToPc; - u8 array[2]; + u8 heldItem[2]; struct Pokemon mon; - CreateMon(&mon, species, var, 32, 0, 0, 0, 0); - array[0] = item; - array[1] = item >> 8; - SetMonData(&mon, MON_DATA_HELD_ITEM, array); + CreateMon(&mon, species, level, 32, 0, 0, 0, 0); + heldItem[0] = item; + heldItem[1] = item >> 8; + SetMonData(&mon, MON_DATA_HELD_ITEM, heldItem); sentToPc = GiveMonToPlayer(&mon); - nationalSpecies = SpeciesToNationalPokedexNum(species); + nationalDexNum = SpeciesToNationalPokedexNum(species); - // nested if check to fool compiler switch(sentToPc) { - case 0: - case 1: - GetNationalPokedexFlag(nationalSpecies, 2); - GetNationalPokedexFlag(nationalSpecies, 3); - return sentToPc; - default: - return sentToPc; + case 0: + case 1: + GetSetPokedexFlag(nationalDexNum, 2); + GetSetPokedexFlag(nationalDexNum, 3); + break; } + return sentToPc; } -u8 ScriptGiveEgg(u16 value) +u8 ScriptGiveEgg(u16 species) { struct Pokemon mon; - u8 data; + u8 isEgg; - sub_8042044(&mon, value, 1); - data = 1; - SetMonData(&mon, MON_DATA_IS_EGG, &data); + sub_8042044(&mon, species, 1); + isEgg = TRUE; + SetMonData(&mon, MON_DATA_IS_EGG, &isEgg); return GiveMonToPlayer(&mon); } @@ -622,18 +620,18 @@ bool8 GetNameOfEnigmaBerryInPlayerParty(void) return hasItem; } -void ScriptWildBattle(u16 species, u8 level, u16 item) +void CreateScriptedWildMon(u16 species, u8 level, u16 item) { - u8 data[2]; + u8 heldItem[2]; ZeroEnemyPartyMons(); CreateMon(&gEnemyParty[0], species, level, 0x20, 0, 0, 0, 0); if(item) { - data[0] = item; - data[1] = item >> 8; - SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, data); + heldItem[0] = item; + heldItem[1] = item >> 8; + SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, heldItem); } } |