Fixes Grassy Terrain heal turn duration (#4903)
This commit is contained in:
parent
594633aa15
commit
dd7b735211
4 changed files with 38 additions and 2 deletions
|
@ -5931,6 +5931,10 @@ BattleScript_MagicRoomEnds::
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
end2
|
end2
|
||||||
|
|
||||||
|
BattleScript_GrassyTerrainEnds::
|
||||||
|
call BattleScript_GrassyTerrainHeals_Ret
|
||||||
|
goto BattleScript_TerrainEnds
|
||||||
|
|
||||||
BattleScript_TerrainEnds_Ret::
|
BattleScript_TerrainEnds_Ret::
|
||||||
printfromtable gTerrainStringIds
|
printfromtable gTerrainStringIds
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
|
@ -8225,6 +8229,10 @@ BattleScript_MoveUsedPsychicTerrainPrevents::
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
BattleScript_GrassyTerrainHeals::
|
BattleScript_GrassyTerrainHeals::
|
||||||
|
call BattleScript_GrassyTerrainHeals_Ret
|
||||||
|
end2
|
||||||
|
|
||||||
|
BattleScript_GrassyTerrainHeals_Ret::
|
||||||
setbyte gBattleCommunication, 0
|
setbyte gBattleCommunication, 0
|
||||||
BattleScript_GrassyTerrainLoop:
|
BattleScript_GrassyTerrainLoop:
|
||||||
copyarraywithindex gBattlerAttacker, gBattlerByTurnOrder, gBattleCommunication, 1
|
copyarraywithindex gBattlerAttacker, gBattlerByTurnOrder, gBattleCommunication, 1
|
||||||
|
@ -8242,7 +8250,7 @@ BattleScript_GrassyTerrainLoopEnd::
|
||||||
bicword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
bicword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
jumpifword CMP_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_PERMANENT, BattleScript_GrassyTerrainHealEnd
|
jumpifword CMP_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_PERMANENT, BattleScript_GrassyTerrainHealEnd
|
||||||
BattleScript_GrassyTerrainHealEnd:
|
BattleScript_GrassyTerrainHealEnd:
|
||||||
end2
|
return
|
||||||
|
|
||||||
BattleScript_AbilityNoSpecificStatLoss::
|
BattleScript_AbilityNoSpecificStatLoss::
|
||||||
pause B_WAIT_TIME_SHORT
|
pause B_WAIT_TIME_SHORT
|
||||||
|
|
|
@ -265,6 +265,7 @@ extern const u8 BattleScript_WonderRoomEnds[];
|
||||||
extern const u8 BattleScript_MagicRoomEnds[];
|
extern const u8 BattleScript_MagicRoomEnds[];
|
||||||
extern const u8 BattleScript_TerrainEnds[];
|
extern const u8 BattleScript_TerrainEnds[];
|
||||||
extern const u8 BattleScript_TerrainEnds_Ret[];
|
extern const u8 BattleScript_TerrainEnds_Ret[];
|
||||||
|
extern const u8 BattleScript_GrassyTerrainEnds[];
|
||||||
extern const u8 BattleScript_MudSportEnds[];
|
extern const u8 BattleScript_MudSportEnds[];
|
||||||
extern const u8 BattleScript_WaterSportEnds[];
|
extern const u8 BattleScript_WaterSportEnds[];
|
||||||
extern const u8 BattleScript_SturdiedMsg[];
|
extern const u8 BattleScript_SturdiedMsg[];
|
||||||
|
|
|
@ -1716,6 +1716,9 @@ static bool32 EndTurnTerrain(u32 terrainFlag, u32 stringTableId)
|
||||||
gFieldStatuses &= ~terrainFlag;
|
gFieldStatuses &= ~terrainFlag;
|
||||||
TryToRevertMimicryAndFlags();
|
TryToRevertMimicryAndFlags();
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = stringTableId;
|
gBattleCommunication[MULTISTRING_CHOOSER] = stringTableId;
|
||||||
|
if (terrainFlag & STATUS_FIELD_GRASSY_TERRAIN)
|
||||||
|
BattleScriptExecute(BattleScript_GrassyTerrainEnds);
|
||||||
|
else
|
||||||
BattleScriptExecute(BattleScript_TerrainEnds);
|
BattleScriptExecute(BattleScript_TerrainEnds);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,3 +85,27 @@ SINGLE_BATTLE_TEST("Grassy Terrain lasts for 5 turns")
|
||||||
MESSAGE("The grass disappeared from the battlefield.");
|
MESSAGE("The grass disappeared from the battlefield.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Grassy Terrain heals the pokemon on the field for the duration of the terrain, including last turn")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET) { HP(1); };
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_GRASSY_TERRAIN); }
|
||||||
|
TURN {}
|
||||||
|
TURN {}
|
||||||
|
TURN {}
|
||||||
|
TURN {}
|
||||||
|
} SCENE {
|
||||||
|
MESSAGE("Foe Wobbuffet used Celebrate!");
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASSY_TERRAIN, player);
|
||||||
|
MESSAGE("Grass grew to cover the battlefield!");
|
||||||
|
MESSAGE("Foe Wobbuffet is healed by the grassy terrain!");
|
||||||
|
MESSAGE("Foe Wobbuffet is healed by the grassy terrain!");
|
||||||
|
MESSAGE("Foe Wobbuffet is healed by the grassy terrain!");
|
||||||
|
MESSAGE("Foe Wobbuffet is healed by the grassy terrain!");
|
||||||
|
MESSAGE("Foe Wobbuffet is healed by the grassy terrain!");
|
||||||
|
MESSAGE("The grass disappeared from the battlefield.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue