* 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>
* Tests dont allow to send out pokemon with 0 hp
* remove test test
* handle in-game 0 hp sent out
---------
Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
* Added TrainerSprite struct with coordinates
* Added .frontPic to struct
* Added .palette to TrainerSprite struct
* Added .animation to the struct
* Added define for sprite size
* Condensed animations since they were all the same
* Improved TRAINER_SPRITE/PAL defines
* Simplified seemingly unused .y_offset and TRAINER_PIC_SIZE values
* Condensed TRAINER_SPRITE and TRAINER_PAL into TRAINER_PIC
* Renamed .size to .y_offset since that what it appears to actually be
* Moved y_offset into TRAINER_PIC
* Moved animation inside of TRAINER_PIC
* Added array number to preproc
* Removed trailing spaces
* Added sprite/palette files to preproc
* Revert adding sprites to preproc as it fails agbcc
This reverts commit dce57f8d1bfab70b4c6630a9c4e5b43495891459.
* Added backsprite struct
* Added animations to backsprite struct
* Changed TRAINER_PIC to TRAINER_SPRITE
* Added animation to backsprite preproc
* Added .backPic to struct
* Moved array number into backsprite preproc
* Removed definitions for trainer sprites
* Hardcoded sAnims_Trainer into struct since every sprite uses it
* Fixed TRAINER_SPRITE arguments
Replaced ALWAYS_CRIT with an alwaysCriticalHit flag to account for the fact that in earlier generations, there is no crit stage at which crits are guaranteed. Renamed critBoost to criticalHitStage (at Edu's prompting). Reorder .criticalHitStage defines in battle_moves.h to be aligned with struct order.
* Unified EFFECT_RECOIL
Combined EFFECT_RECOIL_25/33/50/33_STATUS into a single EFFECT; added an extra field to BattleMove 'secondaryData' that contains the franction of HP recoil; argument still holds status effect for Flare Blitz/Volt Tackle
* BattleMove struct change
Added critrate, recoil, multihit fields, made zMove into a union of effect/powerOverride for status/non-status moves respectively. Added new recoil field and zMove field to all moves. To-do: crit rate, multihit
* Critrate field added
Moves use a critRate field instead of a flag - obsoletes EFFECT_ALWAYS_CRIT
* Just a little define
Makes clear that critBoost = 3 means ALWAYS CRIT
* Added a proper recoil field
Just to make it unambiguous and flexible - can finally have a move with 69% recoil.
* Fixed AI damage calculation for multi-strike moves
* Fixes + removed unused effects
* Tests fixes
Two to fix: pass when run in isolation but not when the whole group is run, which is annoying...
* Minor fixes
* Minor tweaks
* Fixed move effects
* recoil tests
---------
Co-authored-by: Alex <alexthenotes@gmail.com>
Since Gen 6, the capture rate curve was changed to make pokeballs more effective on lower level pokemon
It's by 65536 divided by 255 to the power of(1/5.33) and I did the work of translating that so a rough approximation can be done in integers, and so far, it seems to work close enough. I use this in my romhack for months now and it works fine.
* Remove unnecessary const
* Test that species ID tables are shared between all forms
* Use P_FAMILY_MELTAN
* Test that form change tables contain only IDs in form species tables
* Fix isPrimalReversion typo
* Test form change targets have appropriate species flags
* Fix#3689