sovereignx/include/battle_ai_switch_items.h

10 lines
355 B
C
Raw Normal View History

2017-10-10 20:45:07 +01:00
#ifndef GUARD_BATTLE_AI_SWITCH_ITEMS_H
#define GUARD_BATTLE_AI_SWITCH_ITEMS_H
2019-01-27 19:54:34 +00:00
void GetAIPartyIndexes(u32 battlerId, s32 *firstId, s32 *lastId);
void AI_TrySwitchOrUseItem(u32 battler);
Smarter SwitchAI Mon Choices | HasBadOdds Switch Check (#3253) * SwitchAI makes much smarter mon choices * Add HasHadOdds check to ShouldSwitch decision * Remove early return * Rework Baton Pass check as per discussion with Alex * Forgot to adjust a comment * Don't program before breakfast lol (if / else if fix) * Switch AI_CalcDamage for AI_DATA->simulatedDmg in HasBadOdds Thanks Alex! :D * Typo in a hitToKO comparison * Remove and replace AI_CalcPartyMonBestMoveDamage and IsAiPartyMonOHKOBy from https://github.com/rh-hideout/pokeemerald-expansion/pull/3146 See https://discord.com/channels/419213663107416084/1144447521960251472 for details * Major refactor, new struct, switchin considers damage / healing from hazards / status / held item / weather * Forgot Snow exists and heals Ice Body, haven't played Switch games lol * (https://github.com/rh-hideout/pokeemerald-expansion/commit/766a1a27a7298e50dd89c5fecc1989b3dd8b8ce3) Compatibility, use new struct field instead of function call * Fixing oversight from previous upstream merge * Improve TSpikes handling to make GetSwitchinHazardDamage more applicable Small fixes: - EFFECT_EXPLOSION typo (!= to ==) - Order of if statements near bestResistEffective - Spacing of terms in big HasBadOdds if statements * Forgot to uncomment blocks disabled for debugging what turned out to be vanilla behaviour lol * Remove another holdover from debugging, sorry :/ * Lastly, undoing my debug trainer * Type matchup based on species type rather than current type Suggested by BLourenco on Discord, the idea is that a mon that's had its type affected by a move like Soak will still have moves as though it was its regular typing, and so prioritizing the temporary typing wouldn't be ideal. https://discord.com/channels/419213663107416084/1144447521960251472/1146644578141736970 * gActiveBattler upcoming merge fixes * Egg changes part 1 * Egg changes part 2, just need to address EWRAM still * Move SwitchinCandidate struct to AiLogicData * Consider Steel type when checking TSpikes * Comment about CanBePoisoned compatibility * Changes for Egg's 2nd review * Put period back in comment, whoops lol * Latest upcoming merge fixes * Missed a few u32 updates * Combine GetBestMonIntegrate functions / flags, some modularization * Fix merge error * Make modern fixes * Two tests done, two to go * Accidentally pushed reference test, removing it * Type matchup switching tests * Tests for defensive vs offense switches --------- Co-authored-by: DizzyEggg <jajkodizzy@wp.pl>
2023-11-11 13:37:35 +00:00
u8 GetMostSuitableMonToSwitchInto(u32 battler, bool32 switchAfterMonKOd);
bool32 ShouldSwitch(u32 battler, bool32 emitResult);
2017-10-10 20:45:07 +01:00
#endif // GUARD_BATTLE_AI_SWITCH_ITEMS_H