* Damage roll selection and AI_FLAG_CONSERVATIVE
* Clarify enum names
* Simplify AverageRollDmg line
* Change u8s to u32s
* Turns out Boomburst does a lot of damage lol
* Spacing
* stat stage related AI fixes
* add more ai fixes and 2 tests
* use legal ability in tests
* Fix test and remove mold breaker check
* Use DoesBattlerIgnoreAbilityChecks
* Adds Tidy Up + minor Dragon Cheer follow up
* improve tidy up script
* Add IncreaseTidyUpScore function
* remove useless calls
* 2 small tests and a correction for IncreasyTidyUpScore
* settwoturnstring command
* Unified two-turn attacks and Meteor Beam
To do: Solar Beam
* Solar Beam
Also fixed various function, removed EFFECT_GUST (who knows why that exists?)
* Updated Solar Beam + tests
* Redid two turn move + animations logic
Removed pointless various function; to do: remove Skull Bash, fix AI test
* Removed now-pointless flag
* Removed Skull Bash
And temporarily commented out failing AI tests
* Removed Sky Uppercut effect
Not sure when or why this was ever necessary
* Removed BattleScript_EffectSemiInvulnerable
Now uses BattleScript_EffectTwoTurnsAttack. Kept the effect; used the argument field to determine which STATUS3 such moves should apply but added a function to jump over weather checks in BattleScript_EffectTwoTurnsAttack if the current move is semi-invulnerable (since the instant-fire weather check and STATUS3 use the same field)
* Applied review changes
* Replaced VARIOUS with callnative
Tried to fix test but couldn't :/ wtf is going on
* Fixed one AI test
Cant fix the other...
* Added KNOWN_FAILING to failing AI tests
Separated them out into their own test
* Optimised script, overhauled charge turn string setting
Condensed multiple confusing macros into one, jumpifweathercheckchargeeffects. Script now tweaked and trimmed, string ids for charge turns now added to argument along with status3 (thanks to compression macro) and instant-fire-weather for semi-invulnerable and two-turn moves respectively. Also introduced a savedStringId in gBattleScripting to make string selection work.
* Unified two turn move tests + minor corrections
* Added semi-invulnerable move tests
Set the Razor Wind test to known failing - something to do with its animation?
---------
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
* Splits First Impression effect from Fake Out
* Fix test failing
* rename EFFECT_FAKE_OUT
* use moveeffect chance for fake out and priority field for first impression
* rename rest of fake out
* messed up merge
* remove useful comment
---------
Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
* Created gMoveBattleEffects array
* Renamed array to gBattleMoveEffects
Applied array in battle_util.c and battle_script_commands.c; doesn't build yet...
* Got it building...
* Added missing battle_tv effects
* Fixed and got it building
I'm an idiot sometimes
* Added battle_tv scores, encourage Encore flag
All works and builds just fine
* Merge fixes
* Reformatted battle_move_effects
Also tweaked struct, added macro
---------
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
* 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>
* Slicing moves to new bitfield
* Wind moves to new bitfield
* Two-strike moves to new bitfield
* Forgot to add flagTwoStrikes to battle_moves.h
* Removed "flag" from field names
* FLAG_HIT_IN_SUBSTITUTE and FLAG_THAW_USER
* Airborne moves
* FLAG_POWDER, FLAG_TARGET_ABILITY_IGNORED and FLAG_DANCE
* FLAG_BALLISTIC and FLAG_PROTECTION_MOVE
* Fixed missing uses of MOVE_UNAVAILABLE in battle_ai_util.c
* FLAG_SOUND
* FLAG_DMG_UNDERGROUND and FLAG_DMG_UNDERWATER
* FLAG_DMG_MINIMIZE
* Cleanup
* FLAG_STAT_STAGES_IGNORED
* Updated Pollen Puff's ballistic flag
* FLAG_STRONG_JAW_BOOST and FLAG_MEGA_LAUNCHER_BOOST
* thaw
* FLAG_THREE_STRIKES
* FLAG_IRON_FIST_BOOST
* FLAG_RECKLESS_BOOST
* FLAG_HIGH_CRIT
* Removed empty flags
* Moves that fail when called by Me First + added missing Shell Trap
* Moves that fail when Gravity is active
* Better names for banned fields
* Moves that fail when called by Instruct
* Cleanup
* Contact Moves + Fixed Wandering Spirit skipping contact checks
* Inverted FLAG_PROTECT_AFFECTED so that there's a flag for moves that SKIP protect.
* Simplified B_MOVE_FLAGS configs
* FORBIDDEN_METRONOME
* Renamed hitsPastSubstitute to ignoresSubstitute
* FORBIDDEN_PARENTAL_BOND
* Struggle uncallable by Metronome
* FORBIDDEN_MIMIC
* FLAG_KINGS_ROCK_AFFECTED
* Made a single config for move flags
* Macro for checking move flags
* FLAG_MAGIC_COAT_AFFECTED
* Fixed HasMagicCoatAffectedMove
* FLAG_SNATCH_AFFECTED
* Removed unused EFFECT_FLINCH_MINIMIZE_HIT
* Fixed Stench/King's Rock interaction
* Removed sMovesNotAffectedByStench in favor of checking move effects
* Removed EFFECT_TWISTER, which was a repeat of EFFECT_FLINCH_HIT
* Changed Gen2 configs to less than Gen 3
* FORBIDDEN_SLEEP_TALK
* Cleanup
* Inverted FLAG_MIRROR_MOVE_AFFECTED
* FLAG_SHEER_FORCE_BOOST
* Ordered
* FORBIDDEN_ASSIST and FORBIDDEN_COPYCAT
* Removed TestMoveFlags and TestMoveFlagsInMoveset + flags field
* Fixed Triple Arrows test