diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2017-06-20 21:37:20 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2017-06-20 21:37:20 -0400 |
commit | 8ce2dd0be78310a839b75516a4d50a2af213c493 (patch) | |
tree | 8b9de618951a0cd84b1da0ccedbeb8953b6e08bc /src | |
parent | 98a02324ecd11b2a7c2d9b5ba1c72112e5b3d012 (diff) |
IsGrassTypeInParty
Diffstat (limited to 'src')
-rwxr-xr-x | src/field_specials.c | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/src/field_specials.c b/src/field_specials.c index 984ba7714..716043d03 100755 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1410,3 +1410,85 @@ void sub_810EEDC(void) } BuyMenuFreeMemory(); } + +void SetTrickHouseEndRoomFlag(void) +{ + u16 *specVar = &gSpecialVar_0x8004; + u16 flag = 0x259; + *specVar = flag; + FlagSet(flag); +} + +void ResetTrickHouseEndRoomFlag(void) +{ + u16 *specVar = &gSpecialVar_0x8004; + u16 flag = 0x259; + *specVar = flag; + FlagReset(flag); +} + +bool8 CheckLeadMonCool(void) +{ + if (GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_COOL) < 200) + { + return FALSE; + } + return TRUE; +} + +bool8 CheckLeadMonBeauty(void) +{ + if (GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_BEAUTY) < 200) + { + return FALSE; + } + return TRUE; +} + +bool8 CheckLeadMonCute(void) +{ + if (GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_CUTE) < 200) + { + return FALSE; + } + return TRUE; +} + +bool8 CheckLeadMonSmart(void) +{ + if (GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SMART) < 200) + { + return FALSE; + } + return TRUE; +} + +bool8 CheckLeadMonTough(void) +{ + if (GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_TOUGH) < 200) + { + return FALSE; + } + return TRUE; +} + +void IsGrassTypeInParty(void) +{ + u8 i; + u16 species; + struct Pokemon *pokemon; + for (i=0; i<PARTY_SIZE; i++) + { + pokemon = &gPlayerParty[i]; + if (GetMonData(pokemon, MON_DATA_SANITY_BIT2) && !GetMonData(pokemon, MON_DATA_IS_EGG)) + { + species = GetMonData(pokemon, MON_DATA_SPECIES); + if (gBaseStats[species].type1 == TYPE_GRASS || gBaseStats[species].type2 == TYPE_GRASS) + { + gScriptResult = TRUE; + return; + } + } + } + gScriptResult = FALSE; +} |