pokerogue
pokerogue copied to clipboard
Implement Quick Guard and other conditional team protection moves
With the following changes, this fully implements the moves Quick Guard, Wide Guard, Mat Block, and Crafty Shield:
- A new arena tag class
ConditionalProtectTag
applies a custom condition function to cancel the effects of qualifying moves. The subclassesQuickGuardTag
,WideGuardTag
,MatBlockTag
, andCraftyShieldTag
supply the condition functions for their respective moves. - The move Feint is updated with a new attribute
RemoveArenaTagsAttr
that removes arena tags with the specified tag type(s) from a given side of the field. Feint uses this to remove all of the tags listed above from the target's side of the field. - Pokemon.apply() is updated to apply the tags listed above to cancel incoming moves if conditions are met
Test Videos (not exhaustive, more to come)
Quick Guard:
- Charmander uses Quick Guard, then ally Bulbasaur also tries to use Quick Guard and it fails.
- Pawmi uses Quick Attack targeting Bulbasaur, and the attack is blocked by Quick Guard.
https://github.com/pagefaultgames/pokerogue/assets/168692175/41f31a0e-941f-4fa9-b0dc-a6fc899d0ce2
Wide Guard:
- Charmander uses Wide Guard, then ally Bulbasaur also tries to use Wide Guard and it fails.
- Pawmi uses Dazzling Gleam, and both player Pokemon are protected by Wide Guard.
https://github.com/pagefaultgames/pokerogue/assets/168692175/77b2eee8-3ce5-45f0-ad93-0b153839b3f6
Known Issues
- Conditional protection is not ignored by moves that ignore the effects of Protect (e.g. Quick Guard blocks Feint when it shouldn't). This should be an easy fix in
Pokemon.apply()
[EDIT: FIXED] - Feint does not disable conditional protection on its target if it resolves before the conditional protection move is used (e.g. Mat Block can be applied after Feint is used)