Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Roost fixes/cleanup #2530

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ struct BattleStruct
u8 debugBattler;
u8 magnitudeBasePower;
u8 presentBasePower;
u8 roostTypes[MAX_BATTLERS_COUNT][3];
u8 roostTypes[MAX_BATTLERS_COUNT][2];
u8 savedBattlerTarget;
bool8 ateBoost[MAX_BATTLERS_COUNT];
u8 activeAbilityPopUps; // as bits for each battler
Expand Down
1 change: 1 addition & 0 deletions include/config/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#define B_STEEL_RESISTANCES GEN_LATEST // In Gen6+, Steel-type Pokémon are no longer resistant to Dark-type and Ghost-type moves.
#define B_PRANKSTER_DARK_TYPES GEN_LATEST // In Gen7+, Prankster-elevated status moves do not affect Dark type Pokémon.
#define B_SHEER_COLD_IMMUNITY GEN_LATEST // In Gen7+, Ice-types are immune to Sheer Cold
#define B_ROOST_PURE_FLYING GEN_LATEST // In Gen5+, Roost makes pure Flying-types into Normal-type.

// Turn settings
#define B_BINDING_TURNS GEN_LATEST // In Gen5+, binding moves last for 4-5 turns instead of 2-5 turns. (With Grip Claw, 7 and 5 turns respectively.)
Expand Down
14 changes: 8 additions & 6 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -4802,22 +4802,24 @@ static void Cmd_setroost(void)
{
gBattleStruct->roostTypes[gBattlerAttacker][0] = TYPE_FLYING;
gBattleStruct->roostTypes[gBattlerAttacker][1] = TYPE_FLYING;
gBattleStruct->roostTypes[gBattlerAttacker][2] = TYPE_FLYING;
#if B_ROOST_PURE_FLYING >= GEN_5
SET_BATTLER_TYPE(gBattlerAttacker, TYPE_NORMAL);
AsparagusEduardo marked this conversation as resolved.
Show resolved Hide resolved
#else
SET_BATTLER_TYPE(gBattlerAttacker, TYPE_MYSTERY);
#endif
}
// Dual Type with Flying Type.
else if ((gBattleMons[gBattlerAttacker].type1 == TYPE_FLYING && gBattleMons[gBattlerAttacker].type2 != TYPE_FLYING)
||(gBattleMons[gBattlerAttacker].type2 == TYPE_FLYING && gBattleMons[gBattlerAttacker].type1 != TYPE_FLYING))
// Dual type with flying type.
else if (gBattleMons[gBattlerAttacker].type1 == TYPE_FLYING || gBattleMons[gBattlerAttacker].type2 == TYPE_FLYING)
{
gBattleStruct->roostTypes[gBattlerAttacker][0] = gBattleMons[gBattlerAttacker].type1;
gBattleStruct->roostTypes[gBattlerAttacker][1] = gBattleMons[gBattlerAttacker].type2;
if (gBattleMons[gBattlerAttacker].type1 == TYPE_FLYING)
gBattleMons[gBattlerAttacker].type1 = TYPE_MYSTERY;
if (gBattleMons[gBattlerAttacker].type2 == TYPE_FLYING)
else if (gBattleMons[gBattlerAttacker].type2 == TYPE_FLYING)
gBattleMons[gBattlerAttacker].type2 = TYPE_MYSTERY;
}
// Non-flying type.
else if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FLYING))
else
{
gBattleStruct->roostTypes[gBattlerAttacker][0] = gBattleMons[gBattlerAttacker].type1;
gBattleStruct->roostTypes[gBattlerAttacker][1] = gBattleMons[gBattlerAttacker].type2;
Expand Down