Commit graph

12 commits

Author SHA1 Message Date
DizzyEggg
698e69f2b3
add emitResult argument to ShouldSwitch AI functions (#3784) 2023-12-21 11:40:04 +01:00
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
DizzyEggg
156aa59f18 start removing gActiveBattler in controller emitters 2023-08-29 15:21:31 +02:00
AgustinGDLV
2eabcea86e
Battle Item Refactor (#2902)
* items that can be used in battle now use battlescripts
* removed ExecuteTableBasedItemEffect_
* taught AI how to use items, removed AI_itemtype/flag
* X-Items store stages raised in holdEffectParam
* USE_ITEM in tests
2023-04-14 19:25:50 +01:00
ghoulslash
c3e28e9b1a merge with be 2021-05-23 12:22:52 -06:00
ultima-soul
14a0303e2f Merge branch 'master' of github.com:pret/pokeemerald into battle_engine_sync 2021-04-27 18:36:37 -07:00
GriffinR
b6711441f5 Fix AI Guard Spec use, and Specs->Spec 2021-04-03 15:18:17 -04:00
GriffinR
9ea9ffde09 Add remaining multistring chooser constants 2021-04-03 11:49:06 -04:00
Evan
31ec3e8479 non-partner good move checks 2020-12-19 21:58:23 -07:00
DizzyEggg
736826e863 New feature - battle 2 vs 1 opponent 2019-01-27 20:54:34 +01:00
DizzyEggg
a3b62f43ee battle 9 is decompiled 2017-10-11 12:49:42 +02:00
DizzyEggg
6dfe8ced2c ai switching basically done 2017-10-10 21:45:07 +02:00