sovereignx/include/constants
Pawkkie b93dfb9d59
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

* (766a1a27a7) 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 14:37:35 +01:00
..
abilities.h Add Teal Mask item, move, and ability data (#3349) 2023-10-08 15:56:09 -03:00
apprentice.h
battle.h Merge branch 'RHH/upcoming' into RHH/pr/upcoming/dynamax 2023-10-15 00:30:00 -03:00
battle_ai.h Smarter SwitchAI Mon Choices | HasBadOdds Switch Check (#3253) 2023-11-11 14:37:35 +01:00
battle_anim.h Syrup Bomb move and special speed drop anim, Credits to Dat.H A (#3474) 2023-10-27 19:14:45 -03:00
battle_anim_scripts.h Add many gen 8 move animations (#2861) 2023-06-21 13:19:54 -04:00
battle_arena.h
battle_dome.h
battle_factory.h
battle_frontier.h
battle_frontier_mons.h
battle_frontier_trainers.h
battle_move_effects.h Remove redundant AI score increases (#3504) 2023-10-31 13:41:22 +01:00
battle_palace.h
battle_pike.h
battle_pyramid.h Misc field_specials cleanup 2023-02-01 11:48:55 -05:00
battle_script_commands.h Merge branch 'RHH/master' into RHH/upcoming 2023-11-03 21:59:08 -03:00
battle_setup.h
battle_string_ids.h Adds ability Zero to Hero (#3542) 2023-11-09 08:25:46 -03:00
battle_tent.h
battle_tent_mons.h
battle_tent_trainers.h
battle_tower.h
berry.h
cable_club.h
coins.h
contest.h Merge remote-tracking branch 'pret/master' into RHH/pr/upcoming/pret_20230829 2023-08-31 14:28:01 -04:00
daycare.h Remove unused INHERITED_IV_COUNT define 2023-01-31 09:44:47 +01:00
decorations.h
easy_chat.h Document the trendy saying word group 2023-03-13 15:58:40 -04:00
event_bg.h
event_object_movement.h
event_objects.h Sync clone object macro 2023-02-08 13:11:10 -05:00
expansion.h Defines for Expansion version number (#3454) 2023-11-10 08:08:36 -03:00
field_effects.h
field_poison.h
field_specials.h Misc field_specials cleanup 2023-02-01 11:48:55 -05:00
field_tasks.h
field_weather.h
flags.h Merge pull request #1904 from GriffinRichards/temp-alias 2023-08-11 15:45:00 -04:00
form_change_types.h Merge branch 'RHH/upcoming' into RHH/pr/upcoming/dynamax 2023-10-09 16:51:41 -03:00
frontier_util.h
game_stat.h Rename GAME_STAT_FISHING_CAPTURES to GAME_STAT_FISHING_ENCOUNTERS 2023-06-05 14:15:07 +02:00
global.h Merge remote-tracking branch 'pret/master' into RHH/pr/upcoming/pret_20230829 2023-08-31 14:28:01 -04:00
heal_locations.h
hold_effects.h Adds moves Matcha Gotcha, Syrup Bomb and Ivy Cudgel (#3402) 2023-10-11 11:09:50 +02:00
item.h
item_effects.h Add Teal Mask item, move, and ability data (#3349) 2023-10-08 15:56:09 -03:00
items.h Smarter SwitchAI Mon Choices | HasBadOdds Switch Check (#3253) 2023-11-11 14:37:35 +01:00
layouts.h
lilycove_lady.h
map_groups.h
map_scripts.h
map_types.h
maps.h Correct comment in maps.h 2023-01-18 11:54:06 -05:00
mauville_old_man.h
metatile_behaviors.h Clarify MB_SEMI_DEEP_WATER name 2023-01-17 21:32:55 -05:00
metatile_labels.h Sort metatile labels alphabetically 2023-02-14 14:36:27 -05:00
moves.h Merge branch 'RHH/upcoming' into RHH/pr/upcoming/dynamax 2023-10-09 16:51:41 -03:00
mystery_gift.h
opponents.h
party_menu.h Add Frostbite status 2023-04-22 18:23:08 +02:00
pokedex.h Begin some stuff 2023-10-26 17:34:18 -04:00
pokemon.h Fixes Stantler's evolution's boolean (#3548) 2023-11-10 00:11:29 +01:00
pokemon_debug.h
region_map_sections.h
rgb.h add silk trap anim 2023-01-28 09:03:18 -05:00
roulette.h
script_menu.h
secret_bases.h
slot_machine.h
songs.h Merge remote-tracking branch 'pret/master' into RHH/pr/sync/pret_20230319 2023-03-19 20:28:56 -03:00
sound.h
species.h Merge commit '1467ffa3d8ca71b8b91da815dcf120421759793c' into gen9-species-nomigration 2023-11-02 21:28:53 -04:00
tms_hms.h Reference TMs and HMs by move instead of number (#1732) 2023-08-09 10:51:01 -04:00
trade.h Merge remote-tracking branch 'pret/master' into RHH/sync/pret_20230214 2023-02-15 14:11:03 -03:00
trainer_hill.h Fix some frontier gfx, adjacent cleanup 2023-08-03 11:15:15 -04:00
trainer_types.h
trainers.h Removed uses of F_TRAINER_PARTY_EVERYTHING_CUSTOMIZED 2023-07-05 18:22:48 -04:00
tv.h Redefine TV_SHOWS_COUNT 2023-04-27 13:59:09 -04:00
union_room.h
vars.h Add temp var aliases 2023-08-04 14:17:28 -04:00
weather.h
wild_encounter.h
z_move_effects.h