- 124
- Posts
- 9
- Years
- Seen Apr 5, 2024
I'm currently trying to make a special that checks for the pokeball used on a caught pokemon, I want it to return TRUE or FALSE and this is what I got so far
it's used in conjuction with the choosepartymon special. I thought it was working because it said true, but every mon I choose it returns TRUE, how do I make it return TRUE if the mon chosen was caught with a masterball?
EDIT: I think I got it but if anybody got a more efficient code than the one I made please let me know Im always willing to learn
Code:
bool8 CheckIfPartyMonMasterball()
{
u8 ball = ITEM_MASTER_BALL;
if (GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_POKEBALL, &ball) == ITEM_MASTER_BALL)
{
return TRUE;
}
return FALSE;
}
it's used in conjuction with the choosepartymon special. I thought it was working because it said true, but every mon I choose it returns TRUE, how do I make it return TRUE if the mon chosen was caught with a masterball?
EDIT: I think I got it but if anybody got a more efficient code than the one I made please let me know Im always willing to learn
Code:
void CheckIfPartyMonMasterball(void)
{
struct Pokemon *pokemon;
pokemon = &gPlayerParty[gSpecialVar_0x8004];
if (GetMonData(pokemon, MON_DATA_POKEBALL) == ITEM_MASTER_BALL)
{
gSpecialVar_Result = TRUE;
return;
}
gSpecialVar_Result = FALSE;
}
Attachments
Last edited: