Commit graph

15 commits

Author SHA1 Message Date
Pawkkie
7413d107ae
Should switch refactor to facilitate switch prediction (#5466)
Co-authored-by: Martin Griffin <martinrgriffin@gmail.com>
2024-10-25 13:04:42 +02:00
Galaxeeh
355739db63
Dynamic Move Types in Summary Screen/Battle (#5084)
* Dynamic Hidden Power Types

* Dynamic Ivy Cudgel is summary screens

* Dynamic Move types

* missed unnecessary comment that got left in

* format cleanup, return cleanup, added Tera Blast and Tera Starstorm, Revelation dance fix-> now displays live type update when tera is selected during battle before move selection

* forgot to revert config defaults

* Update src/pokemon.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* if block spaces/ raging bull fix/ more condensing on checks/ reallocating config check/ tera blast fix (was displaying tera blast type on non tera'd mons in party when battler was tera'd)

* revert configs

* added Hail check to Weather Ball

* Fixed agbcc compile/brackets/u32 changes

* Quick fix to ensure Judgment/Techno Blast/Natural Gift are not affected by -ate abilities

* Update src/pokemon_summary_screen.c

---------

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2024-08-08 11:08:50 +02:00
Pawkkie
7e167f0b3c
Add AI_FLAG_SEQUENCE_SWITCHING (#4878)
* AI_FLAG_BAD_SWITCHING

* Cleanup and tests, U-Turn / Baton Pass / Parting Shot aren't working properly

* Fix U-Turn etc. tests

* Test overhaul with Egg's suggestions

* Add EFFECT_HIT_SWITCH_TARGET to tests

* Review feedback

* Re-review feedback
2024-07-01 08:53:07 +02:00
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