forked from DizzyEggg/pokeemerald
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented a CannotUseItemsInBattle function (#3524)
* Implemented a CannotUseItemsInBattle function This fucntion is the result of merging CannotUseBagBattleItem and CannotUsePartyBattleItem. No reason to split the work between 2 functions when you can do it all with just 1. Misc. Changes: -Turned most of the if statements inside the function into "else if" statements for performance reasons. -Refactored how the local variable "cannotUse" was used turning it into a bool. * Made CannotUseItemsInBattle use a switch statement Misc. Changes: -Removed pointless parentheses from case EFFECT_ITEM_SET_FOCUS_ENERGY -Removed pointless i loop variable from case EFFECT_ITEM_INCREASE_ALL_STATS and replaced a hardcoded 1 in its for loop. -Turned the i loop variable declared at the top of the function into a u32 variable -Removed pointless comments. The EFFECT_ITEM constants are readable enough to convey what sort of items they affect. --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
- Loading branch information
1 parent
f700466
commit 58b03cb
Showing
3 changed files
with
85 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters