From 9669a0554d0a2f23e28986b5fe37e804bc5d527a Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 1 Jan 2025 16:34:33 -0300 Subject: [PATCH] Encapsulate move data (#5852) --- asm/macros/battle_script.inc | 4 +- data/battle_scripts_1.s | 2 +- docs/tutorials/how_to_testing_system.md | 14 +- include/battle.h | 38 +- include/battle_main.h | 2 +- include/battle_util.h | 6 +- include/constants/battle.h | 2 +- include/move.h | 544 ++++++++++++++++++ include/pokemon.h | 122 ---- include/pokemon_summary_screen.h | 1 - include/test/battle.h | 14 +- src/battle_ai_main.c | 210 +++---- src/battle_ai_switch_items.c | 49 +- src/battle_ai_util.c | 299 +++++----- src/battle_anim.c | 2 +- src/battle_anim_new.c | 10 +- src/battle_arena.c | 17 +- src/battle_controller_opponent.c | 2 +- src/battle_controller_player.c | 28 +- src/battle_controller_player_partner.c | 5 +- src/battle_controllers.c | 2 +- src/battle_debug.c | 2 +- src/battle_dome.c | 46 +- src/battle_dynamax.c | 39 +- src/battle_gfx_sfx_util.c | 5 +- src/battle_main.c | 54 +- src/battle_script_commands.c | 443 +++++++------- src/battle_tower.c | 35 +- src/battle_tv.c | 29 +- src/battle_util.c | 440 +++++++------- src/battle_z_move.c | 64 +-- src/contest.c | 34 +- src/contest_ai.c | 24 +- src/contest_effect.c | 53 +- src/easy_chat.c | 1 + src/frontier_util.c | 2 +- src/item_icon.c | 7 +- src/item_menu.c | 14 +- src/menu_specialized.c | 29 +- src/move.c | 6 + src/move_relearner.c | 4 +- src/party_menu.c | 2 +- src/pokedex_plus_hgss.c | 22 +- src/pokemon.c | 43 +- src/pokemon_summary_screen.c | 38 +- src/rom_header_gf.c | 5 +- src/scrcmd.c | 1 + src/shop.c | 1 + test/battle/ability/aerilate.c | 4 +- test/battle/ability/anger_point.c | 10 +- test/battle/ability/anger_shell.c | 6 +- test/battle/ability/battle_bond.c | 2 +- test/battle/ability/beads_of_ruin.c | 8 +- test/battle/ability/berserk.c | 6 +- test/battle/ability/blaze.c | 2 +- test/battle/ability/clear_body.c | 44 +- test/battle/ability/cloud_nine.c | 2 +- test/battle/ability/commander.c | 10 +- test/battle/ability/compound_eyes.c | 6 +- test/battle/ability/contrary.c | 10 +- test/battle/ability/corrosion.c | 30 +- test/battle/ability/cud_chew.c | 6 +- test/battle/ability/cute_charm.c | 8 +- test/battle/ability/damp.c | 2 +- test/battle/ability/dancer.c | 36 +- test/battle/ability/dazzling.c | 2 +- test/battle/ability/defeatist.c | 4 +- test/battle/ability/defiant.c | 2 +- test/battle/ability/desolate_land.c | 10 +- test/battle/ability/disguise.c | 12 +- test/battle/ability/download.c | 6 +- test/battle/ability/dragons_maw.c | 10 +- test/battle/ability/dry_skin.c | 14 +- test/battle/ability/earth_eater.c | 8 +- test/battle/ability/effect_spore.c | 12 +- test/battle/ability/electromorphosis.c | 12 +- test/battle/ability/flame_body.c | 8 +- test/battle/ability/flower_gift.c | 4 +- test/battle/ability/fluffy.c | 10 +- test/battle/ability/frisk.c | 4 +- test/battle/ability/gale_wings.c | 14 +- test/battle/ability/galvanize.c | 10 +- test/battle/ability/good_as_gold.c | 10 +- test/battle/ability/grim_neigh.c | 4 +- test/battle/ability/gulp_missile.c | 4 +- test/battle/ability/harvest.c | 14 +- test/battle/ability/hyper_cutter.c | 16 +- test/battle/ability/ice_body.c | 4 +- test/battle/ability/ice_face.c | 34 +- test/battle/ability/ice_scales.c | 8 +- test/battle/ability/immunity.c | 4 +- test/battle/ability/innards_out.c | 10 +- test/battle/ability/insomnia.c | 6 +- test/battle/ability/intimidate.c | 18 +- test/battle/ability/intrepid_sword.c | 2 +- test/battle/ability/keen_eye.c | 16 +- test/battle/ability/leaf_guard.c | 10 +- test/battle/ability/lightning_rod.c | 4 +- test/battle/ability/liquid_ooze.c | 4 +- test/battle/ability/magic_bounce.c | 16 +- test/battle/ability/magic_guard.c | 2 +- test/battle/ability/magician.c | 2 +- test/battle/ability/minds_eye.c | 2 +- test/battle/ability/mirror_armor.c | 4 +- test/battle/ability/moxie.c | 6 +- test/battle/ability/mummy.c | 8 +- test/battle/ability/neuroforce.c | 4 +- test/battle/ability/oblivious.c | 6 +- test/battle/ability/opportunist.c | 2 +- test/battle/ability/overcoat.c | 2 +- test/battle/ability/overgrow.c | 2 +- test/battle/ability/own_tempo.c | 12 +- test/battle/ability/parental_bond.c | 50 +- test/battle/ability/pastel_veil.c | 12 +- test/battle/ability/pickup.c | 8 +- test/battle/ability/pixilate.c | 4 +- test/battle/ability/poison_point.c | 8 +- test/battle/ability/poison_puppeteer.c | 2 +- test/battle/ability/poison_touch.c | 14 +- test/battle/ability/prankster.c | 4 +- test/battle/ability/primordial_sea.c | 10 +- test/battle/ability/protosynthesis.c | 4 +- test/battle/ability/purifying_salt.c | 12 +- test/battle/ability/quark_drive.c | 4 +- test/battle/ability/rain_dish.c | 2 +- test/battle/ability/rattled.c | 20 +- test/battle/ability/refrigerate.c | 4 +- test/battle/ability/rocky_payload.c | 10 +- test/battle/ability/sand_veil.c | 2 +- test/battle/ability/sap_sipper.c | 2 +- test/battle/ability/seed_sower.c | 4 +- test/battle/ability/sharpness.c | 4 +- test/battle/ability/shed_skin.c | 2 +- test/battle/ability/sheer_force.c | 100 ++-- test/battle/ability/snow_cloak.c | 2 +- test/battle/ability/stalwart.c | 4 +- test/battle/ability/stamina.c | 10 +- test/battle/ability/stance_change.c | 2 +- test/battle/ability/static.c | 8 +- test/battle/ability/steelworker.c | 10 +- test/battle/ability/stench.c | 8 +- test/battle/ability/storm_drain.c | 4 +- test/battle/ability/sturdy.c | 2 +- test/battle/ability/supreme_overlord.c | 4 +- test/battle/ability/swarm.c | 6 +- test/battle/ability/sword_of_ruin.c | 8 +- test/battle/ability/tablets_of_ruin.c | 8 +- test/battle/ability/tangling_hair.c | 8 +- test/battle/ability/teraform_zero.c | 8 +- test/battle/ability/torrent.c | 2 +- test/battle/ability/toxic_chain.c | 22 +- test/battle/ability/toxic_debris.c | 4 +- test/battle/ability/transistor.c | 12 +- test/battle/ability/vessel_of_ruin.c | 8 +- test/battle/ability/volt_absorb.c | 18 +- test/battle/ability/water_absorb.c | 14 +- test/battle/ability/weak_armor.c | 12 +- test/battle/ability/wind_power.c | 22 +- test/battle/ability/wind_rider.c | 6 +- test/battle/ability/zero_to_hero.c | 12 +- test/battle/ai/ai.c | 146 ++--- test/battle/ai/ai_calc_best_move_score.c | 34 +- test/battle/ai/ai_check_viability.c | 36 +- test/battle/ai/ai_choice.c | 18 +- test/battle/ai/ai_double_ace.c | 4 +- test/battle/ai/ai_flag_predict_ability.c | 2 +- test/battle/ai/ai_flag_risky.c | 6 +- test/battle/ai/ai_flag_sequence_switching.c | 12 +- test/battle/ai/ai_powerful_status.c | 12 +- test/battle/ai/ai_switching.c | 84 +-- test/battle/ai/ai_trytofaint.c | 6 +- test/battle/crit_chance.c | 16 +- test/battle/damage_formula.c | 14 +- test/battle/form_change/mega_evolution.c | 4 +- test/battle/form_change/primal_reversion.c | 24 +- test/battle/form_change/ultra_burst.c | 2 +- test/battle/gimmick/dynamax.c | 104 ++-- test/battle/gimmick/terastal.c | 16 +- test/battle/gimmick/zmove.c | 92 +-- test/battle/hold_effect/air_balloon.c | 6 +- test/battle/hold_effect/attack_up.c | 4 +- test/battle/hold_effect/berserk_gene.c | 12 +- test/battle/hold_effect/blunder_policy.c | 6 +- test/battle/hold_effect/booster_energy.c | 4 +- test/battle/hold_effect/clear_amulet.c | 14 +- test/battle/hold_effect/critical_hit_up.c | 6 +- test/battle/hold_effect/defense_up.c | 4 +- test/battle/hold_effect/jaboca_berry.c | 6 +- test/battle/hold_effect/kee_berry.c | 4 +- test/battle/hold_effect/maranga_berry.c | 6 +- test/battle/hold_effect/metronome.c | 4 +- test/battle/hold_effect/micle_berry.c | 10 +- test/battle/hold_effect/mirror_herb.c | 2 +- test/battle/hold_effect/ogerpon_mask.c | 2 +- test/battle/hold_effect/protective_pads.c | 2 +- test/battle/hold_effect/red_card.c | 2 +- test/battle/hold_effect/restore_hp.c | 2 +- test/battle/hold_effect/restore_stats.c | 6 +- test/battle/hold_effect/room_service.c | 6 +- test/battle/hold_effect/rowap_berry.c | 6 +- test/battle/hold_effect/safety_goggles.c | 2 +- test/battle/hold_effect/special_attack_up.c | 4 +- test/battle/hold_effect/special_defense_up.c | 4 +- test/battle/hold_effect/speed_up.c | 4 +- test/battle/hold_effect/utility_umbrella.c | 4 +- test/battle/item_effect/escape.c | 2 +- test/battle/item_effect/increase_stat.c | 14 +- test/battle/move.c | 24 +- test/battle/move_effect/absorb.c | 4 +- test/battle/move_effect/accuracy_down.c | 6 +- test/battle/move_effect/acrobatics.c | 4 +- test/battle/move_effect/after_you.c | 4 +- test/battle/move_effect/ally_switch.c | 14 +- test/battle/move_effect/assist.c | 2 +- test/battle/move_effect/attack_accuracy_up.c | 2 +- test/battle/move_effect/attack_down.c | 4 +- test/battle/move_effect/attack_down_2.c | 4 +- test/battle/move_effect/attack_spatk_up.c | 6 +- test/battle/move_effect/attack_up.c | 4 +- test/battle/move_effect/attack_up_2.c | 4 +- test/battle/move_effect/attack_up_user_ally.c | 8 +- test/battle/move_effect/aura_wheel.c | 2 +- test/battle/move_effect/aurora_veil.c | 2 +- test/battle/move_effect/baton_pass.c | 2 +- test/battle/move_effect/beak_blast.c | 14 +- test/battle/move_effect/belch.c | 16 +- test/battle/move_effect/belly_drum.c | 8 +- test/battle/move_effect/bide.c | 2 +- test/battle/move_effect/body_press.c | 18 +- test/battle/move_effect/brick_break.c | 10 +- test/battle/move_effect/change_type_on_item.c | 4 +- test/battle/move_effect/charge.c | 10 +- test/battle/move_effect/chilly_reception.c | 2 +- test/battle/move_effect/coaching.c | 8 +- test/battle/move_effect/collision_course.c | 2 +- test/battle/move_effect/confuse.c | 2 +- test/battle/move_effect/corrosive_gas.c | 4 +- test/battle/move_effect/cosmic_power.c | 2 +- test/battle/move_effect/court_change.c | 2 +- test/battle/move_effect/curse.c | 2 +- test/battle/move_effect/dark_void.c | 2 +- test/battle/move_effect/defense_curl.c | 4 +- test/battle/move_effect/defense_down.c | 4 +- test/battle/move_effect/defense_down_2.c | 4 +- test/battle/move_effect/defense_up.c | 4 +- test/battle/move_effect/defense_up_2.c | 4 +- test/battle/move_effect/defense_up_3.c | 4 +- test/battle/move_effect/defog.c | 32 +- test/battle/move_effect/destiny_bond.c | 2 +- test/battle/move_effect/doodle.c | 2 +- .../move_effect/double_power_on_arg_status.c | 8 +- test/battle/move_effect/dragon_cheer.c | 16 +- test/battle/move_effect/dragon_darts.c | 8 +- test/battle/move_effect/dream_eater.c | 2 +- test/battle/move_effect/dynamax_double_dmg.c | 2 +- test/battle/move_effect/earthquake.c | 4 +- test/battle/move_effect/embargo.c | 2 +- test/battle/move_effect/encore.c | 2 +- test/battle/move_effect/endeavor.c | 2 +- test/battle/move_effect/evasion_up.c | 6 +- test/battle/move_effect/explosion.c | 4 +- .../battle/move_effect/fail_if_not_arg_type.c | 12 +- test/battle/move_effect/fickle_beam.c | 6 +- test/battle/move_effect/fillet_away.c | 2 +- test/battle/move_effect/fixed_damage_arg.c | 4 +- test/battle/move_effect/flame_burst.c | 4 +- test/battle/move_effect/fling.c | 16 +- test/battle/move_effect/flower_shield.c | 2 +- test/battle/move_effect/focus_punch.c | 2 +- test/battle/move_effect/foul_play.c | 6 +- test/battle/move_effect/fury_cutter.c | 2 +- test/battle/move_effect/future_sight.c | 10 +- test/battle/move_effect/gastro_acid.c | 2 +- test/battle/move_effect/glaive_rush.c | 4 +- test/battle/move_effect/gravity.c | 2 +- test/battle/move_effect/guard_split.c | 2 +- test/battle/move_effect/haze.c | 6 +- test/battle/move_effect/heal_bell.c | 4 +- test/battle/move_effect/heal_pulse.c | 8 +- test/battle/move_effect/healing_wish.c | 4 +- test/battle/move_effect/hit_escape.c | 4 +- .../move_effect/hit_set_remove_terrain.c | 12 +- test/battle/move_effect/hit_switch_target.c | 4 +- test/battle/move_effect/hold_hands.c | 2 +- test/battle/move_effect/hydro_steam.c | 2 +- test/battle/move_effect/instruct.c | 28 +- test/battle/move_effect/ion_deluge.c | 4 +- test/battle/move_effect/ivy_cudgel.c | 2 +- test/battle/move_effect/knock_off.c | 2 +- test/battle/move_effect/last_resort.c | 4 +- test/battle/move_effect/last_respects.c | 2 +- test/battle/move_effect/leech_seed.c | 2 +- test/battle/move_effect/magic_coat.c | 4 +- test/battle/move_effect/max_hp_50_recoil.c | 2 +- test/battle/move_effect/metronome.c | 8 +- test/battle/move_effect/mind_blown.c | 4 +- test/battle/move_effect/mirror_move.c | 8 +- test/battle/move_effect/moonlight.c | 2 +- test/battle/move_effect/morning_sun.c | 2 +- test/battle/move_effect/multi_hit.c | 18 +- test/battle/move_effect/ohko.c | 4 +- test/battle/move_effect/photon_geyser.c | 4 +- test/battle/move_effect/pledge.c | 18 +- test/battle/move_effect/population_bomb.c | 2 +- test/battle/move_effect/powder.c | 32 +- .../move_effect/power_based_on_target_hp.c | 2 +- .../move_effect/power_based_on_user_hp.c | 2 +- test/battle/move_effect/power_split.c | 2 +- test/battle/move_effect/protect.c | 76 +-- test/battle/move_effect/pursuit.c | 24 +- test/battle/move_effect/quash.c | 8 +- test/battle/move_effect/rage_fist.c | 8 +- test/battle/move_effect/raging_bull.c | 10 +- test/battle/move_effect/recoil_if_miss.c | 6 +- test/battle/move_effect/reflect.c | 6 +- test/battle/move_effect/refresh.c | 6 +- test/battle/move_effect/relic_song.c | 2 +- test/battle/move_effect/retaliate.c | 24 +- test/battle/move_effect/revelation_dance.c | 10 +- test/battle/move_effect/revival_blessing.c | 2 +- test/battle/move_effect/roar.c | 2 +- test/battle/move_effect/role_play.c | 2 +- test/battle/move_effect/roost.c | 38 +- test/battle/move_effect/round.c | 4 +- test/battle/move_effect/semi_invulnerable.c | 24 +- test/battle/move_effect/shed_tail.c | 6 +- test/battle/move_effect/shell_trap.c | 16 +- test/battle/move_effect/simple_beam.c | 2 +- test/battle/move_effect/skill_swap.c | 2 +- test/battle/move_effect/sleep.c | 2 +- test/battle/move_effect/sleep_talk.c | 8 +- test/battle/move_effect/smelling_salts.c | 2 +- test/battle/move_effect/solar_beam.c | 4 +- test/battle/move_effect/sparkling_aria.c | 4 +- test/battle/move_effect/special_attack_down.c | 4 +- test/battle/move_effect/special_attack_up_3.c | 4 +- test/battle/move_effect/spicy_extract.c | 4 +- test/battle/move_effect/spikes.c | 2 +- test/battle/move_effect/stealth_rock.c | 2 +- test/battle/move_effect/sticky_web.c | 6 +- test/battle/move_effect/stockpile.c | 14 +- test/battle/move_effect/stomping_tantrum.c | 2 +- test/battle/move_effect/strength_sap.c | 8 +- test/battle/move_effect/stuff_cheeks.c | 4 +- test/battle/move_effect/substitute.c | 2 +- .../move_effect/super_effective_on_arg.c | 2 +- test/battle/move_effect/synthesis.c | 2 +- test/battle/move_effect/tailwind.c | 2 +- test/battle/move_effect/take_heart.c | 6 +- test/battle/move_effect/tar_shot.c | 4 +- test/battle/move_effect/teatime.c | 2 +- test/battle/move_effect/telekinesis.c | 8 +- test/battle/move_effect/teleport.c | 2 +- test/battle/move_effect/tera_blast.c | 4 +- test/battle/move_effect/tera_starstorm.c | 10 +- test/battle/move_effect/thousand_arrows.c | 4 +- test/battle/move_effect/thunder.c | 4 +- test/battle/move_effect/tidy_up.c | 2 +- test/battle/move_effect/torment.c | 2 +- test/battle/move_effect/toxic.c | 2 +- test/battle/move_effect/toxic_spikes.c | 4 +- test/battle/move_effect/triple_kick.c | 2 +- test/battle/move_effect/two_turns_attack.c | 10 +- test/battle/move_effect/upper_hand.c | 30 +- test/battle/move_effect/uproar.c | 2 +- test/battle/move_effect/wake_up_slap.c | 2 +- test/battle/move_effect/weather_ball.c | 2 +- test/battle/move_effect/worry_seed.c | 2 +- test/battle/move_effect_secondary/bug_bite.c | 2 +- test/battle/move_effect_secondary/burn.c | 4 +- test/battle/move_effect_secondary/freeze.c | 4 +- .../battle/move_effect_secondary/ion_deluge.c | 2 +- test/battle/move_effect_secondary/order_up.c | 8 +- test/battle/move_effect_secondary/paralysis.c | 2 +- .../move_effect_secondary/psychic_noise.c | 2 +- test/battle/move_effects_combined/axe_kick.c | 2 +- .../move_effects_combined/barb_barrage.c | 4 +- test/battle/move_effects_combined/hurricane.c | 16 +- .../move_effects_combined/infernal_parade.c | 4 +- .../move_effects_combined/make_it_rain.c | 2 +- .../move_effects_combined/triple_arrows.c | 2 +- test/battle/move_flags/cant_use_twice.c | 8 +- .../damages_airborne_double_damage.c | 2 +- test/battle/move_flags/damages_underground.c | 2 +- test/battle/move_flags/damages_underwater.c | 2 +- .../move_flags/ignores_target_ability.c | 14 +- .../move_flags/minimize_double_damage.c | 4 +- test/battle/move_flags/powder.c | 2 +- test/battle/move_flags/recoil.c | 8 +- test/battle/move_flags/strike_count.c | 8 +- test/battle/sleep_clause.c | 206 +++---- test/battle/spread_moves.c | 38 +- test/battle/status1/burn.c | 2 +- test/battle/status1/freeze.c | 4 +- test/battle/status1/frostbite.c | 2 +- test/battle/status2/confusion.c | 2 +- test/battle/weather/rain.c | 4 +- test/battle/weather/sandstorm.c | 2 +- test/battle/weather/snow.c | 4 +- test/battle/weather/sunlight.c | 4 +- test/test_runner_battle.c | 10 +- test/text.c | 28 +- 402 files changed, 3320 insertions(+), 2822 deletions(-) create mode 100644 include/move.h create mode 100644 src/move.c diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 48920a04a2c1..80e9b3678912 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1520,8 +1520,8 @@ .4byte \jumpInstr .endm - .macro jumpifargument argument:req, jumpInstr:req - callnative BS_JumpIfArgument + .macro jumpifmovepropertyargument argument:req, jumpInstr:req + callnative BS_JumpIfMovePropertyArgument .byte \argument .4byte \jumpInstr .endm diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 83f3fd346ab6..cb6329c142fd 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -9454,7 +9454,7 @@ BattleScript_EffectHitSetRemoveTerrain:: accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring ppreduce - jumpifargument ARG_TRY_REMOVE_TERRAIN_FAIL, BattleScript_RemoveTerrain + jumpifmovepropertyargument ARG_TRY_REMOVE_TERRAIN_FAIL, BattleScript_RemoveTerrain critcalc damagecalc adjustdamage diff --git a/docs/tutorials/how_to_testing_system.md b/docs/tutorials/how_to_testing_system.md index c573dfbbf7f6..da11944e2502 100644 --- a/docs/tutorials/how_to_testing_system.md +++ b/docs/tutorials/how_to_testing_system.md @@ -32,7 +32,7 @@ This can be translated to an automated test as follows: ``` ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_STUN_SPORE].effect == EFFECT_PARALYZE); + ASSUME(GetMoveEffect(MOVE_STUN_SPORE) == EFFECT_PARALYZE); } SINGLE_BATTLE_TEST("Stun Spore inflicts paralysis") @@ -78,7 +78,7 @@ This can again be translated as follows: SINGLE_BATTLE_TEST("Stun Spore does not affect Grass-types") { GIVEN { - ASSUME(gMovesInfo[MOVE_STUN_SPORE].powderMove); + ASSUME(IsPowderMove(MOVE_STUN_SPORE)); ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS); PLAYER(SPECIES_ODDISH); // 1. OPPONENT(SPECIES_ODDISH); // 2. @@ -111,7 +111,7 @@ SINGLE_BATTLE_TEST("Meditate raises Attack", s16 damage) PARAMETRIZE { raiseAttack = FALSE; } PARAMETRIZE { raiseAttack = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -146,7 +146,7 @@ The overworld is not available, so it is only possible to test commands which do ### `ASSUME` `ASSUME(cond)` Causes the test to be skipped if `cond` is false. Used to document any prerequisites of the test, e.g. to test Burn reducing the Attack of a Pokémon we can observe the damage of a physical attack with and without the burn. To document that this test assumes the attack is physical we can use: -`ASSUME(gMovesInfo[MOVE_WHATEVER].category == DAMAGE_CATEGORY_PHYSICAL);` +`ASSUME(GetMoveCategory(MOVE_WHATEVER) == DAMAGE_CATEGORY_PHYSICAL);` ### `ASSUMPTIONS` ``` @@ -159,7 +159,7 @@ Should be placed immediately after any `#includes` and contain any `ASSUME` stat ``` ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_POISON_STING].effect == EFFECT_POISON_HIT); + ASSUME(GetMoveEffect(MOVE_POISON_STING) == EFFECT_POISON_HIT); } ``` @@ -201,7 +201,7 @@ SINGLE_BATTLE_TEST("Blaze boosts Fire-type moves in a pinch", s16 damage) PARAMETRIZE { hp = 99; } PARAMETRIZE { hp = 33; } GIVEN { - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); PLAYER(SPECIES_CHARMANDER) { Ability(ABILITY_BLAZE); MaxHP(99); HP(hp); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -233,7 +233,7 @@ SINGLE_BATTLE_TEST("Paralysis has a 25% chance of skipping the turn") All `BattleRandom` calls involving tag will return the same number, so this cannot be used to have two moves independently hit or miss, for example. If the tag is not provided, runs the test 50 times and computes an approximate pass ratio. -`PASSES_RANDOMLY(gMovesInfo[move].accuracy, 100);` +`PASSES_RANDOMLY(GetMoveAccuracy(move), 100);` Note that this mode of PASSES_RANDOMLY makes the tests run very slowly and should be avoided where possible. If the mechanic you are testing is missing its tag, you should add it. ### `GIVEN` diff --git a/include/battle.h b/include/battle.h index 0f798ea4819b..413380ccba62 100644 --- a/include/battle.h +++ b/include/battle.h @@ -17,6 +17,7 @@ #include "battle_dynamax.h" #include "battle_terastal.h" #include "battle_gimmick.h" +#include "move.h" #include "random.h" // for rng_value_t // Helper for accessing command arguments and advancing gBattlescriptCurrInstr. @@ -70,20 +71,6 @@ // Special indicator value for shellBellDmg in SpecialStatus #define IGNORE_SHELL_BELL 0xFFFF -// For defining EFFECT_HIT etc. with battle TV scores and flags etc. -struct __attribute__((packed, aligned(2))) BattleMoveEffect -{ - const u8 *battleScript; - u16 battleTvScore:3; - u16 encourageEncore:1; - u16 twoTurnEffect:1; - u16 semiInvulnerableEffect:1; - u16 usesProtectCounter:1; - u16 padding:9; -}; - -#define GET_MOVE_BATTLESCRIPT(move) gBattleMoveEffects[gMovesInfo[move].effect].battleScript - struct ResourceFlags { u32 flags[MAX_BATTLERS_COUNT]; @@ -864,11 +851,25 @@ STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLER #define F_DYNAMIC_TYPE_IGNORE_PHYSICALITY (1 << 6) // If set, the dynamic type's physicality won't be used for certain move effects. #define F_DYNAMIC_TYPE_SET (1 << 7) // Set for all dynamic types to distinguish a dynamic type of Normal (0) from no dynamic type. -#define IS_MOVE_PHYSICAL(move) (GetBattleMoveCategory(move) == DAMAGE_CATEGORY_PHYSICAL) -#define IS_MOVE_SPECIAL(move) (GetBattleMoveCategory(move) == DAMAGE_CATEGORY_SPECIAL) -#define IS_MOVE_STATUS(move) (gMovesInfo[move].category == DAMAGE_CATEGORY_STATUS) +static inline bool32 IsBattleMovePhysical(u32 move) +{ + return GetBattleMoveCategory(move) == DAMAGE_CATEGORY_PHYSICAL; +} + +static inline bool32 IsBattleMoveSpecial(u32 move) +{ + return GetBattleMoveCategory(move) == DAMAGE_CATEGORY_SPECIAL; +} -#define IS_MOVE_RECOIL(move)(gMovesInfo[move].recoil > 0 || gMovesInfo[move].effect == EFFECT_RECOIL_IF_MISS) +static inline bool32 IsBattleMoveStatus(u32 move) +{ + return GetMoveCategory(move) == DAMAGE_CATEGORY_STATUS; +} + +static inline bool32 IsBattleMoveRecoil(u32 move) +{ + return GetMoveRecoil(move) > 0 || GetMoveEffect(move) == EFFECT_RECOIL_IF_MISS; +} /* Checks if 'battlerId' is any of the types. * Passing multiple types is more efficient than calling this multiple @@ -1176,7 +1177,6 @@ extern u32 gFieldStatuses; extern struct FieldTimer gFieldTimers; extern u8 gBattlerAbility; extern struct QueuedStatBoost gQueuedStatBoosts[MAX_BATTLERS_COUNT]; -extern const struct BattleMoveEffect gBattleMoveEffects[]; extern void (*gPreBattleCallback1)(void); extern void (*gBattleMainFunc)(void); diff --git a/include/battle_main.h b/include/battle_main.h index 7e3206c554bd..e8368f82d619 100644 --- a/include/battle_main.h +++ b/include/battle_main.h @@ -72,7 +72,7 @@ void SwapTurnOrder(u8 id1, u8 id2); u32 GetBattlerTotalSpeedStatArgs(u32 battler, u32 ability, u32 holdEffect); u32 GetBattlerTotalSpeedStat(u32 battler); s8 GetChosenMovePriority(u32 battlerId); -s8 GetMovePriority(u32 battlerId, u16 move); +s8 GetBattleMovePriority(u32 battlerId, u16 move); s32 GetWhichBattlerFasterArgs(u32 battler1, u32 battler2, bool32 ignoreChosenMoves, u32 ability1, u32 ability2, u32 holdEffectBattler1, u32 holdEffectBattler2, u32 speedBattler1, u32 speedBattler2, s32 priority1, s32 priority2); s32 GetWhichBattlerFasterOrTies(u32 battler1, u32 battler2, bool32 ignoreChosenMoves); diff --git a/include/battle_util.h b/include/battle_util.h index f86f9e865e90..46c491a85371 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -1,6 +1,8 @@ #ifndef GUARD_BATTLE_UTIL_H #define GUARD_BATTLE_UTIL_H +#include "move.h" + #define MOVE_LIMITATION_ZEROMOVE (1 << 0) #define MOVE_LIMITATION_PP (1 << 1) #define MOVE_LIMITATION_DISABLED (1 << 2) @@ -226,7 +228,7 @@ u32 ItemBattleEffects(enum ItemEffect, u32 battler, bool32 moveTurn); void ClearVariousBattlerFlags(u32 battler); void HandleAction_RunBattleScript(void); u32 SetRandomTarget(u32 battler); -u32 GetMoveTarget(u16 move, u8 setTarget); +u32 GetBattleMoveTarget(u16 move, u8 setTarget); u8 GetAttackerObedienceForAction(); u32 GetBattlerHoldEffect(u32 battler, bool32 checkNegating); u32 GetBattlerHoldEffectIgnoreAbility(u32 battler, bool32 checkNegating); @@ -328,7 +330,7 @@ u32 GetBattlerType(u32 battler, u32 typeIndex, bool32 ignoreTera); bool8 CanMonParticipateInSkyBattle(struct Pokemon *mon); bool8 IsMonBannedFromSkyBattles(u16 species); void RemoveBattlerType(u32 battler, u8 type); -u32 GetMoveType(u32 move); +u32 GetBattleMoveType(u32 move); void TryActivateSleepClause(u32 battler, u32 indexInParty); void TryDeactivateSleepClause(u32 battlerSide, u32 indexInParty); bool32 IsSleepClauseActiveForSide(u32 battlerSide); diff --git a/include/constants/battle.h b/include/constants/battle.h index ecd6d4d0e4b4..1685b0e58257 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -520,7 +520,7 @@ #define MOVE_TARGET_ALLY (1 << 7) #define MOVE_TARGET_ALL_BATTLERS ((1 << 8) | MOVE_TARGET_USER) // No functionality for status moves -// For the second argument of GetMoveTarget, when no target override is needed +// For the second argument of GetBattleMoveTarget, when no target override is needed #define NO_TARGET_OVERRIDE 0 // Constants for Parental Bond diff --git a/include/move.h b/include/move.h new file mode 100644 index 000000000000..67206d9ba232 --- /dev/null +++ b/include/move.h @@ -0,0 +1,544 @@ +#ifndef GUARD_MOVES_H +#define GUARD_MOVES_H + +#include "contest_effect.h" +#include "constants/battle_move_effects.h" +#include "constants/moves.h" + +// For defining EFFECT_HIT etc. with battle TV scores and flags etc. +struct __attribute__((packed, aligned(2))) BattleMoveEffect +{ + const u8 *battleScript; + u16 battleTvScore:3; + u16 encourageEncore:1; + u16 twoTurnEffect:1; + u16 semiInvulnerableEffect:1; + u16 usesProtectCounter:1; + u16 padding:9; +}; + +#define EFFECTS_ARR(...) (const struct AdditionalEffect[]) {__VA_ARGS__} +#define ADDITIONAL_EFFECTS(...) EFFECTS_ARR( __VA_ARGS__ ), .numAdditionalEffects = ARRAY_COUNT(EFFECTS_ARR( __VA_ARGS__ )) + +enum SheerForceBoost +{ + SHEER_FORCE_AUTO_BOOST, // This is the default state when a move has a move effect with a chance + SHEER_FORCE_BOOST, // If a move effect doesn't have an effect with a chance this can force a boost + SHEER_FORCE_NO_BOOST, // Prevents a Sheer Force boost +}; + +struct AdditionalEffect +{ + u16 moveEffect; + u8 self:1; + u8 onlyIfTargetRaisedStats:1; + u8 onChargeTurnOnly:1; + u8 sheerForceBoost:2; // Handles edge cases for Sheer Force + u8 padding:3; + u8 chance; // 0% = effect certain, primary effect +}; + +struct MoveInfo +{ + const u8 *name; + const u8 *description; + u16 effect; + u16 type:5; // Up to 32 + u16 category:2; + u16 power:9; // up to 511 + // end of word + u16 accuracy:7; + u16 target:9; + u8 pp; + union { + u8 effect; + u8 powerOverride; + } zMove; + // end of word + s32 priority:4; + u32 recoil:7; + u32 strikeCount:4; // Max 15 hits. Defaults to 1 if not set. May apply its effect on each hit. + u32 criticalHitStage:2; + bool32 alwaysCriticalHit:1; + u32 numAdditionalEffects:2; // limited to 3 - don't want to get too crazy + // Flags + bool32 makesContact:1; + bool32 ignoresProtect:1; + bool32 magicCoatAffected:1; + bool32 snatchAffected:1; + bool32 ignoresKingsRock:1; + bool32 punchingMove:1; + bool32 bitingMove:1; + bool32 pulseMove:1; + bool32 soundMove:1; + bool32 ballisticMove:1; + bool32 powderMove:1; + bool32 danceMove:1; + // end of word + bool32 windMove:1; + bool32 slicingMove:1; + bool32 healingMove:1; + bool32 minimizeDoubleDamage:1; + bool32 ignoresTargetAbility:1; + bool32 ignoresTargetDefenseEvasionStages:1; + bool32 damagesUnderground:1; + bool32 damagesUnderwater:1; + bool32 damagesAirborne:1; + bool32 damagesAirborneDoubleDamage:1; + bool32 ignoreTypeIfFlyingAndUngrounded:1; + bool32 thawsUser:1; + bool32 ignoresSubstitute:1; + bool32 forcePressure:1; + bool32 cantUseTwice:1; + // Ban flags + bool32 gravityBanned:1; + bool32 mirrorMoveBanned:1; + bool32 meFirstBanned:1; + bool32 mimicBanned:1; + bool32 metronomeBanned:1; + bool32 copycatBanned:1; + bool32 assistBanned:1; // Matches same moves as copycatBanned + semi-invulnerable moves and Mirror Coat. + bool32 sleepTalkBanned:1; + bool32 instructBanned:1; + bool32 encoreBanned:1; + bool32 parentalBondBanned:1; + bool32 skyBattleBanned:1; + bool32 sketchBanned:1; + u32 padding:19; + // end of word + + union { + struct { + u16 stringId; + u16 status; + } twoTurnAttack; + struct { + u16 side; + u16 property; // can be used to remove the hardcoded values + } protect; + u32 status; + u16 moveProperty; + u16 holdEffect; + u16 type; + u16 fixedDamage; + u16 absorbPercentage; + u16 maxEffect; + } argument; + + // primary/secondary effects + const struct AdditionalEffect *additionalEffects; + + // contest parameters + u8 contestEffect; + u8 contestCategory:3; + u8 contestComboStarterId; + u8 contestComboMoves[MAX_COMBO_MOVES]; + const u8 *battleAnimScript; +}; + +extern const struct MoveInfo gMovesInfo[]; +extern const u8 gNotDoneYetDescription[]; +extern const struct BattleMoveEffect gBattleMoveEffects[]; + +static inline u32 SanitizeMoveId(u32 moveId) +{ + if (moveId >= MOVES_COUNT_ALL) + return MOVE_NONE; + else + return moveId; +} + +static inline const u8 *GetMoveName(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].name; +} + +static inline const u8 *GetMoveDescription(u32 moveId) +{ + moveId = SanitizeMoveId(moveId); + if (gMovesInfo[moveId].effect == EFFECT_PLACEHOLDER) + return gNotDoneYetDescription; + return gMovesInfo[moveId].description; +} + +static inline u32 GetMoveEffect(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].effect; +} + +static inline u32 GetMoveType(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].type; +} + +static inline u32 GetMoveCategory(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].category; +} + +static inline u32 GetMovePower(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].power; +} + +static inline u32 GetMoveAccuracy(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].accuracy; +} + +static inline u32 GetMoveTarget(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].target; +} + +static inline u32 GetMovePP(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].pp; +} + +static inline u32 GetMoveZEffect(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].zMove.effect; +} + +static inline u32 GetMoveZPowerOverride(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].zMove.powerOverride; +} + +static inline s32 GetMovePriority(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].priority; +} + +static inline u32 GetMoveRecoil(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].recoil; +} + +static inline u32 GetMoveStrikeCount(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].strikeCount; +} + +static inline u32 GetMoveCriticalHitStage(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].criticalHitStage; +} + +static inline bool32 MoveAlwaysCrits(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].alwaysCriticalHit; +} + +static inline u32 GetMoveAdditionalEffectCount(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].numAdditionalEffects; +} + +static inline bool32 MoveMakesContact(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].makesContact; +} + +static inline bool32 MoveIgnoresProtect(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].ignoresProtect; +} + +static inline bool32 MoveCanBeBouncedBack(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].magicCoatAffected; +} + +static inline bool32 MoveCanBeSnatched(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].snatchAffected; +} + +static inline bool32 MoveIgnoresKingsRock(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].ignoresKingsRock; +} + +static inline bool32 IsPunchingMove(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].punchingMove; +} + +static inline bool32 IsBitingMove(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].bitingMove; +} + +static inline bool32 IsPulseMove(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].pulseMove; +} + +static inline bool32 IsSoundMove(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].soundMove; +} + +static inline bool32 IsBallisticMove(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].ballisticMove; +} + +static inline bool32 IsPowderMove(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].powderMove; +} + +static inline bool32 IsDanceMove(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].danceMove; +} + +static inline bool32 IsWindMove(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].windMove; +} + +static inline bool32 IsSlicingMove(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].slicingMove; +} + +static inline bool32 IsHealingMove(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].healingMove; +} + +static inline bool32 MoveIncreasesPowerToMinimizedTargets(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].minimizeDoubleDamage; +} + +static inline bool32 MoveIgnoresTargetAbility(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].ignoresTargetAbility; +} + +static inline bool32 MoveIgnoresDefenseEvasionStages(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].ignoresTargetDefenseEvasionStages; +} + +static inline bool32 MoveDamagesUnderground(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].damagesUnderground; +} + +static inline bool32 MoveDamagesUnderWater(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].damagesUnderwater; +} + +static inline bool32 MoveDamagesAirborne(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].damagesAirborne; +} + +static inline bool32 MoveDamagesAirborneDoubleDamage(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].damagesAirborneDoubleDamage; +} + +static inline bool32 MoveIgnoresTypeIfFlyingAndUngrounded(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].ignoreTypeIfFlyingAndUngrounded; +} + +static inline bool32 MoveThawsUser(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].thawsUser; +} + +static inline bool32 MoveIgnoresSubstitute(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].ignoresSubstitute; +} + +static inline bool32 MoveForcesPressure(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].forcePressure; +} + +static inline bool32 MoveCantBeUsedTwice(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].cantUseTwice; +} + +static inline bool32 IsMoveGravityBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].gravityBanned; +} + +static inline bool32 IsMoveMirrorMoveBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].mirrorMoveBanned; +} + +static inline bool32 IsMoveMeFirstBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].meFirstBanned; +} + +static inline bool32 IsMoveMimicBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].mimicBanned; +} + +static inline bool32 IsMoveMetronomeBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].metronomeBanned; +} + +static inline bool32 IsMoveCopycatBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].copycatBanned; +} + +static inline bool32 IsMoveAssistBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].assistBanned; +} + +static inline bool32 IsMoveSleepTalkBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].sleepTalkBanned; +} + +static inline bool32 IsMoveInstructBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].instructBanned; +} + +static inline bool32 IsMoveEncoreBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].encoreBanned; +} + +static inline bool32 IsMoveParentalBondBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].parentalBondBanned; +} + +static inline bool32 IsMoveSkyBattleBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].skyBattleBanned; +} + +static inline bool32 IsMoveSketchBanned(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].sketchBanned; +} + +static inline u32 GetMoveTwoTurnAttackStringId(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].argument.twoTurnAttack.stringId; +} + +static inline u32 GetMoveTwoTurnAttackStatus(u32 moveId) +{ + return UNCOMPRESS_BITS(gMovesInfo[SanitizeMoveId(moveId)].argument.twoTurnAttack.status); +} + +static inline u32 GetMoveTwoTurnAttackWeather(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].argument.twoTurnAttack.status; +} + +static inline u32 GetMoveProtectSide(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].argument.protect.side; +} + +static inline u32 GetMoveEffectArg_Status(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].argument.status; +} + +static inline u32 GetMoveEffectArg_MoveProperty(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].argument.moveProperty; +} + +static inline u32 GetMoveEffectArg_HoldEffect(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].argument.holdEffect; +} + +static inline u32 GetMoveArgType(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].argument.type; +} + +static inline u32 GetMoveFixedDamage(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].argument.fixedDamage; +} + +static inline u32 GetMoveAbsorbPercentage(u32 moveId) +{ + moveId = SanitizeMoveId(moveId); + if (gMovesInfo[moveId].argument.absorbPercentage == 0) + return 50; + return gMovesInfo[moveId].argument.absorbPercentage; +} + +static inline u32 GetMoveMaxEffect(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].argument.maxEffect; +} + +static inline const struct AdditionalEffect *GetMoveAdditionalEffectById(u32 moveId, u32 effect) +{ + return &gMovesInfo[SanitizeMoveId(moveId)].additionalEffects[effect]; +} + +static inline u32 GetMoveContestEffect(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].contestEffect; +} + +static inline u32 GetMoveContestCategory(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].contestCategory; +} + +static inline u32 GetMoveContestComboStarter(u32 moveId) +{ + return gMovesInfo[SanitizeMoveId(moveId)].contestComboStarterId; +} + +static inline u32 GetMoveContestComboMoves(u32 moveId, u32 comboMove) +{ + return gMovesInfo[SanitizeMoveId(moveId)].contestComboMoves[comboMove]; +} + +static inline const u8 *GetMoveAnimationScript(u32 moveId) +{ + moveId = SanitizeMoveId(moveId); + if (gMovesInfo[moveId].battleAnimScript == NULL) + { + DebugPrintfLevel(MGBA_LOG_WARN, "No animation for moveId=%u", moveId); + return gMovesInfo[MOVE_NONE].battleAnimScript; + } + return gMovesInfo[moveId].battleAnimScript; +} + +static inline const u8 *GetMoveBattleScript(u32 moveId) +{ + moveId = SanitizeMoveId(moveId); + if (gBattleMoveEffects[gMovesInfo[moveId].effect].battleScript == NULL) + { + DebugPrintfLevel(MGBA_LOG_WARN, "No effect for moveId=%u", moveId); + return gBattleMoveEffects[EFFECT_PLACEHOLDER].battleScript; + } + return gBattleMoveEffects[gMovesInfo[moveId].effect].battleScript; +} + +#endif // GUARD_MOVES_H diff --git a/include/pokemon.h b/include/pokemon.h index 0618c6c78573..f855b27ea5f3 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -479,125 +479,6 @@ struct SpeciesInfo /*0xC4*/ #endif //OW_POKEMON_OBJECT_EVENTS }; -struct MoveInfo -{ - const u8 *name; - const u8 *description; - u16 effect; - u16 type:5; - u16 category:2; - u16 power:9; // up to 511 - u16 accuracy:7; - u16 target:9; - u8 pp; - union { - u8 effect; - u8 powerOverride; - } zMove; - - union { - struct { - u16 stringId; - u16 status; - } twoTurnAttack; - struct { - u16 side; - u16 property; // can be used to remove the hardcoded values - } protect; - u32 status; - u16 moveProperty; - u16 holdEffect; - u16 type; - u16 fixedDamage; - u16 absorbPercentage; - u16 maxEffect; - } argument; - - s32 priority:4; - u32 recoil:7; - u32 strikeCount:4; // Max 15 hits. Defaults to 1 if not set. May apply its effect on each hit. - u32 criticalHitStage:2; - u32 alwaysCriticalHit:1; - u32 numAdditionalEffects:2; // limited to 3 - don't want to get too crazy - // 12 bits left to complete this word - continues into flags - - // Flags - u32 makesContact:1; - u32 ignoresProtect:1; - u32 magicCoatAffected:1; - u32 snatchAffected:1; - u32 ignoresKingsRock:1; - u32 punchingMove:1; - u32 bitingMove:1; - u32 pulseMove:1; - u32 soundMove:1; - u32 ballisticMove:1; - u32 powderMove:1; - u32 danceMove:1; - u32 windMove:1; - u32 slicingMove:1; // end of word - u32 healingMove:1; - u32 minimizeDoubleDamage:1; - u32 ignoresTargetAbility:1; - u32 ignoresTargetDefenseEvasionStages:1; - u32 damagesUnderground:1; - u32 damagesUnderwater:1; - u32 damagesAirborne:1; - u32 damagesAirborneDoubleDamage:1; - u32 ignoreTypeIfFlyingAndUngrounded:1; - u32 thawsUser:1; - u32 ignoresSubstitute:1; - u32 forcePressure:1; - u32 cantUseTwice:1; - - // Ban flags - u32 gravityBanned:1; - u32 mirrorMoveBanned:1; - u32 meFirstBanned:1; - u32 mimicBanned:1; - u32 metronomeBanned:1; - u32 copycatBanned:1; - u32 assistBanned:1; // Matches same moves as copycatBanned + semi-invulnerable moves and Mirror Coat. - u32 sleepTalkBanned:1; - u32 instructBanned:1; - u32 encoreBanned:1; - u32 parentalBondBanned:1; - u32 skyBattleBanned:1; - u32 sketchBanned:1; - u32 padding:5; // end of word - - // primary/secondary effects - const struct AdditionalEffect *additionalEffects; - - // contest parameters - u8 contestEffect; - u8 contestCategory:3; - u8 contestComboStarterId; - u8 contestComboMoves[MAX_COMBO_MOVES]; - const u8 *battleAnimScript; -}; - -#define EFFECTS_ARR(...) (const struct AdditionalEffect[]) {__VA_ARGS__} -#define ADDITIONAL_EFFECTS(...) EFFECTS_ARR( __VA_ARGS__ ), .numAdditionalEffects = ARRAY_COUNT(EFFECTS_ARR( __VA_ARGS__ )) - -enum SheerForceBoost -{ - SHEER_FORCE_AUTO_BOOST, // This is the default state when a move has a move effect with a chance - SHEER_FORCE_BOOST, // If a move effect doesn't have an effect with a chance this can force a boost - SHEER_FORCE_NO_BOOST, // Prevents a Sheer Force boost -}; - -struct AdditionalEffect -{ - u16 moveEffect; - u8 self:1; - u8 onlyIfTargetRaisedStats:1; - u8 onChargeTurnOnly:1; - u8 sheerForceBoost:2; // Handles edge cases for Sheer Force - u8 padding:3; - u8 chance; // 0% = effect certain, primary effect -}; - struct Ability { u8 name[ABILITY_NAME_LENGTH + 1]; @@ -727,7 +608,6 @@ extern struct Pokemon gEnemyParty[PARTY_SIZE]; extern struct SpriteTemplate gMultiuseSpriteTemplate; extern u16 gFollowerSteps; -extern const struct MoveInfo gMovesInfo[]; extern const u8 gFacilityClassToPicIndex[]; extern const u8 gFacilityClassToTrainerClass[]; extern const struct SpeciesInfo gSpeciesInfo[]; @@ -921,8 +801,6 @@ u16 GetCryIdBySpecies(u16 species); u16 GetSpeciesPreEvolution(u16 species); void HealPokemon(struct Pokemon *mon); void HealBoxPokemon(struct BoxPokemon *boxMon); -const u8 *GetMoveName(u16 moveId); -const u8 *GetMoveAnimationScript(u16 moveId); void UpdateDaysPassedSinceFormChange(u16 days); void TrySetDayLimitToFormChange(struct Pokemon *mon); u32 CheckDynamicMoveType(struct Pokemon *mon, u32 move, u32 battler); diff --git a/include/pokemon_summary_screen.h b/include/pokemon_summary_screen.h index fe299c48b4bf..1f286698a56d 100755 --- a/include/pokemon_summary_screen.h +++ b/include/pokemon_summary_screen.h @@ -5,7 +5,6 @@ extern u8 gLastViewedMonIndex; -extern const u8 gNotDoneYetDescription[]; extern const struct SpriteTemplate gSpriteTemplate_MoveTypes; extern const struct CompressedSpriteSheet gSpriteSheet_MoveTypes; extern const struct CompressedSpriteSheet gSpriteSheet_CategoryIcons; diff --git a/include/test/battle.h b/include/test/battle.h index c8ab519ba05b..1c044fd6e2f6 100644 --- a/include/test/battle.h +++ b/include/test/battle.h @@ -29,7 +29,7 @@ * * ASSUMPTIONS * { - * ASSUME(gMovesInfo[MOVE_STUN_SPORE].effect == EFFECT_PARALYZE); + * ASSUME(GetMoveEffect(MOVE_STUN_SPORE) == EFFECT_PARALYZE); * } * * SINGLE_BATTLE_TEST("Stun Spore inflicts paralysis") @@ -87,7 +87,7 @@ * SINGLE_BATTLE_TEST("Stun Spore does not affect Grass-types") * { * GIVEN { - * ASSUME(gMovesInfo[MOVE_STUN_SPORE].powderMove); + * ASSUME(IsPowderMove(MOVE_STUN_SPORE)); * ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS); * PLAYER(SPECIES_ODDISH); // 1. * OPPONENT(SPECIES_ODDISH); // 2. @@ -129,7 +129,7 @@ * PARAMETRIZE { raiseAttack = FALSE; } * PARAMETRIZE { raiseAttack = TRUE; } * GIVEN { - * ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + * ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); * PLAYER(SPECIES_WOBBUFFET); * OPPONENT(SPECIES_WOBBUFFET); * } WHEN { @@ -176,7 +176,7 @@ * Pokémon we can observe the damage of a physical attack with and * without the burn. To document that this test assumes the attack is * physical we can use: - * ASSUME(gMovesInfo[MOVE_WHATEVER].category == DAMAGE_CATEGORY_PHYSICAL); + * ASSUME(GetMoveCategory(MOVE_WHATEVER) == DAMAGE_CATEGORY_PHYSICAL); * * ASSUMPTIONS * Should be placed immediately after any #includes and contain any @@ -186,7 +186,7 @@ * move_effect_poison_hit.c should be: * ASSUMPTIONS * { - * ASSUME(gMovesInfo[MOVE_POISON_STING].effect == EFFECT_POISON_HIT); + * ASSUME(GetMoveEffect(MOVE_POISON_STING) == EFFECT_POISON_HIT); * } * * SINGLE_BATTLE_TEST(name, results...) and DOUBLE_BATTLE_TEST(name, results...) @@ -228,7 +228,7 @@ * PARAMETRIZE { hp = 99; } * PARAMETRIZE { hp = 33; } * GIVEN { - * ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); + * ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); * PLAYER(SPECIES_CHARMANDER) { Ability(ABILITY_BLAZE); MaxHP(99); HP(hp); } * OPPONENT(SPECIES_WOBBUFFET); * } WHEN { @@ -265,7 +265,7 @@ * * If the tag is not provided, runs the test 50 times and computes an * approximate pass ratio. - * PASSES_RANDOMLY(gMovesInfo[move].accuracy, 100); + * PASSES_RANDOMLY(GetMoveAccuracy(move), 100); * Note that this mode of PASSES_RANDOMLY makes the tests run very * slowly and should be avoided where possible. If the mechanic you are * testing is missing its tag, you should add it. diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 83182fe07c01..828b7b7c94aa 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -278,7 +278,7 @@ u32 BattleAI_ChooseMoveOrAction(void) ret = ChooseMoveOrAction_Doubles(sBattler_AI); // Clear protect structures, some flags may be set during AI calcs - // e.g. pranksterElevated from GetMovePriority + // e.g. pranksterElevated from GetBattleMovePriority memset(&gProtectStructs, 0, MAX_BATTLERS_COUNT * sizeof(struct ProtectStruct)); #if TESTING TestRunner_Battle_CheckAiMoveScores(sBattler_AI); @@ -399,7 +399,7 @@ static u32 Ai_SetMoveAccuracy(struct AiLogicData *aiData, u32 battlerAtk, u32 ba u32 accuracy; u32 abilityAtk = aiData->abilities[battlerAtk]; u32 abilityDef = aiData->abilities[battlerDef]; - if (abilityAtk == ABILITY_NO_GUARD || abilityDef == ABILITY_NO_GUARD || gMovesInfo[move].accuracy == 0) // Moves with accuracy 0 or no guard ability always hit. + if (abilityAtk == ABILITY_NO_GUARD || abilityDef == ABILITY_NO_GUARD || GetMoveAccuracy(move) == 0) // Moves with accuracy 0 or no guard ability always hit. accuracy = 100; else accuracy = GetTotalAccuracy(battlerAtk, battlerDef, move, abilityAtk, abilityDef, aiData->holdEffects[battlerAtk], aiData->holdEffects[battlerDef]); @@ -431,9 +431,9 @@ static void SetBattlerAiMovesData(struct AiLogicData *aiData, u32 battlerAtk, u3 u8 effectiveness = AI_EFFECTIVENESS_x0; move = moves[moveIndex]; - if (move != 0 - && move != 0xFFFF - //&& !IS_MOVE_STATUS(gMovesInfo[move]) /* we want to get effectiveness and accuracy of status moves */ + if (move != MOVE_NONE + && move != MOVE_UNAVAILABLE + //&& !IsBattleMoveStatus(move) /* we want to get effectiveness and accuracy of status moves */ && !(aiData->moveLimitations[battlerAtk] & (1u << moveIndex))) { dmg = AI_CalcDamage(move, battlerAtk, battlerDef, &effectiveness, TRUE, weather, rollType); @@ -661,7 +661,8 @@ static inline bool32 ShouldConsiderMoveForBattler(u32 battlerAi, u32 battlerDef, { if (battlerAi == BATTLE_PARTNER(battlerDef)) { - if (gMovesInfo[move].target == MOVE_TARGET_BOTH || gMovesInfo[move].target == MOVE_TARGET_OPPONENTS_FIELD) + u32 target = GetBattlerMoveTargetType(battlerAi, move); + if (target == MOVE_TARGET_BOTH || target == MOVE_TARGET_OPPONENTS_FIELD) return FALSE; } return TRUE; @@ -707,8 +708,8 @@ static inline void BattleAI_DoAIProcessing(struct AI_ThinkingStruct *aiThink, u3 static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) { // move data - s8 atkPriority = GetMovePriority(battlerAtk, move); - u32 moveEffect = gMovesInfo[move].effect; + s8 atkPriority = GetBattleMovePriority(battlerAtk, move); + u32 moveEffect = GetMoveEffect(move); s32 moveType; u32 moveTarget = GetBattlerMoveTargetType(battlerAtk, move); struct AiLogicData *aiData = AI_DATA; @@ -722,9 +723,9 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) return score; SetTypeBeforeUsingMove(move, battlerAtk); - moveType = GetMoveType(move); + moveType = GetBattleMoveType(move); - if (gMovesInfo[move].powderMove && !IsAffectedByPowder(battlerDef, aiData->abilities[battlerDef], aiData->holdEffects[battlerDef])) + if (IsPowderMove(move) && !IsAffectedByPowder(battlerDef, aiData->abilities[battlerDef], aiData->holdEffects[battlerDef])) RETURN_SCORE_MINUS(10); if (IsSemiInvulnerable(battlerDef, move) && moveEffect != EFFECT_SEMI_INVULNERABLE && AI_IsFaster(battlerAtk, battlerDef, move)) @@ -799,11 +800,11 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) RETURN_SCORE_MINUS(20); break; case ABILITY_JUSTIFIED: - if (moveType == TYPE_DARK && !IS_MOVE_STATUS(move)) + if (moveType == TYPE_DARK && !IsBattleMoveStatus(move)) RETURN_SCORE_MINUS(10); break; case ABILITY_RATTLED: - if (!IS_MOVE_STATUS(move) + if (!IsBattleMoveStatus(move) && (moveType == TYPE_DARK || moveType == TYPE_GHOST || moveType == TYPE_BUG)) RETURN_SCORE_MINUS(10); break; @@ -820,7 +821,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) RETURN_SCORE_MINUS(10); break; case ABILITY_MAGIC_BOUNCE: - if (gMovesInfo[move].magicCoatAffected) + if (MoveCanBeBouncedBack(move)) RETURN_SCORE_MINUS(20); break; case ABILITY_CONTRARY: @@ -889,7 +890,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) RETURN_SCORE_MINUS(20); break; case ABILITY_MAGIC_BOUNCE: - if (gMovesInfo[move].magicCoatAffected && moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_OPPONENTS_FIELD)) + if (MoveCanBeBouncedBack(move) && moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_OPPONENTS_FIELD)) RETURN_SCORE_MINUS(20); break; case ABILITY_SWEET_VEIL: @@ -910,7 +911,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) // gen7+ dark type mons immune to priority->elevated moves from prankster if (B_PRANKSTER_DARK_TYPES >= GEN_7 && IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK) - && aiData->abilities[battlerAtk] == ABILITY_PRANKSTER && IS_MOVE_STATUS(move) + && aiData->abilities[battlerAtk] == ABILITY_PRANKSTER && IsBattleMoveStatus(move) && !(moveTarget & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_USER))) RETURN_SCORE_MINUS(10); @@ -936,7 +937,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) // the following checks apply to any target (including user) // throat chop check - if (gDisableStructs[battlerAtk].throatChopTimer && gMovesInfo[move].soundMove) + if (gDisableStructs[battlerAtk].throatChopTimer && IsSoundMove(move)) return 0; // Can't even select move at all // heal block check if (gStatuses3[battlerAtk] & STATUS3_HEAL_BLOCK && IsHealBlockPreventingMove(battlerAtk, move)) @@ -955,7 +956,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) RETURN_SCORE_MINUS(30); } - if (!IS_MOVE_STATUS(move)) + if (!IsBattleMoveStatus(move)) { if (weather & B_WEATHER_SUN_PRIMAL) { @@ -974,7 +975,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) switch (moveEffect) { case EFFECT_HIT: // only applies to Vital Throw - if (gMovesInfo[move].priority < 0 && AI_IsFaster(battlerAtk, battlerDef, move) && aiData->hpPercents[battlerAtk] < 40) + if (GetBattleMovePriority(battlerAtk, move) < 0 && AI_IsFaster(battlerAtk, battlerDef, move) && aiData->hpPercents[battlerAtk] < 40) ADJUST_SCORE(-2); // don't want to move last break; default: @@ -1696,7 +1697,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) if (!isDoubleBattle || !IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, aiData->partnerMove) - || (aiData->partnerMove != MOVE_NONE && IS_MOVE_STATUS(aiData->partnerMove)) + || (aiData->partnerMove != MOVE_NONE && IsBattleMoveStatus(aiData->partnerMove)) || *(gBattleStruct->monToSwitchIntoId + BATTLE_PARTNER(battlerAtk)) != PARTY_SIZE) //Partner is switching out. ADJUST_SCORE(-10); break; @@ -1792,7 +1793,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) break; case EFFECT_CONVERSION: //Check first move type - if (IS_BATTLER_OF_TYPE(battlerAtk, gMovesInfo[gBattleMons[battlerAtk].moves[0]].type)) + if (IS_BATTLER_OF_TYPE(battlerAtk, GetMoveType(gBattleMons[battlerAtk].moves[0]))) ADJUST_SCORE(-10); break; case EFFECT_REST: @@ -1883,7 +1884,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) ADJUST_SCORE(-10); break; case EFFECT_HEAL_BELL: - if (!AnyPartyMemberStatused(battlerAtk, gMovesInfo[move].soundMove) || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, aiData->partnerMove)) + if (!AnyPartyMemberStatused(battlerAtk, IsSoundMove(move)) || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, aiData->partnerMove)) ADJUST_SCORE(-10); break; case EFFECT_ENDURE: @@ -1985,7 +1986,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) if (isDoubleBattle) { - if (IsHazardMoveEffect(gMovesInfo[aiData->partnerMove].effect) // partner is going to set up hazards + if (IsHazardMoveEffect(GetMoveEffect(aiData->partnerMove)) // partner is going to set up hazards && AI_IsFaster(BATTLE_PARTNER(battlerAtk), battlerAtk, aiData->partnerMove)) // partner is going to set up before the potential Defog { ADJUST_SCORE(-10); @@ -2015,7 +2016,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) case EFFECT_SEMI_INVULNERABLE: if (predictedMove != MOVE_NONE && AI_IsSlower(battlerAtk, battlerDef, move) - && gMovesInfo[predictedMove].effect == EFFECT_SEMI_INVULNERABLE) + && GetMoveEffect(predictedMove) == EFFECT_SEMI_INVULNERABLE) ADJUST_SCORE(-10); // Don't Fly/dig/etc if opponent is going to fly/dig/etc after you if (BattlerWillFaintFromWeather(battlerAtk, aiData->abilities[battlerAtk]) @@ -2247,7 +2248,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) if (isDoubleBattle && gBattleMons[BATTLE_PARTNER(battlerAtk)].hp > 0) { if (aiData->partnerMove != MOVE_NONE - && gMovesInfo[aiData->partnerMove].effect == EFFECT_PLEDGE + && GetMoveEffect(aiData->partnerMove) == EFFECT_PLEDGE && move != aiData->partnerMove) // Different pledge moves { if (gBattleMons[BATTLE_PARTNER(battlerAtk)].status1 & (STATUS1_SLEEP | STATUS1_FREEZE)) @@ -2435,7 +2436,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) instructedMove = gLastMoves[battlerDef]; if (instructedMove == MOVE_NONE - || gMovesInfo[instructedMove].instructBanned + || IsMoveInstructBanned(instructedMove) || MoveHasAdditionalEffectSelf(instructedMove, MOVE_EFFECT_RECHARGE) || IsZMove(instructedMove) || (gLockedMoves[battlerDef] != 0 && gLockedMoves[battlerDef] != 0xFFFF) @@ -2482,7 +2483,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) case EFFECT_SUCKER_PUNCH: if (predictedMove != MOVE_NONE) { - if (IS_MOVE_STATUS(predictedMove) || AI_IsSlower(battlerAtk, battlerDef, move)) // Opponent going first + if (IsBattleMoveStatus(predictedMove) || AI_IsSlower(battlerAtk, battlerDef, move)) // Opponent going first ADJUST_SCORE(-10); } break; @@ -2581,7 +2582,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) ADJUST_SCORE(-10); break; case EFFECT_UPPER_HAND: - if (predictedMove == MOVE_NONE || IS_MOVE_STATUS(predictedMove) || AI_IsSlower(battlerAtk, battlerDef, move) || GetMovePriority(battlerDef, predictedMove) < 1 || GetMovePriority(battlerDef, predictedMove) > 3) // Opponent going first or not using priority move + if (predictedMove == MOVE_NONE || IsBattleMoveStatus(predictedMove) || AI_IsSlower(battlerAtk, battlerDef, move) || GetBattleMovePriority(battlerDef, predictedMove) < 1 || GetBattleMovePriority(battlerDef, predictedMove) > 3) // Opponent going first or not using priority move ADJUST_SCORE(-10); break; case EFFECT_PLACEHOLDER: @@ -2617,10 +2618,10 @@ static s32 AI_TryToFaint(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) if (IS_TARGETING_PARTNER(battlerAtk, battlerDef)) return score; - if (IS_MOVE_STATUS(move)) + if (IsBattleMoveStatus(move)) return score; // status moves aren't accounted here - if (CanIndexMoveFaintTarget(battlerAtk, battlerDef, movesetIndex, 0) && gMovesInfo[move].effect != EFFECT_EXPLOSION) + if (CanIndexMoveFaintTarget(battlerAtk, battlerDef, movesetIndex, 0) && GetMoveEffect(move) != EFFECT_EXPLOSION) { if (AI_IsFaster(battlerAtk, battlerDef, move)) ADJUST_SCORE(FAST_KILL); @@ -2629,7 +2630,7 @@ static s32 AI_TryToFaint(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) } else if (CanTargetFaintAi(battlerDef, battlerAtk) && GetWhichBattlerFasterOrTies(battlerAtk, battlerDef, TRUE) != AI_IS_FASTER - && GetMovePriority(battlerAtk, move) > 0) + && GetBattleMovePriority(battlerAtk, move) > 0) { ADJUST_SCORE(LAST_CHANCE); } @@ -2641,29 +2642,30 @@ static s32 AI_TryToFaint(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) { // move data - u32 moveType = gMovesInfo[move].type; - u32 effect = gMovesInfo[move].effect; + u32 moveType = GetMoveType(move); + u32 effect = GetMoveEffect(move); u32 moveTarget = GetBattlerMoveTargetType(battlerAtk, move); // ally data u32 battlerAtkPartner = BATTLE_PARTNER(battlerAtk); struct AiLogicData *aiData = AI_DATA; u32 atkPartnerAbility = aiData->abilities[BATTLE_PARTNER(battlerAtk)]; u32 atkPartnerHoldEffect = aiData->holdEffects[BATTLE_PARTNER(battlerAtk)]; - bool32 partnerProtecting = (gMovesInfo[aiData->partnerMove].effect == EFFECT_PROTECT); + u32 partnerEffect = GetMoveEffect(aiData->partnerMove); + bool32 partnerProtecting = (partnerEffect == EFFECT_PROTECT); bool32 attackerHasBadAbility = (gAbilitiesInfo[aiData->abilities[battlerAtk]].aiRating < 0); bool32 partnerHasBadAbility = (gAbilitiesInfo[atkPartnerAbility].aiRating < 0); u32 predictedMove = aiData->lastUsedMove[battlerDef]; SetTypeBeforeUsingMove(move, battlerAtk); - moveType = GetMoveType(move); + moveType = GetBattleMoveType(move); // check what effect partner is using if (aiData->partnerMove != 0) { - switch (gMovesInfo[aiData->partnerMove].effect) + switch (partnerEffect) { case EFFECT_HELPING_HAND: - if (IS_MOVE_STATUS(move)) + if (IsBattleMoveStatus(move)) ADJUST_SCORE(-7); break; case EFFECT_PERISH_SONG: @@ -2687,7 +2689,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) } // check partner move effect // Adjust for always crit moves - if (gMovesInfo[aiData->partnerMove].alwaysCriticalHit && aiData->abilities[battlerAtk] == ABILITY_ANGER_POINT) + if (MoveAlwaysCrits(aiData->partnerMove) && aiData->abilities[battlerAtk] == ABILITY_ANGER_POINT) { if (AI_IsSlower(battlerAtk, battlerAtkPartner, move)) // Partner moving first { @@ -2695,7 +2697,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) if (IsAttackBoostMoveEffect(effect)) ADJUST_SCORE(-3); // encourage moves hitting multiple opponents - if (!IS_MOVE_STATUS(move) && (moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) + if (!IsBattleMoveStatus(move) && (moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) ADJUST_SCORE(GOOD_EFFECT); } } @@ -2724,7 +2726,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) ADJUST_SCORE(-5); else if (atkPartnerHoldEffect == HOLD_EFFECT_SCOPE_LENS || IS_BATTLER_OF_TYPE(battlerAtkPartner, TYPE_DRAGON) - || gMovesInfo[aiData->partnerMove].criticalHitStage > 0 + || GetMoveCriticalHitStage(aiData->partnerMove) > 0 || HasMoveWithCriticalHitChance(battlerAtkPartner)) ADJUST_SCORE(GOOD_EFFECT); break; @@ -2777,7 +2779,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) switch (atkPartnerAbility) { case ABILITY_ANGER_POINT: - if (gMovesInfo[move].alwaysCriticalHit == TRUE + if (MoveAlwaysCrits(move) && BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_ATK) && AI_IsFaster(battlerAtk, battlerAtkPartner, move) && !CanIndexMoveFaintTarget(battlerAtk, battlerAtkPartner, AI_THINKING_STRUCT->movesetIndex, 1)) @@ -2848,7 +2850,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) break; case ABILITY_JUSTIFIED: if (moveType == TYPE_DARK - && !IS_MOVE_STATUS(move) + && !IsBattleMoveStatus(move) && HasMoveWithCategory(battlerAtkPartner, DAMAGE_CATEGORY_PHYSICAL) && BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_ATK) && !CanIndexMoveFaintTarget(battlerAtk, battlerAtkPartner, AI_THINKING_STRUCT->movesetIndex, 1)) @@ -2857,7 +2859,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) } break; case ABILITY_RATTLED: - if (!IS_MOVE_STATUS(move) + if (!IsBattleMoveStatus(move) && (moveType == TYPE_DARK || moveType == TYPE_GHOST || moveType == TYPE_BUG) && BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_SPEED) && !CanIndexMoveFaintTarget(battlerAtk, battlerAtkPartner, AI_THINKING_STRUCT->movesetIndex, 1)) @@ -2914,7 +2916,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) case EFFECT_BEAT_UP: if (atkPartnerAbility == ABILITY_JUSTIFIED && moveType == TYPE_DARK - && !IS_MOVE_STATUS(move) + && !IsBattleMoveStatus(move) && HasMoveWithCategory(battlerAtkPartner, DAMAGE_CATEGORY_PHYSICAL) && BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_ATK) && !CanIndexMoveFaintTarget(battlerAtk, battlerAtkPartner, AI_THINKING_STRUCT->movesetIndex, 0)) @@ -2984,7 +2986,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) instructedMove = gLastMoves[battlerAtkPartner]; if (instructedMove != MOVE_NONE - && !IS_MOVE_STATUS(instructedMove) + && !IsBattleMoveStatus(instructedMove) && (GetBattlerMoveTargetType(battlerAtkPartner, instructedMove) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) // Use instruct on multi-target moves { RETURN_SCORE_PLUS(WEAK_EFFECT); @@ -2995,7 +2997,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) if (AI_IsSlower(battlerAtkPartner, FOE(battlerAtkPartner), aiData->partnerMove) // Opponent mon 1 goes before partner || AI_IsSlower(battlerAtkPartner, BATTLE_PARTNER(FOE(battlerAtkPartner)), aiData->partnerMove)) // Opponent mon 2 goes before partner { - if (gMovesInfo[aiData->partnerMove].effect == EFFECT_COUNTER || gMovesInfo[aiData->partnerMove].effect == EFFECT_MIRROR_COAT) + if (partnerEffect == EFFECT_COUNTER || partnerEffect == EFFECT_MIRROR_COAT) break; // These moves need to go last RETURN_SCORE_PLUS(WEAK_EFFECT); } @@ -3069,7 +3071,7 @@ static inline bool32 ShouldUseSpreadDamageMove(u32 battlerAtk, u32 move, u32 mov return (IsDoubleBattle() && noOfHitsToFaintPartner != 0 // Immunity check && IsBattlerAlive(partnerBattler) - && gMovesInfo[move].target == MOVE_TARGET_FOES_AND_ALLY + && GetBattlerMoveTargetType(battlerAtk, move) == MOVE_TARGET_FOES_AND_ALLY && !(noOfHitsToFaintPartner < 4 && hitsToFaintOpposingBattler == 1) && noOfHitsToFaintPartner < 7); } @@ -3088,7 +3090,7 @@ static s32 AI_CompareDamagingMoves(u32 battlerAtk, u32 battlerDef, u32 currId) for (i = 0; i < MAX_MON_MOVES; i++) { - if (moves[i] != MOVE_NONE && gMovesInfo[moves[i]].power) + if (moves[i] != MOVE_NONE && GetMovePower(moves[i]) != 0) { noOfHits[i] = GetNoOfHitsToKOBattler(battlerAtk, battlerDef, i); if (ShouldUseSpreadDamageMove(battlerAtk,moves[i], i, noOfHits[i])) @@ -3180,27 +3182,28 @@ static s32 AI_CompareDamagingMoves(u32 battlerAtk, u32 battlerDef, u32 currId) static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) { // move data - u32 moveEffect = gMovesInfo[move].effect; + u32 moveEffect = GetMoveEffect(move); struct AiLogicData *aiData = AI_DATA; u32 movesetIndex = AI_THINKING_STRUCT->movesetIndex; u32 effectiveness = aiData->effectiveness[battlerAtk][battlerDef][movesetIndex]; s32 score = 0; u32 predictedMove = aiData->lastUsedMove[battlerDef]; + u32 predictedType = GetMoveType(predictedMove); u32 predictedMoveSlot = GetMoveSlot(GetMovesArray(battlerDef), predictedMove); bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); u32 i; // The AI should understand that while Dynamaxed, status moves function like Protect. - if (GetActiveGimmick(battlerAtk) == GIMMICK_DYNAMAX && gMovesInfo[move].category == DAMAGE_CATEGORY_STATUS) + if (GetActiveGimmick(battlerAtk) == GIMMICK_DYNAMAX && GetMoveCategory(move) == DAMAGE_CATEGORY_STATUS) moveEffect = EFFECT_PROTECT; // check status move preference - if (AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_PREFER_STATUS_MOVES && IS_MOVE_STATUS(move) && effectiveness != AI_EFFECTIVENESS_x0) + if (AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_PREFER_STATUS_MOVES && IsBattleMoveStatus(move) && effectiveness != AI_EFFECTIVENESS_x0) ADJUST_SCORE(10); // check thawing moves - if ((gBattleMons[battlerAtk].status1 & (STATUS1_FREEZE | STATUS1_FROSTBITE)) && gMovesInfo[move].thawsUser) + if ((gBattleMons[battlerAtk].status1 & (STATUS1_FREEZE | STATUS1_FROSTBITE)) && MoveThawsUser(move)) ADJUST_SCORE(10); // check burn / frostbite @@ -3389,7 +3392,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) score += AI_TryToClearStats(battlerAtk, battlerDef, isDoubleBattle); break; case EFFECT_ROAR: - if ((gMovesInfo[move].soundMove && aiData->abilities[battlerDef] == ABILITY_SOUNDPROOF) + if ((IsSoundMove(move) && aiData->abilities[battlerDef] == ABILITY_SOUNDPROOF) || aiData->abilities[battlerDef] == ABILITY_SUCTION_CUPS) break; else if (GetActiveGimmick(battlerDef) == GIMMICK_DYNAMAX) @@ -3405,7 +3408,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) ADJUST_SCORE(-2); break; case EFFECT_CONVERSION: - if (!IS_BATTLER_OF_TYPE(battlerAtk, gMovesInfo[gBattleMons[battlerAtk].moves[0]].type)) + if (!IS_BATTLER_OF_TYPE(battlerAtk, GetMoveType(gBattleMons[battlerAtk].moves[0]))) ADJUST_SCORE(WEAK_EFFECT); break; case EFFECT_SWALLOW: @@ -3582,7 +3585,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) break; else if (gDisableStructs[battlerDef].encoreTimer == 0 && (B_MENTAL_HERB < GEN_5 || aiData->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB) - && (gBattleMoveEffects[gMovesInfo[gLastMoves[battlerDef]].effect].encourageEncore)) + && (gBattleMoveEffects[GetMoveEffect(gLastMoves[battlerDef])].encourageEncore)) ADJUST_SCORE(BEST_EFFECT); break; case EFFECT_SLEEP_TALK: @@ -3630,7 +3633,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) switch (move) { case MOVE_QUICK_GUARD: - if (predictedMove != MOVE_NONE && gMovesInfo[predictedMove].priority > 0) + if (predictedMove != MOVE_NONE && GetMovePriority(predictedMove) > 0) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); break; case MOVE_WIDE_GUARD: @@ -3645,13 +3648,13 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) } break; case MOVE_CRAFTY_SHIELD: - if (predictedMove != MOVE_NONE && IS_MOVE_STATUS(predictedMove) && !(GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER)) + if (predictedMove != MOVE_NONE && IsBattleMoveStatus(predictedMove) && !(GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER)) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); break; case MOVE_MAT_BLOCK: if (gDisableStructs[battlerAtk].isFirstTurn && predictedMove != MOVE_NONE - && !IS_MOVE_STATUS(predictedMove) && !(GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER)) + && !IsBattleMoveStatus(predictedMove) && !(GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER)) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); break; case MOVE_KINGS_SHIELD: @@ -3799,10 +3802,11 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) case EFFECT_SEMI_INVULNERABLE: if (predictedMove != MOVE_NONE && !isDoubleBattle) { + u32 predictedEffect = GetMoveEffect(predictedMove); if ((AI_IsFaster(battlerAtk, battlerDef, move)) - && (gMovesInfo[predictedMove].effect == EFFECT_EXPLOSION || gMovesInfo[predictedMove].effect == EFFECT_PROTECT)) + && (predictedEffect == EFFECT_EXPLOSION || predictedEffect == EFFECT_PROTECT)) ADJUST_SCORE(GOOD_EFFECT); - else if (gMovesInfo[predictedMove].effect == EFFECT_SEMI_INVULNERABLE && !(gStatuses3[battlerDef] & STATUS3_SEMI_INVULNERABLE)) + else if (predictedEffect == EFFECT_SEMI_INVULNERABLE && !(gStatuses3[battlerDef] & STATUS3_SEMI_INVULNERABLE)) ADJUST_SCORE(GOOD_EFFECT); } break; @@ -3874,7 +3878,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) { if (isDoubleBattle) { - if (IsHazardMoveEffect(gMovesInfo[aiData->partnerMove].effect) // Partner is going to set up hazards + if (IsHazardMoveEffect(GetMoveEffect(aiData->partnerMove)) // Partner is going to set up hazards && AI_IsSlower(battlerAtk, BATTLE_PARTNER(battlerAtk), move)) // Partner going first break; // Don't use Defog if partner is going to set up hazards } @@ -3895,7 +3899,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) && IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) { u32 predictedMoveOnPartner = gLastMoves[BATTLE_PARTNER(battlerAtk)]; - if (predictedMoveOnPartner != MOVE_NONE && !IS_MOVE_STATUS(predictedMoveOnPartner)) + if (predictedMoveOnPartner != MOVE_NONE && !IsBattleMoveStatus(predictedMoveOnPartner)) ADJUST_SCORE(GOOD_EFFECT); } break; @@ -3906,7 +3910,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) ADJUST_SCORE(IncreaseStatUpScore(battlerAtk, battlerDef, STAT_CHANGE_SPDEF)); break; case EFFECT_TAUNT: - if (IS_MOVE_STATUS(predictedMove)) + if (IsBattleMoveStatus(predictedMove)) ADJUST_SCORE(GOOD_EFFECT); else if (HasMoveWithCategory(battlerDef, DAMAGE_CATEGORY_STATUS)) ADJUST_SCORE(DECENT_EFFECT); @@ -3970,7 +3974,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) ADJUST_SCORE(DECENT_EFFECT); // Force 'em out next turn break; default: - if (gMovesInfo[move].effect != EFFECT_BESTOW && aiData->items[battlerAtk] == ITEM_NONE && aiData->items[battlerDef] != ITEM_NONE) + if (GetMoveEffect(move) != EFFECT_BESTOW && aiData->items[battlerAtk] == ITEM_NONE && aiData->items[battlerDef] != ITEM_NONE) { switch (aiData->holdEffects[battlerDef]) { @@ -4031,7 +4035,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) ADJUST_SCORE(GOOD_EFFECT); break; case EFFECT_MAGIC_COAT: - if (IS_MOVE_STATUS(predictedMove) && GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH)) + if (IsBattleMoveStatus(predictedMove) && GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH)) ADJUST_SCORE(GOOD_EFFECT); break; case EFFECT_RECYCLE: @@ -4111,7 +4115,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) case EFFECT_GRUDGE: break; case EFFECT_SNATCH: - if (predictedMove != MOVE_NONE && gMovesInfo[predictedMove].snatchAffected) + if (predictedMove != MOVE_NONE && MoveCanBeSnatched(predictedMove)) ADJUST_SCORE(GOOD_EFFECT); // Steal move break; case EFFECT_MUD_SPORT: @@ -4278,7 +4282,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) if ((aiData->abilities[battlerAtk] == ABILITY_VOLT_ABSORB || aiData->abilities[battlerAtk] == ABILITY_MOTOR_DRIVE || (B_REDIRECT_ABILITY_IMMUNITY >= GEN_5 && aiData->abilities[battlerAtk] == ABILITY_LIGHTNING_ROD)) - && gMovesInfo[predictedMove].type == TYPE_NORMAL) + && predictedType == TYPE_NORMAL) ADJUST_SCORE(DECENT_EFFECT); break; case EFFECT_FLING: @@ -4309,7 +4313,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) ADJUST_SCORE(DECENT_EFFECT); break; case EFFECT_POWDER: - if (predictedMove != MOVE_NONE && !IS_MOVE_STATUS(predictedMove) && gMovesInfo[predictedMove].type == TYPE_FIRE) + if (predictedMove != MOVE_NONE && !IsBattleMoveStatus(predictedMove) && predictedType == TYPE_FIRE) ADJUST_SCORE(DECENT_EFFECT); break; case EFFECT_TELEKINESIS: @@ -4325,7 +4329,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) ADJUST_SCORE(DECENT_EFFECT); break; case EFFECT_SOAK: - if (HasMoveWithType(battlerAtk, TYPE_ELECTRIC) || HasMoveWithType(battlerAtk, TYPE_GRASS) || (HasMoveEffect(battlerAtk, EFFECT_SUPER_EFFECTIVE_ON_ARG) && gMovesInfo[move].argument.type == TYPE_WATER) ) + if (HasMoveWithType(battlerAtk, TYPE_ELECTRIC) || HasMoveWithType(battlerAtk, TYPE_GRASS) || (HasMoveEffect(battlerAtk, EFFECT_SUPER_EFFECTIVE_ON_ARG) && GetMoveArgType(move) == TYPE_WATER) ) ADJUST_SCORE(DECENT_EFFECT); // Get some super effective moves break; case EFFECT_THIRD_TYPE: @@ -4367,7 +4371,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) { if (AI_IsFaster(battlerAtk, battlerDef, move)) // Attacker goes first { - if (gMovesInfo[predictedMove].type == TYPE_GROUND) + if (predictedType == TYPE_GROUND) ADJUST_SCORE(GOOD_EFFECT); // Cause the enemy's move to fail break; } @@ -4381,7 +4385,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) break; case EFFECT_CAMOUFLAGE: if (predictedMove != MOVE_NONE && AI_IsFaster(battlerAtk, battlerDef, move) // Attacker goes first - && !IS_MOVE_STATUS(move) && AI_GetMoveEffectiveness(predictedMove, battlerDef, battlerAtk) != AI_EFFECTIVENESS_x0) + && !IsBattleMoveStatus(move) && AI_GetMoveEffectiveness(predictedMove, battlerDef, battlerAtk) != AI_EFFECTIVENESS_x0) ADJUST_SCORE(DECENT_EFFECT); break; case EFFECT_TOXIC_THREAD: @@ -4437,28 +4441,30 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) break; } // move effect checks + u32 additionalEffectCount = GetMoveAdditionalEffectCount(move); // check move additional effects that are likely to happen - for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + for (i = 0; i < additionalEffectCount; i++) { + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(move, i); // Only consider effects with a guaranteed chance to happen - if (!MoveEffectIsGuaranteed(battlerAtk, aiData->abilities[battlerAtk], &gMovesInfo[move].additionalEffects[i])) + if (!MoveEffectIsGuaranteed(battlerAtk, aiData->abilities[battlerAtk], additionalEffect)) continue; // Consider move effects that target self - if (gMovesInfo[move].additionalEffects[i].self) + if (additionalEffect->self) { u32 StageStatId; if (aiData->abilities[battlerAtk] != ABILITY_CONTRARY) { - switch (gMovesInfo[move].additionalEffects[i].moveEffect) + switch (additionalEffect->moveEffect) { case MOVE_EFFECT_ATK_PLUS_1: case MOVE_EFFECT_DEF_PLUS_1: case MOVE_EFFECT_SPD_PLUS_1: case MOVE_EFFECT_SP_ATK_PLUS_1: case MOVE_EFFECT_SP_DEF_PLUS_1: - StageStatId = STAT_CHANGE_ATK + gMovesInfo[move].additionalEffects[i].moveEffect - MOVE_EFFECT_ATK_PLUS_1; + StageStatId = STAT_CHANGE_ATK + additionalEffect->moveEffect - MOVE_EFFECT_ATK_PLUS_1; ADJUST_SCORE(IncreaseStatUpScore(battlerAtk, battlerDef, StageStatId)); break; case MOVE_EFFECT_ATK_PLUS_2: @@ -4466,7 +4472,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) case MOVE_EFFECT_SPD_PLUS_2: case MOVE_EFFECT_SP_ATK_PLUS_2: case MOVE_EFFECT_SP_DEF_PLUS_2: - StageStatId = STAT_CHANGE_ATK_2 + gMovesInfo[move].additionalEffects[i].moveEffect - MOVE_EFFECT_ATK_PLUS_1; + StageStatId = STAT_CHANGE_ATK_2 + additionalEffect->moveEffect - MOVE_EFFECT_ATK_PLUS_1; ADJUST_SCORE(IncreaseStatUpScore(battlerAtk, battlerDef, StageStatId)); break; case MOVE_EFFECT_ACC_PLUS_1: @@ -4486,14 +4492,14 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) } else { - switch (gMovesInfo[move].additionalEffects[i].moveEffect) + switch (additionalEffect->moveEffect) { case MOVE_EFFECT_ATK_MINUS_1: case MOVE_EFFECT_DEF_MINUS_1: case MOVE_EFFECT_SPD_MINUS_1: case MOVE_EFFECT_SP_ATK_MINUS_1: case MOVE_EFFECT_SP_DEF_MINUS_1: - StageStatId = STAT_CHANGE_ATK + gMovesInfo[move].additionalEffects[i].moveEffect - MOVE_EFFECT_ATK_MINUS_1; + StageStatId = STAT_CHANGE_ATK + additionalEffect->moveEffect - MOVE_EFFECT_ATK_MINUS_1; ADJUST_SCORE(IncreaseStatUpScoreContrary(battlerAtk, battlerDef, StageStatId)); break; case MOVE_EFFECT_ATK_MINUS_2: @@ -4501,7 +4507,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) case MOVE_EFFECT_SPD_MINUS_2: case MOVE_EFFECT_SP_ATK_MINUS_2: case MOVE_EFFECT_SP_DEF_MINUS_2: - StageStatId = STAT_CHANGE_ATK + gMovesInfo[move].additionalEffects[i].moveEffect - MOVE_EFFECT_ATK_MINUS_2; + StageStatId = STAT_CHANGE_ATK + additionalEffect->moveEffect - MOVE_EFFECT_ATK_MINUS_2; ADJUST_SCORE(IncreaseStatUpScoreContrary(battlerAtk, battlerDef, StageStatId)); break; case MOVE_EFFECT_ACC_MINUS_1: @@ -4530,7 +4536,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) } else // consider move effects that hinder the target { - switch (gMovesInfo[move].additionalEffects[i].moveEffect) + switch (additionalEffect->moveEffect) { case MOVE_EFFECT_FLINCH: score += ShouldTryToFlinch(battlerAtk, battlerDef, aiData->abilities[battlerAtk], aiData->abilities[battlerDef], move); @@ -4663,11 +4669,11 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) } break; case MOVE_EFFECT_FEINT: - if (gMovesInfo[predictedMove].effect == EFFECT_PROTECT) + if (GetMoveEffect(predictedMove) == EFFECT_PROTECT) ADJUST_SCORE(GOOD_EFFECT); break; case MOVE_EFFECT_THROAT_CHOP: - if (gMovesInfo[GetBestDmgMoveFromBattler(battlerDef, battlerAtk)].soundMove) + if (IsSoundMove(GetBestDmgMoveFromBattler(battlerDef, battlerAtk))) { if (AI_IsFaster(battlerAtk, battlerDef, move)) ADJUST_SCORE(GOOD_EFFECT); @@ -4698,7 +4704,7 @@ static s32 AI_CheckViability(u32 battlerAtk, u32 battlerDef, u32 move, s32 score if (IS_TARGETING_PARTNER(battlerAtk, battlerDef)) return score; - if (gMovesInfo[move].power) + if (GetMovePower(move) != 0) { if (GetNoOfHitsToKOBattler(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex) == 0) ADJUST_AND_RETURN_SCORE(NO_DAMAGE_OR_FAILS); // No point in checking the move further so return early @@ -4727,13 +4733,13 @@ static s32 AI_ForceSetupFirstTurn(u32 battlerAtk, u32 battlerDef, u32 move, s32 if (AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_SMART_SWITCHING && AI_IsSlower(battlerAtk, battlerDef, move) && CanTargetFaintAi(battlerDef, battlerAtk) - && GetMovePriority(battlerAtk, move) == 0) + && GetBattleMovePriority(battlerAtk, move) == 0) { RETURN_SCORE_MINUS(20); // No point in setting up if you will faint. Should just switch if possible.. } // check effects to prioritize first turn - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_ATTACK_UP: case EFFECT_ATTACK_UP_USER_ALLY: @@ -4825,9 +4831,11 @@ static s32 AI_ForceSetupFirstTurn(u32 battlerAtk, u32 battlerDef, u32 move, s32 { // TEMPORARY - should applied to all moves regardless of EFFECT // Consider move effects - for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + u32 additionalEffectCount = GetMoveAdditionalEffectCount(move); + for (i = 0; i < additionalEffectCount; i++) { - switch (gMovesInfo[move].additionalEffects[i].moveEffect) + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(move, i); + switch (additionalEffect->moveEffect) { case MOVE_EFFECT_STEALTH_ROCK: case MOVE_EFFECT_SPIKES: @@ -4854,11 +4862,11 @@ static s32 AI_Risky(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) if (IS_TARGETING_PARTNER(battlerAtk, battlerDef)) return score; - if (gMovesInfo[move].criticalHitStage > 0) + if (GetMoveCriticalHitStage(move) > 0) ADJUST_SCORE(DECENT_EFFECT); // +3 Score - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_COUNTER: if (gSpeciesInfo[gBattleMons[battlerDef].species].baseAttack >= gSpeciesInfo[gBattleMons[battlerDef].species].baseSpAttack + 10) @@ -4897,9 +4905,11 @@ static s32 AI_Risky(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) { // TEMPORARY - should applied to all moves regardless of EFFECT // Consider move effects - for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + u32 additionalEffectCount = GetMoveAdditionalEffectCount(move); + for (i = 0; i < additionalEffectCount; i++) { - switch (gMovesInfo[move].additionalEffects[i].moveEffect) + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(move, i); + switch (additionalEffect->moveEffect) { case MOVE_EFFECT_ALL_STATS_UP: if (Random() & 1) @@ -4936,12 +4946,14 @@ static s32 AI_PreferBatonPass(u32 battlerAtk, u32 battlerDef, u32 move, s32 scor { if (IS_TARGETING_PARTNER(battlerAtk, battlerDef) || CountUsablePartyMons(battlerAtk) == 0 - || !IS_MOVE_STATUS(move) + || !IsBattleMoveStatus(move) || !HasMoveEffect(battlerAtk, EFFECT_BATON_PASS) || IsBattlerTrapped(battlerAtk, TRUE)) return score; - if (IsStatRaisingEffect(gMovesInfo[move].effect)) + u32 effect = GetMoveEffect(move); + + if (IsStatRaisingEffect(effect)) { if (gBattleResults.battleTurnCounter == 0) ADJUST_SCORE(GOOD_EFFECT); @@ -4952,7 +4964,7 @@ static s32 AI_PreferBatonPass(u32 battlerAtk, u32 battlerDef, u32 move, s32 scor } // other specific checks - switch (gMovesInfo[move].effect) + switch (effect) { case EFFECT_INGRAIN: if (!(gStatuses3[battlerAtk] & STATUS3_ROOTED)) @@ -4984,11 +4996,11 @@ static s32 AI_PreferBatonPass(u32 battlerAtk, u32 battlerDef, u32 move, s32 scor static s32 AI_HPAware(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) { - u32 effect = gMovesInfo[move].effect; + u32 effect = GetMoveEffect(move); u32 moveType = 0; SetTypeBeforeUsingMove(move, battlerAtk); - moveType = GetMoveType(move); + moveType = GetBattleMoveType(move); if (IS_TARGETING_PARTNER(battlerAtk, battlerDef)) { @@ -5166,7 +5178,7 @@ static s32 AI_HPAware(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) else { // low HP - if (IS_MOVE_STATUS(move)) + if (IsBattleMoveStatus(move)) ADJUST_SCORE(-2); // don't use status moves if target is at low health } } @@ -5176,9 +5188,9 @@ static s32 AI_HPAware(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) static s32 AI_PowerfulStatus(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) { - u32 moveEffect = gMovesInfo[move].effect; + u32 moveEffect = GetMoveEffect(move); - if (gMovesInfo[move].category != DAMAGE_CATEGORY_STATUS || gMovesInfo[AI_DATA->partnerMove].effect == moveEffect) + if (GetMoveCategory(move) != DAMAGE_CATEGORY_STATUS || GetMoveEffect(AI_DATA->partnerMove) == moveEffect) return score; switch (moveEffect) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 5547351ec192..0a49453ce162 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -108,7 +108,7 @@ static bool32 ShouldSwitchIfHasBadOdds(u32 battler) for (i = 0; i < MAX_MON_MOVES; i++) { aiMove = gBattleMons[battler].moves[i]; - aiMoveEffect = gMovesInfo[aiMove].effect; + aiMoveEffect = GetMoveEffect(aiMove); if (aiMove != MOVE_NONE) { // Check if mon has an "important" status move @@ -123,7 +123,7 @@ static bool32 ShouldSwitchIfHasBadOdds(u32 battler) } // Only check damage if it's a damaging move - if (!IS_MOVE_STATUS(aiMove)) + if (!IsBattleMoveStatus(aiMove)) { // Check if mon has a super effective move if (AI_GetMoveEffectiveness(aiMove, battler, opposingBattler) >= AI_EFFECTIVENESS_x2) @@ -156,7 +156,7 @@ static bool32 ShouldSwitchIfHasBadOdds(u32 battler) for (i = 0; i < MAX_MON_MOVES; i++) { playerMove = gBattleMons[opposingBattler].moves[i]; - if (playerMove != MOVE_NONE && !IS_MOVE_STATUS(playerMove)) + if (playerMove != MOVE_NONE && !IsBattleMoveStatus(playerMove)) { damageTaken = AI_CalcDamage(playerMove, opposingBattler, battler, &effectiveness, FALSE, weather, DMG_ROLL_HIGHEST).expected; if (damageTaken > maxDamageTaken) @@ -332,7 +332,9 @@ static bool32 FindMonThatAbsorbsOpponentsMove(u32 battler) u16 monAbility; u32 opposingBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GetBattlerPosition(battler))); u32 incomingMove = AI_DATA->lastUsedMove[opposingBattler]; + u32 incomingType = GetMoveType(incomingMove); u32 predictedMove = incomingMove; // Update for move prediction + u32 predictedType = GetMoveType(predictedMove); bool32 isOpposingBattlerChargingOrInvulnerable = (IsSemiInvulnerable(opposingBattler, incomingMove) || IsTwoTurnNotSemiInvulnerableMove(opposingBattler, incomingMove)); s32 i, j; @@ -356,34 +358,34 @@ static bool32 FindMonThatAbsorbsOpponentsMove(u32 battler) } // Create an array of possible absorb abilities so the AI considers all of them - if (gMovesInfo[predictedMove].type == TYPE_FIRE) + if (predictedType == TYPE_FIRE) { absorbingTypeAbilities[numAbsorbingAbilities++] = ABILITY_FLASH_FIRE; } - else if (gMovesInfo[predictedMove].type == TYPE_WATER || (isOpposingBattlerChargingOrInvulnerable && gMovesInfo[incomingMove].type == TYPE_WATER)) + else if (predictedType == TYPE_WATER || (isOpposingBattlerChargingOrInvulnerable && incomingType == TYPE_WATER)) { absorbingTypeAbilities[numAbsorbingAbilities++] = ABILITY_WATER_ABSORB; absorbingTypeAbilities[numAbsorbingAbilities++] = ABILITY_DRY_SKIN; if (B_REDIRECT_ABILITY_IMMUNITY >= GEN_5) absorbingTypeAbilities[numAbsorbingAbilities++] = ABILITY_STORM_DRAIN; } - else if (gMovesInfo[predictedMove].type == TYPE_ELECTRIC || (isOpposingBattlerChargingOrInvulnerable && gMovesInfo[incomingMove].type == TYPE_ELECTRIC)) + else if (predictedType == TYPE_ELECTRIC || (isOpposingBattlerChargingOrInvulnerable && incomingType == TYPE_ELECTRIC)) { absorbingTypeAbilities[numAbsorbingAbilities++] = ABILITY_VOLT_ABSORB; absorbingTypeAbilities[numAbsorbingAbilities++] = ABILITY_MOTOR_DRIVE; if (B_REDIRECT_ABILITY_IMMUNITY >= GEN_5) absorbingTypeAbilities[numAbsorbingAbilities++] = ABILITY_LIGHTNING_ROD; } - else if (gMovesInfo[predictedMove].type == TYPE_GRASS || (isOpposingBattlerChargingOrInvulnerable && gMovesInfo[incomingMove].type == TYPE_GRASS)) + else if (predictedType == TYPE_GRASS || (isOpposingBattlerChargingOrInvulnerable && incomingType == TYPE_GRASS)) { absorbingTypeAbilities[numAbsorbingAbilities++] = ABILITY_SAP_SIPPER; } - else if (gMovesInfo[predictedMove].type == TYPE_GROUND || (isOpposingBattlerChargingOrInvulnerable && gMovesInfo[incomingMove].type == TYPE_GROUND)) + else if (predictedType == TYPE_GROUND || (isOpposingBattlerChargingOrInvulnerable && incomingType == TYPE_GROUND)) { absorbingTypeAbilities[numAbsorbingAbilities++] = ABILITY_EARTH_EATER; absorbingTypeAbilities[numAbsorbingAbilities++] = ABILITY_LEVITATE; } - else if (gMovesInfo[predictedMove].soundMove || (isOpposingBattlerChargingOrInvulnerable && gMovesInfo[incomingMove].soundMove)) + else if (IsSoundMove(predictedMove) || (isOpposingBattlerChargingOrInvulnerable && IsSoundMove(incomingMove))) { absorbingTypeAbilities[numAbsorbingAbilities++] = ABILITY_SOUNDPROOF; } @@ -702,7 +704,7 @@ static bool32 FindMonWithFlagsAndSuperEffective(u32 battler, u16 flags, u32 perc return FALSE; if (gLastHitBy[battler] == 0xFF) return FALSE; - if (IS_MOVE_STATUS(gLastLandedMoves[battler])) + if (IsBattleMoveStatus(gLastLandedMoves[battler])) return FALSE; if (IsDoubleBattle()) @@ -812,9 +814,10 @@ static bool32 CanMonSurviveHazardSwitchin(u32 battler) for (j = 0; j < MAX_MON_MOVES; j++) { aiMove = GetMonData(&party[i], MON_DATA_MOVE1 + j, NULL); + u32 aiEffect = GetMoveEffect(aiMove); if (MoveHasAdditionalEffectSelf(aiMove, MOVE_EFFECT_RAPID_SPIN) - || (B_DEFOG_EFFECT_CLEARING >= GEN_6 && gMovesInfo[aiMove].effect == EFFECT_DEFOG) - || gMovesInfo[aiMove].effect == EFFECT_TIDY_UP) + || (B_DEFOG_EFFECT_CLEARING >= GEN_6 && aiEffect == EFFECT_DEFOG) + || aiEffect == EFFECT_TIDY_UP) { // Have a mon that can clear the hazards, so switching out is okay return TRUE; @@ -841,7 +844,7 @@ static bool32 ShouldSwitchIfEncored(u32 battler) return FALSE; // Switch out if status move - if (gMovesInfo[encoredMove].category == DAMAGE_CATEGORY_STATUS) + if (GetMoveCategory(encoredMove) == DAMAGE_CATEGORY_STATUS) return SetSwitchinAndSwitch(battler, PARTY_SIZE); // Stay in if effective move @@ -861,7 +864,7 @@ static bool32 ShouldSwitchIfBadChoiceLock(u32 battler) if (HOLD_EFFECT_CHOICE(holdEffect) && gBattleMons[battler].ability != ABILITY_KLUTZ) { - if (gMovesInfo[gLastUsedMove].category == DAMAGE_CATEGORY_STATUS) + if (GetMoveCategory(gLastUsedMove) == DAMAGE_CATEGORY_STATUS) return SetSwitchinAndSwitch(battler, PARTY_SIZE); } @@ -1242,7 +1245,7 @@ static u32 GetBestMonDmg(struct Pokemon *party, int firstId, int lastId, u8 inva for (j = 0; j < MAX_MON_MOVES; j++) { aiMove = AI_DATA->switchinCandidate.battleMon.moves[j]; - if (aiMove != MOVE_NONE && !IS_MOVE_STATUS(aiMove)) + if (aiMove != MOVE_NONE && !IsBattleMoveStatus(aiMove)) { aiMove = GetMonData(&party[i], MON_DATA_MOVE1 + j); dmg = AI_CalcPartyMonDamage(aiMove, battler, opposingBattler, AI_DATA->switchinCandidate.battleMon, TRUE, rollType); @@ -1289,10 +1292,10 @@ static u32 GetSwitchinHazardsDamage(u32 battler, struct BattlePokemon *battleMon { // Stealth Rock if ((hazardFlags & SIDE_STATUS_STEALTH_ROCK) && heldItemEffect != HOLD_EFFECT_HEAVY_DUTY_BOOTS) - hazardDamage += GetStealthHazardDamageByTypesAndHP(gMovesInfo[MOVE_STEALTH_ROCK].type, defType1, defType2, battleMon->maxHP); + hazardDamage += GetStealthHazardDamageByTypesAndHP(GetMoveType(MOVE_STEALTH_ROCK), defType1, defType2, battleMon->maxHP); // G-Max Steelsurge if ((hazardFlags & SIDE_STATUS_STEELSURGE) && heldItemEffect != HOLD_EFFECT_HEAVY_DUTY_BOOTS) - hazardDamage += GetStealthHazardDamageByTypesAndHP(gMovesInfo[MOVE_G_MAX_STEELSURGE].type, defType1, defType2, battleMon->maxHP); + hazardDamage += GetStealthHazardDamageByTypesAndHP(GetMoveType(MOVE_G_MAX_STEELSURGE), defType1, defType2, battleMon->maxHP); // Spikes if ((hazardFlags & SIDE_STATUS_SPIKES) && IsMonGrounded(heldItemEffect, ability, defType1, defType2)) { @@ -1698,7 +1701,7 @@ static s32 GetMaxDamagePlayerCouldDealToSwitchin(u32 battler, u32 opposingBattle for (i = 0; i < MAX_MON_MOVES; i++) { playerMove = gBattleMons[opposingBattler].moves[i]; - if (playerMove != MOVE_NONE && !IS_MOVE_STATUS(playerMove)) + if (playerMove != MOVE_NONE && !IsBattleMoveStatus(playerMove)) { damageTaken = AI_CalcPartyMonDamage(playerMove, opposingBattler, battler, battleMon, FALSE, DMG_ROLL_HIGHEST); if (damageTaken > maxDamageTaken) @@ -1734,7 +1737,7 @@ static inline bool32 IsFreeSwitch(bool32 isSwitchAfterKO, u32 battlerSwitchingOu // Switch out effects if (!IsDoubleBattle()) // Not handling doubles' additional complexity { - if (IsSwitchOutEffect(gMovesInfo[gLastUsedMove].effect) && movedSecond) + if (IsSwitchOutEffect(GetMoveEffect(gLastUsedMove)) && movedSecond) return TRUE; if (AI_DATA->ejectButtonSwitch) return TRUE; @@ -1826,7 +1829,7 @@ static u32 GetBestMonIntegrated(struct Pokemon *party, int firstId, int lastId, { aiMove = AI_DATA->switchinCandidate.battleMon.moves[j]; - if (aiMove != MOVE_NONE && !IS_MOVE_STATUS(aiMove)) + if (aiMove != MOVE_NONE && !IsBattleMoveStatus(aiMove)) { if (AI_THINKING_STRUCT->aiFlags[battler] & AI_FLAG_CONSERVATIVE) damageDealt = AI_CalcPartyMonDamage(aiMove, battler, opposingBattler, AI_DATA->switchinCandidate.battleMon, TRUE, DMG_ROLL_LOWEST); @@ -1856,7 +1859,7 @@ static u32 GetBestMonIntegrated(struct Pokemon *party, int firstId, int lastId, } // Check for mon with resistance and super effective move for best type matchup mon with effective move - if (aiMove != MOVE_NONE && !IS_MOVE_STATUS(aiMove)) + if (aiMove != MOVE_NONE && !IsBattleMoveStatus(aiMove)) { if (typeMatchup < bestResistEffective) { @@ -1871,7 +1874,7 @@ static u32 GetBestMonIntegrated(struct Pokemon *party, int firstId, int lastId, } // If a self destruction move doesn't OHKO, don't factor it into revenge killing - if (gMovesInfo[aiMove].effect == EFFECT_EXPLOSION && damageDealt < playerMonHP) + if (GetMoveEffect(aiMove) == EFFECT_EXPLOSION && damageDealt < playerMonHP) continue; // Check that mon isn't one shot and set best damage mon @@ -1944,7 +1947,7 @@ static u32 GetBestMonIntegrated(struct Pokemon *party, int firstId, int lastId, else if (batonPassId != PARTY_SIZE) return batonPassId; } // If ace mon is the last available Pokemon and U-Turn/Volt Switch was used - switch to the mon. - if (aceMonId != PARTY_SIZE && IsSwitchOutEffect(gMovesInfo[gLastUsedMove].effect)) + if (aceMonId != PARTY_SIZE && IsSwitchOutEffect(GetMoveEffect(gLastUsedMove))) return aceMonId; return PARTY_SIZE; diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index dd1cd296daec..798713ef59cc 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -11,6 +11,7 @@ #include "event_data.h" #include "data.h" #include "item.h" +#include "move.h" #include "pokemon.h" #include "random.h" #include "recorded_battle.h" @@ -22,16 +23,6 @@ #include "constants/moves.h" #include "constants/items.h" -#define CHECK_MOVE_FLAG(flag) \ - s32 i; \ - u16 *moves = GetMovesArray(battler); \ - for (i = 0; i < MAX_MON_MOVES; i++) \ - { \ - if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && gMovesInfo[moves[i]].flag) \ - return TRUE; \ - } \ - return FALSE - static u32 AI_GetEffectiveness(uq4_12_t multiplier); // Functions @@ -338,9 +329,10 @@ bool32 IsTruantMonVulnerable(u32 battlerAI, u32 opposingBattler) for (i = 0; i < MAX_MON_MOVES; i++) { u32 move = gBattleResources->battleHistory->usedMoves[opposingBattler][i]; - if (gMovesInfo[move].effect == EFFECT_PROTECT && move != MOVE_ENDURE) + u32 effect = GetMoveEffect(move); + if (effect == EFFECT_PROTECT && move != MOVE_ENDURE) return TRUE; - if (gMovesInfo[move].effect == EFFECT_SEMI_INVULNERABLE && AI_IsSlower(battlerAI, opposingBattler, GetAIChosenMove(battlerAI))) + if (effect == EFFECT_SEMI_INVULNERABLE && AI_IsSlower(battlerAI, opposingBattler, GetAIChosenMove(battlerAI))) return TRUE; } return FALSE; @@ -373,7 +365,7 @@ bool32 MovesWithCategoryUnusable(u32 attacker, u32 target, u32 category) && !(unusable & (1u << i))) { SetTypeBeforeUsingMove(moves[i], attacker); - moveType = GetMoveType(moves[i]); + moveType = GetBattleMoveType(moves[i]); if (CalcTypeEffectivenessMultiplier(moves[i], moveType, attacker, target, AI_DATA->abilities[target], FALSE) != 0) usable |= 1u << i; } @@ -450,7 +442,7 @@ bool32 IsDamageMoveUnusable(u32 battlerAtk, u32 battlerDef, u32 move, u32 moveTy if (CanAbilityAbsorbMove(battlerAtk, battlerDef, aiData->abilities[battlerDef], move, moveType)) return TRUE; - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_DREAM_EATER: if (!AI_IsBattlerAsleepOrComatose(battlerDef)) @@ -470,11 +462,11 @@ bool32 IsDamageMoveUnusable(u32 battlerAtk, u32 battlerDef, u32 move, u32 moveTy return TRUE; break; case EFFECT_FAIL_IF_NOT_ARG_TYPE: - if (!IS_BATTLER_OF_TYPE(battlerAtk, gMovesInfo[move].argument.type)) + if (!IS_BATTLER_OF_TYPE(battlerAtk, GetMoveArgType(move))) return TRUE; break; case EFFECT_HIT_SET_REMOVE_TERRAIN: - if (!(gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) && gMovesInfo[move].argument.moveProperty == ARG_TRY_REMOVE_TERRAIN_FAIL) + if (!(gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) && GetMoveEffectArg_MoveProperty(move) == ARG_TRY_REMOVE_TERRAIN_FAIL) return TRUE; break; case EFFECT_POLTERGEIST: @@ -512,7 +504,7 @@ static inline s32 GetDamageByRollType(s32 dmg, enum DamageRollType rollType) static inline void SetMoveDamageCategory(u32 battlerAtk, u32 battlerDef, u32 move) { - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_PHOTON_GEYSER: gBattleStruct->swapDamageCategory = (GetCategoryBasedOnStats(battlerAtk) == DAMAGE_CATEGORY_PHYSICAL); @@ -535,14 +527,14 @@ static inline void SetMoveDamageCategory(u32 battlerAtk, u32 battlerDef, u32 mov static inline s32 SetFixedMoveBasePower(u32 battlerAtk, u32 move) { s32 fixedBasePower = 0, n = 0; - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_ROLLOUT: n = gDisableStructs[battlerAtk].rolloutTimer - 1; - fixedBasePower = CalcRolloutBasePower(battlerAtk, gMovesInfo[move].power, n < 0 ? 5 : n); + fixedBasePower = CalcRolloutBasePower(battlerAtk, GetMovePower(move), n < 0 ? 5 : n); break; case EFFECT_FURY_CUTTER: - fixedBasePower = CalcFuryCutterBasePower(gMovesInfo[move].power, min(gDisableStructs[battlerAtk].furyCutterCounter + 1, 5)); + fixedBasePower = CalcFuryCutterBasePower(GetMovePower(move), min(gDisableStructs[battlerAtk].furyCutterCounter + 1, 5)); break; default: fixedBasePower = 0; @@ -554,10 +546,11 @@ static inline s32 SetFixedMoveBasePower(u32 battlerAtk, u32 move) static inline void CalcDynamicMoveDamage(struct DamageCalculationData *damageCalcData, s32 *expectedDamage, s32 *minimumDamage, u32 holdEffectAtk, u32 abilityAtk) { u32 move = damageCalcData->move; + u32 effect = GetMoveEffect(move); s32 expected = *expectedDamage; s32 minimum = *minimumDamage; - switch (gMovesInfo[move].effect) + switch (effect) { case EFFECT_LEVEL_DAMAGE: expected = minimum = gBattleMons[damageCalcData->battlerAtk].level * (abilityAtk == ABILITY_PARENTAL_BOND ? 2 : 1); @@ -566,7 +559,7 @@ static inline void CalcDynamicMoveDamage(struct DamageCalculationData *damageCal expected = minimum = gBattleMons[damageCalcData->battlerAtk].level * (abilityAtk == ABILITY_PARENTAL_BOND ? 2 : 1); break; case EFFECT_FIXED_DAMAGE_ARG: - expected = minimum = gMovesInfo[move].argument.fixedDamage * (abilityAtk == ABILITY_PARENTAL_BOND ? 2 : 1); + expected = minimum = GetMoveFixedDamage(move) * (abilityAtk == ABILITY_PARENTAL_BOND ? 2 : 1); break; case EFFECT_MULTI_HIT: if (move == MOVE_WATER_SHURIKEN && gBattleMons[damageCalcData->battlerAtk].species == SPECIES_GRENINJA_ASH) @@ -620,10 +613,11 @@ static inline void CalcDynamicMoveDamage(struct DamageCalculationData *damageCal } // Handle other multi-strike moves - if (gMovesInfo[move].strikeCount > 1 && gMovesInfo[move].effect != EFFECT_TRIPLE_KICK) + u32 strikeCount = GetMoveStrikeCount(move); + if (strikeCount > 1 && effect != EFFECT_TRIPLE_KICK) { - expected *= gMovesInfo[move].strikeCount; - minimum *= gMovesInfo[move].strikeCount; + expected *= strikeCount; + minimum *= strikeCount; } if (expected == 0) @@ -639,7 +633,7 @@ struct SimulatedDamage AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u { struct SimulatedDamage simDamage; s32 moveType; - u32 moveEffect = gMovesInfo[move].effect; + u32 moveEffect = GetMoveEffect(move); uq4_12_t effectivenessMultiplier; bool32 isDamageMoveUnusable = FALSE; bool32 toggledGimmick = FALSE; @@ -663,13 +657,14 @@ struct SimulatedDamage AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u SetMoveDamageCategory(battlerAtk, battlerDef, move); SetTypeBeforeUsingMove(move, battlerAtk); - moveType = GetMoveType(move); + moveType = GetBattleMoveType(move); effectivenessMultiplier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, aiData->abilities[battlerDef], FALSE); - if (gMovesInfo[move].power) + u32 movePower = GetMovePower(move); + if (movePower) isDamageMoveUnusable = IsDamageMoveUnusable(battlerAtk, battlerDef, move, moveType); - if (gMovesInfo[move].power && !isDamageMoveUnusable) + if (movePower && !isDamageMoveUnusable) { s32 critChanceIndex, fixedBasePower; @@ -723,7 +718,7 @@ struct SimulatedDamage AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u s32 nonCritDmg = 0; if (moveEffect == EFFECT_TRIPLE_KICK) { - for (gMultiHitCounter = gMovesInfo[move].strikeCount; gMultiHitCounter > 0; gMultiHitCounter--) // The global is used to simulate actual damage done + for (gMultiHitCounter = GetMoveStrikeCount(move); gMultiHitCounter > 0; gMultiHitCounter--) // The global is used to simulate actual damage done { nonCritDmg += CalculateMoveDamageVars(&damageCalcData, fixedBasePower, effectivenessMultiplier, weather, @@ -785,7 +780,7 @@ static bool32 AI_IsMoveEffectInPlus(u32 battlerAtk, u32 battlerDef, u32 move, s3 u32 abilityDef = AI_DATA->abilities[battlerDef]; u32 abilityAtk = AI_DATA->abilities[battlerAtk]; - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_HIT_ESCAPE: if (CountUsablePartyMons(battlerAtk) != 0 && ShouldPivot(battlerAtk, battlerDef, abilityDef, move, AI_THINKING_STRUCT->movesetIndex)) @@ -798,12 +793,14 @@ static bool32 AI_IsMoveEffectInPlus(u32 battlerAtk, u32 battlerDef, u32 move, s3 } // check ADDITIONAL_EFFECTS - for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + u32 additionalEffectCount = GetMoveAdditionalEffectCount(move); + for (i = 0; i < additionalEffectCount; i++) { + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(move, i); // Consider move effects that target self - if (gMovesInfo[move].additionalEffects[i].self) + if (additionalEffect->self) { - switch (gMovesInfo[move].additionalEffects[i].moveEffect) + switch (additionalEffect->moveEffect) { case MOVE_EFFECT_ATK_PLUS_1: case MOVE_EFFECT_ATK_PLUS_2: @@ -846,7 +843,7 @@ static bool32 AI_IsMoveEffectInPlus(u32 battlerAtk, u32 battlerDef, u32 move, s3 } else // consider move effects that hinder the target { - switch (gMovesInfo[move].additionalEffects[i].moveEffect) + switch (additionalEffect->moveEffect) { case MOVE_EFFECT_POISON: case MOVE_EFFECT_TOXIC: @@ -880,7 +877,7 @@ static bool32 AI_IsMoveEffectInPlus(u32 battlerAtk, u32 battlerDef, u32 move, s3 case MOVE_EFFECT_SP_DEF_MINUS_1: case MOVE_EFFECT_ACC_MINUS_1: case MOVE_EFFECT_EVS_MINUS_1: - if (ShouldLowerStat(battlerDef, abilityDef, STAT_ATK + (gMovesInfo[move].additionalEffects[i].moveEffect - MOVE_EFFECT_ATK_MINUS_1)) && noOfHitsToKo != 1) + if (ShouldLowerStat(battlerDef, abilityDef, STAT_ATK + (additionalEffect->moveEffect - MOVE_EFFECT_ATK_MINUS_1)) && noOfHitsToKo != 1) return TRUE; break; case MOVE_EFFECT_ATK_MINUS_2: @@ -890,7 +887,7 @@ static bool32 AI_IsMoveEffectInPlus(u32 battlerAtk, u32 battlerDef, u32 move, s3 case MOVE_EFFECT_SP_DEF_MINUS_2: case MOVE_EFFECT_ACC_MINUS_2: case MOVE_EFFECT_EVS_MINUS_2: - if (ShouldLowerStat(battlerDef, abilityDef, STAT_ATK + (gMovesInfo[move].additionalEffects[i].moveEffect - MOVE_EFFECT_ATK_MINUS_2)) && noOfHitsToKo != 1) + if (ShouldLowerStat(battlerDef, abilityDef, STAT_ATK + (additionalEffect->moveEffect - MOVE_EFFECT_ATK_MINUS_2)) && noOfHitsToKo != 1) return TRUE; break; } @@ -907,10 +904,10 @@ static bool32 AI_IsMoveEffectInMinus(u32 battlerAtk, u32 battlerDef, u32 move, s u8 i; // recoil - if (gMovesInfo[move].recoil > 0 && AI_IsDamagedByRecoil(battlerAtk)) + if (GetMoveRecoil(move) > 0 && AI_IsDamagedByRecoil(battlerAtk)) return TRUE; - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_MAX_HP_50_RECOIL: case EFFECT_MIND_BLOWN: @@ -923,9 +920,11 @@ static bool32 AI_IsMoveEffectInMinus(u32 battlerAtk, u32 battlerDef, u32 move, s break; default: { - for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + u32 additionalEffectCount = GetMoveAdditionalEffectCount(move); + for (i = 0; i < additionalEffectCount; i++) { - switch (gMovesInfo[move].additionalEffects[i].moveEffect) + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(move, i); + switch (additionalEffect->moveEffect) { case MOVE_EFFECT_ATK_MINUS_1: case MOVE_EFFECT_DEF_MINUS_1: @@ -944,12 +943,12 @@ static bool32 AI_IsMoveEffectInMinus(u32 battlerAtk, u32 battlerDef, u32 move, s case MOVE_EFFECT_V_CREATE: case MOVE_EFFECT_ATK_DEF_DOWN: case MOVE_EFFECT_DEF_SPDEF_DOWN: - if ((gMovesInfo[move].additionalEffects[i].self && abilityAtk != ABILITY_CONTRARY) + if ((additionalEffect->self && abilityAtk != ABILITY_CONTRARY) || (noOfHitsToKo != 1 && abilityDef == ABILITY_CONTRARY && !DoesBattlerIgnoreAbilityChecks(abilityAtk, move))) return TRUE; break; case MOVE_EFFECT_RECHARGE: - return gMovesInfo[move].additionalEffects[i].self; + return additionalEffect->self; case MOVE_EFFECT_ATK_PLUS_1: case MOVE_EFFECT_DEF_PLUS_1: case MOVE_EFFECT_SPD_PLUS_1: @@ -965,7 +964,7 @@ static bool32 AI_IsMoveEffectInMinus(u32 battlerAtk, u32 battlerDef, u32 move, s case MOVE_EFFECT_EVS_PLUS_2: case MOVE_EFFECT_ACC_PLUS_2: case MOVE_EFFECT_ALL_STATS_UP: - if ((gMovesInfo[move].additionalEffects[i].self && abilityAtk == ABILITY_CONTRARY) + if ((additionalEffect->self && abilityAtk == ABILITY_CONTRARY) || (noOfHitsToKo != 1 && !(abilityDef == ABILITY_CONTRARY && !DoesBattlerIgnoreAbilityChecks(abilityAtk, move)))) return TRUE; break; @@ -989,9 +988,11 @@ s32 AI_WhichMoveBetter(u32 move1, u32 move2, u32 battlerAtk, u32 battlerDef, s32 && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_ROCKY_HELMET || defAbility == ABILITY_IRON_BARBS || defAbility == ABILITY_ROUGH_SKIN)) { - if (gMovesInfo[move1].makesContact && !gMovesInfo[move2].makesContact) + bool32 moveContact1 = MoveMakesContact(move1); + bool32 moveContact2 = MoveMakesContact(move2); + if (moveContact1 && !moveContact2) return -1; - if (gMovesInfo[move2].makesContact && !gMovesInfo[move1].makesContact) + if (moveContact2 && !moveContact1) return 1; } @@ -1050,7 +1051,7 @@ uq4_12_t AI_GetTypeEffectiveness(u32 move, u32 battlerAtk, u32 battlerDef) gBattleStruct->dynamicMoveType = 0; SetTypeBeforeUsingMove(move, battlerAtk); - moveType = GetMoveType(move); + moveType = GetBattleMoveType(move); typeEffectiveness = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], FALSE); RestoreBattlerData(battlerAtk); @@ -1102,7 +1103,7 @@ s32 AI_WhoStrikesFirst(u32 battlerAI, u32 battler, u32 moveConsidered) u32 abilityAI = AI_DATA->abilities[battlerAI]; u32 abilityPlayer = AI_DATA->abilities[battler]; - if (GetMovePriority(battlerAI, moveConsidered) > 0) + if (GetBattleMovePriority(battlerAI, moveConsidered) > 0) return AI_IS_FASTER; speedBattlerAI = GetBattlerTotalSpeedStatArgs(battlerAI, abilityAI, holdEffectAI); @@ -1142,9 +1143,10 @@ s32 AI_WhoStrikesFirst(u32 battlerAI, u32 battler, u32 moveConsidered) static bool32 CanEndureHit(u32 battler, u32 battlerTarget, u32 move) { - if (!AI_BattlerAtMaxHp(battlerTarget) || gMovesInfo[move].effect == EFFECT_MULTI_HIT) + u32 effect = GetMoveEffect(move); + if (!AI_BattlerAtMaxHp(battlerTarget) || effect == EFFECT_MULTI_HIT) return FALSE; - if (gMovesInfo[move].strikeCount > 1 && !(gMovesInfo[move].effect == EFFECT_DRAGON_DARTS && IsValidDoubleBattle(battlerTarget))) + if (GetMoveStrikeCount(move) > 1 && !(effect == EFFECT_DRAGON_DARTS && IsValidDoubleBattle(battlerTarget))) return FALSE; if (AI_DATA->holdEffects[battlerTarget] == HOLD_EFFECT_FOCUS_SASH) return TRUE; @@ -1409,7 +1411,7 @@ bool32 DoesBattlerIgnoreAbilityChecks(u32 atkAbility, u32 move) if (AI_THINKING_STRUCT->aiFlags[sBattler_AI] & AI_FLAG_NEGATE_UNAWARE) return FALSE; // AI handicap flag: doesn't understand ability suppression concept - if (IsMoldBreakerTypeAbility(sBattler_AI, atkAbility) || gMovesInfo[move].ignoresTargetAbility) + if (IsMoldBreakerTypeAbility(sBattler_AI, atkAbility) || MoveIgnoresTargetAbility(move)) return TRUE; return FALSE; @@ -1510,11 +1512,11 @@ bool32 IsSemiInvulnerable(u32 battlerDef, u32 move) return TRUE; else if (gBattleStruct->commandingDondozo & (1u << battlerDef)) return TRUE; - else if (!gMovesInfo[move].damagesAirborne && gStatuses3[battlerDef] & STATUS3_ON_AIR) + else if (!MoveDamagesAirborne(move) && gStatuses3[battlerDef] & STATUS3_ON_AIR) return TRUE; - else if (!gMovesInfo[move].damagesUnderwater && gStatuses3[battlerDef] & STATUS3_UNDERWATER) + else if (!MoveDamagesUnderWater(move) && gStatuses3[battlerDef] & STATUS3_UNDERWATER) return TRUE; - else if (!gMovesInfo[move].damagesUnderground && gStatuses3[battlerDef] & STATUS3_UNDERGROUND) + else if (!MoveDamagesUnderground(move) && gStatuses3[battlerDef] & STATUS3_UNDERGROUND) return TRUE; else return FALSE; @@ -1535,22 +1537,23 @@ bool32 IsMoveEncouragedToHit(u32 battlerAtk, u32 battlerDef, u32 move) if (AI_DATA->abilities[battlerDef] == ABILITY_NO_GUARD || AI_DATA->abilities[battlerAtk] == ABILITY_NO_GUARD) return TRUE; - if (B_TOXIC_NEVER_MISS >= GEN_6 && gMovesInfo[move].effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON)) + u32 effect = GetMoveEffect(move); + if (B_TOXIC_NEVER_MISS >= GEN_6 && effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON)) return TRUE; // discouraged from hitting weather = AI_GetWeather(AI_DATA); - if ((weather & B_WEATHER_SUN) && gMovesInfo[move].effect == EFFECT_THUNDER) + if ((weather & B_WEATHER_SUN) && effect == EFFECT_THUNDER) return FALSE; // increased accuracy but don't always hit - if ((weather & B_WEATHER_RAIN) && gMovesInfo[move].effect == EFFECT_THUNDER) + if ((weather & B_WEATHER_RAIN) && effect == EFFECT_THUNDER) return TRUE; - if ((weather & (B_WEATHER_HAIL | B_WEATHER_SNOW)) && gMovesInfo[move].effect == EFFECT_BLIZZARD) + if ((weather & (B_WEATHER_HAIL | B_WEATHER_SNOW)) && effect == EFFECT_BLIZZARD) return TRUE; - if (B_MINIMIZE_DMG_ACC >= GEN_6 && (gStatuses3[battlerDef] & STATUS3_MINIMIZED) && gMovesInfo[move].minimizeDoubleDamage) + if (B_MINIMIZE_DMG_ACC >= GEN_6 && (gStatuses3[battlerDef] & STATUS3_MINIMIZED) && MoveIncreasesPowerToMinimizedTargets(move)) return TRUE; - if (gMovesInfo[move].accuracy == 0) + if (GetMoveAccuracy(move) == 0) return TRUE; return FALSE; @@ -1712,7 +1715,7 @@ void ProtectChecks(u32 battlerAtk, u32 battlerDef, u32 move, u32 predictedMove, if (uses == 0) { - if (predictedMove != MOVE_NONE && predictedMove != 0xFFFF && !IS_MOVE_STATUS(predictedMove)) + if (predictedMove != MOVE_NONE && predictedMove != 0xFFFF && !IsBattleMoveStatus(predictedMove)) ADJUST_SCORE_PTR(DECENT_EFFECT); else if (Random() % 256 < 100) ADJUST_SCORE_PTR(WEAK_EFFECT); @@ -1976,7 +1979,7 @@ bool32 HasOnlyMovesWithCategory(u32 battlerId, u32 category, bool32 onlyOffensiv for (i = 0; i < MAX_MON_MOVES; i++) { - if (onlyOffensive && IS_MOVE_STATUS(moves[i])) + if (onlyOffensive && IsBattleMoveStatus(moves[i])) continue; if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && GetBattleMoveCategory(moves[i]) != category) return FALSE; @@ -2005,7 +2008,7 @@ bool32 HasMoveWithType(u32 battler, u32 type) for (i = 0; i < MAX_MON_MOVES; i++) { - if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && gMovesInfo[moves[i]].type == type) + if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && GetMoveType(moves[i]) == type) return TRUE; } @@ -2020,7 +2023,7 @@ bool32 HasMoveEffect(u32 battlerId, u32 effect) for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE - && gMovesInfo[moves[i]].effect == effect) + && GetMoveEffect(moves[i]) == effect) return TRUE; } @@ -2035,8 +2038,8 @@ bool32 IsPowerBasedOnStatus(u32 battlerId, u32 effect, u32 argument) for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE - && gMovesInfo[moves[i]].effect == effect - && (gMovesInfo[moves[i]].argument.status & argument)) + && GetMoveEffect(moves[i]) == effect + && (GetMoveEffectArg_Status(moves[i]) & argument)) return TRUE; } @@ -2066,7 +2069,7 @@ bool32 HasMoveWithCriticalHitChance(u32 battlerId) for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE - && gMovesInfo[moves[i]].criticalHitStage > 0) + && GetMoveCriticalHitStage(moves[i]) > 0) return TRUE; } @@ -2081,7 +2084,7 @@ bool32 HasMoveWithMoveEffectExcept(u32 battlerId, u32 moveEffect, u32 exception) for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE - && gMovesInfo[moves[i]].effect != exception + && GetMoveEffect(moves[i]) != exception && MoveHasAdditionalEffect(moves[i], moveEffect)) return TRUE; } @@ -2127,9 +2130,11 @@ bool32 HasMoveThatLowersOwnStats(u32 battlerId) aiMove = moves[i]; if (aiMove != MOVE_NONE && aiMove != MOVE_UNAVAILABLE) { - for (j = 0; j < gMovesInfo[aiMove].numAdditionalEffects; j++) + u32 additionalEffectCount = GetMoveAdditionalEffectCount(aiMove); + for (j = 0; j < additionalEffectCount; j++) { - if (IsSelfStatLoweringEffect(gMovesInfo[aiMove].additionalEffects[j].moveEffect) && gMovesInfo[aiMove].additionalEffects[j].self) + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(aiMove, j); + if (IsSelfStatLoweringEffect(additionalEffect->moveEffect) && additionalEffect->self) return TRUE; } } @@ -2150,9 +2155,9 @@ bool32 HasMoveWithLowAccuracy(u32 battlerAtk, u32 battlerDef, u32 accCheck, bool if (!((1u << i) & moveLimitations)) { - if (ignoreStatus && IS_MOVE_STATUS(moves[i])) + if (ignoreStatus && IsBattleMoveStatus(moves[i])) continue; - else if ((!IS_MOVE_STATUS(moves[i]) && gMovesInfo[moves[i]].accuracy == 0) + else if ((!IsBattleMoveStatus(moves[i]) && GetMoveAccuracy(moves[i]) == 0) || GetBattlerMoveTargetType(battlerAtk, moves[i]) & (MOVE_TARGET_USER | MOVE_TARGET_OPPONENTS_FIELD)) continue; @@ -2176,7 +2181,7 @@ bool32 HasSleepMoveWithLowAccuracy(u32 battlerAtk, u32 battlerDef) break; if (!((1u << i) & moveLimitations)) { - if (gMovesInfo[moves[i]].effect == EFFECT_SLEEP + if (GetMoveEffect(moves[i]) == EFFECT_SLEEP && AI_DATA->moveAccuracy[battlerAtk][battlerDef][i] < 85) return TRUE; } @@ -2184,11 +2189,6 @@ bool32 HasSleepMoveWithLowAccuracy(u32 battlerAtk, u32 battlerDef) return FALSE; } -bool32 IsHealingMove(u32 move) -{ - return gMovesInfo[move].healingMove; -} - bool32 HasHealingEffect(u32 battlerId) { s32 i; @@ -2205,7 +2205,7 @@ bool32 HasHealingEffect(u32 battlerId) bool32 IsTrappingMove(u32 move) { - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_MEAN_LOOK: case EFFECT_FAIRY_LOCK: @@ -2233,7 +2233,14 @@ bool32 HasTrappingMoveEffect(u32 battler) bool32 HasThawingMove(u32 battler) { - CHECK_MOVE_FLAG(thawsUser); + s32 i; + u16 *moves = GetMovesArray(battler); + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && MoveThawsUser(moves[i])) + return TRUE; + } + return FALSE; } bool32 IsUngroundingEffect(u32 effect) @@ -2388,7 +2395,7 @@ bool32 IsSwitchOutEffect(u32 effect) static inline bool32 IsMoveSleepClauseTrigger(u32 move) { - u32 i, effect = gMovesInfo[move].effect; + u32 i, effect = GetMoveEffect(move); // Sleeping effects like Sleep Powder, Yawn, Dark Void, etc. switch (effect) @@ -2400,9 +2407,11 @@ static inline bool32 IsMoveSleepClauseTrigger(u32 move) } // Sleeping effects like G-Max Befuddle, G-Max Snooze, etc. - for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + u32 additionalEffectCount = GetMoveAdditionalEffectCount(move); + for (i = 0; i < additionalEffectCount; i++) { - switch (gMovesInfo[move].additionalEffects[i].moveEffect) + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(move, i); + switch (additionalEffect->moveEffect) { case MAX_EFFECT_EFFECT_SPORE_FOES: case MAX_EFFECT_YAWN_FOE: @@ -2419,7 +2428,7 @@ bool32 HasDamagingMove(u32 battlerId) for (i = 0; i < MAX_MON_MOVES; i++) { - if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && !IS_MOVE_STATUS(moves[i])) + if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && !IsBattleMoveStatus(moves[i])) return TRUE; } @@ -2434,7 +2443,7 @@ bool32 HasDamagingMoveOfType(u32 battlerId, u32 type) for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE - && gMovesInfo[moves[i]].type == type && !IS_MOVE_STATUS(moves[i])) + && GetMoveType(moves[i]) == type && !IsBattleMoveStatus(moves[i])) return TRUE; } @@ -2443,7 +2452,14 @@ bool32 HasDamagingMoveOfType(u32 battlerId, u32 type) bool32 HasSubstituteIgnoringMove(u32 battler) { - CHECK_MOVE_FLAG(ignoresSubstitute); + s32 i; + u16 *moves = GetMovesArray(battler); + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && MoveIgnoresSubstitute(moves[i])) + return TRUE; + } + return FALSE; } bool32 HasHighCritRatioMove(u32 battler) @@ -2453,7 +2469,7 @@ bool32 HasHighCritRatioMove(u32 battler) for (i = 0; i < MAX_MON_MOVES; i++) { - if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && gMovesInfo[moves[i]].criticalHitStage > 0) + if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && GetMoveCriticalHitStage(moves[i]) > 0) return TRUE; } @@ -2462,22 +2478,36 @@ bool32 HasHighCritRatioMove(u32 battler) bool32 HasMagicCoatAffectedMove(u32 battler) { - CHECK_MOVE_FLAG(magicCoatAffected); + s32 i; + u16 *moves = GetMovesArray(battler); + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && MoveCanBeBouncedBack(moves[i])) + return TRUE; + } + return FALSE; } bool32 HasSnatchAffectedMove(u32 battler) { - CHECK_MOVE_FLAG(snatchAffected); + s32 i; + u16 *moves = GetMovesArray(battler); + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && MoveCanBeSnatched(moves[i])) + return TRUE; + } + return FALSE; } bool32 IsTwoTurnNotSemiInvulnerableMove(u32 battlerAtk, u32 move) { - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_SOLAR_BEAM: case EFFECT_TWO_TURNS_ATTACK: return !(AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_POWER_HERB - || (AI_GetWeather(AI_DATA) & gMovesInfo[move].argument.twoTurnAttack.status)); + || (AI_GetWeather(AI_DATA) & GetMoveTwoTurnAttackWeather(move))); default: return FALSE; } @@ -2714,7 +2744,7 @@ static bool32 PartyBattlerShouldAvoidHazards(u32 currBattler, u32 switchBattler) return FALSE; if (flags & SIDE_STATUS_STEALTH_ROCK) - hazardDamage += GetStealthHazardDamageByTypesAndHP(gMovesInfo[MOVE_STEALTH_ROCK].type, type1, type2, maxHp); + hazardDamage += GetStealthHazardDamageByTypesAndHP(GetMoveType(MOVE_STEALTH_ROCK), type1, type2, maxHp); if (flags & SIDE_STATUS_SPIKES && ((type1 != TYPE_FLYING && type2 != TYPE_FLYING && ability != ABILITY_LEVITATE && holdEffect != HOLD_EFFECT_AIR_BALLOON) @@ -2760,7 +2790,7 @@ enum AIPivot ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 mov if (CanTargetFaintAi(battlerDef, battlerAtk)) return SHOULD_PIVOT; // Won't get the two turns, pivot - if (!IS_MOVE_STATUS(move) && ((AI_DATA->shouldSwitch & (1u << battlerAtk)) + if (!IsBattleMoveStatus(move) && ((AI_DATA->shouldSwitch & (1u << battlerAtk)) || (AI_BattlerAtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH || (B_STURDY >= GEN_5 && defAbility == ABILITY_STURDY) || defAbility == ABILITY_MULTISCALE @@ -2769,7 +2799,7 @@ enum AIPivot ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 mov } else if (!hasStatBoost) { - if (!IS_MOVE_STATUS(move) && (AI_BattlerAtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH + if (!IsBattleMoveStatus(move) && (AI_BattlerAtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH || (B_STURDY >= GEN_5 && defAbility == ABILITY_STURDY) || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD))) @@ -2816,7 +2846,7 @@ enum AIPivot ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 mov { if (CanTargetFaintAi(battlerDef, battlerAtk)) { - if (gMovesInfo[move].effect == EFFECT_TELEPORT) + if (GetMoveEffect(move) == EFFECT_TELEPORT) return DONT_PIVOT; // If you're going to faint because you'll go second, use a different move else return CAN_TRY_PIVOT; // You're probably going to faint anyways so if for some reason you don't, better switch @@ -2846,7 +2876,7 @@ enum AIPivot ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 mov else if (CanAIFaintTarget(battlerAtk, battlerDef, 2)) { // can knock out foe in 2 hits - if (IS_MOVE_STATUS(move) && ((AI_DATA->shouldSwitch & (1u << battlerAtk)) //Damaging move + if (IsBattleMoveStatus(move) && ((AI_DATA->shouldSwitch & (1u << battlerAtk)) //Damaging move //&& (switchScore >= SWITCHING_INCREASE_RESIST_ALL_MOVES + SWITCHING_INCREASE_KO_FOE //remove hazards || (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH && AI_BattlerAtMaxHp(battlerDef)))) return DONT_PIVOT; // Pivot to break the sash @@ -3002,7 +3032,7 @@ bool32 AI_CanBeConfused(u32 battlerAtk, u32 battlerDef, u32 move, u32 ability) bool32 AI_CanConfuse(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 battlerAtkPartner, u32 move, u32 partnerMove) { - if (gMovesInfo[move].target == MOVE_TARGET_FOES_AND_ALLY + if (GetBattlerMoveTargetType(battlerAtk, move) == MOVE_TARGET_FOES_AND_ALLY && AI_CanBeConfused(battlerAtk, battlerDef, move, defAbility) && !AI_CanBeConfused(battlerAtk, BATTLE_PARTNER(battlerDef), move, AI_DATA->abilities[BATTLE_PARTNER(battlerDef)])) return FALSE; @@ -3229,8 +3259,7 @@ bool32 ShouldAbsorb(u32 battlerAtk, u32 battlerDef, u32 move, s32 damage) if (move == 0xFFFF || AI_IsFaster(battlerAtk, battlerDef, move)) { // using item or user goes first - u32 healPercent = (gMovesInfo[move].argument.absorbPercentage == 0) ? 50 : gMovesInfo[move].argument.absorbPercentage; - s32 healDmg = (healPercent * damage) / 100; + s32 healDmg = (GetMoveAbsorbPercentage(move) * damage) / 100; if (gStatuses3[battlerAtk] & STATUS3_HEAL_BLOCK) healDmg = 0; @@ -3331,7 +3360,7 @@ bool32 DoesPartnerHaveSameMoveEffect(u32 battlerAtkPartner, u32 battlerDef, u32 if (!IsDoubleBattle()) return FALSE; - if (gMovesInfo[move].effect == gMovesInfo[partnerMove].effect + if (GetMoveEffect(move) == GetMoveEffect(partnerMove) && partnerMove != MOVE_NONE && gBattleStruct->moveTarget[battlerAtkPartner] == battlerDef) { @@ -3346,7 +3375,7 @@ bool32 PartnerHasSameMoveEffectWithoutTarget(u32 battlerAtkPartner, u32 move, u3 if (!IsDoubleBattle()) return FALSE; - if (gMovesInfo[move].effect == gMovesInfo[partnerMove].effect + if (GetMoveEffect(move) == GetMoveEffect(partnerMove) && partnerMove != MOVE_NONE) return TRUE; return FALSE; @@ -3358,27 +3387,29 @@ bool32 PartnerMoveEffectIsStatusSameTarget(u32 battlerAtkPartner, u32 battlerDef if (!IsDoubleBattle()) return FALSE; + u32 partnerEffect = GetMoveEffect(partnerMove); if (partnerMove != MOVE_NONE && gBattleStruct->moveTarget[battlerAtkPartner] == battlerDef - && (gMovesInfo[partnerMove].effect == EFFECT_SLEEP - || gMovesInfo[partnerMove].effect == EFFECT_POISON - || gMovesInfo[partnerMove].effect == EFFECT_TOXIC - || gMovesInfo[partnerMove].effect == EFFECT_PARALYZE - || gMovesInfo[partnerMove].effect == EFFECT_WILL_O_WISP - || gMovesInfo[partnerMove].effect == EFFECT_YAWN)) + && (partnerEffect == EFFECT_SLEEP + || partnerEffect == EFFECT_POISON + || partnerEffect == EFFECT_TOXIC + || partnerEffect == EFFECT_PARALYZE + || partnerEffect == EFFECT_WILL_O_WISP + || partnerEffect == EFFECT_YAWN)) return TRUE; return FALSE; } bool32 IsMoveEffectWeather(u32 move) { + u32 effect = GetMoveEffect(move); if (move != MOVE_NONE - && (gMovesInfo[move].effect == EFFECT_SUNNY_DAY - || gMovesInfo[move].effect == EFFECT_RAIN_DANCE - || gMovesInfo[move].effect == EFFECT_SANDSTORM - || gMovesInfo[move].effect == EFFECT_HAIL - || gMovesInfo[move].effect == EFFECT_SNOWSCAPE - || gMovesInfo[move].effect == EFFECT_CHILLY_RECEPTION)) + && (effect == EFFECT_SUNNY_DAY + || effect == EFFECT_RAIN_DANCE + || effect == EFFECT_SANDSTORM + || effect == EFFECT_HAIL + || effect == EFFECT_SNOWSCAPE + || effect == EFFECT_CHILLY_RECEPTION)) return TRUE; return FALSE; } @@ -3389,11 +3420,12 @@ bool32 PartnerMoveEffectIsTerrain(u32 battlerAtkPartner, u32 partnerMove) if (!IsDoubleBattle()) return FALSE; + u32 partnerEffect = GetMoveEffect(partnerMove); if (partnerMove != MOVE_NONE - && (gMovesInfo[partnerMove].effect == EFFECT_GRASSY_TERRAIN - || gMovesInfo[partnerMove].effect == EFFECT_MISTY_TERRAIN - || gMovesInfo[partnerMove].effect == EFFECT_ELECTRIC_TERRAIN - || gMovesInfo[partnerMove].effect == EFFECT_PSYCHIC_TERRAIN)) + && (partnerEffect == EFFECT_GRASSY_TERRAIN + || partnerEffect == EFFECT_MISTY_TERRAIN + || partnerEffect == EFFECT_ELECTRIC_TERRAIN + || partnerEffect == EFFECT_PSYCHIC_TERRAIN)) return TRUE; return FALSE; @@ -3443,7 +3475,7 @@ bool32 ShouldUseWishAromatherapy(u32 battlerAtk, u32 battlerDef, u32 move) u32 i; s32 firstId, lastId; struct Pokemon* party; - bool32 hasStatus = AnyPartyMemberStatused(battlerAtk, gMovesInfo[move].soundMove); + bool32 hasStatus = AnyPartyMemberStatused(battlerAtk, IsSoundMove(move)); bool32 needHealing = FALSE; GetAIPartyIndexes(battlerAtk, &firstId, &lastId); @@ -3470,7 +3502,7 @@ bool32 ShouldUseWishAromatherapy(u32 battlerAtk, u32 battlerDef, u32 move) if (!IsDoubleBattle()) { - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_WISH: if (needHealing) @@ -3483,7 +3515,7 @@ bool32 ShouldUseWishAromatherapy(u32 battlerAtk, u32 battlerDef, u32 move) } else { - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_WISH: return ShouldRecover(battlerAtk, battlerDef, move, 50); // Switch recovery isn't good idea in doubles @@ -3626,7 +3658,7 @@ bool32 PartyHasMoveCategory(u32 battlerId, u32 category) if (pp > 0 && move != MOVE_NONE) { //TODO - handle photon geyser, light that burns the sky - if (gMovesInfo[move].category == category) + if (GetMoveCategory(move) == category) return TRUE; } } @@ -3868,7 +3900,7 @@ void IncreaseBurnScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score) || (!(AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_OMNISCIENT) // Not Omniscient but expects physical attacker && gSpeciesInfo[gBattleMons[battlerDef].species].baseAttack >= gSpeciesInfo[gBattleMons[battlerDef].species].baseSpAttack + 10)) { - if (gMovesInfo[GetBestDmgMoveFromBattler(battlerDef, battlerAtk)].category == DAMAGE_CATEGORY_PHYSICAL) + if (GetMoveCategory(GetBestDmgMoveFromBattler(battlerDef, battlerAtk)) == DAMAGE_CATEGORY_PHYSICAL) ADJUST_SCORE_PTR(DECENT_EFFECT); else ADJUST_SCORE_PTR(WEAK_EFFECT); @@ -3952,7 +3984,7 @@ void IncreaseFrostbiteScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score || (!(AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_OMNISCIENT) // Not Omniscient but expects special attacker && gSpeciesInfo[gBattleMons[battlerDef].species].baseSpAttack >= gSpeciesInfo[gBattleMons[battlerDef].species].baseAttack + 10)) { - if (gMovesInfo[GetBestDmgMoveFromBattler(battlerDef, battlerAtk)].category == DAMAGE_CATEGORY_SPECIAL) + if (GetMoveCategory(GetBestDmgMoveFromBattler(battlerDef, battlerAtk)) == DAMAGE_CATEGORY_SPECIAL) ADJUST_SCORE_PTR(DECENT_EFFECT); else ADJUST_SCORE_PTR(WEAK_EFFECT); @@ -3966,7 +3998,7 @@ void IncreaseFrostbiteScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score bool32 AI_MoveMakesContact(u32 ability, u32 holdEffect, u32 move) { - if (gMovesInfo[move].makesContact + if (MoveMakesContact(move) && ability != ABILITY_LONG_REACH && holdEffect != HOLD_EFFECT_PROTECTIVE_PADS) return TRUE; @@ -3989,22 +4021,22 @@ bool32 ShouldUseZMove(u32 battlerAtk, u32 battlerDef, u32 chosenMove) struct SimulatedDamage dmg; if (gBattleMons[battlerDef].ability == ABILITY_DISGUISE - && !gMovesInfo[zMove].ignoresTargetAbility + && !MoveIgnoresTargetAbility(zMove) && (gBattleMons[battlerDef].species == SPECIES_MIMIKYU_DISGUISED || gBattleMons[battlerDef].species == SPECIES_MIMIKYU_TOTEM_DISGUISED)) return FALSE; // Don't waste a Z-Move busting disguise if (gBattleMons[battlerDef].ability == ABILITY_ICE_FACE - && !gMovesInfo[zMove].ignoresTargetAbility - && gBattleMons[battlerDef].species == SPECIES_EISCUE_ICE && IS_MOVE_PHYSICAL(chosenMove)) + && !MoveIgnoresTargetAbility(zMove) + && gBattleMons[battlerDef].species == SPECIES_EISCUE_ICE && IsBattleMovePhysical(chosenMove)) return FALSE; // Don't waste a Z-Move busting Ice Face - if (IS_MOVE_STATUS(chosenMove) && !IS_MOVE_STATUS(zMove)) + if (IsBattleMoveStatus(chosenMove) && !IsBattleMoveStatus(zMove)) return FALSE; - else if (!IS_MOVE_STATUS(chosenMove) && IS_MOVE_STATUS(zMove)) + else if (!IsBattleMoveStatus(chosenMove) && IsBattleMoveStatus(zMove)) return FALSE; dmg = AI_CalcDamageSaveBattlers(chosenMove, battlerAtk, battlerDef, &effectiveness, FALSE, DMG_ROLL_DEFAULT); - if (!IS_MOVE_STATUS(chosenMove) && dmg.minimum >= gBattleMons[battlerDef].hp) + if (!IsBattleMoveStatus(chosenMove) && dmg.minimum >= gBattleMons[battlerDef].hp) return FALSE; // don't waste damaging z move if can otherwise faint target return TRUE; @@ -4107,7 +4139,7 @@ bool32 AI_ShouldSpicyExtract(u32 battlerAtk, u32 battlerAtkPartner, u32 move, st || partnerAbility == ABILITY_WHITE_SMOKE || partnerHoldEffect == HOLD_EFFECT_CLEAR_AMULET); - switch (gMovesInfo[aiData->partnerMove].effect) + switch (GetMoveEffect(aiData->partnerMove)) { case EFFECT_DEFENSE_UP: case EFFECT_DEFENSE_UP_2: @@ -4125,12 +4157,13 @@ bool32 AI_ShouldSpicyExtract(u32 battlerAtk, u32 battlerAtkPartner, u32 move, st void IncreaseSubstituteMoveScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score) { - if (gMovesInfo[move].effect == EFFECT_SUBSTITUTE) // Substitute specific + u32 effect = GetMoveEffect(move); + if (effect == EFFECT_SUBSTITUTE) // Substitute specific { if (HasAnyKnownMove(battlerDef) && GetBestDmgFromBattler(battlerDef, battlerAtk) < gBattleMons[battlerAtk].maxHP / 4) ADJUST_SCORE_PTR(GOOD_EFFECT); } - else if (gMovesInfo[move].effect == EFFECT_SHED_TAIL) // Shed Tail specific + else if (effect == EFFECT_SHED_TAIL) // Shed Tail specific { if ((ShouldPivot(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_THINKING_STRUCT->movesetIndex)) && (HasAnyKnownMove(battlerDef) && (GetBestDmgFromBattler(battlerDef, battlerAtk) < gBattleMons[battlerAtk].maxHP / 2))) diff --git a/src/battle_anim.c b/src/battle_anim.c index b036f83cbf6d..3e079647d202 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -2230,7 +2230,7 @@ static void Cmd_jumpifmovetypeequal(void) { const u8 *type = sBattleAnimScriptPtr + 1; sBattleAnimScriptPtr += 2; - if (*type != GetMoveType(gCurrentMove)) + if (*type != GetBattleMoveType(gCurrentMove)) sBattleAnimScriptPtr += 4; else sBattleAnimScriptPtr = T2_READ_PTR(sBattleAnimScriptPtr); diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index fd7fd04bcad3..7308a9d6fd83 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -9267,19 +9267,19 @@ void AnimTask_DynamaxGrowth(u8 taskId) // from CFRU void AnimTask_GetWeatherToSet(u8 taskId) { - switch (gMovesInfo[gCurrentMove].argument.maxEffect) + switch (GetMoveMaxEffect(gCurrentMove)) { case MAX_EFFECT_SUN: - gBattleAnimArgs[ARG_RET_ID] = 1; + gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SUN; break; case MAX_EFFECT_RAIN: - gBattleAnimArgs[ARG_RET_ID] = 2; + gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_RAIN; break; case MAX_EFFECT_SANDSTORM: - gBattleAnimArgs[ARG_RET_ID] = 3; + gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SANDSTORM; break; case MAX_EFFECT_HAIL: - gBattleAnimArgs[ARG_RET_ID] = 4; + gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_HAIL; break; } DestroyAnimVisualTask(taskId); diff --git a/src/battle_arena.c b/src/battle_arena.c index 4a6df309b56a..ff406a37df6f 100644 --- a/src/battle_arena.c +++ b/src/battle_arena.c @@ -362,18 +362,19 @@ void BattleArena_AddMindPoints(u8 battler) // - Fake Out subtracts 1 point // All status moves give 0 points, with the following exceptions: // - Protect, Detect, and Endure subtract 1 point + u32 effect = GetMoveEffect(gCurrentMove); - if (gMovesInfo[gCurrentMove].effect == EFFECT_FIRST_TURN_ONLY - || gMovesInfo[gCurrentMove].effect == EFFECT_PROTECT - || gMovesInfo[gCurrentMove].effect == EFFECT_ENDURE) + if (effect == EFFECT_FIRST_TURN_ONLY + || effect == EFFECT_PROTECT + || effect == EFFECT_ENDURE) { gBattleStruct->arenaMindPoints[battler]--; } - else if (!IS_MOVE_STATUS(gCurrentMove) - && gMovesInfo[gCurrentMove].effect != EFFECT_COUNTER - && gMovesInfo[gCurrentMove].effect != EFFECT_MIRROR_COAT - && gMovesInfo[gCurrentMove].effect != EFFECT_METAL_BURST - && gMovesInfo[gCurrentMove].effect != EFFECT_BIDE) + else if (!IsBattleMoveStatus(gCurrentMove) + && effect != EFFECT_COUNTER + && effect != EFFECT_MIRROR_COAT + && effect != EFFECT_METAL_BURST + && effect != EFFECT_BIDE) { gBattleStruct->arenaMindPoints[battler]++; } diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 2fbf8cf69f97..898a59c2ee7f 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -609,7 +609,7 @@ static void OpponentHandleChooseMove(u32 battler) } while (!CanTargetBattler(battler, target, move)); // Don't bother to loop through table if the move can't attack ally - if (B_WILD_NATURAL_ENEMIES == TRUE && !(gMovesInfo[move].target & MOVE_TARGET_BOTH)) + if (B_WILD_NATURAL_ENEMIES == TRUE && !(GetBattlerMoveTargetType(battler, move) & MOVE_TARGET_BOTH)) { u16 i, speciesAttacker, speciesTarget, isPartnerEnemy = FALSE; static const u16 naturalEnemies[][2] = diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 00e73735e8c3..1eac4dbe2686 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -680,13 +680,13 @@ void HandleInputChooseMove(u32 battler) if (gBattleStruct->zmove.viewing) { gBattleStruct->zmove.viewing = FALSE; - if (gMovesInfo[moveInfo->moves[gMoveSelectionCursor[battler]]].category != DAMAGE_CATEGORY_STATUS) + if (GetMoveCategory(moveInfo->moves[gMoveSelectionCursor[battler]]) != DAMAGE_CATEGORY_STATUS) moveTarget = MOVE_TARGET_SELECTED; //damaging z moves always have selected target } // Status moves turn into Max Guard when Dynamaxed, targets user. if (GetActiveGimmick(battler) == GIMMICK_DYNAMAX || IsGimmickSelected(battler, GIMMICK_DYNAMAX)) - moveTarget = gMovesInfo[GetMaxMove(battler, moveInfo->moves[gMoveSelectionCursor[battler]])].target; + moveTarget = GetMoveTarget(GetMaxMove(battler, moveInfo->moves[gMoveSelectionCursor[battler]])); if (moveTarget & MOVE_TARGET_USER) gMultiUsePlayerCursor = battler; @@ -1715,7 +1715,7 @@ static void MoveSelectionDisplayMoveType(u32 battler) u32 speciesId; struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[battler][4]); txtPtr = StringCopy(gDisplayedStringBattle, gText_MoveInterfaceType); - type = gMovesInfo[moveInfo->moves[gMoveSelectionCursor[battler]]].type; + type = GetMoveType(moveInfo->moves[gMoveSelectionCursor[battler]]); if (moveInfo->moves[gMoveSelectionCursor[battler]] == MOVE_TERA_BLAST) { @@ -1731,7 +1731,7 @@ static void MoveSelectionDisplayMoveType(u32 battler) || speciesId == SPECIES_OGERPON_CORNERSTONE || speciesId == SPECIES_OGERPON_CORNERSTONE_TERA) type = gBattleMons[battler].types[1]; } - else if (gMovesInfo[moveInfo->moves[gMoveSelectionCursor[battler]]].category == DAMAGE_CATEGORY_STATUS + else if (GetMoveCategory(moveInfo->moves[gMoveSelectionCursor[battler]]) == DAMAGE_CATEGORY_STATUS && (GetActiveGimmick(battler) == GIMMICK_DYNAMAX || IsGimmickSelected(battler, GIMMICK_DYNAMAX))) { type = TYPE_NORMAL; // Max Guard is always a Normal-type move @@ -1757,8 +1757,8 @@ static void MoveSelectionDisplayMoveDescription(u32 battler) { struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleResources->bufferA[battler][4]); u16 move = moveInfo->moves[gMoveSelectionCursor[battler]]; - u16 pwr = gMovesInfo[move].power; - u16 acc = gMovesInfo[move].accuracy; + u16 pwr = GetMovePower(move); + u16 acc = GetMoveAccuracy(move); u8 pwr_num[3], acc_num[3]; u8 cat_desc[7] = _("CAT: "); @@ -1786,10 +1786,7 @@ static void MoveSelectionDisplayMoveDescription(u32 battler) StringAppend(gDisplayedStringBattle, acc_desc); StringAppend(gDisplayedStringBattle, acc_num); StringAppend(gDisplayedStringBattle, gText_NewLine); - if (gMovesInfo[move].effect == EFFECT_PLACEHOLDER) - StringAppend(gDisplayedStringBattle, gNotDoneYetDescription); - else - StringAppend(gDisplayedStringBattle, gMovesInfo[move].description); + StringAppend(gDisplayedStringBattle, GetMoveDescription(move)); BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_DESCRIPTION); if (gCategoryIconSpriteId == 0xFF) @@ -2050,8 +2047,9 @@ static void PlayerHandleChooseAction(u32 battler) { StringCopy(gStringVar1, COMPOUND_STRING("Partner will use:\n")); u32 move = gBattleMons[B_POSITION_PLAYER_RIGHT].moves[*(gBattleStruct->chosenMovePositions + B_POSITION_PLAYER_RIGHT)]; - StringAppend(gStringVar1, gMovesInfo[move].name); - if (gMovesInfo[move].target == MOVE_TARGET_SELECTED) + StringAppend(gStringVar1, GetMoveName(move)); + u32 moveTarget = GetBattlerMoveTargetType(B_POSITION_PLAYER_RIGHT, move); + if (moveTarget == MOVE_TARGET_SELECTED) { if (gBattleStruct->aiChosenTarget[B_POSITION_PLAYER_RIGHT] == B_POSITION_OPPONENT_LEFT) StringAppend(gStringVar1, COMPOUND_STRING(" -{UP_ARROW}")); @@ -2062,15 +2060,15 @@ static void PlayerHandleChooseAction(u32 battler) else if (gBattleStruct->aiChosenTarget[B_POSITION_PLAYER_RIGHT] == B_POSITION_PLAYER_RIGHT) StringAppend(gStringVar1, COMPOUND_STRING(" {DOWN_ARROW}-")); } - else if (gMovesInfo[move].target == MOVE_TARGET_BOTH) + else if (moveTarget == MOVE_TARGET_BOTH) { StringAppend(gStringVar1, COMPOUND_STRING(" {UP_ARROW}{UP_ARROW}")); } - else if (gMovesInfo[move].target == MOVE_TARGET_FOES_AND_ALLY) + else if (moveTarget == MOVE_TARGET_FOES_AND_ALLY) { StringAppend(gStringVar1, COMPOUND_STRING(" {V_D_ARROW}{UP_ARROW}")); } - else if (gMovesInfo[move].target == MOVE_TARGET_ALL_BATTLERS) + else if (moveTarget == MOVE_TARGET_ALL_BATTLERS) { StringAppend(gStringVar1, COMPOUND_STRING(" {V_D_ARROW}{V_D_ARROW}")); } diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index f987c333ce4b..81170ec9dedb 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -353,10 +353,11 @@ static void PlayerPartnerHandleChooseMove(u32 battler) chosenMoveId = gBattleStruct->aiMoveOrAction[battler]; gBattlerTarget = gBattleStruct->aiChosenTarget[battler]; + u32 moveTarget = GetBattlerMoveTargetType(battler, moveInfo->moves[chosenMoveId]); - if (gMovesInfo[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED)) + if (moveTarget & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED)) gBattlerTarget = battler; - else if (gMovesInfo[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH) + else if (moveTarget & MOVE_TARGET_BOTH) { gBattlerTarget = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); if (gAbsentBattlerFlags & (1u << gBattlerTarget)) diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 553eb7a85c61..7b7281e9f5fd 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -1113,7 +1113,7 @@ void BtlController_EmitPrintString(u32 battler, u32 bufferId, u16 stringID) stringInfo->bakScriptPartyIdx = gBattleStruct->scriptPartyIdx; stringInfo->hpScale = gBattleStruct->hpScale; stringInfo->itemEffectBattler = gPotentialItemEffectBattler; - stringInfo->moveType = gMovesInfo[gCurrentMove].type; + stringInfo->moveType = GetMoveType(gCurrentMove); for (i = 0; i < MAX_BATTLERS_COUNT; i++) stringInfo->abilities[i] = gBattleMons[i].ability; diff --git a/src/battle_debug.c b/src/battle_debug.c index b03ef194f042..b0e1e23add41 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -1982,7 +1982,7 @@ static u8 *GetSideStatusValue(struct BattleDebugMenu *data, bool32 changeStatus, *(u32 *)(data->modifyArrows.modifiedValPtr) |= SIDE_STATUS_DAMAGE_NON_TYPES; else *(u32 *)(data->modifyArrows.modifiedValPtr) &= ~SIDE_STATUS_DAMAGE_NON_TYPES; - sideTimer->damageNonTypesType = gMovesInfo[gCurrentMove].type; + sideTimer->damageNonTypesType = GetMoveType(gCurrentMove); } return &sideTimer->damageNonTypesTimer; case LIST_SIDE_RAINBOW: diff --git a/src/battle_dome.c b/src/battle_dome.c index 8b376c7e752b..19c508652342 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -2395,13 +2395,13 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int mode) int defType1, defType2, defAbility, moveType; int typePower = TYPE_x1; - if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || IS_MOVE_STATUS(move)) + if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || IsBattleMoveStatus(move)) return 0; defType1 = gSpeciesInfo[targetSpecies].types[0]; defType2 = gSpeciesInfo[targetSpecies].types[1]; defAbility = gSpeciesInfo[targetSpecies].abilities[0]; - moveType = gMovesInfo[move].type; + moveType = GetMoveType(move); if (defAbility == ABILITY_LEVITATE && moveType == TYPE_GROUND) { @@ -3890,7 +3890,7 @@ static bool32 IsDomeHealingMove(u32 move) if (IsHealingMove(move)) return TRUE; // Check extra effects not considered plain healing by AI - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_INGRAIN: case EFFECT_REFRESH: @@ -3949,9 +3949,9 @@ static bool32 IsDomeRiskyMoveEffect(u32 effect) static bool32 IsDomeLuckyMove(u32 move) { - if (gMovesInfo[move].accuracy <= 50) + if (GetMoveAccuracy(move) <= 50) return TRUE; - switch(gMovesInfo[move].effect) + switch(GetMoveEffect(move)) { case EFFECT_COUNTER: case EFFECT_OHKO: // Technically redundant because of the above accuracy check @@ -3982,10 +3982,10 @@ static bool32 IsDomePopularMove(u32 move) if (i == NUM_TECHNICAL_MACHINES + NUM_HIDDEN_MACHINES) return FALSE; // Filter in TMs/HMs - if (gMovesInfo[move].power >= 90) + if (GetMovePower(move) >= 90) return TRUE; - switch(gMovesInfo[move].effect) + switch(GetMoveEffect(move)) { case EFFECT_PROTECT: case EFFECT_MAT_BLOCK: @@ -4000,7 +4000,7 @@ static bool32 IsDomePopularMove(u32 move) static bool32 IsDomeStatusMoveEffect(u32 move) { - switch(gMovesInfo[move].effect) + switch(GetMoveEffect(move)) { case EFFECT_SLEEP: case EFFECT_CONFUSE: @@ -4294,24 +4294,26 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) { for (k = 0; k < NUM_MOVE_POINT_TYPES; k++) { - u16 move; + u32 move; if (trainerId == TRAINER_FRONTIER_BRAIN) move = GetFrontierBrainMonMove(i, j); else if (trainerId == TRAINER_PLAYER) move = gSaveBlock2Ptr->frontier.domePlayerPartyData[i].moves[j]; else move = gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].moves[j]; + u32 effect = GetMoveEffect(move); + u32 accuracy = GetMoveAccuracy(move); switch (k) { case MOVE_POINTS_COMBO: - allocatedArray[k] = IsDomeComboMoveEffect(gMovesInfo[move].effect) ? 1 : 0; + allocatedArray[k] = IsDomeComboMoveEffect(effect) ? 1 : 0; break; case MOVE_POINTS_STAT_RAISE: - allocatedArray[k] = IsStatRaisingEffect(gMovesInfo[move].effect) ? 1 : 0; + allocatedArray[k] = IsStatRaisingEffect(effect) ? 1 : 0; break; case MOVE_POINTS_STAT_LOWER: - allocatedArray[k] = IsStatLoweringEffect(gMovesInfo[move].effect) ? 1 : 0; + allocatedArray[k] = IsStatLoweringEffect(effect) ? 1 : 0; break; case MOVE_POINTS_RARE: allocatedArray[k] = IsDomeRareMove(move) ? 1 : 0; @@ -4320,22 +4322,22 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) allocatedArray[k] = IsDomeHealingMove(move) ? 1 : 0; break; case MOVE_POINTS_RISKY: - allocatedArray[k] = IsDomeRiskyMoveEffect(gMovesInfo[move].effect) ? 1 : 0; + allocatedArray[k] = IsDomeRiskyMoveEffect(effect) ? 1 : 0; break; case MOVE_POINTS_STATUS: allocatedArray[k] = IsDomeStatusMoveEffect(move); break; case MOVE_POINTS_DMG: - allocatedArray[k] = (!IS_MOVE_STATUS(move)) ? 1 : 0; + allocatedArray[k] = (!IsBattleMoveStatus(move)) ? 1 : 0; break; case MOVE_POINTS_DEF: - allocatedArray[k] = IsDomeDefensiveMoveEffect(gMovesInfo[move].effect) ? 1 : 0; + allocatedArray[k] = IsDomeDefensiveMoveEffect(effect) ? 1 : 0; break; case MOVE_POINTS_ACCURATE: - allocatedArray[k] = (gMovesInfo[move].accuracy == 0 || gMovesInfo[move].accuracy == 100) ? 1 : 0; + allocatedArray[k] = (accuracy == 0 || accuracy == 100) ? 1 : 0; break; case MOVE_POINTS_POWERFUL: - allocatedArray[k] = (gMovesInfo[move].power >= 100) ? 1 : 0; + allocatedArray[k] = (GetMovePower(move) >= 100) ? 1 : 0; break; case MOVE_POINTS_POPULAR: allocatedArray[k] = IsDomePopularMove(move) ? 1 : 0; @@ -4344,10 +4346,10 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) allocatedArray[k] = IsDomeLuckyMove(move) ? 1 : 0; break; case MOVE_POINTS_STRONG: - allocatedArray[k] = (gMovesInfo[move].power >= 90) ? 1 : 0; + allocatedArray[k] = (GetMovePower(move) >= 90) ? 1 : 0; break; case MOVE_POINTS_LOW_PP: - allocatedArray[k] = (gMovesInfo[move].pp <= 5) ? 1 : 0; + allocatedArray[k] = (GetMovePP(move) <= 5) ? 1 : 0; break; case MOVE_POINTS_EFFECT: allocatedArray[k] = MoveIsAffectedBySheerForce(move); @@ -5107,12 +5109,12 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun else moveIds[i * MAX_MON_MOVES + j] = gFacilityTrainerMons[DOME_MONS[winnerTournamentId][i]].moves[j]; - movePower = gMovesInfo[moveIds[i * MAX_MON_MOVES + j]].power; - if (IS_MOVE_STATUS(moveIds[i * MAX_MON_MOVES + j])) + movePower = GetMovePower(moveIds[i * MAX_MON_MOVES + j]); + if (IsBattleMoveStatus(moveIds[i * MAX_MON_MOVES + j])) movePower = 40; else if (movePower == 1) movePower = 60; - else if (gMovesInfo[moveIds[i * MAX_MON_MOVES + j]].effect == EFFECT_EXPLOSION) + else if (GetMoveEffect(moveIds[i * MAX_MON_MOVES + j]) == EFFECT_EXPLOSION) movePower /= 2; for (k = 0; k < FRONTIER_PARTY_SIZE; k++) diff --git a/src/battle_dynamax.c b/src/battle_dynamax.c index 876f1e532b5e..c57151ac3783 100644 --- a/src/battle_dynamax.c +++ b/src/battle_dynamax.c @@ -240,7 +240,7 @@ bool32 IsMoveBlockedByMaxGuard(u32 move) bool32 IsMoveBlockedByDynamax(u32 move) { // TODO: Certain moves are banned in raids. - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_HEAT_CRASH: case EFFECT_LOW_KICK: @@ -282,7 +282,7 @@ u16 GetMaxMove(u32 battler, u32 baseMove) { u32 moveType; SetTypeBeforeUsingMove(baseMove, battler); - moveType = GetMoveType(baseMove); + moveType = GetBattleMoveType(baseMove); if (baseMove == MOVE_NONE) // for move display { @@ -292,7 +292,7 @@ u16 GetMaxMove(u32 battler, u32 baseMove) { return MOVE_STRUGGLE; } - else if (gMovesInfo[baseMove].category == DAMAGE_CATEGORY_STATUS) + else if (GetMoveCategory(baseMove) == DAMAGE_CATEGORY_STATUS) { return MOVE_MAX_GUARD; } @@ -320,7 +320,7 @@ u8 GetMaxMovePower(u32 move) { u8 tier; // G-Max Drum Solo, G-Max Hydrosnipe, and G-Max Fireball always have 160 base power. - if (gMovesInfo[GetMaxMove(gBattlerAttacker, move)].argument.maxEffect == MAX_EFFECT_FIXED_POWER) + if (GetMoveMaxEffect(GetMaxMove(gBattlerAttacker, move)) == MAX_EFFECT_FIXED_POWER) return 160; // Exceptions to all other rules below: @@ -333,8 +333,9 @@ u8 GetMaxMovePower(u32 move) } tier = GetMaxPowerTier(move); - if (gMovesInfo[move].type == TYPE_FIGHTING - || gMovesInfo[move].type == TYPE_POISON + u32 moveType = GetMoveType(move); + if (moveType == TYPE_FIGHTING + || moveType == TYPE_POISON || move == MOVE_MULTI_ATTACK) { switch (tier) @@ -369,9 +370,10 @@ u8 GetMaxMovePower(u32 move) static u8 GetMaxPowerTier(u32 move) { - if (gMovesInfo[move].strikeCount >= 2 && gMovesInfo[move].strikeCount <= 5) + u32 strikeCount = GetMoveStrikeCount(move); + if (strikeCount >= 2 && strikeCount <= 5) { - switch(gMovesInfo[move].power) + switch(GetMovePower(move)) { case 0 ... 25: return MAX_POWER_TIER_2; case 26 ... 30: return MAX_POWER_TIER_3; @@ -382,7 +384,7 @@ static u8 GetMaxPowerTier(u32 move) } } - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_BIDE: case EFFECT_SUPER_FANG: @@ -418,7 +420,7 @@ static u8 GetMaxPowerTier(u32 move) case EFFECT_LOW_KICK: return MAX_POWER_TIER_7; case EFFECT_MULTI_HIT: - switch(gMovesInfo[move].power) + switch(GetMovePower(move)) { case 0 ... 15: return MAX_POWER_TIER_1; case 16 ... 18: return MAX_POWER_TIER_2; @@ -428,7 +430,7 @@ static u8 GetMaxPowerTier(u32 move) } } - switch (gMovesInfo[move].power) + switch (GetMovePower(move)) { case 0 ... 40: return MAX_POWER_TIER_1; case 45 ... 50: return MAX_POWER_TIER_2; @@ -470,7 +472,7 @@ void ChooseDamageNonTypesString(u8 type) // Returns the status effect that should be applied by a G-Max Move. static u32 GetMaxMoveStatusEffect(u32 move) { - u8 maxEffect = gMovesInfo[move].argument.maxEffect; + u8 maxEffect = GetMoveMaxEffect(move); switch (maxEffect) { // Status 1 @@ -522,7 +524,7 @@ void BS_SetMaxMoveEffect(void) { NATIVE_ARGS(); u16 effect = 0; - u8 maxEffect = gMovesInfo[gCurrentMove].argument.maxEffect; + u8 maxEffect = GetMoveMaxEffect(gCurrentMove); // Don't continue if the move didn't land. if (gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_NO_EFFECT) @@ -541,7 +543,7 @@ void BS_SetMaxMoveEffect(void) if (!NoAliveMonsForEitherParty()) { // Max Effects are ordered by stat ID. - SET_STATCHANGER(gMovesInfo[gCurrentMove].argument.maxEffect, 1, FALSE); + SET_STATCHANGER(maxEffect, 1, FALSE); BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_EffectRaiseStatAllies; effect++; @@ -569,7 +571,7 @@ void BS_SetMaxMoveEffect(void) break; default: // Max Effects are ordered by stat ID. - statId = gMovesInfo[gCurrentMove].argument.maxEffect - MAX_EFFECT_LOWER_ATTACK + 1; + statId = maxEffect - MAX_EFFECT_LOWER_ATTACK + 1; break; } SET_STATCHANGER(statId, stage, TRUE); @@ -618,7 +620,7 @@ void BS_SetMaxMoveEffect(void) case MAX_EFFECT_PSYCHIC_TERRAIN: { u32 statusFlag = 0; - switch (gMovesInfo[gCurrentMove].argument.moveProperty) + switch (GetMoveEffectArg_MoveProperty(gCurrentMove)) { case MAX_EFFECT_MISTY_TERRAIN: statusFlag = STATUS_FIELD_MISTY_TERRAIN; @@ -659,11 +661,12 @@ void BS_SetMaxMoveEffect(void) u8 side = GetBattlerSide(gBattlerTarget); if (!(gSideStatuses[side] & SIDE_STATUS_DAMAGE_NON_TYPES)) { + u32 moveType = GetMoveType(gCurrentMove); gSideStatuses[side] |= SIDE_STATUS_DAMAGE_NON_TYPES; gSideTimers[side].damageNonTypesTimer = 5; // damage is dealt for 4 turns, ends on 5th - gSideTimers[side].damageNonTypesType = gMovesInfo[gCurrentMove].type; + gSideTimers[side].damageNonTypesType = moveType; BattleScriptPush(gBattlescriptCurrInstr + 1); - ChooseDamageNonTypesString(gMovesInfo[gCurrentMove].type); + ChooseDamageNonTypesString(moveType); gBattlescriptCurrInstr = BattleScript_DamageNonTypesStarts; effect++; } diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 1f768274aa9b..81d0d1cd28ce 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -329,7 +329,7 @@ static u8 GetBattlePalaceMoveGroup(u8 battler, u16 move) case MOVE_TARGET_RANDOM: case MOVE_TARGET_BOTH: case MOVE_TARGET_FOES_AND_ALLY: - if (IS_MOVE_STATUS(move)) + if (IsBattleMoveStatus(move)) return PALACE_MOVE_GROUP_SUPPORT; else return PALACE_MOVE_GROUP_ATTACK; @@ -1043,7 +1043,8 @@ void LoadBattleMonGfxAndAnimate(u8 battler, bool8 loadMonSprite, u8 spriteId) void TrySetBehindSubstituteSpriteBit(u8 battler, u16 move) { - if (gMovesInfo[move].effect == EFFECT_SUBSTITUTE || gMovesInfo[move].effect == EFFECT_SHED_TAIL) + u32 effect = GetMoveEffect(move); + if (effect == EFFECT_SUBSTITUTE || effect == EFFECT_SHED_TAIL) gBattleSpritesDataPtr->battlerData[battler].behindSubstitute = 1; } diff --git a/src/battle_main.c b/src/battle_main.c index 714d23834e2f..c6ece2172904 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -1907,8 +1907,9 @@ void CustomTrainerPartyAssignMoves(struct Pokemon *mon, const struct TrainerMon for (j = 0; j < MAX_MON_MOVES; ++j) { + u32 pp = GetMovePP(partyEntry->moves[j]); SetMonData(mon, MON_DATA_MOVE1 + j, &partyEntry->moves[j]); - SetMonData(mon, MON_DATA_PP1 + j, &gMovesInfo[partyEntry->moves[j]].pp); + SetMonData(mon, MON_DATA_PP1 + j, &pp); } } @@ -3135,10 +3136,11 @@ static void BattleStartClearSetData(void) void SwitchInClearSetData(u32 battler) { s32 i; + u32 effect = GetMoveEffect(gCurrentMove); struct DisableStruct disableStructCopy = gDisableStructs[battler]; ClearIllusionMon(battler); - if (gMovesInfo[gCurrentMove].effect != EFFECT_BATON_PASS) + if (effect != EFFECT_BATON_PASS) { for (i = 0; i < NUM_BATTLE_STATS; i++) gBattleMons[battler].statStages[i] = DEFAULT_STAT_STAGE; @@ -3153,7 +3155,7 @@ void SwitchInClearSetData(u32 battler) } } } - if (gMovesInfo[gCurrentMove].effect == EFFECT_BATON_PASS) + if (effect == EFFECT_BATON_PASS) { gBattleMons[battler].status2 &= (STATUS2_CONFUSION | STATUS2_FOCUS_ENERGY_ANY | STATUS2_SUBSTITUTE | STATUS2_ESCAPE_PREVENTION | STATUS2_CURSED); gStatuses3[battler] &= (STATUS3_LEECHSEED_BATTLER | STATUS3_LEECHSEED | STATUS3_ALWAYS_HITS | STATUS3_PERISH_SONG | STATUS3_ROOTED @@ -3195,7 +3197,7 @@ void SwitchInClearSetData(u32 battler) memset(&gDisableStructs[battler], 0, sizeof(struct DisableStruct)); - if (gMovesInfo[gCurrentMove].effect == EFFECT_BATON_PASS) + if (effect == EFFECT_BATON_PASS) { gDisableStructs[battler].substituteHP = disableStructCopy.substituteHP; gDisableStructs[battler].battlerWithSureHit = disableStructCopy.battlerWithSureHit; @@ -3203,7 +3205,7 @@ void SwitchInClearSetData(u32 battler) gDisableStructs[battler].battlerPreventingEscape = disableStructCopy.battlerPreventingEscape; gDisableStructs[battler].embargoTimer = disableStructCopy.embargoTimer; } - else if (gMovesInfo[gCurrentMove].effect == EFFECT_SHED_TAIL) + else if (effect == EFFECT_SHED_TAIL) { gBattleMons[battler].status2 |= STATUS2_SUBSTITUTE; gDisableStructs[battler].substituteHP = disableStructCopy.substituteHP; @@ -4850,35 +4852,35 @@ s8 GetChosenMovePriority(u32 battler) else move = gBattleMons[battler].moves[*(gBattleStruct->chosenMovePositions + battler)]; - return GetMovePriority(battler, move); + return GetBattleMovePriority(battler, move); } -s8 GetMovePriority(u32 battler, u16 move) +s8 GetBattleMovePriority(u32 battler, u16 move) { s8 priority; u16 ability = GetBattlerAbility(battler); - if (GetActiveGimmick(battler) == GIMMICK_Z_MOVE && !IS_MOVE_STATUS(move)) + if (GetActiveGimmick(battler) == GIMMICK_Z_MOVE && !IsBattleMoveStatus(move)) move = GetUsableZMove(battler, move); - priority = gMovesInfo[move].priority; + priority = GetMovePriority(move); // Max Guard check - if (GetActiveGimmick(battler) == GIMMICK_DYNAMAX && gMovesInfo[move].category == DAMAGE_CATEGORY_STATUS) - return gMovesInfo[MOVE_MAX_GUARD].priority; + if (GetActiveGimmick(battler) == GIMMICK_DYNAMAX && GetMoveCategory(move) == DAMAGE_CATEGORY_STATUS) + return GetMovePriority(MOVE_MAX_GUARD); if (ability == ABILITY_GALE_WINGS && (GetGenConfig(GEN_CONFIG_GALE_WINGS) < GEN_7 || IsBattlerAtMaxHp(battler)) - && gMovesInfo[move].type == TYPE_FLYING) + && GetMoveType(move) == TYPE_FLYING) { priority++; } - else if (ability == ABILITY_PRANKSTER && IS_MOVE_STATUS(move)) + else if (ability == ABILITY_PRANKSTER && IsBattleMoveStatus(move)) { gProtectStructs[battler].pranksterElevated = 1; priority++; } - else if (gMovesInfo[move].effect == EFFECT_GRASSY_GLIDE && gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && IsBattlerGrounded(battler) && GetActiveGimmick(gBattlerAttacker) != GIMMICK_DYNAMAX && !IsGimmickSelected(battler, GIMMICK_DYNAMAX)) + else if (GetMoveEffect(move) == EFFECT_GRASSY_GLIDE && gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && IsBattlerGrounded(battler) && GetActiveGimmick(gBattlerAttacker) != GIMMICK_DYNAMAX && !IsGimmickSelected(battler, GIMMICK_DYNAMAX)) { priority++; } @@ -4904,8 +4906,8 @@ s32 GetWhichBattlerFasterArgs(u32 battler1, u32 battler2, bool32 ignoreChosenMov // Lagging Tail - always last bool32 battler1HasQuickEffect = gProtectStructs[battler1].quickDraw || gProtectStructs[battler1].usedCustapBerry; bool32 battler2HasQuickEffect = gProtectStructs[battler2].quickDraw || gProtectStructs[battler2].usedCustapBerry; - bool32 battler1HasStallingAbility = ability1 == ABILITY_STALL || (ability1 == ABILITY_MYCELIUM_MIGHT && IS_MOVE_STATUS(gChosenMoveByBattler[battler1])); - bool32 battler2HasStallingAbility = ability2 == ABILITY_STALL || (ability2 == ABILITY_MYCELIUM_MIGHT && IS_MOVE_STATUS(gChosenMoveByBattler[battler2])); + bool32 battler1HasStallingAbility = ability1 == ABILITY_STALL || (ability1 == ABILITY_MYCELIUM_MIGHT && IsBattleMoveStatus(gChosenMoveByBattler[battler1])); + bool32 battler2HasStallingAbility = ability2 == ABILITY_STALL || (ability2 == ABILITY_MYCELIUM_MIGHT && IsBattleMoveStatus(gChosenMoveByBattler[battler2])); if (battler1HasQuickEffect && !battler2HasQuickEffect) strikesFirst = 1; @@ -5258,7 +5260,7 @@ static bool32 TryDoMoveEffectsBeforeMoves(void) { gBattleStruct->focusPunchBattlers |= 1u << battlers[i]; gBattlerAttacker = battlers[i]; - switch (gMovesInfo[gChosenMoveByBattler[gBattlerAttacker]].effect) + switch (GetMoveEffect(gChosenMoveByBattler[gBattlerAttacker])) { case EFFECT_FOCUS_PUNCH: BattleScriptExecute(BattleScript_FocusPunchSetUp); @@ -5307,7 +5309,7 @@ static void TryChangingTurnOrderEffects(u32 battler1, u32 battler2) // Battler 1 // Quick Draw - if (ability1 == ABILITY_QUICK_DRAW && !IS_MOVE_STATUS(gChosenMoveByBattler[battler1]) && gBattleStruct->quickDrawRandom[battler1]) + if (ability1 == ABILITY_QUICK_DRAW && !IsBattleMoveStatus(gChosenMoveByBattler[battler1]) && gBattleStruct->quickDrawRandom[battler1]) gProtectStructs[battler1].quickDraw = TRUE; // Quick Claw and Custap Berry if (!gProtectStructs[battler1].quickDraw @@ -5317,7 +5319,7 @@ static void TryChangingTurnOrderEffects(u32 battler1, u32 battler2) // Battler 2 // Quick Draw - if (ability2 == ABILITY_QUICK_DRAW && !IS_MOVE_STATUS(gChosenMoveByBattler[battler2]) && gBattleStruct->quickDrawRandom[battler2]) + if (ability2 == ABILITY_QUICK_DRAW && !IsBattleMoveStatus(gChosenMoveByBattler[battler2]) && gBattleStruct->quickDrawRandom[battler2]) gProtectStructs[battler2].quickDraw = TRUE; // Quick Claw and Custap Berry if (!gProtectStructs[battler2].quickDraw @@ -5810,7 +5812,7 @@ bool32 TrySetAteType(u32 move, u32 battlerAtk, u32 attackerAbility) { u32 ateType; - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_TERA_BLAST: if (GetActiveGimmick(battlerAtk) == GIMMICK_TERA) @@ -5862,8 +5864,8 @@ bool32 TrySetAteType(u32 move, u32 battlerAtk, u32 attackerAbility) // NULL can be passed to ateBoost to avoid applying ate-ability boosts when opening the summary screen in-battle. u32 GetDynamicMoveType(struct Pokemon *mon, u32 move, u32 battler, u8 *ateBoost) { - u32 moveType = gMovesInfo[move].type; - u32 moveEffect = gMovesInfo[move].effect; + u32 moveType = GetMoveType(move); + u32 moveEffect = GetMoveEffect(move); u32 species, heldItem, holdEffect, ability, type1, type2, type3; if (move == MOVE_STRUGGLE) @@ -5958,7 +5960,7 @@ u32 GetDynamicMoveType(struct Pokemon *mon, u32 move, u32 battler, u8 *ateBoost) } break; case EFFECT_CHANGE_TYPE_ON_ITEM: - if (holdEffect == gMovesInfo[move].argument.holdEffect) + if (holdEffect == GetMoveEffectArg_HoldEffect(move)) return ItemId_GetSecondaryId(heldItem); break; case EFFECT_REVELATION_DANCE: @@ -6066,7 +6068,7 @@ u32 GetDynamicMoveType(struct Pokemon *mon, u32 move, u32 battler, u8 *ateBoost) *ateBoost = TRUE; return TYPE_NORMAL; } - else if (gMovesInfo[move].soundMove && ability == ABILITY_LIQUID_VOICE) + else if (IsSoundMove(move) && ability == ABILITY_LIQUID_VOICE) { return TYPE_WATER; } @@ -6095,13 +6097,13 @@ void SetTypeBeforeUsingMove(u32 move, u32 battler) if (moveType != TYPE_NONE) gBattleStruct->dynamicMoveType = moveType | F_DYNAMIC_TYPE_SET; - moveType = GetMoveType(move); + moveType = GetBattleMoveType(move); if ((gFieldStatuses & STATUS_FIELD_ION_DELUGE && moveType == TYPE_NORMAL) || gStatuses4[battler] & STATUS4_ELECTRIFIED) gBattleStruct->dynamicMoveType = TYPE_ELECTRIC | F_DYNAMIC_TYPE_SET; // Check if a gem should activate. - if (holdEffect == HOLD_EFFECT_GEMS && GetMoveType(move) == ItemId_GetSecondaryId(heldItem)) + if (holdEffect == HOLD_EFFECT_GEMS && GetBattleMoveType(move) == ItemId_GetSecondaryId(heldItem)) { gSpecialStatuses[battler].gemParam = GetBattlerHoldEffectParam(battler); gSpecialStatuses[battler].gemBoost = TRUE; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 5a24ead2fe40..fa75c8bd768d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -47,6 +47,7 @@ #include "pokenav.h" #include "menu_specialized.h" #include "data.h" +#include "move.h" #include "constants/abilities.h" #include "constants/battle_anim.h" #include "constants/battle_move_effects.h" @@ -1103,7 +1104,7 @@ static const u8 sTerrainToType[BATTLE_TERRAIN_COUNT] = static bool32 NoTargetPresent(u8 battler, u32 move) { if (!IsBattlerAlive(gBattlerTarget)) - gBattlerTarget = GetMoveTarget(move, NO_TARGET_OVERRIDE); + gBattlerTarget = GetBattleMoveTarget(move, NO_TARGET_OVERRIDE); switch (GetBattlerMoveTargetType(battler, move)) { @@ -1146,7 +1147,7 @@ bool32 ShouldTeraShellDistortTypeMatchups(u32 move, u32 battlerDef) if (!gSpecialStatuses[battlerDef].distortedTypeMatchups && gBattleMons[battlerDef].species == SPECIES_TERAPAGOS_TERASTAL && gBattleMons[battlerDef].hp == gBattleMons[battlerDef].maxHP - && !IS_MOVE_STATUS(move) + && !IsBattleMoveStatus(move) && MoveResultHasEffect(battlerDef) && GetBattlerAbility(battlerDef) == ABILITY_TERA_SHELL) return TRUE; @@ -1156,7 +1157,7 @@ bool32 ShouldTeraShellDistortTypeMatchups(u32 move, u32 battlerDef) bool32 IsMoveNotAllowedInSkyBattles(u32 move) { - return ((gBattleStruct->isSkyBattle) && (gMovesInfo[gCurrentMove].skyBattleBanned)); + return (gBattleStruct->isSkyBattle && IsMoveSkyBattleBanned(gCurrentMove)); } static void Cmd_attackcanceler(void) @@ -1178,7 +1179,9 @@ static void Cmd_attackcanceler(void) return; } - if (!IsBattlerAlive(gBattlerAttacker) && gMovesInfo[gCurrentMove].effect != EFFECT_EXPLOSION && !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) + u32 effect = GetMoveEffect(gCurrentMove); + + if (!IsBattlerAlive(gBattlerAttacker) && effect != EFFECT_EXPLOSION && !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) { gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gBattlescriptCurrInstr = BattleScript_MoveEnd; @@ -1214,21 +1217,22 @@ static void Cmd_attackcanceler(void) // Check if no available target present on the field or if Sky Battles ban the move if ((NoTargetPresent(gBattlerAttacker, gCurrentMove) - && (!gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].twoTurnEffect || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))) + && (!gBattleMoveEffects[effect].twoTurnEffect || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))) || (IsMoveNotAllowedInSkyBattles(gCurrentMove))) { - if (gMovesInfo[gCurrentMove].effect == EFFECT_FLING) // Edge case for removing a mon's item when there is no target available after using Fling. + if (effect == EFFECT_FLING) // Edge case for removing a mon's item when there is no target available after using Fling. gBattlescriptCurrInstr = BattleScript_FlingFailConsumeItem; else gBattlescriptCurrInstr = BattleScript_FailedFromAtkString; - if (!gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].twoTurnEffect || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) + if (!gBattleMoveEffects[effect].twoTurnEffect || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) CancelMultiTurnMoves(gBattlerAttacker); return; } + u32 isBounceable = MoveCanBeBouncedBack(gCurrentMove); if (gProtectStructs[gBattlerTarget].bounceMove - && gMovesInfo[gCurrentMove].magicCoatAffected + && isBounceable && !gBattleStruct->bouncedMoveIsUsed) { gBattleStruct->bouncedMoveIsUsed = TRUE; @@ -1249,7 +1253,7 @@ static void Cmd_attackcanceler(void) } return; } - else if (gMovesInfo[gCurrentMove].magicCoatAffected && !gBattleStruct->bouncedMoveIsUsed) + else if (isBounceable && !gBattleStruct->bouncedMoveIsUsed) { u32 battler = gBattlerTarget; @@ -1259,7 +1263,7 @@ static void Cmd_attackcanceler(void) gBattleStruct->bouncedMoveIsUsed = TRUE; } else if (IsDoubleBattle() - && gMovesInfo[gCurrentMove].target == MOVE_TARGET_OPPONENTS_FIELD + && GetBattlerMoveTargetType(battler, gCurrentMove) == MOVE_TARGET_OPPONENTS_FIELD && GetBattlerAbility(BATTLE_PARTNER(gBattlerTarget)) == ABILITY_MAGIC_BOUNCE) { gBattlerTarget = battler = BATTLE_PARTNER(gBattlerTarget); @@ -1287,7 +1291,7 @@ static void Cmd_attackcanceler(void) for (i = 0; i < gBattlersCount; i++) { - if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gMovesInfo[gCurrentMove].snatchAffected) + if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && MoveCanBeSnatched(gCurrentMove)) { gProtectStructs[gBattlerByTurnOrder[i]].stealMove = FALSE; gBattleStruct->snatchedMoveIsUsed = TRUE; @@ -1316,9 +1320,9 @@ static void Cmd_attackcanceler(void) } else if (IsBattlerProtected(gBattlerAttacker, gBattlerTarget, gCurrentMove) && (gCurrentMove != MOVE_CURSE || IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST)) - && (!gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].twoTurnEffect || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) - && gMovesInfo[gCurrentMove].effect != EFFECT_SUCKER_PUNCH - && gMovesInfo[gCurrentMove].effect != EFFECT_UPPER_HAND) + && (!gBattleMoveEffects[effect].twoTurnEffect || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) + && effect != EFFECT_SUCKER_PUNCH + && effect != EFFECT_UPPER_HAND) { if (IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; @@ -1398,9 +1402,10 @@ static bool32 AccuracyCalcHelper(u32 move, u32 battler) { u32 effect = FALSE; u32 ability = ABILITY_NONE; + u32 moveEffect = GetMoveEffect(move); if ((gStatuses3[battler] & STATUS3_ALWAYS_HITS && gDisableStructs[battler].battlerWithSureHit == gBattlerAttacker) - || (B_TOXIC_NEVER_MISS >= GEN_6 && gMovesInfo[move].effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_POISON)) + || (B_TOXIC_NEVER_MISS >= GEN_6 && moveEffect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_POISON)) || gStatuses4[battler] & STATUS4_GLAIVE_RUSH) { effect = TRUE; @@ -1408,14 +1413,14 @@ static bool32 AccuracyCalcHelper(u32 move, u32 battler) // If the attacker has the ability No Guard and they aren't targeting a Pokemon involved in a Sky Drop with the move Sky Drop, move hits. else if (GetBattlerAbility(gBattlerAttacker) == ABILITY_NO_GUARD && !(gStatuses3[battler] & STATUS3_COMMANDER) - && (gMovesInfo[move].effect != EFFECT_SKY_DROP || gBattleStruct->skyDropTargets[battler] == 0xFF)) + && (moveEffect != EFFECT_SKY_DROP || gBattleStruct->skyDropTargets[battler] == 0xFF)) { effect = TRUE; ability = ABILITY_NO_GUARD; } // If the target has the ability No Guard and they aren't involved in a Sky Drop or the current move isn't Sky Drop, move hits. else if (GetBattlerAbility(battler) == ABILITY_NO_GUARD - && (gMovesInfo[move].effect != EFFECT_SKY_DROP || gBattleStruct->skyDropTargets[battler] == 0xFF)) + && (moveEffect != EFFECT_SKY_DROP || gBattleStruct->skyDropTargets[battler] == 0xFF)) { effect = TRUE; ability = ABILITY_NO_GUARD; @@ -1423,7 +1428,7 @@ static bool32 AccuracyCalcHelper(u32 move, u32 battler) // If the target is under the effects of Telekinesis, and the move isn't a OH-KO move, move hits. else if (gStatuses3[battler] & STATUS3_TELEKINESIS && !(gStatuses3[battler] & STATUS3_SEMI_INVULNERABLE) - && gMovesInfo[move].effect != EFFECT_OHKO) + && moveEffect != EFFECT_OHKO) { effect = TRUE; } @@ -1437,9 +1442,9 @@ static bool32 AccuracyCalcHelper(u32 move, u32 battler) } else if ((gStatuses3[battler] & STATUS3_COMMANDER) || (gStatuses3[battler] & STATUS3_PHANTOM_FORCE) - || ((gStatuses3[battler] & STATUS3_ON_AIR) && !(gMovesInfo[move].damagesAirborne || gMovesInfo[move].damagesAirborneDoubleDamage)) - || ((gStatuses3[battler] & STATUS3_UNDERGROUND) && !gMovesInfo[move].damagesUnderground) - || ((gStatuses3[battler] & STATUS3_UNDERWATER) && !gMovesInfo[move].damagesUnderwater)) + || ((gStatuses3[battler] & STATUS3_ON_AIR) && !(MoveDamagesAirborne(move) || MoveDamagesAirborneDoubleDamage(move))) + || ((gStatuses3[battler] & STATUS3_UNDERGROUND) && !MoveDamagesUnderground(move)) + || ((gStatuses3[battler] & STATUS3_UNDERWATER) && !MoveDamagesUnderWater(move))) { gBattleStruct->moveResultFlags[battler] |= MOVE_RESULT_MISSED; effect = TRUE; @@ -1447,10 +1452,10 @@ static bool32 AccuracyCalcHelper(u32 move, u32 battler) if (WEATHER_HAS_EFFECT) { - if ((gMovesInfo[move].effect == EFFECT_THUNDER || gMovesInfo[move].effect == EFFECT_RAIN_ALWAYS_HIT) + if ((moveEffect == EFFECT_THUNDER || moveEffect == EFFECT_RAIN_ALWAYS_HIT) && IsBattlerWeatherAffected(battler, B_WEATHER_RAIN)) effect = TRUE; - else if ((gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_SNOW)) && gMovesInfo[move].effect == EFFECT_BLIZZARD) + else if ((gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_SNOW)) && moveEffect == EFFECT_BLIZZARD) effect = TRUE; if (effect) @@ -1459,11 +1464,11 @@ static bool32 AccuracyCalcHelper(u32 move, u32 battler) if (B_MINIMIZE_DMG_ACC >= GEN_6 && (gStatuses3[battler] & STATUS3_MINIMIZED) - && gMovesInfo[move].minimizeDoubleDamage) + && MoveIncreasesPowerToMinimizedTargets(move)) { effect = TRUE; } - else if (gMovesInfo[move].accuracy == 0) + else if (GetMoveAccuracy(move) == 0) { effect = TRUE; } @@ -1489,7 +1494,7 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u if (atkAbility == ABILITY_UNAWARE || atkAbility == ABILITY_KEEN_EYE || atkAbility == ABILITY_MINDS_EYE || (B_ILLUMINATE_EFFECT >= GEN_9 && atkAbility == ABILITY_ILLUMINATE)) evasionStage = DEFAULT_STAT_STAGE; - if (gMovesInfo[move].ignoresTargetDefenseEvasionStages) + if (MoveIgnoresDefenseEvasionStages(move)) evasionStage = DEFAULT_STAT_STAGE; if (defAbility == ABILITY_UNAWARE) accStage = DEFAULT_STAT_STAGE; @@ -1504,12 +1509,12 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u if (buff > MAX_STAT_STAGE) buff = MAX_STAT_STAGE; - moveAcc = gMovesInfo[move].accuracy; + moveAcc = GetMoveAccuracy(move); // Check Thunder and Hurricane on sunny weather. - if (IsBattlerWeatherAffected(battlerDef, B_WEATHER_SUN) && gMovesInfo[move].effect == EFFECT_THUNDER) + if (IsBattlerWeatherAffected(battlerDef, B_WEATHER_SUN) && GetMoveEffect(move) == EFFECT_THUNDER) moveAcc = 50; // Check Wonder Skin. - if (defAbility == ABILITY_WONDER_SKIN && IS_MOVE_STATUS(move) && moveAcc > 50) + if (defAbility == ABILITY_WONDER_SKIN && IsBattleMoveStatus(move) && moveAcc > 50) moveAcc = 50; calc = gAccuracyStageRatios[buff].dividend * moveAcc; @@ -1525,7 +1530,7 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u calc = (calc * 110) / 100; // 1.1 victory star boost break; case ABILITY_HUSTLE: - if (IS_MOVE_PHYSICAL(move)) + if (IsBattleMovePhysical(move)) calc = (calc * 80) / 100; // 1.2 hustle loss break; } @@ -1604,6 +1609,8 @@ static void AccuracyCheck(bool32 recalcDragonDarts, const u8 *nextInstr, const u if (move == ACC_CURR_MOVE) move = gCurrentMove; + u32 effect = GetMoveEffect(move); + abilityAtk = GetBattlerAbility(gBattlerAttacker); holdEffectAtk = GetBattlerHoldEffect(gBattlerAttacker, TRUE); @@ -1626,16 +1633,16 @@ static void AccuracyCheck(bool32 recalcDragonDarts, const u8 *nextInstr, const u else if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT || (gSpecialStatuses[gBattlerAttacker].multiHitOn && (abilityAtk == ABILITY_SKILL_LINK || holdEffectAtk == HOLD_EFFECT_LOADED_DICE - || !(gMovesInfo[move].effect == EFFECT_TRIPLE_KICK || gMovesInfo[move].effect == EFFECT_POPULATION_BOMB)))) + || !(effect == EFFECT_TRIPLE_KICK || effect == EFFECT_POPULATION_BOMB)))) { // No acc checks for second hit of Parental Bond or multi hit moves, except Triple Kick/Triple Axel/Population Bomb gBattlescriptCurrInstr = nextInstr; } else { - u32 moveType = GetMoveType(move); + u32 moveType = GetBattleMoveType(move); u32 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, move); - bool32 calcSpreadMove = IsSpreadMove(moveTarget) && !IS_MOVE_STATUS(move); + bool32 calcSpreadMove = IsSpreadMove(moveTarget) && !IsBattleMoveStatus(move); for (u32 battlerDef = 0; battlerDef < gBattlersCount; battlerDef++) { @@ -1666,7 +1673,7 @@ static void AccuracyCheck(bool32 recalcDragonDarts, const u8 *nextInstr, const u if (holdEffectAtk == HOLD_EFFECT_BLUNDER_POLICY) gBattleStruct->blunderPolicy = TRUE; // Only activates from missing through acc/evasion checks - if (gMovesInfo[gCurrentMove].effect == EFFECT_DRAGON_DARTS + if (effect == EFFECT_DRAGON_DARTS && !recalcDragonDarts // So we don't jump back and forth between targets && CanTargetPartner(gBattlerAttacker, battlerDef) && !TargetFullyImmuneToCurrMove(gBattlerAttacker, BATTLE_PARTNER(battlerDef))) @@ -1677,7 +1684,7 @@ static void AccuracyCheck(bool32 recalcDragonDarts, const u8 *nextInstr, const u return; } - if (gMovesInfo[move].power) + if (GetMovePower(move) != 0) CalcTypeEffectivenessMultiplier(move, moveType, gBattlerAttacker, battlerDef, GetBattlerAbility(battlerDef), TRUE); } } @@ -1734,7 +1741,7 @@ static void Cmd_ppreduce(void) if (moveTarget == MOVE_TARGET_BOTH || moveTarget == MOVE_TARGET_FOES_AND_ALLY || moveTarget == MOVE_TARGET_ALL_BATTLERS - || gMovesInfo[gCurrentMove].forcePressure) + || MoveForcesPressure(gCurrentMove)) { for (i = 0; i < gBattlersCount; i++) { @@ -1835,7 +1842,7 @@ s32 CalcCritChanceStageArgs(u32 battlerAtk, u32 battlerDef, u32 move, bool32 rec critChance = CRITICAL_HIT_BLOCKED; } else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS - || gMovesInfo[move].alwaysCriticalHit + || MoveAlwaysCrits(move) || (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY)) { critChance = CRITICAL_HIT_ALWAYS; @@ -1844,7 +1851,7 @@ s32 CalcCritChanceStageArgs(u32 battlerAtk, u32 battlerDef, u32 move, bool32 rec { critChance = 2 * ((gBattleMons[battlerAtk].status2 & STATUS2_FOCUS_ENERGY) != 0) + 1 * ((gBattleMons[battlerAtk].status2 & STATUS2_DRAGON_CHEER) != 0) - + gMovesInfo[move].criticalHitStage + + GetMoveCriticalHitStage(move) + GetHoldEffectCritChanceIncrease(battlerAtk, holdEffectAtk) + 2 * (B_AFFECTION_MECHANICS == TRUE && GetBattlerAffectionHearts(battlerAtk) == AFFECTION_FIVE_HEARTS) + (abilityAtk == ABILITY_SUPER_LUCK) @@ -1898,7 +1905,7 @@ s32 CalcCritChanceStageGen1(u32 battlerAtk, u32 battlerDef, u32 move, bool32 rec u32 farfetchdLeekScaler = 8; s32 critChance = 0; - s32 moveCritStage = gMovesInfo[gCurrentMove].criticalHitStage; + s32 moveCritStage = GetMoveCriticalHitStage(gCurrentMove); s32 bonusCritStage = gBattleStruct->bonusCritStages[battlerAtk]; // G-Max Chi Strike u32 abilityAtk = GetBattlerAbility(battlerAtk); u32 abilityDef = GetBattlerAbility(battlerDef); @@ -1942,7 +1949,7 @@ s32 CalcCritChanceStageGen1(u32 battlerAtk, u32 battlerDef, u32 move, bool32 rec // Guaranteed crits else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS - || gMovesInfo[move].alwaysCriticalHit == TRUE + || MoveAlwaysCrits(move) || (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY)) { critChance = -2; @@ -1965,7 +1972,7 @@ static void Cmd_critcalc(void) u32 partySlot = gBattlerPartyIndexes[gBattlerAttacker]; u32 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); - bool32 calcSpreadMoveDamage = IsSpreadMove(moveTarget) && !IS_MOVE_STATUS(gCurrentMove); + bool32 calcSpreadMoveDamage = IsSpreadMove(moveTarget) && !IsBattleMoveStatus(gCurrentMove); gPotentialItemEffectBattler = gBattlerAttacker; for (u32 battlerDef = 0; battlerDef < gBattlersCount; battlerDef++) @@ -2019,8 +2026,8 @@ static void Cmd_critcalc(void) static inline void GetShellSideArmCategory(u32 battlerDef) { - if (gMovesInfo[gCurrentMove].effect == EFFECT_SHELL_SIDE_ARM) - gBattleStruct->swapDamageCategory = (gBattleStruct->shellSideArmCategory[gBattlerAttacker][battlerDef] != gMovesInfo[gCurrentMove].category); + if (GetMoveEffect(gCurrentMove) == EFFECT_SHELL_SIDE_ARM) + gBattleStruct->swapDamageCategory = (gBattleStruct->shellSideArmCategory[gBattlerAttacker][battlerDef] != GetMoveCategory(gCurrentMove)); } static void Cmd_damagecalc(void) @@ -2038,7 +2045,7 @@ static void Cmd_damagecalc(void) struct DamageCalculationData damageCalcData; damageCalcData.battlerAtk = gBattlerAttacker; damageCalcData.move = gCurrentMove; - damageCalcData.moveType = GetMoveType(gCurrentMove); + damageCalcData.moveType = GetBattleMoveType(gCurrentMove); damageCalcData.randomFactor = TRUE; damageCalcData.updateFlags = TRUE; @@ -2085,7 +2092,7 @@ static void Cmd_typecalc(void) if (!IsSpreadMove(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove))) // Handled in CANCELLER_MULTI_TARGET_MOVES for Spread Moves { - u32 moveType = GetMoveType(gCurrentMove); + u32 moveType = GetBattleMoveType(gCurrentMove); CalcTypeEffectivenessMultiplier(gCurrentMove, moveType, gBattlerAttacker, gBattlerTarget, GetBattlerAbility(gBattlerTarget), TRUE); } @@ -2101,7 +2108,8 @@ static void Cmd_adjustdamage(void) u32 rand = Random() % 100; u32 affectionScore = GetBattlerAffectionHearts(gBattlerTarget); u32 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); - bool32 calcSpreadMoveDamage = IsSpreadMove(moveTarget) && !IS_MOVE_STATUS(gCurrentMove); + u32 moveEffect = GetMoveEffect(gCurrentMove); + bool32 calcSpreadMoveDamage = IsSpreadMove(moveTarget) && !IsBattleMoveStatus(gCurrentMove); for (battlerDef = 0; battlerDef < gBattlersCount; battlerDef++) { @@ -2123,7 +2131,7 @@ static void Cmd_adjustdamage(void) gBattleStruct->enduredDamage |= 1u << battlerDef; goto END; } - if (GetBattlerAbility(battlerDef) == ABILITY_ICE_FACE && IS_MOVE_PHYSICAL(gCurrentMove) && gBattleMons[battlerDef].species == SPECIES_EISCUE) + if (GetBattlerAbility(battlerDef) == ABILITY_ICE_FACE && IsBattleMovePhysical(gCurrentMove) && gBattleMons[battlerDef].species == SPECIES_EISCUE) { // Damage deals typeless 0 HP. gBattleStruct->moveResultFlags[battlerDef] &= ~(MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE); @@ -2164,7 +2172,7 @@ static void Cmd_adjustdamage(void) gSpecialStatuses[battlerDef].affectionEndured = TRUE; } - if (gMovesInfo[gCurrentMove].effect != EFFECT_FALSE_SWIPE + if (moveEffect != EFFECT_FALSE_SWIPE && !gProtectStructs[battlerDef].endured && !gSpecialStatuses[battlerDef].focusBanded && !gSpecialStatuses[battlerDef].focusSashed @@ -2210,7 +2218,7 @@ static void Cmd_adjustdamage(void) && MoveResultHasEffect(gBattlerTarget) && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleMons[gBattlerAttacker].item - && gMovesInfo[gCurrentMove].effect != EFFECT_PLEDGE + && moveEffect != EFFECT_PLEDGE && gCurrentMove != MOVE_STRUGGLE) { BattleScriptPushCursor(); @@ -2305,7 +2313,7 @@ static inline bool32 TryStrongWindsWeakenAttack(u32 battlerDef, u32 moveType) { if (gBattleWeather & B_WEATHER_STRONG_WINDS && WEATHER_HAS_EFFECT) { - if (gMovesInfo[gCurrentMove].category != DAMAGE_CATEGORY_STATUS + if (GetMoveCategory(gCurrentMove) != DAMAGE_CATEGORY_STATUS && IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING) && gTypeEffectivenessTable[moveType][TYPE_FLYING] >= UQ_4_12(2.0) && !gBattleStruct->printedStrongWindsWeakenedAttack) @@ -2353,7 +2361,7 @@ static inline bool32 TryActivateWeakenessBerry(u32 battlerDef) static bool32 ProcessPreAttackAnimationFuncs(void) { - u32 moveType = GetMoveType(gCurrentMove); + u32 moveType = GetBattleMoveType(gCurrentMove); if (IsDoubleSpreadMove()) { u32 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); @@ -2415,7 +2423,7 @@ static void Cmd_attackanimation(void) && gCurrentMove != MOVE_SUBSTITUTE && gCurrentMove != MOVE_ALLY_SWITCH // In a wild double battle gotta use the teleport animation if two wild pokemon are alive. - && !(gMovesInfo[gCurrentMove].effect == EFFECT_TELEPORT && WILD_DOUBLE_BATTLE && GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT && IsBattlerAlive(BATTLE_PARTNER(gBattlerAttacker)))) + && !(GetMoveEffect(gCurrentMove) == EFFECT_TELEPORT && WILD_DOUBLE_BATTLE && GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT && IsBattlerAlive(BATTLE_PARTNER(gBattlerAttacker)))) { BattleScriptPush(cmd->nextInstr); gBattlescriptCurrInstr = BattleScript_Pausex20; @@ -2651,10 +2659,12 @@ static void Cmd_datahpupdate(void) if (gSpecialStatuses[battler].shellBellDmg == 0 && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE)) gSpecialStatuses[battler].shellBellDmg = gHpDealt; + u32 effect = GetMoveEffect(gCurrentMove); + // Note: While physicalDmg/specialDmg below are only distinguished between for Counter/Mirror Coat, they are // used in combination as general damage trackers for other purposes. specialDmg is additionally used // to help determine if a fire move should defrost the target. - if (IS_MOVE_PHYSICAL(gCurrentMove) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && gMovesInfo[gCurrentMove].effect != EFFECT_PAIN_SPLIT) + if (IsBattleMovePhysical(gCurrentMove) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && effect != EFFECT_PAIN_SPLIT) { gProtectStructs[battler].physicalDmg = gHpDealt; gSpecialStatuses[battler].physicalDmg = gHpDealt; @@ -2669,7 +2679,7 @@ static void Cmd_datahpupdate(void) gSpecialStatuses[battler].physicalBattlerId = gBattlerTarget; } } - else if (!IS_MOVE_PHYSICAL(gCurrentMove) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && gMovesInfo[gCurrentMove].effect != EFFECT_PAIN_SPLIT) + else if (!IsBattleMovePhysical(gCurrentMove) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && effect != EFFECT_PAIN_SPLIT) { // Record special damage/attacker for Mirror Coat gProtectStructs[battler].specialDmg = gHpDealt; @@ -2827,7 +2837,7 @@ static void Cmd_resultmessage(void) if (*moveResultFlags & MOVE_RESULT_MISSED && (!(*moveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) || gBattleStruct->missStringId[gBattlerTarget] > B_MSG_AVOIDED_ATK)) { - if (gMultiHitCounter && gMultiHitCounter < gMovesInfo[gCurrentMove].strikeCount) + if (gMultiHitCounter && gMultiHitCounter < GetMoveStrikeCount(gCurrentMove)) { gMultiHitCounter = 0; *moveResultFlags &= ~MOVE_RESULT_MISSED; @@ -3187,7 +3197,7 @@ void SetMoveEffect(bool32 primary, bool32 certain) if (!(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) && TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove) - && !(gMovesInfo[gCurrentMove].effect == EFFECT_ORDER_UP && gBattleStruct->commanderActive[gBattlerAttacker]) + && !(GetMoveEffect(gCurrentMove) == EFFECT_ORDER_UP && gBattleStruct->commanderActive[gBattlerAttacker]) && !primary && gBattleScripting.moveEffect != MOVE_EFFECT_CHARGING) INCREMENT_RESET_RETURN @@ -3294,7 +3304,7 @@ void SetMoveEffect(bool32 primary, bool32 certain) if (B_STATUS_TYPE_IMMUNITY == GEN_1) { - u32 moveType = GetMoveType(gCurrentMove); + u32 moveType = GetBattleMoveType(gCurrentMove); if (primary == FALSE && certain == FALSE && IS_BATTLER_OF_TYPE(gEffectBattler, moveType)) break; } @@ -3307,7 +3317,7 @@ void SetMoveEffect(bool32 primary, bool32 certain) case STATUS1_FREEZE: if (B_STATUS_TYPE_IMMUNITY == GEN_1) { - u32 moveType = GetMoveType(gCurrentMove); + u32 moveType = GetBattleMoveType(gCurrentMove); if (primary == FALSE && certain == FALSE && IS_BATTLER_OF_TYPE(gEffectBattler, moveType)) break; } @@ -3348,7 +3358,7 @@ void SetMoveEffect(bool32 primary, bool32 certain) } if (B_STATUS_TYPE_IMMUNITY == GEN_1) { - u32 moveType = GetMoveType(gCurrentMove); + u32 moveType = GetBattleMoveType(gCurrentMove); if (primary == FALSE && certain == FALSE && IS_BATTLER_OF_TYPE(gEffectBattler, moveType)) break; } @@ -3418,7 +3428,7 @@ void SetMoveEffect(bool32 primary, bool32 certain) case STATUS1_FROSTBITE: if (B_STATUS_TYPE_IMMUNITY == GEN_1) { - u32 moveType = GetMoveType(gCurrentMove); + u32 moveType = GetBattleMoveType(gCurrentMove); if (primary == FALSE && certain == FALSE && IS_BATTLER_OF_TYPE(gEffectBattler, moveType)) break; } @@ -4002,9 +4012,11 @@ void SetMoveEffect(bool32 primary, bool32 certain) gBattleMons[gBattlerAttacker].status2 |= STATUS2_ESCAPE_PREVENTION; break; case MOVE_EFFECT_REMOVE_ARG_TYPE: + { + u32 type = GetMoveArgType(gCurrentMove); // This seems unnecessary but is done to make it work properly with Parental Bond BattleScriptPush(gBattlescriptCurrInstr + 1); - switch (gMovesInfo[gCurrentMove].argument.type) + switch (type) { case TYPE_FIRE: // Burn Up gBattlescriptCurrInstr = BattleScript_RemoveFireType; @@ -4016,8 +4028,9 @@ void SetMoveEffect(bool32 primary, bool32 certain) gBattlescriptCurrInstr = BattleScript_RemoveGenericType; break; } - RemoveBattlerType(gEffectBattler, gMovesInfo[gCurrentMove].argument.type); + RemoveBattlerType(gEffectBattler, type); break; + } case MOVE_EFFECT_ROUND: TryUpdateRoundTurnOrder(); // If another Pokémon uses Round before the user this turn, the user will use Round directly after it gBattlescriptCurrInstr++; @@ -4354,10 +4367,11 @@ static void Cmd_setadditionaleffects(void) if (MoveResultHasEffect(gBattlerTarget)) { - if (gMovesInfo[gCurrentMove].numAdditionalEffects > gBattleStruct->additionalEffectsCounter) + u32 numAdditionalEffects = GetMoveAdditionalEffectCount(gCurrentMove); + if (numAdditionalEffects > gBattleStruct->additionalEffectsCounter) { u32 percentChance; - const struct AdditionalEffect *additionalEffect = &gMovesInfo[gCurrentMove].additionalEffects[gBattleStruct->additionalEffectsCounter]; + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(gCurrentMove, gBattleStruct->additionalEffectsCounter); const u8 *currentPtr = gBattlescriptCurrInstr; // Various checks for if this move effect can be applied this turn @@ -4383,7 +4397,7 @@ static void Cmd_setadditionaleffects(void) // Call setadditionaleffects again in the case of a move with multiple effects gBattleStruct->additionalEffectsCounter++; - if (gMovesInfo[gCurrentMove].numAdditionalEffects > gBattleStruct->additionalEffectsCounter) + if (numAdditionalEffects > gBattleStruct->additionalEffectsCounter) gBattleScripting.moveEffect = MOVE_EFFECT_CONTINUE; else gBattleScripting.moveEffect = gBattleStruct->additionalEffectsCounter = 0; @@ -5924,7 +5938,9 @@ static void Cmd_moveend(void) endState = cmd->endState; holdEffectAtk = GetBattlerHoldEffect(gBattlerAttacker, TRUE); - moveType = GetMoveType(gCurrentMove); + moveType = GetBattleMoveType(gCurrentMove); + + u32 moveEffect = GetMoveEffect(gCurrentMove); do { @@ -5938,7 +5954,7 @@ static void Cmd_moveend(void) if (gProtectStructs[gBattlerAttacker].touchedProtectLike) { if (gProtectStructs[gBattlerTarget].spikyShielded - && gMovesInfo[gCurrentMove].effect != EFFECT_COUNTER + && moveEffect != EFFECT_COUNTER && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) { gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; @@ -5973,7 +5989,8 @@ static void Cmd_moveend(void) gBattlescriptCurrInstr = BattleScript_BanefulBunkerEffect; effect = 1; } - else if (gProtectStructs[gBattlerTarget].obstructed && gMovesInfo[gCurrentMove].effect != EFFECT_SUCKER_PUNCH && gMovesInfo[gCurrentMove].effect != EFFECT_UPPER_HAND) + else if (gProtectStructs[gBattlerTarget].obstructed + && moveEffect != EFFECT_SUCKER_PUNCH && moveEffect != EFFECT_UPPER_HAND) { gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; i = gBattlerAttacker; @@ -6021,18 +6038,18 @@ static void Cmd_moveend(void) gBattleScripting.moveendState++; break; case MOVEEND_ABSORB: - if (gMovesInfo[gCurrentMove].effect == EFFECT_ABSORB + if (moveEffect == EFFECT_ABSORB && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && IsBattlerTurnDamaged(gBattlerTarget)) { - if (gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK && gMovesInfo[gCurrentMove].healingMove) + if (gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK && IsHealingMove(gCurrentMove)) { gBattleScripting.moveendState++; break; } else if (IsBattlerAlive(gBattlerAttacker) && MoveResultHasEffect(gBattlerTarget)) { - gBattleStruct->moveDamage[gBattlerAttacker] = max(1, (gBattleStruct->moveDamage[gBattlerTarget] * gMovesInfo[gCurrentMove].argument.absorbPercentage / 100)); + gBattleStruct->moveDamage[gBattlerAttacker] = max(1, (gBattleStruct->moveDamage[gBattlerTarget] * GetMoveAbsorbPercentage(gCurrentMove) / 100)); gBattleStruct->moveDamage[gBattlerAttacker] = GetDrainedBigRootHp(gBattlerAttacker, gBattleStruct->moveDamage[gBattlerAttacker]); gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE; effect = TRUE; @@ -6061,7 +6078,7 @@ static void Cmd_moveend(void) && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget) && MoveResultHasEffect(gBattlerTarget) && IsBattlerTurnDamaged(gBattlerTarget) - && !IS_MOVE_STATUS(gCurrentMove) + && !IsBattleMoveStatus(gCurrentMove) && CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) { SET_STATCHANGER(STAT_ATK, 1, FALSE); @@ -6088,7 +6105,7 @@ static void Cmd_moveend(void) if (gBattleMons[gBattlerTarget].status1 & STATUS1_FROSTBITE && IsBattlerAlive(gBattlerTarget) && gBattlerAttacker != gBattlerTarget - && gMovesInfo[originallyUsedMove].thawsUser + && MoveThawsUser(originallyUsedMove) && MoveResultHasEffect(gBattlerTarget)) { gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FROSTBITE; @@ -6101,30 +6118,31 @@ static void Cmd_moveend(void) gBattleScripting.moveendState++; break; case MOVEEND_RECOIL: + { + u32 moveRecoil = GetMoveRecoil(gCurrentMove); if (gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) { gBattleScripting.moveendState++; break; } - else if (gMovesInfo[gCurrentMove].recoil > 0 + else if (moveRecoil > 0 && MoveResultHasEffect(gBattlerTarget) && IsBattlerAlive(gBattlerAttacker) && gBattleScripting.savedDmg != 0) // Some checks may be redundant alongside this one { - gBattleStruct->moveDamage[gBattlerAttacker] = max(1, gBattleScripting.savedDmg * max(1, gMovesInfo[gCurrentMove].recoil) / 100); + gBattleStruct->moveDamage[gBattlerAttacker] = max(1, gBattleScripting.savedDmg * max(1, moveRecoil) / 100); BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MoveEffectRecoil; effect = TRUE; } - else if (gMovesInfo[gCurrentMove].effect == EFFECT_EXPLOSION && !IsAbilityOnField(ABILITY_DAMP)) + else if (moveEffect == EFFECT_EXPLOSION && !IsAbilityOnField(ABILITY_DAMP)) { gBattleStruct->moveDamage[gBattlerAttacker] = 0; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_FaintAttackerForExplosion; effect = TRUE; } - else if ((gMovesInfo[gCurrentMove].effect == EFFECT_MAX_HP_50_RECOIL - || gMovesInfo[gCurrentMove].effect == EFFECT_MIND_BLOWN) + else if ((moveEffect == EFFECT_MAX_HP_50_RECOIL || moveEffect == EFFECT_MIND_BLOWN) && IsBattlerAlive(gBattlerAttacker) && !(gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_FAILED) && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) @@ -6136,6 +6154,7 @@ static void Cmd_moveend(void) } gBattleScripting.moveendState++; break; + } case MOVEEND_ITEM_EFFECTS_ATTACKER: if (ItemBattleEffects(ITEMEFFECT_MOVE_END, gBattlerAttacker, FALSE)) effect = TRUE; @@ -6181,8 +6200,7 @@ static void Cmd_moveend(void) && gChosenMove != MOVE_STRUGGLE && (*choicedMoveAtk == MOVE_NONE || *choicedMoveAtk == MOVE_UNAVAILABLE)) { - if ((gMovesInfo[gChosenMove].effect == EFFECT_BATON_PASS - || gMovesInfo[gChosenMove].effect == EFFECT_HEALING_WISH) + if ((moveEffect == EFFECT_BATON_PASS || moveEffect == EFFECT_HEALING_WISH) && !(gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_FAILED)) { gBattleScripting.moveendState++; @@ -6250,19 +6268,21 @@ static void Cmd_moveend(void) } break; case MOVE_EFFECT_REMOVE_STATUS: // Smelling salts, Wake-Up Slap, Sparkling Aria - if ((gBattleMons[gBattlerTarget].status1 & gMovesInfo[gCurrentMove].argument.status) + { + u32 argStatus = GetMoveEffectArg_Status(gCurrentMove); + if ((gBattleMons[gBattlerTarget].status1 & argStatus) && IsBattlerAlive(gBattlerTarget) && !DoesSubstituteBlockMove(gBattlerAttacker, gBattlerTarget, gCurrentMove) && (gBattleStruct->numSpreadTargets > 1 || !IsMoveEffectBlockedByTarget(GetBattlerAbility(gBattlerTarget)))) { - gBattleMons[gBattlerTarget].status1 &= ~(gMovesInfo[gCurrentMove].argument.status); + gBattleMons[gBattlerTarget].status1 &= ~(argStatus); BtlController_EmitSetMonData(gBattlerTarget, 0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gBattlerTarget].status1); MarkBattlerForControllerExec(gBattlerTarget); effect = TRUE; BattleScriptPush(gBattlescriptCurrInstr); - switch (gMovesInfo[gCurrentMove].argument.status) + switch (argStatus) { case STATUS1_PARALYSIS: gBattlescriptCurrInstr = BattleScript_TargetPRLZHeal; @@ -6289,6 +6309,7 @@ static void Cmd_moveend(void) } break; // MOVE_EFFECT_REMOVE_STATUS } + } gBattleStruct->moveEffect2 = 0; gBattleScripting.moveendState++; break; // MOVEEND_MOVE_EFFECTS2 @@ -6344,7 +6365,7 @@ static void Cmd_moveend(void) break; case MOVEEND_NUM_HITS: if (gBattlerAttacker != gBattlerTarget - && gMovesInfo[gCurrentMove].category != DAMAGE_CATEGORY_STATUS + && GetMoveCategory(gCurrentMove) != DAMAGE_CATEGORY_STATUS && MoveResultHasEffect(gBattlerTarget) && IsBattlerTurnDamaged(gBattlerTarget)) { @@ -6396,7 +6417,7 @@ static void Cmd_moveend(void) gBattleStruct->lastMoveFailed &= ~(1u << gBattlerAttacker); // Set ShellTrap to activate after the attacker's turn if target was hit by a physical move. - if (gMovesInfo[gChosenMoveByBattler[gBattlerTarget]].effect == EFFECT_SHELL_TRAP + if (GetMoveEffect(gChosenMoveByBattler[gBattlerTarget]) == EFFECT_SHELL_TRAP && gBattlerTarget != gBattlerAttacker && GetBattlerSide(gBattlerTarget) != GetBattlerSide(gBattlerAttacker) && gProtectStructs[gBattlerTarget].physicalDmg @@ -6429,10 +6450,10 @@ static void Cmd_moveend(void) gBattleStruct->dynamax.lastUsedBaseMove = gBattleStruct->dynamax.baseMoves[gBattlerAttacker]; } } + u32 originalEffect = GetMoveEffect(originallyUsedMove); if (!(gAbsentBattlerFlags & (1u << gBattlerAttacker)) && !(gBattleStruct->absentBattlerFlags & (1u << gBattlerAttacker)) - && gMovesInfo[originallyUsedMove].effect != EFFECT_BATON_PASS - && gMovesInfo[originallyUsedMove].effect != EFFECT_HEALING_WISH) + && originalEffect != EFFECT_BATON_PASS && originalEffect != EFFECT_HEALING_WISH) { if (gHitMarker & HITMARKER_OBEYS) { @@ -6441,7 +6462,7 @@ static void Cmd_moveend(void) gLastMoves[gBattlerAttacker] = gChosenMove; RecordKnownMove(gBattlerAttacker, gChosenMove); gLastResultingMoves[gBattlerAttacker] = gCurrentMove; - gLastUsedMoveType[gBattlerAttacker] = GetMoveType(gCurrentMove); + gLastUsedMoveType[gBattlerAttacker] = GetBattleMoveType(gCurrentMove); } } else @@ -6463,7 +6484,7 @@ static void Cmd_moveend(void) else { gLastLandedMoves[gBattlerTarget] = gCurrentMove; - gLastHitByType[gBattlerTarget] = GetMoveType(gCurrentMove); + gLastHitByType[gBattlerTarget] = GetBattleMoveType(gCurrentMove); } } else @@ -6476,7 +6497,7 @@ static void Cmd_moveend(void) case MOVEEND_MIRROR_MOVE: // mirror move if (!(gAbsentBattlerFlags & (1u << gBattlerAttacker)) && !(gBattleStruct->absentBattlerFlags & (1u << gBattlerAttacker)) - && !gMovesInfo[originallyUsedMove].mirrorMoveBanned + && !IsMoveMirrorMoveBanned(originallyUsedMove) && gHitMarker & HITMARKER_OBEYS && gBattlerAttacker != gBattlerTarget && !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget)) @@ -6513,10 +6534,10 @@ static void Cmd_moveend(void) MoveValuesCleanUp(); gBattleScripting.moveEffect = gBattleScripting.savedMoveEffect; - if (gMovesInfo[gCurrentMove].effect == EFFECT_EXPLOSION) + if (moveEffect == EFFECT_EXPLOSION) BattleScriptPush(gBattleMoveEffects[EFFECT_HIT].battleScript); // Edge case for Explosion not changing targets else - BattleScriptPush(GET_MOVE_BATTLESCRIPT(gCurrentMove)); + BattleScriptPush(GetMoveBattleScript(gCurrentMove)); gBattlescriptCurrInstr = BattleScript_FlushMessageBox; return; } @@ -6538,7 +6559,7 @@ static void Cmd_moveend(void) gBattleScripting.animTurn = 0; gBattleScripting.animTargetsHit = 0; MoveValuesCleanUp(); - BattleScriptPush(GET_MOVE_BATTLESCRIPT(gCurrentMove)); + BattleScriptPush(GetMoveBattleScript(gCurrentMove)); gBattlescriptCurrInstr = BattleScript_FlushMessageBox; return; } @@ -6556,17 +6577,17 @@ static void Cmd_moveend(void) if (MoveResultHasEffect(gBattlerTarget) && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gMultiHitCounter - && !(gMovesInfo[gCurrentMove].effect == EFFECT_PRESENT && gBattleStruct->presentBasePower == 0)) // Silly edge case + && !(moveEffect == EFFECT_PRESENT && gBattleStruct->presentBasePower == 0)) // Silly edge case { gMultiHitCounter--; - if (!IsBattlerAlive(gBattlerTarget) && gMovesInfo[gCurrentMove].effect != EFFECT_DRAGON_DARTS) + if (!IsBattlerAlive(gBattlerTarget) && moveEffect != EFFECT_DRAGON_DARTS) gMultiHitCounter = 0; gBattleScripting.multihitString[4]++; if (gMultiHitCounter == 0) { BattleScriptPushCursor(); - if (gMovesInfo[gCurrentMove].argument.moveProperty == MOVE_EFFECT_SCALE_SHOT && !NoAliveMonsForEitherParty()) + if (GetMoveEffectArg_MoveProperty(gCurrentMove) == MOVE_EFFECT_SCALE_SHOT && !NoAliveMonsForEitherParty()) gBattlescriptCurrInstr = BattleScript_ScaleShot; else gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; @@ -6574,7 +6595,7 @@ static void Cmd_moveend(void) } else { - if (gMovesInfo[gCurrentMove].effect == EFFECT_DRAGON_DARTS + if (moveEffect == EFFECT_DRAGON_DARTS && !(gBattleStruct->moveResultFlags[BATTLE_PARTNER(gBattlerTarget)] & MOVE_RESULT_MISSED) // didn't miss the other target && CanTargetPartner(gBattlerAttacker, gBattlerTarget) && !TargetFullyImmuneToCurrMove(gBattlerAttacker, BATTLE_PARTNER(gBattlerTarget))) @@ -6596,7 +6617,7 @@ static void Cmd_moveend(void) gSpecialStatuses[gBattlerTarget].focusSashed = 0; // Delete this line to make Focus Sash last for the duration of the whole move turn. gSpecialStatuses[gBattlerAttacker].multiHitOn = TRUE; MoveValuesCleanUp(); - BattleScriptPush(GET_MOVE_BATTLESCRIPT(gCurrentMove)); + BattleScriptPush(GetMoveBattleScript(gCurrentMove)); gBattlescriptCurrInstr = BattleScript_FlushMessageBox; return; } @@ -6689,12 +6710,12 @@ static void Cmd_moveend(void) if (IsBattlerAlive(battler) && CountUsablePartyMons(battler) > 0 // Has mon to switch into // Does not activate if attacker used Parting Shot and can switch out - && !(gMovesInfo[gCurrentMove].effect == EFFECT_HIT_SWITCH_TARGET && CanBattlerSwitch(gBattlerAttacker)) + && !(moveEffect == EFFECT_HIT_SWITCH_TARGET && CanBattlerSwitch(gBattlerAttacker)) ) { gBattleScripting.battler = battler; gLastUsedItem = gBattleMons[battler].item; - if (gMovesInfo[gCurrentMove].effect == EFFECT_HIT_ESCAPE) + if (moveEffect == EFFECT_HIT_ESCAPE) gBattlescriptCurrInstr = BattleScript_MoveEnd; // Prevent user switch-in selection effect = TRUE; BattleScriptPushCursor(); @@ -6751,7 +6772,7 @@ static void Cmd_moveend(void) redCardBattlers |= (1u << i); } if (redCardBattlers - && (gMovesInfo[gCurrentMove].effect != EFFECT_HIT_SWITCH_TARGET || gBattleStruct->hitSwitchTargetFailed) + && (moveEffect != EFFECT_HIT_SWITCH_TARGET || gBattleStruct->hitSwitchTargetFailed) && IsBattlerAlive(gBattlerAttacker) && !TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove) && GetBattlerAbility(gBattlerAttacker) != ABILITY_GUARD_DOG) @@ -6776,7 +6797,7 @@ static void Cmd_moveend(void) gBattleScripting.battler = battler; gEffectBattler = gBattlerAttacker; gBattleStruct->redCardActivates = TRUE; - if (gMovesInfo[gCurrentMove].effect == EFFECT_HIT_ESCAPE) + if (moveEffect == EFFECT_HIT_ESCAPE) gBattlescriptCurrInstr = BattleScript_MoveEnd; // Prevent user switch-in selection BattleScriptPushCursor(); if (gBattleStruct->commanderActive[gBattlerAttacker] != SPECIES_NONE) @@ -6839,7 +6860,7 @@ static void Cmd_moveend(void) gBattleScripting.moveendState++; break; case MOVEEND_DANCER: // Special case because it's so annoying - if (gMovesInfo[gCurrentMove].danceMove && !gBattleStruct->snatchedMoveIsUsed) + if (IsDanceMove(gCurrentMove) && !gBattleStruct->snatchedMoveIsUsed) { u32 battler, nextDancer = 0; bool32 hasDancerTriggered = FALSE; @@ -7171,7 +7192,7 @@ static void Cmd_switchindataupdate(void) gBattleMons[battler].item = ITEM_NONE; } - if (gMovesInfo[gCurrentMove].effect == EFFECT_BATON_PASS) + if (GetMoveEffect(gCurrentMove) == EFFECT_BATON_PASS) { for (i = 0; i < NUM_BATTLE_STATS; i++) { @@ -7757,7 +7778,7 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler) && GetBattlerAbility(battler) != ABILITY_MAGIC_GUARD) { gDisableStructs[battler].stealthRockDone = TRUE; - gBattleStruct->moveDamage[battler] = GetStealthHazardDamage(gMovesInfo[MOVE_STEALTH_ROCK].type, battler); + gBattleStruct->moveDamage[battler] = GetStealthHazardDamage(GetMoveType(MOVE_STEALTH_ROCK), battler); if (gBattleStruct->moveDamage[battler] != 0) SetDmgHazardsBattlescript(battler, B_MSG_STEALTHROCKDMG); @@ -7816,7 +7837,7 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler) && GetBattlerAbility(battler) != ABILITY_MAGIC_GUARD) { gDisableStructs[battler].steelSurgeDone = TRUE; - gBattleStruct->moveDamage[battler] = GetStealthHazardDamage(gMovesInfo[MOVE_G_MAX_STEELSURGE].type, battler); + gBattleStruct->moveDamage[battler] = GetStealthHazardDamage(GetMoveType(MOVE_G_MAX_STEELSURGE), battler); if (gBattleStruct->moveDamage[battler] != 0) SetDmgHazardsBattlescript(battler, B_MSG_SHARPSTEELDMG); @@ -8440,7 +8461,7 @@ static void Cmd_jumptocalledmove(void) else gChosenMove = gCurrentMove = gCalledMove; - gBattlescriptCurrInstr = GET_MOVE_BATTLESCRIPT(gCurrentMove); + gBattlescriptCurrInstr = GetMoveBattleScript(gCurrentMove); } static void Cmd_statusanimation(void) @@ -8651,7 +8672,7 @@ static void Cmd_removeitem(void) // Popped Air Balloon cannot be restored by any means. // Corroded items cannot be restored either. if (GetBattlerHoldEffect(battler, TRUE) != HOLD_EFFECT_AIR_BALLOON - && gMovesInfo[gCurrentMove].effect != EFFECT_CORROSIVE_GAS) + && GetMoveEffect(gCurrentMove) != EFFECT_CORROSIVE_GAS) gBattleStruct->usedHeldItems[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)] = itemId; // Remember if switched out gBattleMons[battler].item = ITEM_NONE; @@ -9080,7 +9101,7 @@ static void Cmd_useitemonopponent(void) static bool32 HasAttackerFaintedTarget(void) { if (MoveResultHasEffect(gBattlerTarget) - && !IS_MOVE_STATUS(gCurrentMove) + && !IsBattleMoveStatus(gCurrentMove) && (gLastHitBy[gBattlerTarget] == 0xFF || gLastHitBy[gBattlerTarget] == gBattlerAttacker) && gBattleStruct->moveTarget[gBattlerAttacker] == gBattlerTarget && gBattlerTarget != gBattlerAttacker @@ -9343,11 +9364,11 @@ static bool32 IsElectricAbilityAffected(u32 battler, u32 ability) u32 moveType; if (gBattleStruct->dynamicMoveType == 0) - moveType = gMovesInfo[gCurrentMove].type; + moveType = GetMoveType(gCurrentMove); else if (!(gBattleStruct->dynamicMoveType & F_DYNAMIC_TYPE_IGNORE_PHYSICALITY)) moveType = gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK; else - moveType = gMovesInfo[gCurrentMove].type; + moveType = GetMoveType(gCurrentMove); if (moveType == TYPE_ELECTRIC && (ability != ABILITY_LIGHTNING_ROD || B_REDIRECT_ABILITY_IMMUNITY >= GEN_5) @@ -9852,7 +9873,7 @@ static void Cmd_various(void) case VARIOUS_GET_MOVE_TARGET: { VARIOUS_ARGS(); - gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); + gBattlerTarget = GetBattleMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); break; } case VARIOUS_GET_BATTLER_FAINTED: @@ -10237,7 +10258,7 @@ static void Cmd_various(void) case VARIOUS_TRY_ACTIVATE_FELL_STINGER: { VARIOUS_ARGS(); - if (gMovesInfo[gCurrentMove].effect == EFFECT_FELL_STINGER + if (GetMoveEffect(gCurrentMove) == EFFECT_FELL_STINGER && HasAttackerFaintedTarget() && !NoAliveMonsForEitherParty() && CompareStat(gBattlerAttacker, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) @@ -10281,7 +10302,7 @@ static void Cmd_various(void) gBattlescriptCurrInstr = cmd->failInstr; else if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) gBattlescriptCurrInstr = cmd->failInstr; - else if (IS_MOVE_STATUS(gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]])) + else if (IsBattleMoveStatus(gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]])) gBattlescriptCurrInstr = cmd->failInstr; else gBattlescriptCurrInstr = cmd->nextInstr; @@ -10363,12 +10384,12 @@ static void Cmd_various(void) { VARIOUS_ARGS(const u8 *failInstr); u16 move = gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]]; - if (IS_MOVE_STATUS(move) || gMovesInfo[move].meFirstBanned + if (IsBattleMoveStatus(move) || IsMoveMeFirstBanned(move) || GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) gBattlescriptCurrInstr = cmd->failInstr; else { - if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE && !IS_MOVE_STATUS(move)) + if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE && !IsBattleMoveStatus(move)) { gBattleStruct->zmove.baseMoves[gBattlerAttacker] = move; gCalledMove = GetTypeBasedZMove(move); @@ -10378,7 +10399,7 @@ static void Cmd_various(void) gCalledMove = move; } gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); + gBattlerTarget = GetBattleMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); gStatuses3[gBattlerAttacker] |= STATUS3_ME_FIRST; gBattlescriptCurrInstr = cmd->nextInstr; } @@ -10412,15 +10433,16 @@ static void Cmd_various(void) VARIOUS_ARGS(const u8 *failInstr); u32 types[3]; GetBattlerTypes(gBattlerTarget, FALSE, types); - if ((types[0] == gMovesInfo[gCurrentMove].type && types[1] == gMovesInfo[gCurrentMove].type) + u32 moveType = GetMoveType(gCurrentMove); + if ((types[0] == moveType && types[1] == moveType) || GetActiveGimmick(gBattlerTarget) == GIMMICK_TERA) { gBattlescriptCurrInstr = cmd->failInstr; } else { - SET_BATTLER_TYPE(gBattlerTarget, gMovesInfo[gCurrentMove].type); - PREPARE_TYPE_BUFFER(gBattleTextBuff1, gMovesInfo[gCurrentMove].type); + SET_BATTLER_TYPE(gBattlerTarget, moveType); + PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType); gBattlescriptCurrInstr = cmd->nextInstr; } return; @@ -10465,7 +10487,7 @@ static void Cmd_various(void) case VARIOUS_SET_ARG_TO_BATTLE_DAMAGE: { VARIOUS_ARGS(); - gBattleStruct->moveDamage[gBattlerTarget] = gMovesInfo[gCurrentMove].argument.fixedDamage; + gBattleStruct->moveDamage[gBattlerTarget] = GetMoveFixedDamage(gCurrentMove); break; } case VARIOUS_TRY_AUTOTOMIZE: @@ -10487,8 +10509,8 @@ static void Cmd_various(void) VARIOUS_ARGS(const u8 *failInstr); u16 move = gLastPrintedMoves[gBattlerTarget]; if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || MoveHasAdditionalEffectSelf(move, MOVE_EFFECT_RECHARGE) - || gMovesInfo[move].instructBanned - || gBattleMoveEffects[gMovesInfo[move].effect].twoTurnEffect + || IsMoveInstructBanned(move) + || gBattleMoveEffects[GetMoveEffect(move)].twoTurnEffect || (GetActiveGimmick(gBattlerTarget) == GIMMICK_DYNAMAX) || IsZMove(move) || IsMaxMove(move)) @@ -10737,14 +10759,15 @@ static void Cmd_various(void) case VARIOUS_TRY_THIRD_TYPE: { VARIOUS_ARGS(const u8 *failInstr); - if (IS_BATTLER_OF_TYPE(battler, gMovesInfo[gCurrentMove].argument.type) || GetActiveGimmick(battler) == GIMMICK_TERA) + u32 type = GetMoveArgType(gCurrentMove); + if (IS_BATTLER_OF_TYPE(battler, type) || GetActiveGimmick(battler) == GIMMICK_TERA) { gBattlescriptCurrInstr = cmd->failInstr; } else { - gBattleMons[battler].types[2] = gMovesInfo[gCurrentMove].argument.type; - PREPARE_TYPE_BUFFER(gBattleTextBuff1, gMovesInfo[gCurrentMove].argument.type); + gBattleMons[battler].types[2] = type; + PREPARE_TYPE_BUFFER(gBattleTextBuff1, type); gBattlescriptCurrInstr = cmd->nextInstr; } return; @@ -11343,9 +11366,10 @@ static void Cmd_various(void) static void TryResetProtectUseCounter(u32 battler) { u32 lastMove = gLastResultingMoves[battler]; + u32 lastEffect = GetMoveEffect(lastMove); if (lastMove == MOVE_UNAVAILABLE - || (!gBattleMoveEffects[gMovesInfo[lastMove].effect].usesProtectCounter - && (B_ALLY_SWITCH_FAIL_CHANCE >= GEN_9 && gMovesInfo[lastMove].effect != EFFECT_ALLY_SWITCH))) + || (!gBattleMoveEffects[lastEffect].usesProtectCounter + && (B_ALLY_SWITCH_FAIL_CHANCE >= GEN_9 && lastEffect != EFFECT_ALLY_SWITCH))) gDisableStructs[battler].protectUses = 0; } @@ -11364,9 +11388,9 @@ static void Cmd_setprotectlike(void) || (gCurrentMove == MOVE_WIDE_GUARD && B_WIDE_GUARD != GEN_5) || (gCurrentMove == MOVE_QUICK_GUARD && B_QUICK_GUARD != GEN_5)) { - if (!gMovesInfo[gCurrentMove].argument.protect.side) // Protects one mon only. + if (!GetMoveProtectSide(gCurrentMove)) // Protects one mon only. { - if (gMovesInfo[gCurrentMove].effect == EFFECT_ENDURE) + if (GetMoveEffect(gCurrentMove) == EFFECT_ENDURE) { gProtectStructs[gBattlerAttacker].endured = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BRACED_ITSELF; @@ -11529,7 +11553,7 @@ static void SetMoveForMirrorMove(u32 move) { gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; // Edge case, we used Z Mirror Move, got the stat boost and now need to use the Z-move - if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE && !IS_MOVE_STATUS(move)) + if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE && !IsBattleMoveStatus(move)) { gBattleStruct->zmove.baseMoves[gBattlerAttacker] = move; gCurrentMove = GetTypeBasedZMove(move); @@ -11540,8 +11564,8 @@ static void SetMoveForMirrorMove(u32 move) } SetAtkCancellerForCalledMove(); - gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); - gBattlescriptCurrInstr = GET_MOVE_BATTLESCRIPT(gCurrentMove); + gBattlerTarget = GetBattleMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); + gBattlescriptCurrInstr = GetMoveBattleScript(gCurrentMove); } static void Cmd_trymirrormove(void) @@ -11921,10 +11945,7 @@ static void Cmd_setdrainedhp(void) { CMD_ARGS(); - if (gMovesInfo[gCurrentMove].argument.absorbPercentage != 0) - gBattleStruct->moveDamage[gBattlerAttacker] = (gHpDealt * gMovesInfo[gCurrentMove].argument.absorbPercentage / 100); - else - gBattleStruct->moveDamage[gBattlerAttacker] = (gHpDealt / 2); + gBattleStruct->moveDamage[gBattlerAttacker] = (gHpDealt * GetMoveAbsorbPercentage(gCurrentMove) / 100); if (gBattleStruct->moveDamage[gBattlerAttacker] == 0) gBattleStruct->moveDamage[gBattlerAttacker] = 1; @@ -12342,7 +12363,7 @@ static void Cmd_twoturnmoveschargestringandanimation(void) { CMD_ARGS(const u8 *animationThenStringPtr); - gBattleScripting.savedStringId = gMovesInfo[gCurrentMove].argument.twoTurnAttack.stringId; + gBattleScripting.savedStringId = GetMoveTwoTurnAttackStringId(gCurrentMove); if (B_UPDATED_MOVE_DATA < GEN_5 || MoveHasChargeTurnAdditionalEffect(gCurrentMove)) gBattlescriptCurrInstr = cmd->animationThenStringPtr; else @@ -12571,7 +12592,7 @@ static void Cmd_tryconversiontypechange(void) { if (gBattleMons[gBattlerAttacker].moves[moveChecked] != MOVE_NONE) { - moveType = gMovesInfo[gBattleMons[gBattlerAttacker].moves[moveChecked]].type; + moveType = GetMoveType(gBattleMons[gBattlerAttacker].moves[moveChecked]); break; } } @@ -12599,7 +12620,7 @@ static void Cmd_tryconversiontypechange(void) for (moveChecked = 0; moveChecked < validMoves; moveChecked++) { - moveType = gMovesInfo[gBattleMons[gBattlerAttacker].moves[moveChecked]].type; + moveType = GetMoveType(gBattleMons[gBattlerAttacker].moves[moveChecked]); if (moveType == TYPE_MYSTERY) { @@ -12626,7 +12647,7 @@ static void Cmd_tryconversiontypechange(void) { while ((moveChecked = MOD(Random(), MAX_MON_MOVES)) >= validMoves); - moveType = gMovesInfo[gBattleMons[gBattlerAttacker].moves[moveChecked]].type; + moveType = GetMoveType(gBattleMons[gBattlerAttacker].moves[moveChecked]); if (moveType == TYPE_MYSTERY) { @@ -12742,7 +12763,7 @@ static void Cmd_tryKO(void) } else { - u16 odds = gMovesInfo[gCurrentMove].accuracy + (gBattleMons[gBattlerAttacker].level - gBattleMons[gBattlerTarget].level); + u16 odds = GetMoveAccuracy(gCurrentMove) + (gBattleMons[gBattlerAttacker].level - gBattleMons[gBattlerTarget].level); if (B_SHEER_COLD_ACC >= GEN_7 && gCurrentMove == MOVE_SHEER_COLD && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE)) odds -= 10; if (RandomPercentage(RNG_ACCURACY, odds) && gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) @@ -12905,14 +12926,15 @@ static void Cmd_setfocusenergy(void) { CMD_ARGS(u8 battler); u8 battler = GetBattlerForBattleScript(cmd->battler); + u32 effect = GetMoveEffect(gCurrentMove); - if ((gMovesInfo[gCurrentMove].effect == EFFECT_DRAGON_CHEER && (!(IsDoubleBattle()) || (gAbsentBattlerFlags & (1u << battler)))) + if ((effect == EFFECT_DRAGON_CHEER && (!(IsDoubleBattle()) || (gAbsentBattlerFlags & (1u << battler)))) || gBattleMons[battler].status2 & STATUS2_FOCUS_ENERGY_ANY) { gBattleStruct->moveResultFlags[gBattlerTarget] |= MOVE_RESULT_FAILED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FOCUS_ENERGY_FAILED; } - else if (gMovesInfo[gCurrentMove].effect == EFFECT_DRAGON_CHEER && !IS_BATTLER_OF_TYPE(battler, TYPE_DRAGON)) + else if (effect == EFFECT_DRAGON_CHEER && !IS_BATTLER_OF_TYPE(battler, TYPE_DRAGON)) { gBattleMons[battler].status2 |= STATUS2_DRAGON_CHEER; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_GETTING_PUMPED; @@ -12966,8 +12988,9 @@ static void Cmd_transformdataexecution(void) gBattleStruct->overwrittenAbilities[gBattlerAttacker] = GetBattlerAbility(gBattlerTarget); for (i = 0; i < MAX_MON_MOVES; i++) { - if (gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].pp < 5) - gBattleMons[gBattlerAttacker].pp[i] = gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].pp; + u32 pp = GetMovePP(gBattleMons[gBattlerAttacker].moves[i]); + if (pp < 5) + gBattleMons[gBattlerAttacker].pp[i] = pp; else gBattleMons[gBattlerAttacker].pp[i] = 5; } @@ -12986,7 +13009,7 @@ static void Cmd_setsubstitute(void) { CMD_ARGS(); - u32 factor = gMovesInfo[gCurrentMove].effect == EFFECT_SHED_TAIL ? 2 : 4; + u32 factor = GetMoveEffect(gCurrentMove) == EFFECT_SHED_TAIL ? 2 : 4; u32 hp; if (factor == 2) @@ -13025,7 +13048,7 @@ static void Cmd_mimicattackcopy(void) { CMD_ARGS(const u8 *failInstr); - if ((gMovesInfo[gLastMoves[gBattlerTarget]].mimicBanned) + if ((IsMoveMimicBanned(gLastMoves[gBattlerTarget])) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED) || gLastMoves[gBattlerTarget] == MOVE_NONE || gLastMoves[gBattlerTarget] == MOVE_UNAVAILABLE) @@ -13046,8 +13069,9 @@ static void Cmd_mimicattackcopy(void) { gChosenMove = 0xFFFF; gBattleMons[gBattlerAttacker].moves[gCurrMovePos] = gLastMoves[gBattlerTarget]; - if (gMovesInfo[gLastMoves[gBattlerTarget]].pp < 5) - gBattleMons[gBattlerAttacker].pp[gCurrMovePos] = gMovesInfo[gLastMoves[gBattlerTarget]].pp; + u32 pp = GetMovePP(gLastMoves[gBattlerTarget]); + if (pp < 5) + gBattleMons[gBattlerAttacker].pp[gCurrMovePos] = pp; else gBattleMons[gBattlerAttacker].pp[gCurrMovePos] = 5; @@ -13065,8 +13089,8 @@ static void Cmd_mimicattackcopy(void) static bool32 InvalidMetronomeMove(u32 move) { - return gMovesInfo[move].effect == EFFECT_PLACEHOLDER - || gMovesInfo[move].metronomeBanned; + return GetMoveEffect(move) == EFFECT_PLACEHOLDER + || IsMoveMetronomeBanned(move); } static void Cmd_metronome(void) @@ -13096,8 +13120,8 @@ static void Cmd_metronome(void) gCurrentMove = RandomUniformExcept(RNG_METRONOME, 1, moveCount - 1, InvalidMetronomeMove); SetAtkCancellerForCalledMove(); PrepareStringBattle(STRINGID_WAGGLINGAFINGER, gBattlerAttacker); - gBattlescriptCurrInstr = GET_MOVE_BATTLESCRIPT(gCurrentMove); - gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); + gBattlescriptCurrInstr = GetMoveBattleScript(gCurrentMove); + gBattlerTarget = GetBattleMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); } static void Cmd_dmgtolevel(void) @@ -13224,7 +13248,7 @@ static void Cmd_trysetencore(void) } } - if ((gMovesInfo[gLastMoves[gBattlerTarget]].encoreBanned) + if ((IsMoveEncoreBanned(gLastMoves[gBattlerTarget])) || gLastMoves[gBattlerTarget] == MOVE_NONE || gLastMoves[gBattlerTarget] == MOVE_UNAVAILABLE) { @@ -13283,7 +13307,7 @@ static void Cmd_settypetorandomresistance(void) { gBattlescriptCurrInstr = cmd->failInstr; } - else if (gBattleMoveEffects[gMovesInfo[gLastLandedMoves[gBattlerAttacker]].effect].twoTurnEffect + else if (gBattleMoveEffects[GetMoveEffect(gLastLandedMoves[gBattlerAttacker])].twoTurnEffect && gBattleMons[gLastHitBy[gBattlerAttacker]].status2 & STATUS2_MULTIPLETURNS) { gBattlescriptCurrInstr = cmd->failInstr; @@ -13412,7 +13436,7 @@ static void Cmd_copymovepermanently(void) if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED) && gLastPrintedMoves[gBattlerTarget] != MOVE_UNAVAILABLE - && !gMovesInfo[gLastPrintedMoves[gBattlerTarget]].sketchBanned) + && !IsMoveSketchBanned(gLastPrintedMoves[gBattlerTarget])) { s32 i; @@ -13433,7 +13457,7 @@ static void Cmd_copymovepermanently(void) struct MovePpInfo movePpData; gBattleMons[gBattlerAttacker].moves[gCurrMovePos] = gLastPrintedMoves[gBattlerTarget]; - gBattleMons[gBattlerAttacker].pp[gCurrMovePos] = gMovesInfo[gLastPrintedMoves[gBattlerTarget]].pp; + gBattleMons[gBattlerAttacker].pp[gCurrMovePos] = GetMovePP(gLastPrintedMoves[gBattlerTarget]); for (i = 0; i < MAX_MON_MOVES; i++) { @@ -13464,8 +13488,8 @@ static void Cmd_trychoosesleeptalkmove(void) for (i = 0; i < MAX_MON_MOVES; i++) { - if (gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].sleepTalkBanned - || gBattleMoveEffects[gMovesInfo[gBattleMons[gBattlerAttacker].moves[i]].effect].twoTurnEffect) + if (IsMoveSleepTalkBanned(gBattleMons[gBattlerAttacker].moves[i]) + || gBattleMoveEffects[GetMoveEffect(gBattleMons[gBattlerAttacker].moves[i])].twoTurnEffect) { unusableMovesBits |= (1 << (i)); } @@ -13485,7 +13509,7 @@ static void Cmd_trychoosesleeptalkmove(void) movePosition = MOD(Random(), MAX_MON_MOVES); } while ((1u << movePosition) & unusableMovesBits); - if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE && !IS_MOVE_STATUS(gBattleMons[gBattlerAttacker].moves[movePosition])) + if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE && !IsBattleMoveStatus(gBattleMons[gBattlerAttacker].moves[movePosition])) { gBattleStruct->zmove.baseMoves[gBattlerAttacker] = gBattleMons[gBattlerAttacker].moves[movePosition]; gCalledMove = GetTypeBasedZMove(gBattleMons[gBattlerAttacker].moves[movePosition]); @@ -13496,7 +13520,7 @@ static void Cmd_trychoosesleeptalkmove(void) } gCurrMovePos = movePosition; gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); + gBattlerTarget = GetBattleMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); gBattlescriptCurrInstr = cmd->failInstr; } } @@ -13585,7 +13609,7 @@ static void Cmd_tryspiteppreduce(void) { s32 ppToDeduct = B_PP_REDUCED_BY_SPITE >= GEN_4 ? 4 : (Random() & 3) + 2; // G-Max Depletion only deducts 2 PP. - if (IsMaxMove(gCurrentMove) && gMovesInfo[gCurrentMove].argument.maxEffect == MAX_EFFECT_SPITE) + if (IsMaxMove(gCurrentMove) && GetMoveMaxEffect(gCurrentMove) == MAX_EFFECT_SPITE) ppToDeduct = 2; if (gBattleMons[gBattlerTarget].pp[i] < ppToDeduct) @@ -14029,7 +14053,7 @@ static bool32 SetTargetToNextPursuiter(u32 battlerDef) { u32 battler = gBattlerByTurnOrder[i]; if (gChosenActionByBattler[battler] == B_ACTION_USE_MOVE - && gMovesInfo[gChosenMoveByBattler[battler]].effect == EFFECT_PURSUIT + && GetMoveEffect(gChosenMoveByBattler[battler]) == EFFECT_PURSUIT && IsBattlerAlive(battlerDef) && IsBattlerAlive(battler) && GetBattlerSide(battler) != GetBattlerSide(battlerDef) @@ -14310,7 +14334,7 @@ static void Cmd_trydobeatup(void) gBattlescriptCurrInstr = cmd->nextInstr; gBattleStruct->moveDamage[gBattlerTarget] = gSpeciesInfo[GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES)].baseAttack; - gBattleStruct->moveDamage[gBattlerTarget] *= gMovesInfo[gCurrentMove].power; + gBattleStruct->moveDamage[gBattlerTarget] *= GetMovePower(gCurrentMove); gBattleStruct->moveDamage[gBattlerTarget] *= (GetMonData(&party[gBattleCommunication[0]], MON_DATA_LEVEL) * 2 / 5 + 2); gBattleStruct->moveDamage[gBattlerTarget] /= gSpeciesInfo[gBattleMons[gBattlerTarget].species].baseDefense; gBattleStruct->moveDamage[gBattlerTarget] = (gBattleStruct->moveDamage[gBattlerTarget] / 50) + 2; @@ -14335,9 +14359,9 @@ static void Cmd_setsemiinvulnerablebit(void) { CMD_ARGS(bool8 clear); - if (gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].semiInvulnerableEffect == TRUE) + if (gBattleMoveEffects[GetMoveEffect(gCurrentMove)].semiInvulnerableEffect == TRUE) { - u32 semiInvulnerableEffect = UNCOMPRESS_BITS(gMovesInfo[gCurrentMove].argument.twoTurnAttack.status); + u32 semiInvulnerableEffect = GetMoveTwoTurnAttackStatus(gCurrentMove); if (cmd->clear) gStatuses3[gBattlerAttacker] &= ~semiInvulnerableEffect; else @@ -14350,7 +14374,7 @@ static void Cmd_setsemiinvulnerablebit(void) static bool32 CheckIfCanFireTwoTurnMoveNow(u8 battler, bool8 checkChargeTurnEffects) { // Semi-invulnerable moves cannot skip their charge turn (except with Power Herb) - if (gBattleMoveEffects[gMovesInfo[gCurrentMove].effect].semiInvulnerableEffect == TRUE) + if (gBattleMoveEffects[GetMoveEffect(gCurrentMove)].semiInvulnerableEffect == TRUE) return FALSE; // If this move has charge turn effects, it must charge, activate them, then try to fire @@ -14361,7 +14385,7 @@ static bool32 CheckIfCanFireTwoTurnMoveNow(u8 battler, bool8 checkChargeTurnEffe // Certain two-turn moves may fire on the first turn in the right weather (Solar Beam, Electro Shot) // By default, all two-turn moves have the option of adding weather to their argument - if (IsBattlerWeatherAffected(battler, gMovesInfo[gCurrentMove].argument.twoTurnAttack.status)) + if (IsBattlerWeatherAffected(battler, GetMoveTwoTurnAttackWeather(gCurrentMove))) return TRUE; return FALSE; @@ -14432,7 +14456,7 @@ static void Cmd_setforcedtarget(void) gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTimer = 1; gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTarget = gBattlerTarget; - gSideTimers[GetBattlerSide(gBattlerTarget)].followmePowder = gMovesInfo[gCurrentMove].powderMove; + gSideTimers[GetBattlerSide(gBattlerTarget)].followmePowder = IsPowderMove(gCurrentMove); gBattlescriptCurrInstr = cmd->nextInstr; } @@ -14457,8 +14481,8 @@ static void Cmd_callterrainattack(void) gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; gCurrentMove = GetNaturePowerMove(gBattlerAttacker); - gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); - BattleScriptPush(GET_MOVE_BATTLESCRIPT(gCurrentMove)); + gBattlerTarget = GetBattleMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); + BattleScriptPush(GetMoveBattleScript(gCurrentMove)); gBattlescriptCurrInstr = cmd->nextInstr; } @@ -14490,7 +14514,7 @@ static void Cmd_curestatuswithmove(void) CMD_ARGS(const u8 *failInstr); u32 shouldHeal; - if (gMovesInfo[gCurrentMove].effect == EFFECT_REFRESH) + if (GetMoveEffect(gCurrentMove) == EFFECT_REFRESH) shouldHeal = gBattleMons[gBattlerAttacker].status1 & STATUS1_REFRESH; else // Take Heart shouldHeal = gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY; @@ -14715,7 +14739,7 @@ static void Cmd_trycopyability(void) if (gBattleMons[battler].ability == defAbility || defAbility == ABILITY_NONE || gAbilitiesInfo[gBattleMons[battler].ability].cantBeSuppressed - || (IsBattlerAlive(BATTLE_PARTNER(battler)) && gAbilitiesInfo[gBattleMons[BATTLE_PARTNER(battler)].ability].cantBeSuppressed && gMovesInfo[gCurrentMove].effect == EFFECT_DOODLE) + || (IsBattlerAlive(BATTLE_PARTNER(battler)) && gAbilitiesInfo[gBattleMons[BATTLE_PARTNER(battler)].ability].cantBeSuppressed && GetMoveEffect(gCurrentMove) == EFFECT_DOODLE) || gAbilitiesInfo[defAbility].cantBeCopied) { gBattlescriptCurrInstr = cmd->failInstr; @@ -14869,7 +14893,7 @@ static void Cmd_setroom(void) { CMD_ARGS(); - switch (gMovesInfo[gCurrentMove].effect) + switch (GetMoveEffect(gCurrentMove)) { case EFFECT_TRICK_ROOM: HandleRoomMove(STATUS_FIELD_TRICK_ROOM, &gFieldTimers.trickRoomTimer, 0); @@ -15034,7 +15058,7 @@ static void Cmd_assistattackselect(void) { u16 move = GetMonData(&party[monId], MON_DATA_MOVE1 + moveId); - if (gMovesInfo[move].assistBanned) + if (IsMoveAssistBanned(move)) continue; validMoves[chooseableMovesNo++] = move; @@ -15046,7 +15070,7 @@ static void Cmd_assistattackselect(void) { gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; gCalledMove = validMoves[Random() % chooseableMovesNo]; - gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); + gBattlerTarget = GetBattleMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); gBattlescriptCurrInstr = cmd->nextInstr; } else @@ -15155,8 +15179,9 @@ static void Cmd_jumpifnotcurrentmoveargtype(void) u8 battler = GetBattlerForBattleScript(cmd->battler); const u8 *failInstr = cmd->failInstr; + u32 type = GetMoveArgType(gCurrentMove); - if (!IS_BATTLER_OF_TYPE(battler, gMovesInfo[gCurrentMove].argument.type)) + if (!IS_BATTLER_OF_TYPE(battler, type)) gBattlescriptCurrInstr = failInstr; else gBattlescriptCurrInstr = cmd->nextInstr; @@ -15250,7 +15275,7 @@ static void Cmd_settypebasedhalvers(void) bool8 worked = FALSE; - if (gMovesInfo[gCurrentMove].effect == EFFECT_MUD_SPORT) + if (GetMoveEffect(gCurrentMove) == EFFECT_MUD_SPORT) { if (B_SPORT_TURNS >= GEN_6) { @@ -15305,7 +15330,7 @@ bool32 DoesSubstituteBlockMove(u32 battlerAtk, u32 battlerDef, u32 move) { if (!(gBattleMons[battlerDef].status2 & STATUS2_SUBSTITUTE)) return FALSE; - else if (gMovesInfo[move].ignoresSubstitute) + else if (MoveIgnoresSubstitute(move)) return FALSE; else if (GetBattlerAbility(battlerAtk) == ABILITY_INFILTRATOR) return FALSE; @@ -15317,7 +15342,7 @@ bool32 DoesDisguiseBlockMove(u32 battler, u32 move) { if (!(gBattleMons[battler].species == SPECIES_MIMIKYU_DISGUISED || gBattleMons[battler].species == SPECIES_MIMIKYU_TOTEM_DISGUISED) || gBattleMons[battler].status2 & STATUS2_TRANSFORMED - || (!gProtectStructs[battler].confusionSelfDmg && (IS_MOVE_STATUS(move) || gHitMarker & HITMARKER_PASSIVE_DAMAGE)) + || (!gProtectStructs[battler].confusionSelfDmg && (IsBattleMoveStatus(move) || gHitMarker & HITMARKER_PASSIVE_DAMAGE)) || gHitMarker & HITMARKER_IGNORE_DISGUISE || GetBattlerAbility(battler) != ABILITY_DISGUISE) return FALSE; @@ -15416,7 +15441,7 @@ static void Cmd_pursuitdoubles(void) if (IsDoubleBattle() && !(gAbsentBattlerFlags & (1u << battler)) && gChosenActionByBattler[battler] == B_ACTION_USE_MOVE - && gMovesInfo[gChosenMoveByBattler[battler]].effect == EFFECT_PURSUIT) + && GetMoveEffect(gChosenMoveByBattler[battler]) == EFFECT_PURSUIT) { gActionsByTurnOrder[battler] = B_ACTION_TRY_FINISH; gCurrentMove = gChosenMoveByBattler[battler]; @@ -16426,10 +16451,10 @@ static bool32 CriticalCapture(u32 odds) bool32 IsMoveAffectedByParentalBond(u32 move, u32 battler) { if (move != MOVE_NONE && move != MOVE_UNAVAILABLE && move != MOVE_STRUGGLE - && !gMovesInfo[move].parentalBondBanned - && gMovesInfo[move].category != DAMAGE_CATEGORY_STATUS - && gMovesInfo[move].strikeCount < 2 - && gMovesInfo[move].effect != EFFECT_MULTI_HIT) + && !IsMoveParentalBondBanned(move) + && GetMoveCategory(move) != DAMAGE_CATEGORY_STATUS + && GetMoveStrikeCount(move) < 2 + && GetMoveEffect(move) != EFFECT_MULTI_HIT) { if (IsDoubleBattle()) { @@ -16484,9 +16509,11 @@ static bool8 CanBurnHitThaw(u16 move) if (B_BURN_HIT_THAW >= GEN_6) { - for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + u32 numAdditionalEffects = GetMoveAdditionalEffectCount(move); + for (i = 0; i < numAdditionalEffects; i++) { - if (gMovesInfo[move].additionalEffects[i].moveEffect == MOVE_EFFECT_BURN) + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(move, i); + if (additionalEffect->moveEffect == MOVE_EFFECT_BURN) return TRUE; } } @@ -16915,11 +16942,20 @@ void BS_JumpIfElectricAbilityAffected(void) gBattlescriptCurrInstr = cmd->nextInstr; } -void BS_JumpIfArgument(void) +void BS_ApplySaltCure(void) +{ + NATIVE_ARGS(u8 battler); + + u8 battler = GetBattlerForBattleScript(cmd->battler); + gStatuses4[battler] |= STATUS4_SALT_CURE; + gBattlescriptCurrInstr = cmd->nextInstr; +} + +void BS_JumpIfMovePropertyArgument(void) { NATIVE_ARGS(u8 argument, const u8 *jumpInstr); - if (gMovesInfo[gCurrentMove].argument.moveProperty == cmd->argument) + if (GetMoveEffectArg_MoveProperty(gCurrentMove) == cmd->argument) gBattlescriptCurrInstr = cmd->jumpInstr; else gBattlescriptCurrInstr = cmd->nextInstr; @@ -16930,7 +16966,7 @@ void BS_SetRemoveTerrain(void) NATIVE_ARGS(const u8 *jumpInstr); u32 statusFlag = 0; - switch (gMovesInfo[gCurrentMove].effect) + switch (GetMoveEffect(gCurrentMove)) { case EFFECT_MISTY_TERRAIN: statusFlag = STATUS_FIELD_MISTY_TERRAIN; @@ -16949,7 +16985,7 @@ void BS_SetRemoveTerrain(void) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_SET_PSYCHIC; break; case EFFECT_HIT_SET_REMOVE_TERRAIN: - switch (gMovesInfo[gCurrentMove].argument.moveProperty) + switch (GetMoveEffectArg_MoveProperty(gCurrentMove)) { case ARG_SET_PSYCHIC_TERRAIN: // Genesis Supernova statusFlag = STATUS_FIELD_PSYCHIC_TERRAIN; @@ -17138,7 +17174,7 @@ void BS_SetPledge(void) && GetBattlerTurnOrderNum(gBattlerAttacker) < GetBattlerTurnOrderNum(partner) && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gCurrentMove != partnerMove - && gMovesInfo[partnerMove].effect == EFFECT_PLEDGE) + && GetMoveEffect(partnerMove) == EFFECT_PLEDGE) { u32 currPledgeUser = 0; u32 newTurnOrder[] = {0xFF, 0xFF}; @@ -17264,9 +17300,9 @@ void BS_TryHealPulse(void) } else { - if (GetBattlerAbility(gBattlerAttacker) == ABILITY_MEGA_LAUNCHER && gMovesInfo[gCurrentMove].pulseMove) + if (GetBattlerAbility(gBattlerAttacker) == ABILITY_MEGA_LAUNCHER && IsPulseMove(gCurrentMove)) gBattleStruct->moveDamage[gBattlerTarget] = -(GetNonDynamaxMaxHP(gBattlerTarget) * 75 / 100); - else if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && gMovesInfo[gCurrentMove].argument.moveProperty == MOVE_EFFECT_FLORAL_HEALING) + else if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && GetMoveEffectArg_MoveProperty(gCurrentMove) == MOVE_EFFECT_FLORAL_HEALING) gBattleStruct->moveDamage[gBattlerTarget] = -(GetNonDynamaxMaxHP(gBattlerTarget) * 2 / 3); else gBattleStruct->moveDamage[gBattlerTarget] = -(GetNonDynamaxMaxHP(gBattlerTarget) / 2); @@ -17281,13 +17317,13 @@ void BS_TryCopycat(void) { NATIVE_ARGS(const u8 *failInstr); - if (gLastUsedMove == MOVE_NONE || gLastUsedMove == MOVE_UNAVAILABLE || gMovesInfo[gLastUsedMove].copycatBanned || IsZMove(gLastUsedMove)) + if (gLastUsedMove == MOVE_NONE || gLastUsedMove == MOVE_UNAVAILABLE || IsMoveCopycatBanned(gLastUsedMove) || IsZMove(gLastUsedMove)) { gBattlescriptCurrInstr = cmd->failInstr; } else { - if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE && !IS_MOVE_STATUS(gLastUsedMove)) + if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE && !IsBattleMoveStatus(gLastUsedMove)) { gBattleStruct->zmove.baseMoves[gBattlerAttacker] = gLastUsedMove; gCalledMove = GetTypeBasedZMove(gLastUsedMove); @@ -17302,7 +17338,7 @@ void BS_TryCopycat(void) } gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); + gBattlerTarget = GetBattleMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); gBattlescriptCurrInstr = cmd->nextInstr; } } @@ -17333,7 +17369,7 @@ void BS_TryUpperHand(void) if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget) || gChosenMoveByBattler[gBattlerTarget] == MOVE_NONE - || IS_MOVE_STATUS(gChosenMoveByBattler[gBattlerTarget]) + || IsBattleMoveStatus(gChosenMoveByBattler[gBattlerTarget]) || GetChosenMovePriority(gBattlerTarget) < 1 || GetChosenMovePriority(gBattlerTarget) > 3) // Fails if priority is less than 1 or greater than 3, if target already moved, or if using a status gBattlescriptCurrInstr = cmd->failInstr; else @@ -17387,9 +17423,10 @@ void BS_AllySwitchFailChance(void) void BS_SetPhotonGeyserCategory(void) { NATIVE_ARGS(); - if (!((gMovesInfo[gCurrentMove].effect == EFFECT_TERA_BLAST && GetActiveGimmick(gBattlerAttacker) != GIMMICK_TERA) - || (gMovesInfo[gCurrentMove].effect == EFFECT_TERA_STARSTORM && GetActiveGimmick(gBattlerAttacker) != GIMMICK_TERA && gBattleMons[gBattlerAttacker].species == SPECIES_TERAPAGOS_STELLAR))) - gBattleStruct->swapDamageCategory = (GetCategoryBasedOnStats(gBattlerAttacker) != gMovesInfo[gCurrentMove].category); + u32 effect = GetMoveEffect(gCurrentMove); + if (!((effect == EFFECT_TERA_BLAST && GetActiveGimmick(gBattlerAttacker) != GIMMICK_TERA) + || (effect == EFFECT_TERA_STARSTORM && GetActiveGimmick(gBattlerAttacker) != GIMMICK_TERA && gBattleMons[gBattlerAttacker].species == SPECIES_TERAPAGOS_STELLAR))) + gBattleStruct->swapDamageCategory = (GetCategoryBasedOnStats(gBattlerAttacker) != GetMoveCategory(gCurrentMove)); gBattlescriptCurrInstr = cmd->nextInstr; } @@ -17696,7 +17733,7 @@ void BS_JumpIfBlockedBySoundproof(void) { NATIVE_ARGS(u8 battler, const u8 *jumpInstr); u32 battler = GetBattlerForBattleScript(cmd->battler); - if (gMovesInfo[gCurrentMove].soundMove && GetBattlerAbility(battler) == ABILITY_SOUNDPROOF) + if (IsSoundMove(gCurrentMove) && GetBattlerAbility(battler) == ABILITY_SOUNDPROOF) { gLastUsedAbility = ABILITY_SOUNDPROOF; gBattlescriptCurrInstr = cmd->jumpInstr; diff --git a/src/battle_tower.c b/src/battle_tower.c index 6f80823b9857..9eda82f1b5fb 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -1590,7 +1590,7 @@ void CreateFacilityMon(const struct TrainerMon *fmon, u16 level, u8 fixedIV, u32 move = MOVE_FRUSTRATION; SetMonMoveSlot(dst, move, j); - if (gMovesInfo[move].effect == EFFECT_FRUSTRATION) + if (GetMoveEffect(move) == EFFECT_FRUSTRATION) friendship = 0; // Frustration is more powerful the lower the pokemon's friendship is. } @@ -1758,39 +1758,6 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount) } } -// Probably an early draft before the 'CreateApprenticeMon' was written. -static void UNUSED Unused_CreateApprenticeMons(u16 trainerId, u8 firstMonId) -{ - s32 i, j; - u8 friendship = MAX_FRIENDSHIP; - u8 level = 0; - u8 fixedIV = 0; - struct Apprentice *apprentice = &gSaveBlock2Ptr->apprentices[0]; - - if (apprentice->numQuestions < 5) - fixedIV = 6; - else - fixedIV = 9; - - if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) - level = FRONTIER_MAX_LEVEL_OPEN; - else - level = FRONTIER_MAX_LEVEL_50; - - for (i = 0; i != FRONTIER_PARTY_SIZE; i++) - { - CreateMonWithEVSpread(&gEnemyParty[firstMonId + i], apprentice->party[i].species, level, fixedIV, 8); - friendship = MAX_FRIENDSHIP; - for (j = 0; j < MAX_MON_MOVES; j++) - { - if (gMovesInfo[apprentice->party[i].moves[j]].effect == EFFECT_FRUSTRATION) - friendship = 0; - } - SetMonData(&gEnemyParty[firstMonId + i], MON_DATA_FRIENDSHIP, &friendship); - SetMonData(&gEnemyParty[firstMonId + i], MON_DATA_HELD_ITEM, &apprentice->party[i].item); - } -} - u16 GetRandomFrontierMonFromSet(u16 trainerId) { u8 level = SetFacilityPtrsGetLevel(); diff --git a/src/battle_tv.c b/src/battle_tv.c index b03eee1ca9b3..e5be946d8170 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -774,7 +774,7 @@ void BattleTv_SetDataBasedOnMove(u16 move, u16 weatherFlags, struct DisableStruc tvPtr->side[atkSide].wishMonId = gBattlerPartyIndexes[gBattlerAttacker] + 1; tvPtr->side[atkSide].wishMoveSlot = moveSlot; } - if (gMovesInfo[move].effect == EFFECT_EXPLOSION) + if (GetMoveEffect(move) == EFFECT_EXPLOSION) { tvPtr->side[atkSide ^ BIT_SIDE].explosionMonId = gBattlerPartyIndexes[gBattlerAttacker] + 1; tvPtr->side[atkSide ^ BIT_SIDE].explosionMoveSlot = moveSlot; @@ -782,10 +782,11 @@ void BattleTv_SetDataBasedOnMove(u16 move, u16 weatherFlags, struct DisableStruc tvPtr->side[atkSide ^ BIT_SIDE].explosion = TRUE; } - AddMovePoints(PTS_REFLECT, move, gMovesInfo[move].power, 0); - AddMovePoints(PTS_LIGHT_SCREEN, move, gMovesInfo[move].power, 0); - AddMovePoints(PTS_WATER_SPORT, move, 0, 0); - AddMovePoints(PTS_MUD_SPORT, move, 0, 0); + u32 movePower = GetMovePower(move); + AddMovePoints(PTS_REFLECT, move, movePower, 0); + AddMovePoints(PTS_LIGHT_SCREEN, move, movePower, 0); + AddMovePoints(PTS_WATER_SPORT, move, 0, 0); + AddMovePoints(PTS_MUD_SPORT, move, 0, 0); } void BattleTv_SetDataBasedOnAnimation(u8 animationId) @@ -928,10 +929,10 @@ static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3) { case PTS_MOVE_EFFECT: // arg1 -> move slot, arg2 -> move { - u8 baseFromEffect = gBattleMoveEffects[gMovesInfo[arg2].effect].battleTvScore; + u8 baseFromEffect = gBattleMoveEffects[GetMoveEffect(arg2)].battleTvScore; // Various cases to add/remove points - if (gMovesInfo[arg2].recoil > 0) + if (GetMoveRecoil(arg2) > 0) baseFromEffect++; // Recoil moves if (MoveHasAdditionalEffect(arg2, MOVE_EFFECT_RAPID_SPIN)) baseFromEffect++; @@ -1006,7 +1007,7 @@ static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3) #define power arg2 case PTS_WATER_SPORT: // If used fire move during Water Sport - if (tvPtr->pos[defSide][0].waterSportMonId != -(tvPtr->pos[defSide][1].waterSportMonId) && gMovesInfo[move].type == TYPE_FIRE) + if (tvPtr->pos[defSide][0].waterSportMonId != -(tvPtr->pos[defSide][1].waterSportMonId) && GetMoveType(move) == TYPE_FIRE) { if (tvPtr->pos[defSide][0].waterSportMonId != 0) { @@ -1022,7 +1023,7 @@ static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3) break; case PTS_MUD_SPORT: // If used Electric move during Mud Sport - if (tvPtr->pos[defSide][0].mudSportMonId != -(tvPtr->pos[defSide][1].mudSportMonId) && gMovesInfo[move].type == TYPE_ELECTRIC) + if (tvPtr->pos[defSide][0].mudSportMonId != -(tvPtr->pos[defSide][1].mudSportMonId) && GetMoveType(move) == TYPE_ELECTRIC) { if (tvPtr->pos[defSide][0].mudSportMonId != 0) { @@ -1038,7 +1039,7 @@ static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3) break; case PTS_REFLECT: // If hit Reflect with damaging physical move - if (IS_MOVE_PHYSICAL(move) && power != 0 && tvPtr->side[defSide].reflectMonId != 0) + if (IsBattleMovePhysical(move) && power != 0 && tvPtr->side[defSide].reflectMonId != 0) { u32 id = (tvPtr->side[defSide].reflectMonId - 1) * 4; movePoints->points[defSide][id + tvPtr->side[defSide].reflectMoveSlot] += sPointsArray[caseId][0]; @@ -1046,7 +1047,7 @@ static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3) break; case PTS_LIGHT_SCREEN: // If hit Light Screen with damaging special move - if (IS_MOVE_SPECIAL(move) && power != 0 && tvPtr->side[defSide].lightScreenMonId != 0) + if (IsBattleMoveSpecial(move) && power != 0 && tvPtr->side[defSide].lightScreenMonId != 0) { u32 id = (tvPtr->side[defSide].lightScreenMonId - 1) * 4; movePoints->points[defSide][id + tvPtr->side[defSide].lightScreenMoveSlot] += sPointsArray[caseId][0]; @@ -1227,7 +1228,7 @@ static void TrySetBattleSeminarShow(void) return; else if (gBattleTypeFlags & (BATTLE_TYPE_PALACE | BATTLE_TYPE_PIKE | BATTLE_TYPE_PYRAMID)) return; - else if (IS_MOVE_STATUS(gBattleMons[gBattlerAttacker].moves[gMoveSelectionCursor[gBattlerAttacker]])) + else if (IsBattleMoveStatus(gBattleMons[gBattlerAttacker].moves[gMoveSelectionCursor[gBattlerAttacker]])) return; i = 0; @@ -1254,7 +1255,7 @@ static void TrySetBattleSeminarShow(void) damageCalcData.battlerAtk = gBattlerAttacker; damageCalcData.battlerDef = gBattlerTarget; damageCalcData.move = gCurrentMove; - damageCalcData.moveType = gMovesInfo[gCurrentMove].type; + damageCalcData.moveType = GetMoveType(gCurrentMove); damageCalcData.isCrit = FALSE; damageCalcData.randomFactor = FALSE; damageCalcData.updateFlags = FALSE; @@ -1296,7 +1297,7 @@ static void TrySetBattleSeminarShow(void) static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride) { - if (IS_MOVE_STATUS(moveId)) + if (IsBattleMoveStatus(moveId)) { *dmg = 0; return FALSE; diff --git a/src/battle_util.c b/src/battle_util.c index 67c1d30cb85d..fd264e4606b9 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -112,15 +112,15 @@ static u8 CalcBeatUpPower(void) bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move) { u32 ability = GetBattlerAbility(battlerAtk); + u32 effect = GetMoveEffect(move); if (gSideTimers[defSide].followmeTimer == 0 || !IsBattlerAlive(gSideTimers[defSide].followmeTarget) - || gMovesInfo[move].effect == EFFECT_SNIPE_SHOT - || gMovesInfo[move].effect == EFFECT_SKY_DROP + || effect == EFFECT_SNIPE_SHOT || effect == EFFECT_SKY_DROP || ability == ABILITY_PROPELLER_TAIL || ability == ABILITY_STALWART) return FALSE; - if (gMovesInfo[move].effect == EFFECT_PURSUIT && gBattleStruct->pursuitTarget) + if (effect == EFFECT_PURSUIT && gBattleStruct->pursuitTarget) return FALSE; if (gSideTimers[defSide].followmePowder && !IsAffectedByPowder(battlerAtk, ability, GetBattlerHoldEffect(battlerAtk, TRUE))) @@ -158,7 +158,7 @@ void HandleAction_UseMove(void) gProtectStructs[gBattlerAttacker].noValidMoves = FALSE; gCurrentMove = gChosenMove = MOVE_STRUGGLE; gHitMarker |= HITMARKER_NO_PPDEDUCT; - *(gBattleStruct->moveTarget + gBattlerAttacker) = GetMoveTarget(MOVE_STRUGGLE, NO_TARGET_OVERRIDE); + *(gBattleStruct->moveTarget + gBattlerAttacker) = GetBattleMoveTarget(MOVE_STRUGGLE, NO_TARGET_OVERRIDE); } else if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS || gBattleMons[gBattlerAttacker].status2 & STATUS2_RECHARGE) { @@ -170,7 +170,7 @@ void HandleAction_UseMove(void) { gCurrentMove = gChosenMove = gDisableStructs[gBattlerAttacker].encoredMove; gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos; - *(gBattleStruct->moveTarget + gBattlerAttacker) = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); + *(gBattleStruct->moveTarget + gBattlerAttacker) = GetBattleMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); } // check if the encored move wasn't overwritten else if (GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE && gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE @@ -181,12 +181,12 @@ void HandleAction_UseMove(void) gDisableStructs[gBattlerAttacker].encoredMove = MOVE_NONE; gDisableStructs[gBattlerAttacker].encoredMovePos = 0; gDisableStructs[gBattlerAttacker].encoreTimer = 0; - *(gBattleStruct->moveTarget + gBattlerAttacker) = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); + *(gBattleStruct->moveTarget + gBattlerAttacker) = GetBattleMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); } else if (gBattleMons[gBattlerAttacker].moves[gCurrMovePos] != gChosenMoveByBattler[gBattlerAttacker]) { gCurrentMove = gChosenMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos]; - *(gBattleStruct->moveTarget + gBattlerAttacker) = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); + *(gBattleStruct->moveTarget + gBattlerAttacker) = GetBattleMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); } else { @@ -203,22 +203,23 @@ void HandleAction_UseMove(void) // Set dynamic move type. SetTypeBeforeUsingMove(gChosenMove, gBattlerAttacker); - moveType = GetMoveType(gCurrentMove); + moveType = GetBattleMoveType(gCurrentMove); // check Z-Move used - if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE && !IS_MOVE_STATUS(gCurrentMove) && !IsZMove(gCurrentMove)) + if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE && !IsBattleMoveStatus(gCurrentMove) && !IsZMove(gCurrentMove)) { - gBattleStruct->categoryOverride = gMovesInfo[gCurrentMove].category; + gBattleStruct->categoryOverride = GetMoveCategory(gCurrentMove); gCurrentMove = gChosenMove = GetUsableZMove(gBattlerAttacker, gCurrentMove); } // check Max Move used else if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_DYNAMAX) { - gBattleStruct->categoryOverride = gMovesInfo[gCurrentMove].category; + gBattleStruct->categoryOverride = GetMoveCategory(gCurrentMove); gCurrentMove = gChosenMove = GetMaxMove(gBattlerAttacker, gCurrentMove); } moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); + u32 moveEffect = GetMoveEffect(gCurrentMove); // choose target side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker)); @@ -231,7 +232,7 @@ void HandleAction_UseMove(void) else if (IsDoubleBattle() && gSideTimers[side].followmeTimer == 0 && !(gBattleStruct->pursuitTarget & (1u << *(gBattleStruct->moveTarget + gBattlerAttacker))) - && (!IS_MOVE_STATUS(gCurrentMove) || (moveTarget != MOVE_TARGET_USER && moveTarget != MOVE_TARGET_ALL_BATTLERS)) + && (!IsBattleMoveStatus(gCurrentMove) || (moveTarget != MOVE_TARGET_USER && moveTarget != MOVE_TARGET_ALL_BATTLERS)) && ((GetBattlerAbility(*(gBattleStruct->moveTarget + gBattlerAttacker)) != ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC) || (GetBattlerAbility(*(gBattleStruct->moveTarget + gBattlerAttacker)) != ABILITY_STORM_DRAIN && moveType == TYPE_WATER))) { @@ -243,8 +244,8 @@ void HandleAction_UseMove(void) && ((GetBattlerAbility(battler) == ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC) || (GetBattlerAbility(battler) == ABILITY_STORM_DRAIN && moveType == TYPE_WATER)) && GetBattlerTurnOrderNum(battler) < var - && gMovesInfo[gCurrentMove].effect != EFFECT_SNIPE_SHOT - && gMovesInfo[gCurrentMove].effect != EFFECT_PLEDGE + && moveEffect != EFFECT_SNIPE_SHOT + && moveEffect != EFFECT_PLEDGE && GetBattlerAbility(gBattlerAttacker) != ABILITY_PROPELLER_TAIL && GetBattlerAbility(gBattlerAttacker) != ABILITY_STALWART) { @@ -356,7 +357,7 @@ void HandleAction_UseMove(void) } else { - gBattlescriptCurrInstr = GET_MOVE_BATTLESCRIPT(gCurrentMove); + gBattlescriptCurrInstr = GetMoveBattleScript(gCurrentMove); } if (gBattleTypeFlags & BATTLE_TYPE_ARENA) @@ -691,11 +692,11 @@ void HandleAction_ActionFinished(void) | HITMARKER_CHARGING | HITMARKER_NEVER_SET | HITMARKER_IGNORE_DISGUISE); // check if Stellar type boost should be used up - moveType = GetMoveType(gCurrentMove); + moveType = GetBattleMoveType(gCurrentMove); if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_TERA && GetBattlerTeraType(gBattlerAttacker) == TYPE_STELLAR - && gMovesInfo[gCurrentMove].category != DAMAGE_CATEGORY_STATUS + && GetMoveCategory(gCurrentMove) != DAMAGE_CATEGORY_STATUS && IsTypeStellarBoosted(gBattlerAttacker, moveType)) { ExpendTypeStellarBoost(gBattlerAttacker, moveType); @@ -1104,7 +1105,7 @@ static bool32 IsGravityPreventingMove(u32 move) if (!(gFieldStatuses & STATUS_FIELD_GRAVITY)) return FALSE; - return gMovesInfo[move].gravityBanned; + return IsMoveGravityBanned(move); } bool32 IsHealBlockPreventingMove(u32 battler, u32 move) @@ -1112,12 +1113,12 @@ bool32 IsHealBlockPreventingMove(u32 battler, u32 move) if (!(gStatuses3[battler] & STATUS3_HEAL_BLOCK)) return FALSE; - return gMovesInfo[move].healingMove; + return IsHealingMove(move); } bool32 IsBelchPreventingMove(u32 battler, u32 move) { - if (gMovesInfo[move].effect != EFFECT_BELCH) + if (GetMoveEffect(move) != EFFECT_BELCH) return FALSE; return !(gBattleStruct->ateBerry[battler & BIT_SIDE] & (1u << gBattlerPartyIndexes[battler])); @@ -1133,6 +1134,7 @@ u32 TrySetCantSelectMoveBattleScript(u32 battler) u32 move = gBattleMons[battler].moves[moveId]; u32 holdEffect = GetBattlerHoldEffect(battler, TRUE); u16 *choicedMove = &gBattleStruct->choicedMove[battler]; + u32 moveEffect = GetMoveEffect(move); if (DYNAMAX_BYPASS_CHECK && GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE && gDisableStructs[battler].disabledMove == move && move != MOVE_NONE) { @@ -1165,7 +1167,7 @@ u32 TrySetCantSelectMoveBattleScript(u32 battler) } } - if (GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE && gDisableStructs[battler].tauntTimer != 0 && IS_MOVE_STATUS(move)) + if (GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE && gDisableStructs[battler].tauntTimer != 0 && IsBattleMoveStatus(move)) { if ((GetActiveGimmick(gBattlerAttacker) == GIMMICK_DYNAMAX)) gCurrentMove = MOVE_MAX_GUARD; @@ -1183,7 +1185,7 @@ u32 TrySetCantSelectMoveBattleScript(u32 battler) } } - if (DYNAMAX_BYPASS_CHECK && GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE && gDisableStructs[battler].throatChopTimer != 0 && gMovesInfo[move].soundMove) + if (DYNAMAX_BYPASS_CHECK && GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE && gDisableStructs[battler].throatChopTimer != 0 && IsSoundMove(move)) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1258,7 +1260,7 @@ u32 TrySetCantSelectMoveBattleScript(u32 battler) } } - if (DYNAMAX_BYPASS_CHECK && gMovesInfo[move].effect == EFFECT_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[battler].item) != POCKET_BERRIES) + if (DYNAMAX_BYPASS_CHECK && moveEffect == EFFECT_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[battler].item) != POCKET_BERRIES) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1273,7 +1275,7 @@ u32 TrySetCantSelectMoveBattleScript(u32 battler) } } - if (gMovesInfo[move].cantUseTwice && move == gLastResultingMoves[battler]) + if (MoveCantBeUsedTwice(move) && move == gLastResultingMoves[battler]) { gCurrentMove = move; PREPARE_MOVE_BUFFER(gBattleTextBuff1, gCurrentMove); @@ -1305,7 +1307,7 @@ u32 TrySetCantSelectMoveBattleScript(u32 battler) limitations++; } } - else if (holdEffect == HOLD_EFFECT_ASSAULT_VEST && IS_MOVE_STATUS(move) && gMovesInfo[move].effect != EFFECT_ME_FIRST) + else if (holdEffect == HOLD_EFFECT_ASSAULT_VEST && IsBattleMoveStatus(move) && moveEffect != EFFECT_ME_FIRST) { if ((GetActiveGimmick(gBattlerAttacker) == GIMMICK_DYNAMAX)) gCurrentMove = MOVE_MAX_GUARD; @@ -1353,7 +1355,7 @@ u32 TrySetCantSelectMoveBattleScript(u32 battler) } } - if (gMovesInfo[move].effect == EFFECT_PLACEHOLDER) + if (moveEffect == EFFECT_PLACEHOLDER) { if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { @@ -1382,7 +1384,7 @@ u8 CheckMoveLimitations(u32 battler, u8 unusableMoves, u16 check) for (i = 0; i < MAX_MON_MOVES; i++) { move = gBattleMons[battler].moves[i]; - moveEffect = gMovesInfo[move].effect; + moveEffect = GetMoveEffect(move); // No move if (check & MOVE_LIMITATION_ZEROMOVE && move == MOVE_NONE) unusableMoves |= 1u << i; @@ -1399,7 +1401,7 @@ u8 CheckMoveLimitations(u32 battler, u8 unusableMoves, u16 check) else if (check & MOVE_LIMITATION_TORMENTED && move == gLastMoves[battler] && gBattleMons[battler].status2 & STATUS2_TORMENT) unusableMoves |= 1u << i; // Taunt - else if (check & MOVE_LIMITATION_TAUNT && gDisableStructs[battler].tauntTimer && IS_MOVE_STATUS(move)) + else if (check & MOVE_LIMITATION_TAUNT && gDisableStructs[battler].tauntTimer && IsBattleMoveStatus(move)) unusableMoves |= 1u << i; // Imprison else if (check & MOVE_LIMITATION_IMPRISON && GetImprisonedMovesCount(battler, move)) @@ -1411,7 +1413,7 @@ u8 CheckMoveLimitations(u32 battler, u8 unusableMoves, u16 check) else if (check & MOVE_LIMITATION_CHOICE_ITEM && HOLD_EFFECT_CHOICE(holdEffect) && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move) unusableMoves |= 1u << i; // Assault Vest - else if (check & MOVE_LIMITATION_ASSAULT_VEST && holdEffect == HOLD_EFFECT_ASSAULT_VEST && IS_MOVE_STATUS(move) && gMovesInfo[move].effect != EFFECT_ME_FIRST) + else if (check & MOVE_LIMITATION_ASSAULT_VEST && holdEffect == HOLD_EFFECT_ASSAULT_VEST && IsBattleMoveStatus(move) && moveEffect != EFFECT_ME_FIRST) unusableMoves |= 1u << i; // Gravity else if (check & MOVE_LIMITATION_GRAVITY && IsGravityPreventingMove(move)) @@ -1423,7 +1425,7 @@ u8 CheckMoveLimitations(u32 battler, u8 unusableMoves, u16 check) else if (check & MOVE_LIMITATION_BELCH && IsBelchPreventingMove(battler, move)) unusableMoves |= 1u << i; // Throat Chop - else if (check & MOVE_LIMITATION_THROAT_CHOP && gDisableStructs[battler].throatChopTimer && gMovesInfo[move].soundMove) + else if (check & MOVE_LIMITATION_THROAT_CHOP && gDisableStructs[battler].throatChopTimer && IsSoundMove(move)) unusableMoves |= 1u << i; // Stuff Cheeks else if (check & MOVE_LIMITATION_STUFF_CHEEKS && moveEffect == EFFECT_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[battler].item) != POCKET_BERRIES) @@ -1432,7 +1434,7 @@ u8 CheckMoveLimitations(u32 battler, u8 unusableMoves, u16 check) else if (check & MOVE_LIMITATION_CHOICE_ITEM && GetBattlerAbility(battler) == ABILITY_GORILLA_TACTICS && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move) unusableMoves |= 1u << i; // Can't Use Twice flag - else if (check & MOVE_LIMITATION_CANT_USE_TWICE && gMovesInfo[move].cantUseTwice && move == gLastResultingMoves[battler]) + else if (check & MOVE_LIMITATION_CANT_USE_TWICE && MoveCantBeUsedTwice(move) && move == gLastResultingMoves[battler]) unusableMoves |= 1u << i; } return unusableMoves; @@ -3222,7 +3224,7 @@ static void CancellerAsleep(u32 *effect) static void CancellerFrozen(u32 *effect) { - if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE && !(gMovesInfo[gCurrentMove].thawsUser)) + if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE && !MoveThawsUser(gCurrentMove)) { if (!RandomPercentage(RNG_FROZEN, 20)) { @@ -3284,7 +3286,7 @@ static void CancellerObedience(u32 *effect) gCalledMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos]; SetAtkCancellerForCalledMove(); gBattlescriptCurrInstr = BattleScript_IgnoresAndUsesRandomMove; - gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); + gBattlerTarget = GetBattleMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); gHitMarker |= HITMARKER_DISOBEDIENT_MOVE; gHitMarker |= HITMARKER_OBEYS; break; @@ -3385,7 +3387,7 @@ static void CancellerGravity(u32 *effect) static void CancellerThroatChop(u32 *effect) { - if (GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE && gDisableStructs[gBattlerAttacker].throatChopTimer && gMovesInfo[gCurrentMove].soundMove) + if (GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE && gDisableStructs[gBattlerAttacker].throatChopTimer && IsSoundMove(gCurrentMove)) { gProtectStructs[gBattlerAttacker].usedThroatChopPreventedMove = TRUE; CancelMultiTurnMoves(gBattlerAttacker); @@ -3397,7 +3399,7 @@ static void CancellerThroatChop(u32 *effect) static void CancellerTaunted(u32 *effect) { - if (GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE && gDisableStructs[gBattlerAttacker].tauntTimer && IS_MOVE_STATUS(gCurrentMove)) + if (GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE && gDisableStructs[gBattlerAttacker].tauntTimer && IsBattleMoveStatus(gCurrentMove)) { gProtectStructs[gBattlerAttacker].usedTauntedMove = TRUE; CancelMultiTurnMoves(gBattlerAttacker); @@ -3496,7 +3498,7 @@ static void CancellerBide(u32 *effect) gCurrentMove = MOVE_BIDE; gBattlerTarget = gBideTarget[gBattlerAttacker]; if (gAbsentBattlerFlags & (1u << gBattlerTarget)) - gBattlerTarget = GetMoveTarget(MOVE_BIDE, MOVE_TARGET_SELECTED + 1); + gBattlerTarget = GetBattleMoveTarget(MOVE_BIDE, MOVE_TARGET_SELECTED + 1); gBattlescriptCurrInstr = BattleScript_BideAttack; } else @@ -3521,7 +3523,7 @@ static void CancellerThaw(u32 *effect) } *effect = 2; } - if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FROSTBITE && gMovesInfo[gCurrentMove].thawsUser) + if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FROSTBITE && MoveThawsUser(gCurrentMove)) { if (!(IsMoveEffectRemoveSpeciesType(gCurrentMove, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE))) { @@ -3542,9 +3544,9 @@ static void CancellerStanceChangeTwo(u32 *effect) static void CancellerWeatherPrimal(u32 *effect) { - if (WEATHER_HAS_EFFECT && gMovesInfo[gCurrentMove].power) + if (WEATHER_HAS_EFFECT && GetMovePower(gCurrentMove) > 0) { - u32 moveType = GetMoveType(gCurrentMove); + u32 moveType = GetBattleMoveType(gCurrentMove); if (moveType == TYPE_FIRE && (gBattleWeather & B_WEATHER_RAIN_PRIMAL)) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PRIMAL_WEATHER_FIZZLED_BY_RAIN; @@ -3577,7 +3579,7 @@ static void CancellerDynamaxBlocked(u32 *effect) static void CancellerPowderMove(u32 *effect) { - if ((gMovesInfo[gCurrentMove].powderMove) && (gBattlerAttacker != gBattlerTarget)) + if (IsPowderMove(gCurrentMove) && (gBattlerAttacker != gBattlerTarget)) { if (B_POWDER_GRASS >= GEN_6 && (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_GRASS) || GetBattlerAbility(gBattlerTarget) == ABILITY_OVERCOAT)) @@ -3602,7 +3604,7 @@ static void CancellerPowderStatus(u32 *effect) if (gBattleMons[gBattlerAttacker].status2 & STATUS2_POWDER) { u32 partnerMove = gBattleMons[BATTLE_PARTNER(gBattlerAttacker)].moves[gBattleStruct->chosenMovePositions[BATTLE_PARTNER(gBattlerAttacker)]]; - if ((GetMoveType(gCurrentMove) == TYPE_FIRE && !gBattleStruct->pledgeMove) + if ((GetBattleMoveType(gCurrentMove) == TYPE_FIRE && !gBattleStruct->pledgeMove) || (gCurrentMove == MOVE_FIRE_PLEDGE && partnerMove == MOVE_GRASS_PLEDGE) || (gCurrentMove == MOVE_GRASS_PLEDGE && partnerMove == MOVE_FIRE_PLEDGE && gBattleStruct->pledgeMove)) { @@ -3622,7 +3624,7 @@ static void CancellerPowderStatus(u32 *effect) static void CancellerProtean(u32 *effect) { - u32 moveType = GetMoveType(gCurrentMove); + u32 moveType = GetBattleMoveType(gCurrentMove); if (ProteanTryChangeType(gBattlerAttacker, GetBattlerAbility(gBattlerAttacker), gCurrentMove, moveType)) { if (B_PROTEAN_LIBERO == GEN_9) @@ -3642,8 +3644,8 @@ static void CancellerPsychicTerrain(u32 *effect) if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN && IsBattlerGrounded(gBattlerTarget) && GetChosenMovePriority(gBattlerAttacker) > 0 - && gMovesInfo[gCurrentMove].target != MOVE_TARGET_ALL_BATTLERS - && gMovesInfo[gCurrentMove].target != MOVE_TARGET_OPPONENTS_FIELD + && GetMoveTarget(gCurrentMove) != MOVE_TARGET_ALL_BATTLERS + && GetMoveTarget(gCurrentMove) != MOVE_TARGET_OPPONENTS_FIELD && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget)) { CancelMultiTurnMoves(gBattlerAttacker); @@ -3656,8 +3658,8 @@ static void CancellerPsychicTerrain(u32 *effect) static void CancellerExplodingDamp(u32 *effect) { u32 dampBattler = IsAbilityOnField(ABILITY_DAMP); - if (dampBattler && (gMovesInfo[gCurrentMove].effect == EFFECT_EXPLOSION - || gMovesInfo[gCurrentMove].effect == EFFECT_MIND_BLOWN)) + if (dampBattler && (GetMoveEffect(gCurrentMove) == EFFECT_EXPLOSION + || GetMoveEffect(gCurrentMove) == EFFECT_MIND_BLOWN)) { gBattleScripting.battler = dampBattler - 1; gBattlescriptCurrInstr = BattleScript_DampStopsExplosion; @@ -3668,7 +3670,7 @@ static void CancellerExplodingDamp(u32 *effect) static void CancellerMultihitMoves(u32 *effect) { - if (gMovesInfo[gCurrentMove].effect == EFFECT_MULTI_HIT) + if (GetMoveEffect(gCurrentMove) == EFFECT_MULTI_HIT) { u32 ability = GetBattlerAbility(gBattlerAttacker); @@ -3689,17 +3691,17 @@ static void CancellerMultihitMoves(u32 *effect) PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) } - else if (gMovesInfo[gCurrentMove].strikeCount > 1) + else if (GetMoveStrikeCount(gCurrentMove) > 1) { - if (gMovesInfo[gCurrentMove].effect == EFFECT_POPULATION_BOMB && GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LOADED_DICE) + if (GetMoveEffect(gCurrentMove) == EFFECT_POPULATION_BOMB && GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LOADED_DICE) { gMultiHitCounter = RandomUniform(RNG_LOADED_DICE, 4, 10); } else { - gMultiHitCounter = gMovesInfo[gCurrentMove].strikeCount; + gMultiHitCounter = GetMoveStrikeCount(gCurrentMove); - if (gMovesInfo[gCurrentMove].effect == EFFECT_DRAGON_DARTS + if (GetMoveEffect(gCurrentMove) == EFFECT_DRAGON_DARTS && CanTargetPartner(gBattlerAttacker, gBattlerTarget) && TargetFullyImmuneToCurrMove(gBattlerAttacker, gBattlerTarget)) gBattlerTarget = BATTLE_PARTNER(gBattlerTarget); @@ -3707,7 +3709,7 @@ static void CancellerMultihitMoves(u32 *effect) PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 3, 0) } - else if (B_BEAT_UP >= GEN_5 && gMovesInfo[gCurrentMove].effect == EFFECT_BEAT_UP) + else if (B_BEAT_UP >= GEN_5 && GetMoveEffect(gCurrentMove) == EFFECT_BEAT_UP) { struct Pokemon* party = GetBattlerParty(gBattlerAttacker); int i; @@ -3750,7 +3752,7 @@ static void CancellerZMoves(u32 *effect) gBattlescriptCurrInstr = BattleScript_ZMoveActivatePowder; } } - else if (gMovesInfo[gCurrentMove].category == DAMAGE_CATEGORY_STATUS) + else if (GetMoveCategory(gCurrentMove) == DAMAGE_CATEGORY_STATUS) { if (!alreadyUsed) { @@ -3789,7 +3791,7 @@ static void CancellerMultiTargetMoves(u32 *effect) gBattleStruct->noResultString[battlerDef] = TRUE; } else if (AbilityBattleEffects(ABILITYEFFECT_WOULD_BLOCK, battlerDef, 0, 0, 0) - || (IsBattlerTerrainAffected(gBattlerAttacker, STATUS_FIELD_PSYCHIC_TERRAIN) && GetMovePriority(gBattlerAttacker, gCurrentMove) > 0)) + || (IsBattlerTerrainAffected(gBattlerAttacker, STATUS_FIELD_PSYCHIC_TERRAIN) && GetBattleMovePriority(gBattlerAttacker, gCurrentMove) > 0)) { gBattleStruct->moveResultFlags[battlerDef] = 0; gBattleStruct->noResultString[battlerDef] = TRUE; @@ -3801,7 +3803,7 @@ static void CancellerMultiTargetMoves(u32 *effect) } else { - CalcTypeEffectivenessMultiplier(gCurrentMove, gMovesInfo[gCurrentMove].type, gBattlerAttacker, battlerDef, GetBattlerAbility(battlerDef), TRUE); + CalcTypeEffectivenessMultiplier(gCurrentMove, GetMoveType(gCurrentMove), gBattlerAttacker, battlerDef, GetBattlerAbility(battlerDef), TRUE); } } if (moveTarget == MOVE_TARGET_BOTH) @@ -4089,7 +4091,7 @@ static void ForewarnChooseMove(u32 battler) continue; data[count].moveId = gBattleMons[i].moves[j]; data[count].battler = i; - switch (gMovesInfo[data[count].moveId].effect) + switch (GetMoveEffect(data[count].moveId)) { case EFFECT_OHKO: data[count].power = 150; @@ -4100,12 +4102,15 @@ static void ForewarnChooseMove(u32 battler) data[count].power = 120; break; default: - if (gMovesInfo[data[count].moveId].power == 1) + { + u32 movePower = GetMovePower(data[count].moveId); + if (movePower == 1) data[count].power = 80; else - data[count].power = gMovesInfo[data[count].moveId].power; + data[count].power = movePower; break; } + } count++; } } @@ -4225,11 +4230,11 @@ u32 CanAbilityBlockMove(u32 battlerAtk, u32 battlerDef, u32 move, u32 abilityDef switch (abilityDef) { case ABILITY_SOUNDPROOF: - if (gMovesInfo[move].soundMove && !(GetBattlerMoveTargetType(battlerAtk, move) & MOVE_TARGET_USER)) + if (IsSoundMove(move) && !(GetBattlerMoveTargetType(battlerAtk, move) & MOVE_TARGET_USER)) effect = MOVE_BLOCKED_BY_SOUNDPROOF_OR_BULLETPROOF; break; case ABILITY_BULLETPROOF: - if (gMovesInfo[move].ballisticMove) + if (IsBallisticMove(move)) effect = MOVE_BLOCKED_BY_SOUNDPROOF_OR_BULLETPROOF; break; case ABILITY_DAZZLING: @@ -4237,13 +4242,13 @@ u32 CanAbilityBlockMove(u32 battlerAtk, u32 battlerDef, u32 move, u32 abilityDef case ABILITY_ARMOR_TAIL: if (GetBattlerSide(battlerAtk) != GetBattlerSide(battlerDef)) { - u32 priority = AI_DATA->aiCalcInProgress ? GetMovePriority(battlerAtk, move) : GetChosenMovePriority(battlerAtk); + u32 priority = AI_DATA->aiCalcInProgress ? GetBattleMovePriority(battlerAtk, move) : GetChosenMovePriority(battlerAtk); if (priority > 0) effect = MOVE_BLOCKED_BY_DAZZLING; } break; case ABILITY_GOOD_AS_GOLD: - if (IS_MOVE_STATUS(move)) + if (IsBattleMoveStatus(move)) { u32 moveTarget = GetBattlerMoveTargetType(battlerAtk, move); if (!(moveTarget & MOVE_TARGET_OPPONENTS_FIELD) && !(moveTarget & MOVE_TARGET_ALL_BATTLERS)) @@ -4267,7 +4272,7 @@ u32 CanPartnerAbilityBlockMove(u32 battlerAtk, u32 battlerDef, u32 move, u32 abi case ABILITY_ARMOR_TAIL: if (GetBattlerSide(battlerAtk) != GetBattlerSide(battlerDef)) { - s32 priority = AI_DATA->aiCalcInProgress ? GetMovePriority(battlerAtk, move) : GetChosenMovePriority(battlerAtk); + s32 priority = AI_DATA->aiCalcInProgress ? GetBattleMovePriority(battlerAtk, move) : GetChosenMovePriority(battlerAtk); if (priority > 0) return MOVE_BLOCKED_BY_PARTNER_DAZZLING; } @@ -4286,7 +4291,7 @@ u32 CanAbilityAbsorbMove(u32 battlerAtk, u32 battlerDef, u32 abilityDef, u32 mov effect = MOVE_ABSORBED_BY_NO_ABILITY; break; case ABILITY_VOLT_ABSORB: - if (moveType == TYPE_ELECTRIC && gMovesInfo[move].target != MOVE_TARGET_ALL_BATTLERS) + if (moveType == TYPE_ELECTRIC && GetMoveTarget(move) != MOVE_TARGET_ALL_BATTLERS) effect = MOVE_ABSORBED_BY_DRAIN_HP_ABILITY; break; case ABILITY_WATER_ABSORB: @@ -4299,11 +4304,11 @@ u32 CanAbilityAbsorbMove(u32 battlerAtk, u32 battlerDef, u32 abilityDef, u32 mov effect = MOVE_ABSORBED_BY_DRAIN_HP_ABILITY; break; case ABILITY_MOTOR_DRIVE: - if (moveType == TYPE_ELECTRIC && gMovesInfo[move].target != MOVE_TARGET_ALL_BATTLERS) // Potential bug in singles (might be solved with simu hp reudction) + if (moveType == TYPE_ELECTRIC && GetMoveTarget(move) != MOVE_TARGET_ALL_BATTLERS) // Potential bug in singles (might be solved with simu hp reudction) effect = MOVE_ABSORBED_BY_STAT_INCREASE_ABILITY; break; case ABILITY_LIGHTNING_ROD: - if (B_REDIRECT_ABILITY_IMMUNITY >= GEN_5 && moveType == TYPE_ELECTRIC && gMovesInfo[move].target != MOVE_TARGET_ALL_BATTLERS) // Potential bug in singles (might be solved with simu hp reudction) + if (B_REDIRECT_ABILITY_IMMUNITY >= GEN_5 && moveType == TYPE_ELECTRIC && GetMoveTarget(move) != MOVE_TARGET_ALL_BATTLERS) // Potential bug in singles (might be solved with simu hp reudction) effect = MOVE_ABSORBED_BY_STAT_INCREASE_ABILITY; break; case ABILITY_STORM_DRAIN: @@ -4319,7 +4324,7 @@ u32 CanAbilityAbsorbMove(u32 battlerAtk, u32 battlerDef, u32 abilityDef, u32 mov effect = MOVE_ABSORBED_BY_STAT_INCREASE_ABILITY; break; case ABILITY_WIND_RIDER: - if (gMovesInfo[move].windMove && !(GetBattlerMoveTargetType(battlerAtk, move) & MOVE_TARGET_USER)) + if (IsWindMove(move) && !(GetBattlerMoveTargetType(battlerAtk, move) & MOVE_TARGET_USER)) effect = MOVE_ABSORBED_BY_STAT_INCREASE_ABILITY; break; case ABILITY_FLASH_FIRE: @@ -4393,7 +4398,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 else move = gCurrentMove; - moveType = GetMoveType(move); + moveType = GetBattleMoveType(move); switch (caseID) { @@ -4749,7 +4754,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 for (j = 0; j < MAX_MON_MOVES; j++) { move = gBattleMons[i].moves[j]; - moveType = GetMoveType(move); + moveType = GetBattleMoveType(move); if (CalcTypeEffectivenessMultiplier(move, moveType, i, battler, ABILITY_ANTICIPATION, FALSE) >= UQ_4_12(2.0)) { effect++; @@ -5490,7 +5495,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 default: if (GetChosenMovePriority(gBattlerAttacker) > 0 && BlocksPrankster(move, gBattlerAttacker, gBattlerTarget, TRUE) - && !(IS_MOVE_STATUS(move) && (gLastUsedAbility == ABILITY_MAGIC_BOUNCE || gProtectStructs[gBattlerTarget].bounceMove))) + && !(IsBattleMoveStatus(move) && (gLastUsedAbility == ABILITY_MAGIC_BOUNCE || gProtectStructs[gBattlerTarget].bounceMove))) { if (!IsDoubleBattle() || !(GetBattlerMoveTargetType(gBattlerAttacker, move) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) @@ -5705,11 +5710,11 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 if (MoveResultHasEffect(battler) && IsBattlerTurnDamaged(gBattlerTarget) && IsBattlerAlive(battler) - && IS_MOVE_PHYSICAL(gCurrentMove) + && IsBattleMovePhysical(gCurrentMove) && (CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN) // Don't activate if both Speed and Defense cannot be raised. || CompareStat(battler, STAT_DEF, MIN_STAT_STAGE, CMP_GREATER_THAN))) { - if (gMovesInfo[gCurrentMove].effect == EFFECT_HIT_ESCAPE && CanBattlerSwitch(gBattlerAttacker)) + if (GetMoveEffect(gCurrentMove) == EFFECT_HIT_ESCAPE && CanBattlerSwitch(gBattlerAttacker)) gProtectStructs[battler].disableEjectPack = TRUE; // Set flag for target BattleScriptPushCursor(); @@ -5801,7 +5806,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 case ABILITY_COLOR_CHANGE: if (MoveResultHasEffect(battler) && move != MOVE_STRUGGLE - && !IS_MOVE_STATUS(move) + && !IsBattleMoveStatus(move) && IsBattlerTurnDamaged(gBattlerTarget) && !IS_BATTLER_OF_TYPE(battler, moveType) && moveType != TYPE_STELLAR @@ -6162,7 +6167,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 } break; case ABILITY_WIND_POWER: - if (!(gMovesInfo[gCurrentMove].windMove)) + if (!IsWindMove(gCurrentMove)) break; // fall through case ABILITY_ELECTROMORPHOSIS: @@ -6180,7 +6185,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 if (MoveResultHasEffect(gBattlerTarget) && (!gBattleStruct->isSkyBattle) && !gProtectStructs[gBattlerAttacker].confusionSelfDmg - && IS_MOVE_PHYSICAL(gCurrentMove) + && IsBattleMovePhysical(gCurrentMove) && IsBattlerTurnDamaged(gBattlerTarget) && (gSideTimers[GetBattlerSide(gBattlerAttacker)].toxicSpikesAmount != 2)) { @@ -6274,7 +6279,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 { case ABILITY_DANCER: if (IsBattlerAlive(battler) - && (gMovesInfo[gCurrentMove].danceMove) + && IsDanceMove(gCurrentMove) && !gSpecialStatuses[battler].dancerUsedMove && gBattlerAttacker != battler) { @@ -6620,12 +6625,12 @@ bool32 IsMoldBreakerTypeAbility(u32 battler, u32 ability) return FALSE; return (ability == ABILITY_MOLD_BREAKER || ability == ABILITY_TERAVOLT || ability == ABILITY_TURBOBLAZE - || (ability == ABILITY_MYCELIUM_MIGHT && IS_MOVE_STATUS(gCurrentMove))); + || (ability == ABILITY_MYCELIUM_MIGHT && IsBattleMoveStatus(gCurrentMove))); } static inline bool32 CanBreakThroughAbility(u32 battlerAtk, u32 battlerDef, u32 ability) { - return ((IsMoldBreakerTypeAbility(battlerAtk, ability) || gMovesInfo[gCurrentMove].ignoresTargetAbility) + return ((IsMoldBreakerTypeAbility(battlerAtk, ability) || MoveIgnoresTargetAbility(gCurrentMove)) && battlerDef != battlerAtk && gAbilitiesInfo[gBattleMons[battlerDef].ability].breakable && gBattlerByTurnOrder[gCurrentTurnActionNumber] == battlerAtk @@ -8130,7 +8135,7 @@ u32 ItemBattleEffects(enum ItemEffect caseID, u32 battler, bool32 moveTurn) if (gBattleStruct->moveDamage[battler] != 0 // Need to have done damage && MoveResultHasEffect(gBattlerTarget) && IsBattlerTurnDamaged(gBattlerTarget) - && !gMovesInfo[gCurrentMove].ignoresKingsRock + && !MoveIgnoresKingsRock(gCurrentMove) && gBattleMons[gBattlerTarget].hp && RandomPercentage(RNG_HOLD_EFFECT_FLINCH, atkHoldEffectParam) && ability != ABILITY_STENCH) @@ -8200,7 +8205,7 @@ u32 ItemBattleEffects(enum ItemEffect caseID, u32 battler, bool32 moveTurn) case HOLD_EFFECT_THROAT_SPRAY: // Does NOT need to be a damaging move if (gProtectStructs[gBattlerAttacker].targetAffected && IsBattlerAlive(gBattlerAttacker) - && gMovesInfo[gCurrentMove].soundMove + && IsSoundMove(gCurrentMove) && CompareStat(gBattlerAttacker, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN) && !NoAliveMonsForEitherParty()) // Don't activate if battle will end { @@ -8217,7 +8222,7 @@ u32 ItemBattleEffects(enum ItemEffect caseID, u32 battler, bool32 moveTurn) case ITEMEFFECT_TARGET: if (MoveResultHasEffect(gBattlerTarget)) { - moveType = GetMoveType(gCurrentMove); + moveType = GetBattleMoveType(gCurrentMove); switch (battlerHoldEffect) { case HOLD_EFFECT_AIR_BALLOON: @@ -8306,7 +8311,7 @@ u32 ItemBattleEffects(enum ItemEffect caseID, u32 battler, bool32 moveTurn) if (IsBattlerAlive(battler) && IsBattlerTurnDamaged(gBattlerTarget) && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) - && IS_MOVE_PHYSICAL(gCurrentMove) + && IsBattleMovePhysical(gCurrentMove) && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) { gBattleStruct->moveDamage[gBattlerAttacker] = GetNonDynamaxMaxHP(gBattlerAttacker) / 8; @@ -8326,7 +8331,7 @@ u32 ItemBattleEffects(enum ItemEffect caseID, u32 battler, bool32 moveTurn) if (IsBattlerAlive(battler) && IsBattlerTurnDamaged(gBattlerTarget) && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) - && IS_MOVE_SPECIAL(gCurrentMove) + && IsBattleMoveSpecial(gCurrentMove) && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) { gBattleStruct->moveDamage[gBattlerAttacker] = GetNonDynamaxMaxHP(gBattlerAttacker) / 8; @@ -8350,7 +8355,7 @@ u32 ItemBattleEffects(enum ItemEffect caseID, u32 battler, bool32 moveTurn) break; case HOLD_EFFECT_CURE_STATUS: // only Toxic Chain's interaction with Knock Off case HOLD_EFFECT_CURE_PSN: - if (gBattleMons[battler].status1 & STATUS1_PSN_ANY && !UnnerveOn(battler, gLastUsedItem) && GetBattlerAbility(gBattlerAttacker) == ABILITY_TOXIC_CHAIN && gMovesInfo[gCurrentMove].effect == EFFECT_KNOCK_OFF) + if (gBattleMons[battler].status1 & STATUS1_PSN_ANY && !UnnerveOn(battler, gLastUsedItem) && GetBattlerAbility(gBattlerAttacker) == ABILITY_TOXIC_CHAIN && GetMoveEffect(gCurrentMove) == EFFECT_KNOCK_OFF) { gBattleScripting.battler = battler; gBattleMons[battler].status1 &= ~(STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER); @@ -8496,11 +8501,11 @@ u32 SetRandomTarget(u32 battlerAtk) return target; } -u32 GetMoveTarget(u16 move, u8 setTarget) +u32 GetBattleMoveTarget(u16 move, u8 setTarget) { u8 targetBattler = 0; u32 moveTarget, side; - u32 moveType = GetMoveType(move); + u32 moveType = GetBattleMoveType(move); if (setTarget != NO_TARGET_OVERRIDE) moveTarget = setTarget - 1; @@ -8637,7 +8642,8 @@ u8 GetAttackerObedienceForAction() // is not obedient if (gCurrentMove == MOVE_RAGE) gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_RAGE; - if (gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP && (gMovesInfo[gCurrentMove].effect == EFFECT_SNORE || gMovesInfo[gCurrentMove].effect == EFFECT_SLEEP_TALK)) + u32 moveEffect = GetMoveEffect(gCurrentMove); + if (gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP && (moveEffect == EFFECT_SNORE || moveEffect == EFFECT_SLEEP_TALK)) return DISOBEYS_WHILE_ASLEEP; calc = (levelReferenced + obedienceLevel) * ((rnd >> 8) & 255) >> 8; @@ -8725,14 +8731,14 @@ bool32 IsMoveMakingContact(u32 move, u32 battlerAtk) { u32 atkHoldEffect = GetBattlerHoldEffect(battlerAtk, TRUE); - if (!gMovesInfo[move].makesContact) + if (!MoveMakesContact(move)) { - if (gMovesInfo[move].effect == EFFECT_SHELL_SIDE_ARM && gBattleStruct->shellSideArmCategory[battlerAtk][gBattlerTarget] == DAMAGE_CATEGORY_PHYSICAL) + if (GetMoveEffect(move) == EFFECT_SHELL_SIDE_ARM && gBattleStruct->shellSideArmCategory[battlerAtk][gBattlerTarget] == DAMAGE_CATEGORY_PHYSICAL) return TRUE; else return FALSE; } - else if ((atkHoldEffect == HOLD_EFFECT_PUNCHING_GLOVE && gMovesInfo[move].punchingMove) + else if ((atkHoldEffect == HOLD_EFFECT_PUNCHING_GLOVE && IsPunchingMove(move)) || GetBattlerAbility(battlerAtk) == ABILITY_LONG_REACH) { return FALSE; @@ -8748,7 +8754,7 @@ bool32 IsBattlerProtected(u32 battlerAtk, u32 battlerDef, u32 move) bool32 isProtected = FALSE; if ((IsZMove(move) || IsMaxMove(move)) - && (!gProtectStructs[battlerDef].maxGuarded || gMovesInfo[move].argument.maxEffect == MAX_EFFECT_BYPASS_PROTECT)) + && (!gProtectStructs[battlerDef].maxGuarded || GetMoveMaxEffect(move) == MAX_EFFECT_BYPASS_PROTECT)) isProtected = FALSE; // Z-Moves and Max Moves bypass protection (except Max Guard). else if (gProtectStructs[battlerDef].maxGuarded && IsMoveBlockedByMaxGuard(move)) isProtected = TRUE; @@ -8756,9 +8762,9 @@ bool32 IsBattlerProtected(u32 battlerAtk, u32 battlerDef, u32 move) && IsMoveMakingContact(move, gBattlerAttacker) && GetBattlerAbility(gBattlerAttacker) == ABILITY_UNSEEN_FIST) isProtected = FALSE; - else if (gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_CRAFTY_SHIELD && IS_MOVE_STATUS(move) && gMovesInfo[move].effect != EFFECT_COACHING) + else if (gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_CRAFTY_SHIELD && IsBattleMoveStatus(move) && GetMoveEffect(move) != EFFECT_COACHING) isProtected = TRUE; - else if (gMovesInfo[move].ignoresProtect) + else if (MoveIgnoresProtect(move)) isProtected = FALSE; else if (gProtectStructs[battlerDef].protected) isProtected = TRUE; @@ -8769,11 +8775,11 @@ bool32 IsBattlerProtected(u32 battlerAtk, u32 battlerDef, u32 move) isProtected = TRUE; else if (gProtectStructs[battlerDef].burningBulwarked) isProtected = TRUE; - else if ((gProtectStructs[battlerDef].obstructed || gProtectStructs[battlerDef].silkTrapped) && !IS_MOVE_STATUS(move)) + else if ((gProtectStructs[battlerDef].obstructed || gProtectStructs[battlerDef].silkTrapped) && !IsBattleMoveStatus(move)) isProtected = TRUE; else if (gProtectStructs[battlerDef].spikyShielded) isProtected = TRUE; - else if (gProtectStructs[battlerDef].kingsShielded && !IS_MOVE_STATUS(move)) + else if (gProtectStructs[battlerDef].kingsShielded && !IsBattleMoveStatus(move)) isProtected = TRUE; else if (gProtectStructs[battlerDef].maxGuarded) isProtected = TRUE; @@ -8781,7 +8787,7 @@ bool32 IsBattlerProtected(u32 battlerAtk, u32 battlerDef, u32 move) && GetChosenMovePriority(gBattlerAttacker) > 0) isProtected = TRUE; else if (gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_MAT_BLOCK - && !IS_MOVE_STATUS(move)) + && !IsBattleMoveStatus(move)) isProtected = TRUE; else isProtected = FALSE; @@ -9047,7 +9053,7 @@ static inline u32 CalcMoveBasePower(struct DamageCalculationData *damageCalcData u32 move = damageCalcData->move; u32 i; - u32 basePower = gMovesInfo[move].power; + u32 basePower = GetMovePower(move); u32 weight, hpFraction, speed; if (GetActiveGimmick(battlerAtk) == GIMMICK_Z_MOVE) @@ -9056,7 +9062,7 @@ static inline u32 CalcMoveBasePower(struct DamageCalculationData *damageCalcData if (GetActiveGimmick(battlerAtk) == GIMMICK_DYNAMAX) return GetMaxMovePower(move); - switch (gMovesInfo[move].effect) + switch (GetMoveEffect(move)) { case EFFECT_PLEDGE: if (gBattleStruct->pledgeMove) @@ -9096,7 +9102,7 @@ static inline u32 CalcMoveBasePower(struct DamageCalculationData *damageCalcData basePower = gBattleStruct->presentBasePower; break; case EFFECT_TRIPLE_KICK: - basePower *= 1 + gMovesInfo[move].strikeCount - gMultiHitCounter; + basePower *= 1 + GetMoveStrikeCount(move) - gMultiHitCounter; break; case EFFECT_SPIT_UP: basePower = 100 * gDisableStructs[battlerAtk].stockpileCounter; @@ -9121,8 +9127,8 @@ static inline u32 CalcMoveBasePower(struct DamageCalculationData *damageCalcData break; case EFFECT_DOUBLE_POWER_ON_ARG_STATUS: // Comatose targets treated as if asleep - if ((gBattleMons[battlerDef].status1 | (STATUS1_SLEEP * (abilityDef == ABILITY_COMATOSE))) & gMovesInfo[move].argument.status - && !((gMovesInfo[move].additionalEffects->moveEffect == MOVE_EFFECT_REMOVE_STATUS) && DoesSubstituteBlockMove(battlerAtk, battlerDef, move))) + if ((gBattleMons[battlerDef].status1 | (STATUS1_SLEEP * (abilityDef == ABILITY_COMATOSE))) & GetMoveEffectArg_Status(move) + && !((GetMoveAdditionalEffectById(move, 0)->moveEffect == MOVE_EFFECT_REMOVE_STATUS) && DoesSubstituteBlockMove(battlerAtk, battlerDef, move))) { basePower *= 2; } @@ -9210,7 +9216,7 @@ static inline u32 CalcMoveBasePower(struct DamageCalculationData *damageCalcData case EFFECT_ROUND: for (i = 0; i < gBattlersCount; i++) { - if (i != battlerAtk && IsBattlerAlive(i) && gMovesInfo[gLastUsedMove].effect == EFFECT_ROUND) + if (i != battlerAtk && IsBattlerAlive(i) && GetMoveEffect(gLastUsedMove) == EFFECT_ROUND) { basePower *= 2; break; @@ -9218,7 +9224,7 @@ static inline u32 CalcMoveBasePower(struct DamageCalculationData *damageCalcData } break; case EFFECT_FUSION_COMBO: - if (gMovesInfo[gLastUsedMove].effect == EFFECT_FUSION_COMBO && move != gLastUsedMove) + if (GetMoveEffect(gLastUsedMove) == EFFECT_FUSION_COMBO && move != gLastUsedMove) basePower *= 2; break; case EFFECT_LASH_OUT: @@ -9316,13 +9322,14 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData * u32 battlerDef = damageCalcData->battlerDef; u32 move = damageCalcData->move; u32 moveType = damageCalcData->moveType; + u32 moveEffect = GetMoveEffect(move); uq4_12_t holdEffectModifier; uq4_12_t modifier = UQ_4_12(1.0); u32 atkSide = GetBattlerSide(battlerAtk); // move effect - switch (gMovesInfo[move].effect) + switch (moveEffect) { case EFFECT_FACADE: if (gBattleMons[battlerAtk].status1 & (STATUS1_BURN | STATUS1_PSN_ANY | STATUS1_PARALYSIS | STATUS1_FROSTBITE)) @@ -9390,19 +9397,19 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData * modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_FLARE_BOOST: - if (gBattleMons[battlerAtk].status1 & STATUS1_BURN && IS_MOVE_SPECIAL(move)) + if (gBattleMons[battlerAtk].status1 & STATUS1_BURN && IsBattleMoveSpecial(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_TOXIC_BOOST: - if (gBattleMons[battlerAtk].status1 & STATUS1_PSN_ANY && IS_MOVE_PHYSICAL(move)) + if (gBattleMons[battlerAtk].status1 & STATUS1_PSN_ANY && IsBattleMovePhysical(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_RECKLESS: - if (IS_MOVE_RECOIL(move)) + if (IsBattleMoveRecoil(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); break; case ABILITY_IRON_FIST: - if (gMovesInfo[move].punchingMove) + if (IsPunchingMove(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); break; case ABILITY_SHEER_FORCE: @@ -9429,11 +9436,11 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData * modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); break; case ABILITY_STRONG_JAW: - if (gMovesInfo[move].bitingMove) + if (IsBitingMove(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_MEGA_LAUNCHER: - if (gMovesInfo[move].pulseMove) + if (IsPulseMove(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_WATER_BUBBLE: @@ -9465,7 +9472,7 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData * modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); break; case ABILITY_PUNK_ROCK: - if (gMovesInfo[move].soundMove) + if (IsSoundMove(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); break; case ABILITY_STEELY_SPIRIT: @@ -9473,7 +9480,7 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData * modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_SHARPNESS: - if (gMovesInfo[move].slicingMove) + if (IsSlicingMove(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_SUPREME_OVERLORD: @@ -9497,7 +9504,7 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData * switch (GetBattlerAbility(BATTLE_PARTNER(battlerAtk))) { case ABILITY_BATTERY: - if (IS_MOVE_SPECIAL(move)) + if (IsBattleMoveSpecial(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); break; case ABILITY_POWER_SPOT: @@ -9530,7 +9537,7 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData * { u8 defHighestStat = GetHighestStatId(battlerDef); if (((weather & B_WEATHER_SUN && WEATHER_HAS_EFFECT) || gBattleStruct->boosterEnergyActivates & (1u << battlerDef)) - && ((IS_MOVE_PHYSICAL(move) && defHighestStat == STAT_DEF) || (IS_MOVE_SPECIAL(move) && defHighestStat == STAT_SPDEF)) + && ((IsBattleMovePhysical(move) && defHighestStat == STAT_DEF) || (IsBattleMoveSpecial(move) && defHighestStat == STAT_SPDEF)) && !(gBattleMons[battlerDef].status2 & STATUS2_TRANSFORMED)) modifier = uq4_12_multiply(modifier, UQ_4_12(0.7)); } @@ -9539,7 +9546,7 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData * { u8 defHighestStat = GetHighestStatId(battlerDef); if ((gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN || gBattleStruct->boosterEnergyActivates & (1u << battlerDef)) - && ((IS_MOVE_PHYSICAL(move) && defHighestStat == STAT_DEF) || (IS_MOVE_SPECIAL(move) && defHighestStat == STAT_SPDEF)) + && ((IsBattleMovePhysical(move) && defHighestStat == STAT_DEF) || (IsBattleMoveSpecial(move) && defHighestStat == STAT_SPDEF)) && !(gBattleMons[battlerDef].status2 & STATUS2_TRANSFORMED)) modifier = uq4_12_multiply(modifier, UQ_4_12(0.7)); } @@ -9556,11 +9563,11 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData * switch (holdEffectAtk) { case HOLD_EFFECT_MUSCLE_BAND: - if (IS_MOVE_PHYSICAL(move)) + if (IsBattleMovePhysical(move)) modifier = uq4_12_multiply(modifier, uq4_12_add(UQ_4_12(1.0), PercentToUQ4_12_Floored(holdEffectParamAtk))); break; case HOLD_EFFECT_WISE_GLASSES: - if (IS_MOVE_SPECIAL(move)) + if (IsBattleMoveSpecial(move)) modifier = uq4_12_multiply(modifier, uq4_12_add(UQ_4_12(1.0), PercentToUQ4_12_Floored(holdEffectParamAtk))); break; case HOLD_EFFECT_LUSTROUS_ORB: @@ -9578,7 +9585,7 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData * case HOLD_EFFECT_SOUL_DEW: if ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) && ((B_SOUL_DEW_BOOST >= GEN_7 && (moveType == TYPE_PSYCHIC || moveType == TYPE_DRAGON)) - || (B_SOUL_DEW_BOOST < GEN_7 && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER) && IS_MOVE_SPECIAL(move)))) + || (B_SOUL_DEW_BOOST < GEN_7 && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER) && IsBattleMoveSpecial(move)))) modifier = uq4_12_multiply(modifier, holdEffectModifier); break; case HOLD_EFFECT_BUG_POWER: @@ -9614,7 +9621,7 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData * modifier = uq4_12_multiply(modifier, holdEffectModifier); break; case HOLD_EFFECT_PUNCHING_GLOVE: - if (gMovesInfo[move].punchingMove) + if (IsPunchingMove(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.1)); break; case HOLD_EFFECT_OGERPON_MASK: @@ -9628,9 +9635,9 @@ static inline u32 CalcMoveBasePowerAfterModifiers(struct DamageCalculationData * && (moveType == GetBattlerTeraType(battlerAtk) || (GetBattlerTeraType(battlerAtk) == TYPE_STELLAR && IsTypeStellarBoosted(battlerAtk, moveType))) && uq4_12_multiply_by_int_half_down(modifier, basePower) < 60 - && gMovesInfo[move].strikeCount < 2 - && gMovesInfo[move].effect != EFFECT_MULTI_HIT - && gMovesInfo[move].priority == 0) + && GetMoveStrikeCount(move) < 2 + && moveEffect != EFFECT_MULTI_HIT + && GetMovePriority(move) == 0) { return 60; } @@ -9648,12 +9655,13 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u u32 battlerDef = damageCalcData->battlerDef; u32 move = damageCalcData->move; u32 moveType = damageCalcData->moveType; + u32 moveEffect = GetMoveEffect(move); atkBaseSpeciesId = GET_BASE_SPECIES_ID(gBattleMons[battlerAtk].species); - if (gMovesInfo[move].effect == EFFECT_FOUL_PLAY) + if (moveEffect == EFFECT_FOUL_PLAY) { - if (IS_MOVE_PHYSICAL(move)) + if (IsBattleMovePhysical(move)) { atkStat = gBattleMons[battlerDef].attack; atkStage = gBattleMons[battlerDef].statStages[STAT_ATK]; @@ -9664,9 +9672,9 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u atkStage = gBattleMons[battlerDef].statStages[STAT_SPATK]; } } - else if (gMovesInfo[move].effect == EFFECT_BODY_PRESS) + else if (moveEffect == EFFECT_BODY_PRESS) { - if (IS_MOVE_PHYSICAL(move)) + if (IsBattleMovePhysical(move)) { atkStat = gBattleMons[battlerAtk].defense; // Edge case: Body Press used during Wonder Room. For some reason, it still uses Defense over Sp.Def, but uses Sp.Def stat changes @@ -9683,7 +9691,7 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u } else { - if (IS_MOVE_PHYSICAL(move)) + if (IsBattleMovePhysical(move)) { atkStat = gBattleMons[battlerAtk].attack; atkStage = gBattleMons[battlerAtk].statStages[STAT_ATK]; @@ -9713,7 +9721,7 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u { case ABILITY_HUGE_POWER: case ABILITY_PURE_POWER: - if (IS_MOVE_PHYSICAL(move)) + if (IsBattleMovePhysical(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); break; case ABILITY_SLOW_START: @@ -9721,7 +9729,7 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.5)); break; case ABILITY_SOLAR_POWER: - if (IS_MOVE_SPECIAL(move) && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN)) + if (IsBattleMoveSpecial(move) && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); break; case ABILITY_DEFEATIST: @@ -9749,7 +9757,7 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); break; case ABILITY_PLUS: - if (IS_MOVE_SPECIAL(move) && IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) + if (IsBattleMoveSpecial(move) && IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) { u32 partnerAbility = GetBattlerAbility(BATTLE_PARTNER(battlerAtk)); if (partnerAbility == ABILITY_MINUS @@ -9758,7 +9766,7 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u } break; case ABILITY_MINUS: - if (IS_MOVE_SPECIAL(move) && IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) + if (IsBattleMoveSpecial(move) && IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) { u32 partnerAbility = GetBattlerAbility(BATTLE_PARTNER(battlerAtk)); if (partnerAbility == ABILITY_PLUS @@ -9767,11 +9775,11 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u } break; case ABILITY_FLOWER_GIFT: - if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move)) + if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN) && IsBattleMovePhysical(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); break; case ABILITY_HUSTLE: - if (IS_MOVE_PHYSICAL(move)) + if (IsBattleMovePhysical(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); break; case ABILITY_STAKEOUT: @@ -9779,7 +9787,7 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); break; case ABILITY_GUTS: - if (gBattleMons[battlerAtk].status1 & STATUS1_ANY && IS_MOVE_PHYSICAL(move)) + if (gBattleMons[battlerAtk].status1 & STATUS1_ANY && IsBattleMovePhysical(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); break; case ABILITY_TRANSISTOR: @@ -9796,7 +9804,7 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_GORILLA_TACTICS: - if (IS_MOVE_PHYSICAL(move)) + if (IsBattleMovePhysical(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_ROCKY_PAYLOAD: @@ -9809,7 +9817,7 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u u32 atkHighestStat = GetHighestStatId(battlerAtk); if (((weather & B_WEATHER_SUN) && WEATHER_HAS_EFFECT) || gBattleStruct->boosterEnergyActivates & (1u << battlerAtk)) { - if ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK)) + if ((IsBattleMovePhysical(move) && atkHighestStat == STAT_ATK) || (IsBattleMoveSpecial(move) && atkHighestStat == STAT_SPATK)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); } } @@ -9820,17 +9828,17 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u u32 atkHighestStat = GetHighestStatId(battlerAtk); if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN || gBattleStruct->boosterEnergyActivates & (1u << battlerAtk)) { - if ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK)) + if ((IsBattleMovePhysical(move) && atkHighestStat == STAT_ATK) || (IsBattleMoveSpecial(move) && atkHighestStat == STAT_SPATK)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); } } break; case ABILITY_ORICHALCUM_PULSE: - if ((weather & B_WEATHER_SUN) && WEATHER_HAS_EFFECT && IS_MOVE_PHYSICAL(move)) + if ((weather & B_WEATHER_SUN) && WEATHER_HAS_EFFECT && IsBattleMovePhysical(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.3333)); break; case ABILITY_HADRON_ENGINE: - if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && IS_MOVE_SPECIAL(move)) + if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && IsBattleMoveSpecial(move)) modifier = uq4_12_multiply(modifier, UQ_4_12(1.3333)); break; } @@ -9854,49 +9862,49 @@ static inline u32 CalcAttackStat(struct DamageCalculationData *damageCalcData, u switch (GetBattlerAbility(BATTLE_PARTNER(battlerAtk))) { case ABILITY_FLOWER_GIFT: - if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerAtk), B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move)) + if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerAtk), B_WEATHER_SUN) && IsBattleMovePhysical(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); break; } } // field abilities - if (IsAbilityOnField(ABILITY_VESSEL_OF_RUIN) && atkAbility != ABILITY_VESSEL_OF_RUIN && IS_MOVE_SPECIAL(move)) + if (IsAbilityOnField(ABILITY_VESSEL_OF_RUIN) && atkAbility != ABILITY_VESSEL_OF_RUIN && IsBattleMoveSpecial(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.75)); - if (IsAbilityOnField(ABILITY_TABLETS_OF_RUIN) && atkAbility != ABILITY_TABLETS_OF_RUIN && IS_MOVE_PHYSICAL(move)) + if (IsAbilityOnField(ABILITY_TABLETS_OF_RUIN) && atkAbility != ABILITY_TABLETS_OF_RUIN && IsBattleMovePhysical(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(0.75)); // attacker's hold effect switch (holdEffectAtk) { case HOLD_EFFECT_THICK_CLUB: - if ((atkBaseSpeciesId == SPECIES_CUBONE || atkBaseSpeciesId == SPECIES_MAROWAK) && IS_MOVE_PHYSICAL(move)) + if ((atkBaseSpeciesId == SPECIES_CUBONE || atkBaseSpeciesId == SPECIES_MAROWAK) && IsBattleMovePhysical(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); break; case HOLD_EFFECT_DEEP_SEA_TOOTH: - if (gBattleMons[battlerAtk].species == SPECIES_CLAMPERL && IS_MOVE_SPECIAL(move)) + if (gBattleMons[battlerAtk].species == SPECIES_CLAMPERL && IsBattleMoveSpecial(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); break; case HOLD_EFFECT_LIGHT_BALL: - if (atkBaseSpeciesId == SPECIES_PIKACHU && (B_LIGHT_BALL_ATTACK_BOOST >= GEN_4 || IS_MOVE_SPECIAL(move))) + if (atkBaseSpeciesId == SPECIES_PIKACHU && (B_LIGHT_BALL_ATTACK_BOOST >= GEN_4 || IsBattleMoveSpecial(move))) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(2.0)); break; case HOLD_EFFECT_CHOICE_BAND: - if (IS_MOVE_PHYSICAL(move) && GetActiveGimmick(battlerAtk) != GIMMICK_DYNAMAX) + if (IsBattleMovePhysical(move) && GetActiveGimmick(battlerAtk) != GIMMICK_DYNAMAX) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); break; case HOLD_EFFECT_CHOICE_SPECS: - if (IS_MOVE_SPECIAL(move) && GetActiveGimmick(battlerAtk) != GIMMICK_DYNAMAX) + if (IsBattleMoveSpecial(move) && GetActiveGimmick(battlerAtk) != GIMMICK_DYNAMAX) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5)); break; } // The offensive stats of a Player's Pokémon are boosted by x1.1 (+10%) if they have the 1st badge and 7th badges. // Having the 1st badge boosts physical attack while having the 7th badge boosts special attack. - if (ShouldGetStatBadgeBoost(FLAG_BADGE01_GET, battlerAtk) && IS_MOVE_PHYSICAL(move)) + if (ShouldGetStatBadgeBoost(FLAG_BADGE01_GET, battlerAtk) && IsBattleMovePhysical(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.1)); - if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerAtk) && IS_MOVE_SPECIAL(move)) + if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerAtk) && IsBattleMoveSpecial(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.1)); return uq4_12_multiply_by_int_half_down(modifier, atkStat); @@ -9928,6 +9936,7 @@ static inline u32 CalcDefenseStat(struct DamageCalculationData *damageCalcData, u32 battlerDef = damageCalcData->battlerDef; u32 move = damageCalcData->move; u32 moveType = damageCalcData->moveType; + u32 moveEffect = GetMoveEffect(move); if (gFieldStatuses & STATUS_FIELD_WONDER_ROOM) // the defense stats are swapped { @@ -9940,7 +9949,7 @@ static inline u32 CalcDefenseStat(struct DamageCalculationData *damageCalcData, spDef = gBattleMons[battlerDef].spDefense; } - if (gMovesInfo[move].effect == EFFECT_PSYSHOCK || IS_MOVE_PHYSICAL(move)) // uses defense stat instead of sp.def + if (moveEffect == EFFECT_PSYSHOCK || IsBattleMovePhysical(move)) // uses defense stat instead of sp.def { defStat = def; defStage = gBattleMons[battlerDef].statStages[STAT_DEF]; @@ -9954,7 +9963,7 @@ static inline u32 CalcDefenseStat(struct DamageCalculationData *damageCalcData, } // Self-destruct / Explosion cut defense in half - if (B_EXPLOSION_DEFENSE < GEN_5 && gMovesInfo[gCurrentMove].effect == EFFECT_EXPLOSION) + if (B_EXPLOSION_DEFENSE < GEN_5 && moveEffect == EFFECT_EXPLOSION) defStat /= 2; // critical hits ignore positive stat changes @@ -9964,7 +9973,7 @@ static inline u32 CalcDefenseStat(struct DamageCalculationData *damageCalcData, if (atkAbility == ABILITY_UNAWARE) defStage = DEFAULT_STAT_STAGE; // certain moves also ignore stat changes - if (gMovesInfo[move].ignoresTargetDefenseEvasionStages) + if (MoveIgnoresDefenseEvasionStages(move)) defStage = DEFAULT_STAT_STAGE; defStat *= gStatStageRatios[defStage][0]; @@ -10066,9 +10075,9 @@ static inline u32 CalcDefenseStat(struct DamageCalculationData *damageCalcData, // The defensive stats of a Player's Pokémon are boosted by x1.1 (+10%) if they have the 5th badge and 7th badges. // Having the 5th badge boosts physical defense while having the 7th badge boosts special defense. - if (ShouldGetStatBadgeBoost(FLAG_BADGE05_GET, battlerDef) && IS_MOVE_PHYSICAL(move)) + if (ShouldGetStatBadgeBoost(FLAG_BADGE05_GET, battlerDef) && IsBattleMovePhysical(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.1)); - if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerDef) && IS_MOVE_SPECIAL(move)) + if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerDef) && IsBattleMoveSpecial(move)) modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.1)); return uq4_12_multiply_by_int_half_down(modifier, defStat); @@ -10117,7 +10126,7 @@ static uq4_12_t GetWeatherDamageModifier(struct DamageCalculationData *damageCal if (weather == B_WEATHER_NONE) return UQ_4_12(1.0); - if (gMovesInfo[move].effect == EFFECT_HYDRO_STEAM && (weather & B_WEATHER_SUN) && holdEffectAtk != HOLD_EFFECT_UTILITY_UMBRELLA) + if (GetMoveEffect(move) == EFFECT_HYDRO_STEAM && (weather & B_WEATHER_SUN) && holdEffectAtk != HOLD_EFFECT_UTILITY_UMBRELLA) return UQ_4_12(1.5); if (holdEffectDef == HOLD_EFFECT_UTILITY_UMBRELLA) return UQ_4_12(1.0); @@ -10141,15 +10150,16 @@ static inline uq4_12_t GetBurnOrFrostBiteModifier(struct DamageCalculationData * { u32 battlerAtk = damageCalcData->battlerAtk; u32 move = damageCalcData->move; + u32 moveEffect = GetMoveEffect(move); if (gBattleMons[battlerAtk].status1 & STATUS1_BURN - && IS_MOVE_PHYSICAL(move) - && (B_BURN_FACADE_DMG < GEN_6 || gMovesInfo[move].effect != EFFECT_FACADE) + && IsBattleMovePhysical(move) + && (B_BURN_FACADE_DMG < GEN_6 || moveEffect != EFFECT_FACADE) && abilityAtk != ABILITY_GUTS) return UQ_4_12(0.5); if (gBattleMons[battlerAtk].status1 & STATUS1_FROSTBITE - && IS_MOVE_SPECIAL(move) - && (B_BURN_FACADE_DMG < GEN_6 || gMovesInfo[move].effect != EFFECT_FACADE)) + && IsBattleMoveSpecial(move) + && (B_BURN_FACADE_DMG < GEN_6 || moveEffect != EFFECT_FACADE)) return UQ_4_12(0.5); return UQ_4_12(1.0); } @@ -10177,28 +10187,28 @@ static inline uq4_12_t GetZMaxMoveAgainstProtectionModifier(struct DamageCalcula static inline uq4_12_t GetMinimizeModifier(u32 move, u32 battlerDef) { - if (gMovesInfo[move].minimizeDoubleDamage && gStatuses3[battlerDef] & STATUS3_MINIMIZED) + if (MoveIncreasesPowerToMinimizedTargets(move) && gStatuses3[battlerDef] & STATUS3_MINIMIZED) return UQ_4_12(2.0); return UQ_4_12(1.0); } static inline uq4_12_t GetUndergroundModifier(u32 move, u32 battlerDef) { - if (gMovesInfo[move].damagesUnderground && gStatuses3[battlerDef] & STATUS3_UNDERGROUND) + if (MoveDamagesUnderground(move) && gStatuses3[battlerDef] & STATUS3_UNDERGROUND) return UQ_4_12(2.0); return UQ_4_12(1.0); } static inline uq4_12_t GetDiveModifier(u32 move, u32 battlerDef) { - if (gMovesInfo[move].damagesUnderwater && gStatuses3[battlerDef] & STATUS3_UNDERWATER) + if (MoveDamagesUnderWater(move) && gStatuses3[battlerDef] & STATUS3_UNDERWATER) return UQ_4_12(2.0); return UQ_4_12(1.0); } static inline uq4_12_t GetAirborneModifier(u32 move, u32 battlerDef) { - if (gMovesInfo[move].damagesAirborneDoubleDamage && gStatuses3[battlerDef] & STATUS3_ON_AIR) + if (MoveDamagesAirborneDoubleDamage(move) && gStatuses3[battlerDef] & STATUS3_ON_AIR) return UQ_4_12(2.0); return UQ_4_12(1.0); } @@ -10206,8 +10216,8 @@ static inline uq4_12_t GetAirborneModifier(u32 move, u32 battlerDef) static inline uq4_12_t GetScreensModifier(u32 move, u32 battlerAtk, u32 battlerDef, bool32 isCrit, u32 abilityAtk) { u32 sideStatus = gSideStatuses[GetBattlerSide(battlerDef)]; - bool32 lightScreen = (sideStatus & SIDE_STATUS_LIGHTSCREEN) && IS_MOVE_SPECIAL(move); - bool32 reflect = (sideStatus & SIDE_STATUS_REFLECT) && IS_MOVE_PHYSICAL(move); + bool32 lightScreen = (sideStatus & SIDE_STATUS_LIGHTSCREEN) && IsBattleMoveSpecial(move); + bool32 reflect = (sideStatus & SIDE_STATUS_REFLECT) && IsBattleMovePhysical(move); bool32 auroraVeil = sideStatus & SIDE_STATUS_AURORA_VEIL; if (isCrit || abilityAtk == ABILITY_INFILTRATOR || gProtectStructs[battlerAtk].confusionSelfDmg) @@ -10219,7 +10229,7 @@ static inline uq4_12_t GetScreensModifier(u32 move, u32 battlerAtk, u32 battlerD static inline uq4_12_t GetCollisionCourseElectroDriftModifier(u32 move, uq4_12_t typeEffectivenessModifier) { - if (gMovesInfo[move].effect == EFFECT_COLLISION_COURSE && typeEffectivenessModifier >= UQ_4_12(2.0)) + if (GetMoveEffect(move) == EFFECT_COLLISION_COURSE && typeEffectivenessModifier >= UQ_4_12(2.0)) return UQ_4_12(1.3333); return UQ_4_12(1.0); } @@ -10266,11 +10276,11 @@ static inline uq4_12_t GetDefenderAbilitiesModifier(u32 move, u32 moveType, u32 return UQ_4_12(0.5); break; case ABILITY_PUNK_ROCK: - if (gMovesInfo[move].soundMove) + if (IsSoundMove(move)) return UQ_4_12(0.5); break; case ABILITY_ICE_SCALES: - if (IS_MOVE_SPECIAL(move)) + if (IsBattleMoveSpecial(move)) return UQ_4_12(0.5); break; } @@ -10469,9 +10479,9 @@ static inline s32 DoFutureSightAttackDamageCalcVars(struct DamageCalculationData struct Pokemon *partyMon = &party[gWishFutureKnock.futureSightPartyIndex[battlerDef]]; u32 partyMonLevel = GetMonData(partyMon, MON_DATA_LEVEL, NULL); u32 partyMonSpecies = GetMonData(partyMon, MON_DATA_SPECIES, NULL); - gBattleMovePower = gMovesInfo[move].power; + gBattleMovePower = GetMovePower(move); - if (IS_MOVE_PHYSICAL(move)) + if (IsBattleMovePhysical(move)) userFinalAttack = GetMonData(partyMon, MON_DATA_ATK, NULL); else userFinalAttack = GetMonData(partyMon, MON_DATA_SPATK, NULL); @@ -10527,7 +10537,7 @@ static u32 GetWeather(void) static inline bool32 IsFutureSightAttackerInParty(struct DamageCalculationData *damageCalcData) { - if (gMovesInfo[damageCalcData->move].effect != EFFECT_FUTURE_SIGHT) + if (GetMoveEffect(damageCalcData->move) != EFFECT_FUTURE_SIGHT) return FALSE; struct Pokemon *party = GetSideParty(GetBattlerSide(gBattlerAttacker)); @@ -10584,7 +10594,7 @@ static inline void MulByTypeEffectiveness(uq4_12_t *modifier, u32 move, u32 move if (moveType == TYPE_PSYCHIC && defType == TYPE_DARK && gStatuses3[battlerDef] & STATUS3_MIRACLE_EYED && mod == UQ_4_12(0.0)) mod = UQ_4_12(1.0); - if (gMovesInfo[move].effect == EFFECT_SUPER_EFFECTIVE_ON_ARG && defType == gMovesInfo[move].argument.type) + if (GetMoveEffect(move) == EFFECT_SUPER_EFFECTIVE_ON_ARG && defType == GetMoveArgType(move)) mod = UQ_4_12(2.0); if (moveType == TYPE_GROUND && defType == TYPE_FLYING && IsBattlerGrounded(battlerDef) && mod == UQ_4_12(0.0)) mod = UQ_4_12(1.0); @@ -10661,13 +10671,13 @@ static inline uq4_12_t CalcTypeEffectivenessMultiplierInternal(u32 move, u32 mov if (recordAbilities && (illusionSpecies = GetIllusionMonSpecies(battlerDef))) TryNoticeIllusionInTypeEffectiveness(move, moveType, battlerAtk, battlerDef, modifier, illusionSpecies); - if (gMovesInfo[move].category == DAMAGE_CATEGORY_STATUS && move != MOVE_THUNDER_WAVE) + if (GetMoveCategory(move) == DAMAGE_CATEGORY_STATUS && move != MOVE_THUNDER_WAVE) { modifier = UQ_4_12(1.0); if (B_GLARE_GHOST < GEN_4 && move == MOVE_GLARE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)) modifier = UQ_4_12(0.0); } - else if (moveType == TYPE_GROUND && !IsBattlerGroundedInverseCheck(battlerDef, TRUE) && !(gMovesInfo[move].ignoreTypeIfFlyingAndUngrounded)) + else if (moveType == TYPE_GROUND && !IsBattlerGroundedInverseCheck(battlerDef, TRUE) && !(MoveIgnoresTypeIfFlyingAndUngrounded(move))) { modifier = UQ_4_12(0.0); if (recordAbilities && defAbility == ABILITY_LEVITATE) @@ -10686,7 +10696,7 @@ static inline uq4_12_t CalcTypeEffectivenessMultiplierInternal(u32 move, u32 mov // Thousand Arrows ignores type modifiers for flying mons if (!IsBattlerGrounded(battlerDef) - && (gMovesInfo[move].ignoreTypeIfFlyingAndUngrounded) + && MoveIgnoresTypeIfFlyingAndUngrounded(move) && IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) { modifier = UQ_4_12(1.0); @@ -10694,7 +10704,7 @@ static inline uq4_12_t CalcTypeEffectivenessMultiplierInternal(u32 move, u32 mov if (((defAbility == ABILITY_WONDER_GUARD && modifier <= UQ_4_12(1.0)) || (defAbility == ABILITY_TELEPATHY && battlerDef == BATTLE_PARTNER(battlerAtk))) - && gMovesInfo[move].power) + && GetMovePower(move) != 0) { modifier = UQ_4_12(0.0); if (recordAbilities) @@ -10721,8 +10731,8 @@ uq4_12_t CalcTypeEffectivenessMultiplier(u32 move, u32 moveType, u32 battlerAtk, if (move != MOVE_STRUGGLE && moveType != TYPE_MYSTERY) { modifier = CalcTypeEffectivenessMultiplierInternal(move, moveType, battlerAtk, battlerDef, recordAbilities, modifier, defAbility); - if (gMovesInfo[move].effect == EFFECT_TWO_TYPED_MOVE) - modifier = CalcTypeEffectivenessMultiplierInternal(move, gMovesInfo[move].argument.type, battlerAtk, battlerDef, recordAbilities, modifier, defAbility); + if (GetMoveEffect(move) == EFFECT_TWO_TYPED_MOVE) + modifier = CalcTypeEffectivenessMultiplierInternal(move, GetMoveArgType(move), battlerAtk, battlerDef, recordAbilities, modifier, defAbility); } if (recordAbilities) @@ -10733,7 +10743,7 @@ uq4_12_t CalcTypeEffectivenessMultiplier(u32 move, u32 moveType, u32 battlerAtk, uq4_12_t CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 abilityDef) { uq4_12_t modifier = UQ_4_12(1.0); - u32 moveType = GetMoveType(move); + u32 moveType = GetBattleMoveType(move); if (move != MOVE_STRUGGLE && moveType != TYPE_MYSTERY) { @@ -10743,7 +10753,7 @@ uq4_12_t CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 a if (moveType == TYPE_GROUND && abilityDef == ABILITY_LEVITATE && !(gFieldStatuses & STATUS_FIELD_GRAVITY)) modifier = UQ_4_12(0.0); - if (abilityDef == ABILITY_WONDER_GUARD && modifier <= UQ_4_12(1.0) && gMovesInfo[move].power) + if (abilityDef == ABILITY_WONDER_GUARD && modifier <= UQ_4_12(1.0) && GetMovePower(move) != 0) modifier = UQ_4_12(0.0); } @@ -11331,7 +11341,7 @@ bool32 ShouldGetStatBadgeBoost(u16 badgeFlag, u32 battler) static u32 SwapMoveDamageCategory(u32 move) { - if (gMovesInfo[move].category == DAMAGE_CATEGORY_PHYSICAL) + if (GetMoveCategory(move) == DAMAGE_CATEGORY_PHYSICAL) return DAMAGE_CATEGORY_SPECIAL; return DAMAGE_CATEGORY_PHYSICAL; } @@ -11343,11 +11353,11 @@ u8 GetBattleMoveCategory(u32 moveId) if (gBattleStruct != NULL && (IsZMove(moveId) || IsMaxMove(moveId))) // TODO: Might be buggy depending on when this is called. return gBattleStruct->categoryOverride; if (B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) - return gMovesInfo[moveId].category; + return GetMoveCategory(moveId); - if (IS_MOVE_STATUS(moveId)) + if (IsBattleMoveStatus(moveId)) return DAMAGE_CATEGORY_STATUS; - return gTypesInfo[GetMoveType(moveId)].damageCategory; + return gTypesInfo[GetBattleMoveType(moveId)].damageCategory; } static bool32 TryRemoveScreens(u32 battler) @@ -11410,7 +11420,7 @@ static u32 GetFlingPowerFromItemId(u32 itemId) { if (itemId >= ITEM_TM01 && itemId <= ITEM_HM08) { - u32 power = gMovesInfo[ItemIdToBattleMoveId(itemId)].power; + u32 power = GetMovePower(ItemIdToBattleMoveId(itemId)); if (power > 1) return power; return 10; // Status moves and moves with variable power always return 10 power. @@ -11727,17 +11737,18 @@ u32 GetBattlerMoveTargetType(u32 battler, u32 move) { if (move == MOVE_CURSE && !IS_BATTLER_OF_TYPE(battler, TYPE_GHOST)) return MOVE_TARGET_USER; - if (gMovesInfo[move].effect == EFFECT_EXPANDING_FORCE && IsBattlerTerrainAffected(battler, STATUS_FIELD_PSYCHIC_TERRAIN)) + u32 effect = GetMoveEffect(move); + if (effect == EFFECT_EXPANDING_FORCE && IsBattlerTerrainAffected(battler, STATUS_FIELD_PSYCHIC_TERRAIN)) return MOVE_TARGET_BOTH; - if (gMovesInfo[move].effect == EFFECT_TERA_STARSTORM && gBattleMons[battler].species == SPECIES_TERAPAGOS_STELLAR) + if (effect == EFFECT_TERA_STARSTORM && gBattleMons[battler].species == SPECIES_TERAPAGOS_STELLAR) return MOVE_TARGET_BOTH; - return gMovesInfo[move].target; + return GetMoveTarget(move); } bool32 CanTargetBattler(u32 battlerAtk, u32 battlerDef, u16 move) { - if (gMovesInfo[move].effect == EFFECT_HIT_ENEMY_HEAL_ALLY + if (GetMoveEffect(move) == EFFECT_HIT_ENEMY_HEAL_ALLY && GetBattlerSide(battlerAtk) == GetBattlerSide(battlerDef) && gStatuses3[battlerAtk] & STATUS3_HEAL_BLOCK) return FALSE; // Pokémon affected by Heal Block cannot target allies with Pollen Puff @@ -11864,10 +11875,11 @@ bool32 IsGen6ExpShareEnabled(void) bool32 MoveHasAdditionalEffect(u32 move, u32 moveEffect) { u32 i; - for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + u32 numAdditionalEffects = GetMoveAdditionalEffectCount(move); + for (i = 0; i < numAdditionalEffects; i++) { - if (gMovesInfo[move].additionalEffects[i].moveEffect == moveEffect - && gMovesInfo[move].additionalEffects[i].self == FALSE) + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(move, i); + if (additionalEffect->moveEffect == moveEffect && additionalEffect->self == FALSE) return TRUE; } return FALSE; @@ -11876,10 +11888,11 @@ bool32 MoveHasAdditionalEffect(u32 move, u32 moveEffect) bool32 MoveHasAdditionalEffectWithChance(u32 move, u32 moveEffect, u32 chance) { u32 i; - for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + u32 numAdditionalEffects = GetMoveAdditionalEffectCount(move); + for (i = 0; i < numAdditionalEffects; i++) { - if (gMovesInfo[move].additionalEffects[i].moveEffect == moveEffect - && gMovesInfo[move].additionalEffects[i].chance == chance) + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(move, i); + if (additionalEffect->moveEffect == moveEffect && additionalEffect->chance == chance) return TRUE; } return FALSE; @@ -11888,10 +11901,11 @@ bool32 MoveHasAdditionalEffectWithChance(u32 move, u32 moveEffect, u32 chance) bool32 MoveHasAdditionalEffectSelf(u32 move, u32 moveEffect) { u32 i; - for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + u32 numAdditionalEffects = GetMoveAdditionalEffectCount(move); + for (i = 0; i < numAdditionalEffects; i++) { - if (gMovesInfo[move].additionalEffects[i].moveEffect == moveEffect - && gMovesInfo[move].additionalEffects[i].self == TRUE) + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(move, i); + if (additionalEffect->moveEffect == moveEffect && additionalEffect->self == TRUE) return TRUE; } return FALSE; @@ -11899,15 +11913,16 @@ bool32 MoveHasAdditionalEffectSelf(u32 move, u32 moveEffect) bool32 IsMoveEffectRemoveSpeciesType(u32 move, u32 moveEffect, u32 argument) { - return (gMovesInfo[move].argument.type == argument) && MoveHasAdditionalEffectSelf(move, moveEffect); + return (GetMoveArgType(move) == argument) && MoveHasAdditionalEffectSelf(move, moveEffect); } bool32 MoveHasChargeTurnAdditionalEffect(u32 move) { u32 i; - for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + u32 numAdditionalEffects = GetMoveAdditionalEffectCount(move); + for (i = 0; i < numAdditionalEffects; i++) { - if (gMovesInfo[move].additionalEffects[i].onChargeTurnOnly) + if (GetMoveAdditionalEffectById(move, i)->onChargeTurnOnly) return TRUE; } return FALSE; @@ -11916,14 +11931,16 @@ bool32 MoveHasChargeTurnAdditionalEffect(u32 move) bool32 MoveIsAffectedBySheerForce(u32 move) { u32 i; - for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + u32 numAdditionalEffects = GetMoveAdditionalEffectCount(move); + for (i = 0; i < numAdditionalEffects; i++) { - if (gMovesInfo[move].additionalEffects[i].sheerForceBoost == SHEER_FORCE_NO_BOOST) + const struct AdditionalEffect *additionalEffect = GetMoveAdditionalEffectById(move, i); + if (additionalEffect->sheerForceBoost == SHEER_FORCE_NO_BOOST) continue; - if (gMovesInfo[move].additionalEffects[i].chance > 0) + if (additionalEffect->chance > 0) return TRUE; - if (gMovesInfo[move].additionalEffects[i].sheerForceBoost == SHEER_FORCE_BOOST) + if (additionalEffect->sheerForceBoost == SHEER_FORCE_BOOST) return TRUE; } return FALSE; @@ -12039,6 +12056,7 @@ void SetShellSideArmCategory(void) u8 statStage; u32 physical; u32 special; + u32 power = GetMovePower(MOVE_SHELL_SIDE_ARM); for (battlerAtk = 0; battlerAtk < gBattlersCount; battlerAtk++) { @@ -12062,14 +12080,14 @@ void SetShellSideArmCategory(void) targetDefStat *= gStatStageRatios[statStage][0]; targetDefStat /= gStatStageRatios[statStage][1]; - physical = ((((2 * gBattleMons[battlerAtk].level / 5 + 2) * gMovesInfo[MOVE_SHELL_SIDE_ARM].power * attackerAtkStat) / targetDefStat) / 50); + physical = ((((2 * gBattleMons[battlerAtk].level / 5 + 2) * power * attackerAtkStat) / targetDefStat) / 50); targetSpDefStat = gBattleMons[battlerDef].spDefense; statStage = gBattleMons[battlerDef].statStages[STAT_SPDEF]; targetSpDefStat *= gStatStageRatios[statStage][0]; targetSpDefStat /= gStatStageRatios[statStage][1]; - special = ((((2 * gBattleMons[battlerAtk].level / 5 + 2) * gMovesInfo[MOVE_SHELL_SIDE_ARM].power * attackerSpAtkStat) / targetSpDefStat) / 50); + special = ((((2 * gBattleMons[battlerAtk].level / 5 + 2) * power * attackerSpAtkStat) / targetSpDefStat) / 50); if ((physical > special) || (physical == special && RandomPercentage(RNG_SHELL_SIDE_ARM, 50))) gBattleStruct->shellSideArmCategory[battlerAtk][battlerDef] = DAMAGE_CATEGORY_PHYSICAL; @@ -12094,13 +12112,13 @@ static inline bool32 DoesBattlerHaveAbilityImmunity(u32 battlerDef) bool32 TargetFullyImmuneToCurrMove(u32 battlerAtk, u32 battlerDef) { - return ((CalcTypeEffectivenessMultiplier(gCurrentMove, GetMoveType(gCurrentMove), battlerAtk, battlerDef, GetBattlerAbility(battlerDef), FALSE) == UQ_4_12(0.0)) + return ((CalcTypeEffectivenessMultiplier(gCurrentMove, GetBattleMoveType(gCurrentMove), battlerAtk, battlerDef, GetBattlerAbility(battlerDef), FALSE) == UQ_4_12(0.0)) || IsBattlerProtected(battlerAtk, battlerDef, gCurrentMove) || IsSemiInvulnerable(battlerDef, gCurrentMove) || DoesBattlerHaveAbilityImmunity(battlerDef)); } -u32 GetMoveType(u32 move) +u32 GetBattleMoveType(u32 move) { if (gMain.inBattle && gBattleStruct->dynamicMoveType) return gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK; @@ -12109,7 +12127,7 @@ u32 GetMoveType(u32 move) || move == MOVE_FUTURE_SIGHT || move == MOVE_DOOM_DESIRE)) return TYPE_MYSTERY; - return gMovesInfo[move].type; + return GetMoveType(move); } void TryActivateSleepClause(u32 battler, u32 indexInParty) @@ -12171,7 +12189,7 @@ void ClearDamageCalcResults(void) bool32 DoesDestinyBondFail(u32 battler) { if (B_DESTINY_BOND_FAIL >= GEN_7 - && gMovesInfo[gLastResultingMoves[battler]].effect == EFFECT_DESTINY_BOND + && GetMoveEffect(gLastResultingMoves[battler]) == EFFECT_DESTINY_BOND && !(gBattleStruct->lastMoveFailed & (1u << battler))) return TRUE; return FALSE; diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 53a39b6a792e..c878a2c12b8d 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -151,7 +151,7 @@ u32 GetUsableZMove(u32 battler, u32 move) if (zMove != MOVE_NONE) return zMove; // Signature z move exists - if (move != MOVE_NONE && zMove != MOVE_Z_STATUS && gMovesInfo[move].type == ItemId_GetSecondaryId(item)) + if (move != MOVE_NONE && zMove != MOVE_Z_STATUS && GetMoveType(move) == ItemId_GetSecondaryId(item)) return GetTypeBasedZMove(move); } @@ -195,7 +195,7 @@ bool32 IsViableZMove(u32 battler, u32 move) if (zMove != MOVE_NONE) return TRUE; - if (move != MOVE_NONE && gMovesInfo[move].type == ItemId_GetSecondaryId(item)) + if (move != MOVE_NONE && GetMoveType(move) == ItemId_GetSecondaryId(item)) return TRUE; } @@ -243,13 +243,13 @@ u32 GetSignatureZMove(u32 move, u32 species, u32 item) u32 GetTypeBasedZMove(u32 move) { - u32 moveType = gMovesInfo[move].type; + u32 moveType = GetMoveType(move); if (moveType >= NUMBER_OF_MON_TYPES) moveType = TYPE_MYSTERY; // Z-Weather Ball changes types, however Revelation Dance, -ate ability affected moves, and Hidden Power do not - if (gBattleStruct->dynamicMoveType && gMovesInfo[move].effect == EFFECT_WEATHER_BALL) + if (gBattleStruct->dynamicMoveType && GetMoveEffect(move) == EFFECT_WEATHER_BALL) moveType = gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK; // Get Z-Move from type @@ -276,9 +276,9 @@ bool32 MoveSelectionDisplayZMove(u16 zmove, u32 battler) BattlePutTextOnWindow(gDisplayedStringBattle, i + 3); } - if (IS_MOVE_STATUS(move)) + if (IsBattleMoveStatus(move)) { - u8 zEffect = gMovesInfo[move].zMove.effect; + u8 zEffect = GetMoveZEffect(move); gDisplayedStringBattle[0] = EOS; @@ -388,9 +388,9 @@ static void ZMoveSelectionDisplayPower(u16 move, u16 zMove) u16 power = GetZMovePower(move); if (zMove >= MOVE_CATASTROPIKA) - power = gMovesInfo[zMove].power; + power = GetMovePower(zMove); - if (gMovesInfo[move].category != DAMAGE_CATEGORY_STATUS) + if (GetMoveCategory(move) != DAMAGE_CATEGORY_STATUS) { txtPtr = StringCopy(gDisplayedStringBattle, sText_PowerColon); ConvertIntToDecimalStringN(txtPtr, power, STR_CONV_MODE_LEFT_ALIGN, 3); @@ -415,7 +415,7 @@ static void ZMoveSelectionDisplayPpNumber(u32 battler) static void ZMoveSelectionDisplayMoveType(u16 zMove, u32 battler) { u8 *txtPtr, *end; - u32 zMoveType = GetMoveType(zMove); + u32 zMoveType = GetBattleMoveType(zMove); txtPtr = StringCopy(gDisplayedStringBattle, gText_MoveInterfaceType); *(txtPtr)++ = EXT_CTRL_CODE_BEGIN; @@ -433,7 +433,7 @@ static void ZMoveSelectionDisplayMoveType(u16 zMove, u32 battler) void SetZEffect(void) { u32 i; - u32 effect = gMovesInfo[gBattleStruct->zmove.baseMoves[gBattlerAttacker]].zMove.effect; + u32 effect = GetMoveZEffect(gBattleStruct->zmove.baseMoves[gBattlerAttacker]); if (effect == Z_EFFECT_CURSE) { @@ -542,35 +542,25 @@ void SetZEffect(void) u32 GetZMovePower(u32 move) { - if (gMovesInfo[move].category == DAMAGE_CATEGORY_STATUS) + if (GetMoveCategory(move) == DAMAGE_CATEGORY_STATUS) return 0; - if (gMovesInfo[move].effect == EFFECT_OHKO) + if (GetMoveEffect(move) == EFFECT_OHKO) return 180; - if (gMovesInfo[move].zMove.powerOverride > 0) - return gMovesInfo[move].zMove.powerOverride; - else - { - if (gMovesInfo[move].power >= 140) - return 200; - else if (gMovesInfo[move].power >= 130) - return 195; - else if (gMovesInfo[move].power >= 120) - return 190; - else if (gMovesInfo[move].power >= 110) - return 185; - else if (gMovesInfo[move].power >= 100) - return 180; - else if (gMovesInfo[move].power >= 90) - return 175; - else if (gMovesInfo[move].power >= 80) - return 160; - else if (gMovesInfo[move].power >= 70) - return 140; - else if (gMovesInfo[move].power >= 60) - return 120; - else - return 100; - } + u32 power = GetMoveZPowerOverride(move); + if (power > 0) + return power; + + power = GetMovePower(move); + if (power >= 140) return 200; + else if (power >= 130) return 195; + else if (power >= 120) return 190; + else if (power >= 110) return 185; + else if (power >= 100) return 180; + else if (power >= 90) return 175; + else if (power >= 80) return 160; + else if (power >= 70) return 140; + else if (power >= 60) return 120; + else return 100; } diff --git a/src/contest.c b/src/contest.c index f740b46b6227..a1cd62777f93 100644 --- a/src/contest.c +++ b/src/contest.c @@ -1639,7 +1639,7 @@ static void Task_ShowMoveSelectScreen(u8 taskId) } else if (move != MOVE_NONE && eContestantStatus[gContestPlayerMonIndex].prevMove == move - && gMovesInfo[move].contestEffect != CONTEST_EFFECT_REPETITION_NOT_BORING) + && GetMoveContestEffect(move) != CONTEST_EFFECT_REPETITION_NOT_BORING) { // Gray the text because it's a repeated move moveNameBuffer = StringCopy(moveName, gText_ColorBlue); @@ -2310,7 +2310,7 @@ static void Task_DoAppeals(u8 taskId) } else { - StringCopy(gStringVar3, sContestConditions[gMovesInfo[eContestantStatus[contestant].currMove].contestCategory]); + StringCopy(gStringVar3, sContestConditions[GetMoveContestCategory(eContestantStatus[contestant].currMove)]); } if (r3 > 0 && eContestantStatus[contestant].repeatedMove) @@ -3267,7 +3267,7 @@ static u16 GetMoveEffectSymbolTileOffset(u16 move, u8 contestant) { u16 offset; - switch (gContestEffects[gMovesInfo[move].contestEffect].effectType) + switch (gContestEffects[GetMoveContestEffect(move)].effectType) { case 0: case 1: @@ -3293,7 +3293,7 @@ static void PrintContestMoveDescription(u16 move) u8 numHearts; // The contest category icon is implemented as a 5x2 group of tiles. - category = gMovesInfo[move].contestCategory; + category = GetMoveContestCategory(move); if (category == CONTEST_CATEGORY_COOL) categoryTile = 0x4040; else if (category == CONTEST_CATEGORY_BEAUTY) @@ -3309,27 +3309,27 @@ static void PrintContestMoveDescription(u16 move) ContestBG_FillBoxWithIncrementingTile(0, categoryTile + 0x10, 0x0b, 0x20, 0x05, 0x01, 0x11, 0x01); // Appeal hearts - if (gContestEffects[gMovesInfo[move].contestEffect].appeal == 0xFF) + if (gContestEffects[GetMoveContestEffect(move)].appeal == 0xFF) numHearts = 0; else - numHearts = gContestEffects[gMovesInfo[move].contestEffect].appeal / 10; + numHearts = gContestEffects[GetMoveContestEffect(move)].appeal / 10; if (numHearts > MAX_CONTEST_MOVE_HEARTS) numHearts = MAX_CONTEST_MOVE_HEARTS; ContestBG_FillBoxWithTile(0, TILE_EMPTY_APPEAL_HEART, 0x15, 0x1f, MAX_CONTEST_MOVE_HEARTS, 0x01, 0x11); ContestBG_FillBoxWithTile(0, TILE_FILLED_APPEAL_HEART, 0x15, 0x1f, numHearts, 0x01, 0x11); // Jam hearts - if (gContestEffects[gMovesInfo[move].contestEffect].jam == 0xFF) + if (gContestEffects[GetMoveContestEffect(move)].jam == 0xFF) numHearts = 0; else - numHearts = gContestEffects[gMovesInfo[move].contestEffect].jam / 10; + numHearts = gContestEffects[GetMoveContestEffect(move)].jam / 10; if (numHearts > MAX_CONTEST_MOVE_HEARTS) numHearts = MAX_CONTEST_MOVE_HEARTS; ContestBG_FillBoxWithTile(0, TILE_EMPTY_JAM_HEART, 0x15, 0x20, MAX_CONTEST_MOVE_HEARTS, 0x01, 0x11); ContestBG_FillBoxWithTile(0, TILE_FILLED_JAM_HEART, 0x15, 0x20, numHearts, 0x01, 0x11); FillWindowPixelBuffer(WIN_MOVE_DESCRIPTION, PIXEL_FILL(0)); - Contest_PrintTextToBg0WindowStd(WIN_MOVE_DESCRIPTION, gContestEffectDescriptionPointers[gMovesInfo[move].contestEffect]); + Contest_PrintTextToBg0WindowStd(WIN_MOVE_DESCRIPTION, gContestEffectDescriptionPointers[GetMoveContestEffect(move)]); Contest_PrintTextToBg0WindowStd(WIN_SLASH, gText_Slash); } @@ -4530,9 +4530,9 @@ static void CalculateAppealMoveImpact(u8 contestant) return; move = eContestantStatus[contestant].currMove; - effect = gMovesInfo[move].contestEffect; + effect = GetMoveContestEffect(move); - eContestantStatus[contestant].moveCategory = gMovesInfo[eContestantStatus[contestant].currMove].contestCategory; + eContestantStatus[contestant].moveCategory = GetMoveContestCategory(eContestantStatus[contestant].currMove); if (eContestantStatus[contestant].currMove == eContestantStatus[contestant].prevMove && eContestantStatus[contestant].currMove != MOVE_NONE) { eContestantStatus[contestant].repeatedMove = TRUE; @@ -4583,7 +4583,7 @@ static void CalculateAppealMoveImpact(u8 contestant) } else { - if (gMovesInfo[eContestantStatus[contestant].currMove].contestComboStarterId != 0) + if (GetMoveContestComboStarter(eContestantStatus[contestant].currMove) != 0) { eContestantStatus[contestant].hasJudgesAttention = TRUE; eContestantStatus[contestant].usedComboMove = TRUE; @@ -4663,13 +4663,13 @@ static void PrintAppealMoveResultText(u8 contestant, u8 stringId) { StringCopy(gStringVar1, gContestMons[contestant].nickname); StringCopy(gStringVar2, GetMoveName(eContestantStatus[contestant].currMove)); - if (gMovesInfo[eContestantStatus[eContestAppealResults.contestant].currMove].contestCategory == CONTEST_CATEGORY_COOL) + if (GetMoveContestCategory(eContestantStatus[eContestAppealResults.contestant].currMove) == CONTEST_CATEGORY_COOL) StringCopy(gStringVar3, gText_Contest_Shyness); - else if (gMovesInfo[eContestantStatus[eContestAppealResults.contestant].currMove].contestCategory == CONTEST_CATEGORY_BEAUTY) + else if (GetMoveContestCategory(eContestantStatus[eContestAppealResults.contestant].currMove) == CONTEST_CATEGORY_BEAUTY) StringCopy(gStringVar3, gText_Contest_Anxiety); - else if (gMovesInfo[eContestantStatus[eContestAppealResults.contestant].currMove].contestCategory == CONTEST_CATEGORY_CUTE) + else if (GetMoveContestCategory(eContestantStatus[eContestAppealResults.contestant].currMove) == CONTEST_CATEGORY_CUTE) StringCopy(gStringVar3, gText_Contest_Laziness); - else if (gMovesInfo[eContestantStatus[eContestAppealResults.contestant].currMove].contestCategory == CONTEST_CATEGORY_SMART) + else if (GetMoveContestCategory(eContestantStatus[eContestAppealResults.contestant].currMove) == CONTEST_CATEGORY_SMART) StringCopy(gStringVar3, gText_Contest_Hesitancy); else StringCopy(gStringVar3, gText_Contest_Fear); @@ -4842,7 +4842,7 @@ static void UpdateApplauseMeter(void) s8 Contest_GetMoveExcitement(u16 move) { - return sContestExcitementTable[gSpecialVar_ContestCategory][gMovesInfo[move].contestCategory]; + return sContestExcitementTable[gSpecialVar_ContestCategory][GetMoveContestCategory(move)]; } static u8 StartApplauseOverflowAnimation(void) diff --git a/src/contest_ai.c b/src/contest_ai.c index f131c709ac31..4386aeee64b5 100644 --- a/src/contest_ai.c +++ b/src/contest_ai.c @@ -758,7 +758,7 @@ static void ContestAICmd_get_move_effect(void) { u16 move = gContestMons[eContestAI.contestantId].moves[eContestAI.nextMoveIndex]; - eContestAI.scriptResult = gMovesInfo[move].contestEffect; + eContestAI.scriptResult = GetMoveContestEffect(move); gAIScriptPtr += 1; } @@ -786,7 +786,7 @@ static void ContestAICmd_get_move_effect_type(void) { u16 move = gContestMons[eContestAI.contestantId].moves[eContestAI.nextMoveIndex]; - eContestAI.scriptResult = gContestEffects[gMovesInfo[move].contestEffect].effectType; + eContestAI.scriptResult = gContestEffects[GetMoveContestEffect(move)].effectType; gAIScriptPtr += 1; } @@ -814,12 +814,12 @@ static void ContestAICmd_check_most_appealing_move(void) { int i; u16 move = gContestMons[eContestAI.contestantId].moves[eContestAI.nextMoveIndex]; - u8 appeal = gContestEffects[gMovesInfo[move].contestEffect].appeal; + u8 appeal = gContestEffects[GetMoveContestEffect(move)].appeal; for (i = 0; i < MAX_MON_MOVES; i++) { u16 newMove = gContestMons[eContestAI.contestantId].moves[i]; - if (newMove != 0 && appeal < gContestEffects[gMovesInfo[newMove].contestEffect].appeal) + if (newMove != 0 && appeal < gContestEffects[GetMoveContestEffect(newMove)].appeal) break; } @@ -845,12 +845,12 @@ static void ContestAICmd_check_most_jamming_move(void) { int i; u16 move = gContestMons[eContestAI.contestantId].moves[eContestAI.nextMoveIndex]; - u8 jam = gContestEffects[gMovesInfo[move].contestEffect].jam; + u8 jam = gContestEffects[GetMoveContestEffect(move)].jam; for (i = 0; i < MAX_MON_MOVES; i++) { u16 newMove = gContestMons[eContestAI.contestantId].moves[i]; - if (newMove != MOVE_NONE && jam < gContestEffects[gMovesInfo[newMove].contestEffect].jam) + if (newMove != MOVE_NONE && jam < gContestEffects[GetMoveContestEffect(newMove)].jam) break; } @@ -876,7 +876,7 @@ static void ContestAICmd_get_num_move_hearts(void) { u16 move = gContestMons[eContestAI.contestantId].moves[eContestAI.nextMoveIndex]; - eContestAI.scriptResult = gContestEffects[gMovesInfo[move].contestEffect].appeal / 10; + eContestAI.scriptResult = gContestEffects[GetMoveContestEffect(move)].appeal / 10; gAIScriptPtr += 1; } @@ -924,7 +924,7 @@ static void ContestAICmd_get_num_move_jam_hearts(void) { u16 move = gContestMons[eContestAI.contestantId].moves[eContestAI.nextMoveIndex]; - eContestAI.scriptResult = gContestEffects[gMovesInfo[move].contestEffect].jam / 10; + eContestAI.scriptResult = gContestEffects[GetMoveContestEffect(move)].jam / 10; gAIScriptPtr += 1; } @@ -1203,7 +1203,7 @@ static void ContestAICmd_get_used_combo_starter(void) u8 contestant = GetContestantIdByTurn(gAIScriptPtr[1]); if (IsContestantAllowedToCombo(contestant)) - result = gMovesInfo[eContestantStatus[contestant].prevMove].contestComboStarterId ? TRUE : FALSE; + result = GetMoveContestComboStarter(eContestantStatus[contestant].prevMove) ? TRUE : FALSE; eContestAI.scriptResult = result; gAIScriptPtr += 2; @@ -1409,7 +1409,7 @@ static void ContestAICmd_get_used_moves_effect(void) u8 round = gAIScriptPtr[2]; u16 move = eContest.moveHistory[round][contestant]; - eContestAI.scriptResult = gMovesInfo[move].contestEffect; + eContestAI.scriptResult = GetMoveContestEffect(move); gAIScriptPtr += 3; } @@ -1509,7 +1509,7 @@ static void ContestAICmd_get_used_moves_effect_type(void) u8 round = gAIScriptPtr[2]; u16 move = eContest.moveHistory[round][contestant]; - eContestAI.scriptResult = gContestEffects[gMovesInfo[move].contestEffect].effectType; + eContestAI.scriptResult = gContestEffects[GetMoveContestEffect(move)].effectType; gAIScriptPtr += 3; } @@ -1748,7 +1748,7 @@ static void ContestAICmd_check_user_has_move(void) for (i = 0; i < MAX_MON_MOVES; i++) { #ifdef BUGFIX - u16 move = gMovesInfo[gContestMons[eContestAI.contestantId].moves[i]].contestEffect; + u16 move = GetMoveContestEffect(gContestMons[eContestAI.contestantId].moves[i]); #else u16 move = gContestMons[eContestAI.contestantId].moves[i]; #endif diff --git a/src/contest_effect.c b/src/contest_effect.c index 0de31339f4b8..51416ba14a76 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -1,4 +1,5 @@ #include "global.h" +#include "move.h" #include "random.h" #include "constants/moves.h" #include "contest.h" @@ -60,7 +61,7 @@ static s16 RoundUp(s16); bool8 AreMovesContestCombo(u16 lastMove, u16 nextMove) { int i; - u8 lastMoveComboStarterId = gMovesInfo[lastMove].contestComboStarterId; + u8 lastMoveComboStarterId = GetMoveContestComboStarter(lastMove); if (lastMoveComboStarterId == 0) { @@ -70,7 +71,7 @@ bool8 AreMovesContestCombo(u16 lastMove, u16 nextMove) { for (i = 0; i < MAX_COMBO_MOVES; i++) { - if (lastMoveComboStarterId == gMovesInfo[nextMove].contestComboMoves[i]) + if (lastMoveComboStarterId == GetMoveContestComboMoves(nextMove, i)) return TRUE; } return FALSE; @@ -132,7 +133,7 @@ static void ContestEffect_UserLessEasilyStartled(void) SetContestantEffectStringID(eContestAppealResults.contestant,CONTEST_STRING_STOPPED_CARING); } -// Slightly startles the POKéMON in front. +// Slightly startles the POK�MON in front. static void ContestEffect_StartleFrontMon(void) { u8 idx = 0; @@ -180,7 +181,7 @@ static void ContestEffect_StartlePrevMons(void) SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Startles the POKéMON that appealed before the user. +// Startles the POK�MON that appealed before the user. static void ContestEffect_StartlePrevMon2(void) { u8 rval = Random() % 10; @@ -197,7 +198,7 @@ static void ContestEffect_StartlePrevMon2(void) ContestEffect_StartleFrontMon(); } -// Startles all POKéMON that appealed before the user. +// Startles all POK�MON that appealed before the user. static void ContestEffect_StartlePrevMons2(void) { u8 numStartled = 0; @@ -273,7 +274,7 @@ static void ContestEffect_ShiftJudgeAttention(void) } } -// Startles the POKéMON that has the JUDGE's attention. +// Startles the POK�MON that has the JUDGE's attention. static void ContestEffect_StartleMonWithJudgesAttention(void) { u8 numStartled = 0; @@ -311,50 +312,50 @@ static void ContestEffect_JamsOthersButMissOneTurn(void) SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Startles POKéMON that made a same-type appeal. +// Startles POK�MON that made a same-type appeal. static void ContestEffect_StartleMonsSameTypeAppeal(void) { u16 move = eContestantStatus[eContestAppealResults.contestant].currMove; - JamByMoveCategory(gMovesInfo[move].contestCategory); + JamByMoveCategory(GetMoveContestCategory(move)); SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Badly startles POKéMON that made COOL appeals. +// Badly startles POK�MON that made COOL appeals. static void ContestEffect_StartleMonsCoolAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_COOL); SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Badly startles POKéMON that made BEAUTY appeals. +// Badly startles POK�MON that made BEAUTY appeals. static void ContestEffect_StartleMonsBeautyAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_BEAUTY); SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Badly startles POKéMON that made CUTE appeals. +// Badly startles POK�MON that made CUTE appeals. static void ContestEffect_StartleMonsCuteAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_CUTE); SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Badly startles POKéMON that made SMART appeals. +// Badly startles POK�MON that made SMART appeals. static void ContestEffect_StartleMonsSmartAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_SMART); SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Badly startles POKéMON that made TOUGH appeals. +// Badly startles POK�MON that made TOUGH appeals. static void ContestEffect_StartleMonsToughAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_TOUGH); SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Makes one POKéMON after the user nervous. +// Makes one POK�MON after the user nervous. static void ContestEffect_MakeFollowingMonNervous(void) { bool32 hitAny = FALSE; @@ -386,7 +387,7 @@ static void ContestEffect_MakeFollowingMonNervous(void) SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_MESSED_UP2); } -// Makes all POKéMON after the user nervous. +// Makes all POK�MON after the user nervous. static void ContestEffect_MakeFollowingMonsNervous(void) { u8 numUnnerved = 0; @@ -428,7 +429,7 @@ static void ContestEffect_MakeFollowingMonsNervous(void) for (i = 0; i < CONTESTANT_COUNT; i++) { if (eContestantStatus[i].hasJudgesAttention && IsContestantAllowedToCombo(i)) - oddsMod[i] = gMovesInfo[eContestantStatus[i].prevMove].contestComboStarterId == 0 ? 0 : 10; + oddsMod[i] = GetMoveContestComboStarter(eContestantStatus[i].prevMove) == 0 ? 0 : 10; else oddsMod[i] = 0; oddsMod[i] -= (eContestantStatus[i].condition / 10) * 10; @@ -493,7 +494,7 @@ static void ContestEffect_WorsenConditionOfPrevMons(void) SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_IGNORED); } -// Badly startles POKéMON in good condition. +// Badly startles POK�MON in good condition. static void ContestEffect_BadlyStartlesMonsInGoodCondition(void) { u8 numHit = 0; @@ -524,7 +525,7 @@ static void ContestEffect_BetterIfFirst(void) if (gContestantTurnOrder[eContestAppealResults.contestant] == 0) { u16 move = eContestantStatus[eContestAppealResults.contestant].currMove; - eContestantStatus[eContestAppealResults.contestant].appeal += 2 * gContestEffects[gMovesInfo[move].contestEffect].appeal; + eContestantStatus[eContestAppealResults.contestant].appeal += 2 * gContestEffects[GetMoveContestEffect(move)].appeal; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_HUSTLE_STANDOUT); } } @@ -535,7 +536,7 @@ static void ContestEffect_BetterIfLast(void) if (gContestantTurnOrder[eContestAppealResults.contestant] == 3) { u16 move = eContestantStatus[eContestAppealResults.contestant].currMove; - eContestantStatus[eContestAppealResults.contestant].appeal += 2 * gContestEffects[gMovesInfo[move].contestEffect].appeal; + eContestantStatus[eContestAppealResults.contestant].appeal += 2 * gContestEffects[GetMoveContestEffect(move)].appeal; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_WORK_HARD_UNNOTICED); } } @@ -671,9 +672,9 @@ static void ContestEffect_BetterIfSameType(void) } move = eContestantStatus[eContestAppealResults.contestant].currMove; - if (gMovesInfo[move].contestCategory == gMovesInfo[eContestantStatus[j].currMove].contestCategory) + if (GetMoveContestCategory(move) == GetMoveContestCategory(eContestantStatus[j].currMove)) { - eContestantStatus[eContestAppealResults.contestant].appeal += gContestEffects[gMovesInfo[move].contestEffect].appeal * 2; + eContestantStatus[eContestAppealResults.contestant].appeal += gContestEffects[GetMoveContestEffect(move)].appeal * 2; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_SAME_TYPE_GOOD); } } @@ -689,9 +690,9 @@ static void ContestEffect_BetterIfDiffType(void) for (i = 0; i < CONTESTANT_COUNT; i++) { if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] - 1 == eContestAppealResults.turnOrder[i] && - gMovesInfo[move].contestCategory != gMovesInfo[eContestantStatus[i].currMove].contestCategory) + GetMoveContestCategory(move) != GetMoveContestCategory(eContestantStatus[i].currMove)) { - eContestantStatus[eContestAppealResults.contestant].appeal += gContestEffects[gMovesInfo[move].contestEffect].appeal * 2; + eContestantStatus[eContestAppealResults.contestant].appeal += gContestEffects[GetMoveContestEffect(move)].appeal * 2; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_DIFF_TYPE_GOOD); break; } @@ -891,13 +892,13 @@ static void ContestEffect_ScrambleNextTurnOrder(void) // An appeal that excites the audience in any CONTEST. static void ContestEffect_ExciteAudienceInAnyContest(void) { - if (gMovesInfo[eContestantStatus[eContestAppealResults.contestant].currMove].contestCategory != gSpecialVar_ContestCategory) + if (GetMoveContestCategory(eContestantStatus[eContestAppealResults.contestant].currMove) != gSpecialVar_ContestCategory) { eContestantStatus[eContestAppealResults.contestant].overrideCategoryExcitementMod = TRUE; } } -// Badly startles all POKéMON that made good appeals. +// Badly startles all POK�MON that made good appeals. static void ContestEffect_BadlyStartleMonsWithGoodAppeals(void) { int i; @@ -980,7 +981,7 @@ static void JamByMoveCategory(u8 category) { if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] > eContestAppealResults.turnOrder[i]) { - if (category == gMovesInfo[eContestantStatus[i].currMove].contestCategory) + if (category == GetMoveContestCategory(eContestantStatus[i].currMove)) eContestAppealResults.jam = 40; else eContestAppealResults.jam = 10; diff --git a/src/easy_chat.c b/src/easy_chat.c index ce3b4fe907ce..aa8405be759e 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -17,6 +17,7 @@ #include "main.h" #include "mystery_gift.h" #include "menu.h" +#include "move.h" #include "overworld.h" #include "palette.h" #include "pokedex.h" diff --git a/src/frontier_util.c b/src/frontier_util.c index 44246766444b..30c22d4442bc 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -2543,7 +2543,7 @@ void CreateFrontierBrainPokemon(void) for (j = 0; j < MAX_MON_MOVES; j++) { SetMonMoveSlot(&gEnemyParty[monPartyId], sFrontierBrainsMons[facility][symbol][i].moves[j], j); - if (gMovesInfo[sFrontierBrainsMons[facility][symbol][i].moves[j]].effect == EFFECT_FRUSTRATION) + if (GetMoveEffect(sFrontierBrainsMons[facility][symbol][i].moves[j]) == EFFECT_FRUSTRATION) friendship = 0; } SetMonData(&gEnemyParty[monPartyId], MON_DATA_FRIENDSHIP, &friendship); diff --git a/src/item_icon.c b/src/item_icon.c index 14a812b7fa8f..03b56918be2f 100644 --- a/src/item_icon.c +++ b/src/item_icon.c @@ -1,12 +1,13 @@ #include "global.h" +#include "battle_main.h" #include "decompress.h" #include "graphics.h" +#include "item.h" #include "item_icon.h" #include "malloc.h" +#include "move.h" #include "sprite.h" #include "constants/items.h" -#include "item.h" -#include "battle_main.h" // EWRAM vars EWRAM_DATA u8 *gItemIconDecompressionBuffer = NULL; @@ -182,7 +183,7 @@ const void *GetItemIconPalette(u16 itemId) if (itemId >= ITEMS_COUNT) return gItemsInfo[0].iconPalette; if (itemId >= ITEM_TM01 && itemId < ITEM_HM01 + NUM_HIDDEN_MACHINES) - return gTypesInfo[gMovesInfo[gItemsInfo[itemId].secondaryId].type].paletteTMHM; + return gTypesInfo[GetMoveType(gItemsInfo[itemId].secondaryId)].paletteTMHM; return gItemsInfo[itemId].iconPalette; } diff --git a/src/item_menu.c b/src/item_menu.c index 75751cae6f2e..ff5d569f966f 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -2604,34 +2604,36 @@ static void PrintTMHMMoveData(u16 itemId) else { moveId = ItemIdToBattleMoveId(itemId); - BlitMenuInfoIcon(WIN_TMHM_INFO, gMovesInfo[moveId].type + 1, 0, 0); + BlitMenuInfoIcon(WIN_TMHM_INFO, GetMoveType(moveId) + 1, 0, 0); // Print TMHM power - if (gMovesInfo[moveId].power <= 1) + u32 power = GetMovePower(moveId); + if (power <= 1) { text = gText_ThreeDashes; } else { - ConvertIntToDecimalStringN(gStringVar1, gMovesInfo[moveId].power, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, power, STR_CONV_MODE_RIGHT_ALIGN, 3); text = gStringVar1; } BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 12, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO); + u32 accuracy = GetMoveAccuracy(moveId); // Print TMHM accuracy - if (gMovesInfo[moveId].accuracy == 0) + if (accuracy == 0) { text = gText_ThreeDashes; } else { - ConvertIntToDecimalStringN(gStringVar1, gMovesInfo[moveId].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); text = gStringVar1; } BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 24, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO); // Print TMHM pp - ConvertIntToDecimalStringN(gStringVar1, gMovesInfo[moveId].pp, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, GetMovePP(moveId), STR_CONV_MODE_RIGHT_ALIGN, 3); BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, gStringVar1, 7, 36, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO); CopyWindowToVram(WIN_TMHM_INFO, COPYWIN_GFX); diff --git a/src/menu_specialized.c b/src/menu_specialized.c index 693e9f12bc02..7b6d94b5f23a 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -10,6 +10,7 @@ #include "international_string_util.h" #include "menu.h" #include "menu_specialized.h" +#include "move.h" #include "move_relearner.h" #include "palette.h" #include "player_pc.h" @@ -752,7 +753,6 @@ u8 LoadMoveRelearnerMovesList(const struct ListMenuItem *items, u16 numChoices) static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove) { s32 x; - const struct MoveInfo *move; u8 buffer[32]; const u8 *str; @@ -780,49 +780,41 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove) CopyWindowToVram(RELEARNERWIN_DESC_BATTLE, COPYWIN_GFX); return; } - move = &gMovesInfo[chosenMove]; - str = gTypesInfo[move->type].name; + str = gTypesInfo[GetMoveType(chosenMove)].name; AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, 4, 25, TEXT_SKIP_DRAW, NULL); x = 4 + GetStringWidth(FONT_NORMAL, gText_MoveRelearnerPP, 0); - ConvertIntToDecimalStringN(buffer, move->pp, STR_CONV_MODE_LEFT_ALIGN, 2); + ConvertIntToDecimalStringN(buffer, GetMovePP(chosenMove), STR_CONV_MODE_LEFT_ALIGN, 2); AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, buffer, x, 41, TEXT_SKIP_DRAW, NULL); - if (move->power < 2) + if (GetMovePower(chosenMove) < 2) { str = gText_ThreeDashes; } else { - ConvertIntToDecimalStringN(buffer, move->power, STR_CONV_MODE_LEFT_ALIGN, 3); + ConvertIntToDecimalStringN(buffer, GetMovePower(chosenMove), STR_CONV_MODE_LEFT_ALIGN, 3); str = buffer; } AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, 106, 25, TEXT_SKIP_DRAW, NULL); - if (move->accuracy == 0) + if (GetMoveAccuracy(chosenMove) == 0) { str = gText_ThreeDashes; } else { - ConvertIntToDecimalStringN(buffer, move->accuracy, STR_CONV_MODE_LEFT_ALIGN, 3); + ConvertIntToDecimalStringN(buffer, GetMoveAccuracy(chosenMove), STR_CONV_MODE_LEFT_ALIGN, 3); str = buffer; } AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NORMAL, str, 106, 41, TEXT_SKIP_DRAW, NULL); - - if (move->effect != EFFECT_PLACEHOLDER) - str = gMovesInfo[chosenMove].description; - else - str = gNotDoneYetDescription; - - AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NARROW, str, 0, 65, 0, NULL); + AddTextPrinterParameterized(RELEARNERWIN_DESC_BATTLE, FONT_NARROW, GetMoveDescription(chosenMove), 0, 65, 0, NULL); } static void MoveRelearnerMenuLoadContestMoveDescription(u32 chosenMove) { s32 x; const u8 *str; - const struct MoveInfo *move; MoveRelearnerShowHideHearts(chosenMove); FillWindowPixelBuffer(RELEARNERWIN_DESC_CONTEST, PIXEL_FILL(1)); @@ -844,11 +836,10 @@ static void MoveRelearnerMenuLoadContestMoveDescription(u32 chosenMove) return; } - move = &gMovesInfo[chosenMove]; - str = gContestMoveTypeTextPointers[move->contestCategory]; + str = gContestMoveTypeTextPointers[GetMoveContestCategory(chosenMove)]; AddTextPrinterParameterized(RELEARNERWIN_DESC_CONTEST, FONT_NORMAL, str, 4, 25, TEXT_SKIP_DRAW, NULL); - str = gContestEffectDescriptionPointers[move->contestEffect]; + str = gContestEffectDescriptionPointers[GetMoveContestEffect(chosenMove)]; AddTextPrinterParameterized(RELEARNERWIN_DESC_CONTEST, FONT_NARROW, str, 0, 65, TEXT_SKIP_DRAW, NULL); CopyWindowToVram(RELEARNERWIN_DESC_CONTEST, COPYWIN_GFX); diff --git a/src/move.c b/src/move.c new file mode 100644 index 000000000000..c77742c30ecb --- /dev/null +++ b/src/move.c @@ -0,0 +1,6 @@ +#include "global.h" +#include "battle.h" +#include "main.h" +#include "move.h" + +#include "data/moves_info.h" diff --git a/src/move_relearner.c b/src/move_relearner.c index 1e6670269501..f81e9ddc3720 100644 --- a/src/move_relearner.c +++ b/src/move_relearner.c @@ -969,7 +969,7 @@ void MoveRelearnerShowHideHearts(s32 moveId) } else { - numHearts = (u8)(gContestEffects[gMovesInfo[moveId].contestEffect].appeal / 10); + numHearts = (u8)(gContestEffects[GetMoveContestEffect(moveId)].appeal / 10); if (numHearts == 0xFF) numHearts = 0; @@ -983,7 +983,7 @@ void MoveRelearnerShowHideHearts(s32 moveId) gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = FALSE; } - numHearts = (u8)(gContestEffects[gMovesInfo[moveId].contestEffect].jam / 10); + numHearts = (u8)(gContestEffects[GetMoveContestEffect(moveId)].jam / 10); if (numHearts == 0xFF) numHearts = 0; diff --git a/src/party_menu.c b/src/party_menu.c index 064a0eec16c7..5f71697621f8 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -2735,7 +2735,7 @@ static u8 DisplaySelectionWindow(u8 windowType) const u8 *text; u8 fontColorsId = (sPartyMenuInternal->actions[i] >= MENU_FIELD_MOVES) ? 4 : 3; if (sPartyMenuInternal->actions[i] >= MENU_FIELD_MOVES) - text = gMovesInfo[sFieldMoves[sPartyMenuInternal->actions[i] - MENU_FIELD_MOVES]].name; + text = GetMoveName(sFieldMoves[sPartyMenuInternal->actions[i] - MENU_FIELD_MOVES]); else text = sCursorOptions[sPartyMenuInternal->actions[i]].text; diff --git a/src/pokedex_plus_hgss.c b/src/pokedex_plus_hgss.c index 8782044769c6..50a00c22b8e6 100644 --- a/src/pokedex_plus_hgss.c +++ b/src/pokedex_plus_hgss.c @@ -5182,12 +5182,12 @@ static void PrintStatsScreen_Moves_Top(u8 taskId) //Draw move type icon if (gTasks[taskId].data[5] == 0) { - SetTypeIconPosAndPal(gMovesInfo[move].type, moves_x + 146, moves_y + 17, 0); + SetTypeIconPosAndPal(GetMoveType(move), moves_x + 146, moves_y + 17, 0); SetSpriteInvisibility(1, TRUE); } else { - SetTypeIconPosAndPal(NUMBER_OF_MON_TYPES + gMovesInfo[move].contestCategory, moves_x + 146, moves_y + 17, 1); + SetTypeIconPosAndPal(NUMBER_OF_MON_TYPES + GetMoveContestCategory(move), moves_x + 146, moves_y + 17, 1); SetSpriteInvisibility(0, TRUE); } @@ -5243,12 +5243,12 @@ static void PrintStatsScreen_Moves_Description(u8 taskId) //Move description if (gTasks[taskId].data[5] == 0) { - StringCopy(gStringVar4, gMovesInfo[move].description); + StringCopy(gStringVar4, GetMoveDescription(move)); PrintStatsScreenTextSmall(WIN_STATS_MOVES_DESCRIPTION, gStringVar4, moves_x, moves_y); } else { - StringCopy(gStringVar4, gContestEffectDescriptionPointers[gMovesInfo[move].contestEffect]); + StringCopy(gStringVar4, gContestEffectDescriptionPointers[GetMoveContestEffect(move)]); PrintStatsScreenTextSmall(WIN_STATS_MOVES_DESCRIPTION, gStringVar4, moves_x, moves_y); } } @@ -5287,19 +5287,21 @@ static void PrintStatsScreen_Moves_Bottom(u8 taskId) if (gTasks[taskId].data[5] == 0) { //Power - if (gMovesInfo[move].power < 2) + u32 power = GetMovePower(move); + if (power < 2) StringCopy(gStringVar1, gText_ThreeDashes); else - ConvertIntToDecimalStringN(gStringVar1, gMovesInfo[move].power, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, power, STR_CONV_MODE_RIGHT_ALIGN, 3); PrintStatsScreenTextSmall(WIN_STATS_MOVES_BOTTOM, gStringVar1, moves_x + 45, moves_y); //Physical/Special/Status Category DestroyCategoryIcon(); ShowCategoryIcon(GetBattleMoveCategory(move)); //Accuracy - if (gMovesInfo[move].accuracy == 0) + u32 accuracy = GetMoveAccuracy(move); + if (accuracy == 0) StringCopy(gStringVar1, gText_ThreeDashes); else - ConvertIntToDecimalStringN(gStringVar1, gMovesInfo[move].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); PrintStatsScreenTextSmall(WIN_STATS_MOVES_BOTTOM, gStringVar1, moves_x + 114, moves_y); } else //Appeal + Jam @@ -5307,7 +5309,7 @@ static void PrintStatsScreen_Moves_Bottom(u8 taskId) DestroyCategoryIcon(); gSprites[sPokedexView->categoryIconSpriteId].invisible = TRUE; //Appeal - contest_effectValue = gContestEffects[gMovesInfo[move].contestEffect].appeal; + contest_effectValue = gContestEffects[GetMoveContestEffect(move)].appeal; if (contest_effectValue != 0xFF) contest_appeal = contest_effectValue / 10; ConvertIntToDecimalStringN(gStringVar1, contest_appeal, STR_CONV_MODE_RIGHT_ALIGN, 1); @@ -5316,7 +5318,7 @@ static void PrintStatsScreen_Moves_Bottom(u8 taskId) PrintStatsScreenTextSmall(WIN_STATS_MOVES_BOTTOM, gStringVar2, moves_x + 45, moves_y); //Jam - contest_effectValue = gContestEffects[gMovesInfo[move].contestEffect].jam; + contest_effectValue = gContestEffects[GetMoveContestEffect(move)].jam; if (contest_effectValue != 0xFF) contest_jam = contest_effectValue / 10; ConvertIntToDecimalStringN(gStringVar1, contest_jam, STR_CONV_MODE_RIGHT_ALIGN, 1); diff --git a/src/pokemon.c b/src/pokemon.c index 0771076b2a0a..ff4b2df7c762 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -47,6 +47,7 @@ #include "constants/battle_move_effects.h" #include "constants/battle_script_commands.h" #include "constants/battle_partner.h" +#include "constants/battle_string_ids.h" #include "constants/cries.h" #include "constants/event_objects.h" #include "constants/form_change_types.h" @@ -87,7 +88,6 @@ EWRAM_DATA static struct MonSpritesGfxManager *sMonSpritesGfxManagers[MON_SPR_GF EWRAM_DATA static u8 sTriedEvolving = 0; EWRAM_DATA u16 gFollowerSteps = 0; -#include "data/moves_info.h" #include "data/abilities.h" // Used in an unreferenced function in RS. @@ -1867,8 +1867,9 @@ u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move) u16 existingMove = GetBoxMonData(boxMon, MON_DATA_MOVE1 + i, NULL); if (existingMove == MOVE_NONE) { + u32 pp = GetMovePP(move); SetBoxMonData(boxMon, MON_DATA_MOVE1 + i, &move); - SetBoxMonData(boxMon, MON_DATA_PP1 + i, &gMovesInfo[move].pp); + SetBoxMonData(boxMon, MON_DATA_PP1 + i, &pp); return move; } if (existingMove == move) @@ -1886,7 +1887,7 @@ u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move) if (mon->moves[i] == MOVE_NONE) { mon->moves[i] = move; - mon->pp[i] = gMovesInfo[move].pp; + mon->pp[i] = GetMovePP(move); return move; } } @@ -1897,7 +1898,8 @@ u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move) void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot) { SetMonData(mon, MON_DATA_MOVE1 + slot, &move); - SetMonData(mon, MON_DATA_PP1 + slot, &gMovesInfo[move].pp); + u32 pp = GetMovePP(move); + SetMonData(mon, MON_DATA_PP1 + slot, &pp); } static void SetMonMoveSlot_KeepPP(struct Pokemon *mon, u16 move, u8 slot) @@ -1914,7 +1916,7 @@ static void SetMonMoveSlot_KeepPP(struct Pokemon *mon, u16 move, u8 slot) void SetBattleMonMoveSlot(struct BattlePokemon *mon, u16 move, u8 slot) { mon->moves[slot] = move; - mon->pp[slot] = gMovesInfo[move].pp; + mon->pp[slot] = GetMovePP(move); } void GiveMonInitialMoveset(struct Pokemon *mon) @@ -1968,7 +1970,8 @@ void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon) //Credit: AsparagusEdua for (i = 0; i < MAX_MON_MOVES; i++) { SetBoxMonData(boxMon, MON_DATA_MOVE1 + i, &moves[i]); - SetBoxMonData(boxMon, MON_DATA_PP1 + i, &gMovesInfo[moves[i]].pp); + u32 pp = GetMovePP(moves[i]); + SetBoxMonData(boxMon, MON_DATA_PP1 + i, &pp); } } @@ -2021,7 +2024,7 @@ void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move) ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES, NULL); ppBonuses >>= 2; moves[MAX_MON_MOVES - 1] = move; - pp[MAX_MON_MOVES - 1] = gMovesInfo[move].pp; + pp[MAX_MON_MOVES - 1] = GetMovePP(move); for (i = 0; i < MAX_MON_MOVES; i++) { @@ -2048,7 +2051,7 @@ void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move) ppBonuses = GetBoxMonData(boxMon, MON_DATA_PP_BONUSES, NULL); ppBonuses >>= 2; moves[MAX_MON_MOVES - 1] = move; - pp[MAX_MON_MOVES - 1] = gMovesInfo[move].pp; + pp[MAX_MON_MOVES - 1] = GetMovePP(move); for (i = 0; i < MAX_MON_MOVES; i++) { @@ -3509,7 +3512,8 @@ void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord) for (j = 0; j < MAX_MON_MOVES; j++) { SetMonData(&gEnemyParty[i], MON_DATA_MOVE1 + j, &gBattleResources->secretBase->party.moves[i * MAX_MON_MOVES + j]); - SetMonData(&gEnemyParty[i], MON_DATA_PP1 + j, &gMovesInfo[gBattleResources->secretBase->party.moves[i * MAX_MON_MOVES + j]].pp); + u32 pp = GetMovePP(gBattleResources->secretBase->party.moves[i * MAX_MON_MOVES + j]); + SetMonData(&gEnemyParty[i], MON_DATA_PP1 + j, &pp); } } } @@ -3634,7 +3638,7 @@ const struct FormChange *GetSpeciesFormChanges(u16 species) u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex) { - u8 basePP = gMovesInfo[move].pp; + u8 basePP = GetMovePP(move); return basePP + ((basePP * 20 * ((gPPUpGetMask[moveIndex] & ppBonuses) >> (2 * moveIndex))) / 100); } @@ -4617,7 +4621,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, enum EvolutionMode mode, u16 { for (j = 0; j < MAX_MON_MOVES; j++) { - if (gMovesInfo[GetMonData(mon, MON_DATA_MOVE1 + j, NULL)].type == evolutions[i].param) + if (GetMoveType(GetMonData(mon, MON_DATA_MOVE1 + j, NULL)) == evolutions[i].param) { targetSpecies = evolutions[i].targetSpecies; break; @@ -6945,21 +6949,6 @@ u16 GetSpeciesPreEvolution(u16 species) return SPECIES_NONE; } -const u8 *GetMoveName(u16 moveId) -{ - return gMovesInfo[moveId].name; -} - -const u8 *GetMoveAnimationScript(u16 moveId) -{ - if (gMovesInfo[moveId].battleAnimScript == NULL) - { - DebugPrintfLevel(MGBA_LOG_WARN, "No animation for moveId=%u", moveId); - return gMovesInfo[MOVE_NONE].battleAnimScript; - } - return gMovesInfo[moveId].battleAnimScript; -} - void UpdateDaysPassedSinceFormChange(u16 days) { u32 i; @@ -7000,5 +6989,5 @@ u32 CheckDynamicMoveType(struct Pokemon *mon, u32 move, u32 battler) u32 moveType = GetDynamicMoveType(mon, move, battler, NULL); if (moveType != TYPE_NONE) return moveType; - return gMovesInfo[move].type; + return GetMoveType(move); } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 4cfc17c707ea..f0c65dc2a753 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -2836,7 +2836,7 @@ static void DrawContestMoveHearts(u16 move) if (move != MOVE_NONE) { // Draw appeal hearts - u8 effectValue = gContestEffects[gMovesInfo[move].contestEffect].appeal; + u8 effectValue = gContestEffects[GetMoveContestEffect(move)].appeal; if (effectValue != 0xFF) effectValue /= 10; @@ -2849,7 +2849,7 @@ static void DrawContestMoveHearts(u16 move) } // Draw jam hearts - effectValue = gContestEffects[gMovesInfo[move].contestEffect].jam; + effectValue = gContestEffects[GetMoveContestEffect(move)].jam; if (effectValue != 0xFF) effectValue /= 10; @@ -3750,29 +3750,31 @@ static void PrintMoveNameAndPP(u8 moveIndex) static void PrintMovePowerAndAccuracy(u16 moveIndex) { const u8 *text; - if (moveIndex != 0) + if (moveIndex != MOVE_NONE) { FillWindowPixelRect(PSS_LABEL_WINDOW_MOVES_POWER_ACC, PIXEL_FILL(0), 53, 0, 19, 32); - if (gMovesInfo[moveIndex].power < 2) + u32 power = GetMovePower(moveIndex); + if (power < 2) { text = gText_ThreeDashes; } else { - ConvertIntToDecimalStringN(gStringVar1, gMovesInfo[moveIndex].power, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, power, STR_CONV_MODE_RIGHT_ALIGN, 3); text = gStringVar1; } PrintTextOnWindow(PSS_LABEL_WINDOW_MOVES_POWER_ACC, text, 53, 1, 0, 0); - if (gMovesInfo[moveIndex].accuracy == 0) + u32 accuracy = GetMoveAccuracy(moveIndex); + if (accuracy == 0) { text = gText_ThreeDashes; } else { - ConvertIntToDecimalStringN(gStringVar1, gMovesInfo[moveIndex].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); text = gStringVar1; } @@ -3842,32 +3844,26 @@ static void PrintContestMoveDescription(u8 moveSlot) if (move != MOVE_NONE) { u8 windowId = AddWindowFromTemplateList(sPageMovesTemplate, PSS_DATA_WINDOW_MOVE_DESCRIPTION); - PrintTextOnWindow(windowId, gContestEffectDescriptionPointers[gMovesInfo[move].contestEffect], 6, 1, 0, 0); + PrintTextOnWindow(windowId, gContestEffectDescriptionPointers[GetMoveContestEffect(move)], 6, 1, 0, 0); } } static void PrintMoveDetails(u16 move) { u8 windowId = AddWindowFromTemplateList(sPageMovesTemplate, PSS_DATA_WINDOW_MOVE_DESCRIPTION); - u8 moveEffect; FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); if (move != MOVE_NONE) { if (sMonSummaryScreen->currPageIndex == PSS_PAGE_BATTLE_MOVES) { - moveEffect = gMovesInfo[move].effect; if (B_SHOW_CATEGORY_ICON == TRUE) ShowCategoryIcon(GetBattleMoveCategory(move)); PrintMovePowerAndAccuracy(move); - - if (moveEffect != EFFECT_PLACEHOLDER) - PrintTextOnWindow(windowId, gMovesInfo[move].description, 6, 1, 0, 0); - else - PrintTextOnWindow(windowId, gNotDoneYetDescription, 6, 1, 0, 0); + PrintTextOnWindow(windowId, GetMoveDescription(move), 6, 1, 0, 0); } else { - PrintTextOnWindow(windowId, gContestEffectDescriptionPointers[gMovesInfo[move].contestEffect], 6, 1, 0, 0); + PrintTextOnWindow(windowId, gContestEffectDescriptionPointers[GetMoveContestEffect(move)], 6, 1, 0, 0); } PutWindowTilemap(windowId); } @@ -3897,7 +3893,7 @@ static void PrintNewMoveDetailsOrCancelText(void) else PrintTextOnWindowToFit(windowId1, GetMoveName(move), 0, 65, 0, 5); - ConvertIntToDecimalStringN(gStringVar1, gMovesInfo[move].pp, STR_CONV_MODE_RIGHT_ALIGN, 2); + ConvertIntToDecimalStringN(gStringVar1, GetMovePP(move), STR_CONV_MODE_RIGHT_ALIGN, 2); DynamicPlaceholderTextUtil_Reset(); DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1); DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, gStringVar1); @@ -4051,7 +4047,7 @@ static void SetMoveTypeIcons(void) { if (summary->moves[i] != MOVE_NONE) { - type = gMovesInfo[summary->moves[i]].type; + type = GetMoveType(summary->moves[i]); if (P_SHOW_DYNAMIC_TYPES) type = CheckDynamicMoveType(mon, summary->moves[i], 0); SetTypeSpritePosAndPal(type, 85, 32 + (i * 16), i + SPRITE_ARR_ID_TYPE); @@ -4070,7 +4066,7 @@ static void SetContestMoveTypeIcons(void) for (i = 0; i < MAX_MON_MOVES; i++) { if (summary->moves[i] != MOVE_NONE) - SetTypeSpritePosAndPal(NUMBER_OF_MON_TYPES + gMovesInfo[summary->moves[i]].contestCategory, 85, 32 + (i * 16), i + SPRITE_ARR_ID_TYPE); + SetTypeSpritePosAndPal(NUMBER_OF_MON_TYPES + GetMoveContestCategory(summary->moves[i]), 85, 32 + (i * 16), i + SPRITE_ARR_ID_TYPE); else SetSpriteInvisibility(i + SPRITE_ARR_ID_TYPE, TRUE); } @@ -4078,7 +4074,7 @@ static void SetContestMoveTypeIcons(void) static void SetNewMoveTypeIcon(void) { - u32 type = gMovesInfo[sMonSummaryScreen->newMove].type; + u32 type = GetMoveType(sMonSummaryScreen->newMove); struct Pokemon *mon = &sMonSummaryScreen->currentMon; if (P_SHOW_DYNAMIC_TYPES) @@ -4096,7 +4092,7 @@ static void SetNewMoveTypeIcon(void) } else { - SetTypeSpritePosAndPal(NUMBER_OF_MON_TYPES + gMovesInfo[sMonSummaryScreen->newMove].contestCategory, 85, 96, SPRITE_ARR_ID_TYPE + 4); + SetTypeSpritePosAndPal(NUMBER_OF_MON_TYPES + GetMoveContestCategory(sMonSummaryScreen->newMove), 85, 96, SPRITE_ARR_ID_TYPE + 4); } } } diff --git a/src/rom_header_gf.c b/src/rom_header_gf.c index 1074a86bf883..c55535003c27 100644 --- a/src/rom_header_gf.c +++ b/src/rom_header_gf.c @@ -1,10 +1,11 @@ #include "global.h" +#include "battle_main.h" #include "data.h" -#include "pokemon_icon.h" #include "decoration.h" -#include "battle_main.h" #include "item.h" +#include "move.h" #include "pokeball.h" +#include "pokemon_icon.h" // The purpose of this struct is for outside applications to be // able to access parts of the ROM or its save file, like a public API. diff --git a/src/scrcmd.c b/src/scrcmd.c index 399562f9a054..2471f3b5959c 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -29,6 +29,7 @@ #include "main.h" #include "menu.h" #include "money.h" +#include "move.h" #include "mystery_event_script.h" #include "palette.h" #include "party_menu.h" diff --git a/src/shop.c b/src/shop.c index a343bab0d3ee..dae2ea86ffb4 100644 --- a/src/shop.c +++ b/src/shop.c @@ -21,6 +21,7 @@ #include "menu.h" #include "menu_helpers.h" #include "money.h" +#include "move.h" #include "overworld.h" #include "palette.h" #include "party_menu.h" diff --git a/test/battle/ability/aerilate.c b/test/battle/ability/aerilate.c index 4386034a59f1..efd6776d9ba7 100644 --- a/test/battle/ability/aerilate.c +++ b/test/battle/ability/aerilate.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); } SINGLE_BATTLE_TEST("Aerilate turns a Normal-type move into Flying-type move") diff --git a/test/battle/ability/anger_point.c b/test/battle/ability/anger_point.c index b803b40f3fcf..7e8be8cb3378 100644 --- a/test/battle/ability/anger_point.c +++ b/test/battle/ability/anger_point.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Anger Point raises Attack stage to maximum after receiving a critical hit") { GIVEN { - ASSUME(gMovesInfo[MOVE_FROST_BREATH].alwaysCriticalHit); + ASSUME(MoveAlwaysCrits(MOVE_FROST_BREATH)); PLAYER(SPECIES_PRIMEAPE) { Ability(ABILITY_ANGER_POINT); } OPPONENT(SPECIES_SNORUNT); } WHEN { @@ -23,8 +23,8 @@ SINGLE_BATTLE_TEST("Anger Point raises Attack stage to maximum after receiving a SINGLE_BATTLE_TEST("Anger Point does not trigger when already at maximum Attack stage") { GIVEN { - ASSUME(gMovesInfo[MOVE_FROST_BREATH].alwaysCriticalHit); - ASSUME(gMovesInfo[MOVE_BELLY_DRUM].effect == EFFECT_BELLY_DRUM); + ASSUME(MoveAlwaysCrits(MOVE_FROST_BREATH)); + ASSUME(GetMoveEffect(MOVE_BELLY_DRUM) == EFFECT_BELLY_DRUM); PLAYER(SPECIES_PRIMEAPE) { Ability(ABILITY_ANGER_POINT); Speed(2); } OPPONENT(SPECIES_SNORUNT) { Speed(1); } } WHEN { @@ -50,8 +50,8 @@ TO_DO_BATTLE_TEST("Anger Point triggers when a substitute takes the hit (Gen4)") SINGLE_BATTLE_TEST("Anger Point does not trigger when a substitute takes the hit (Gen5+)") { GIVEN { - ASSUME(gMovesInfo[MOVE_FROST_BREATH].alwaysCriticalHit); - ASSUME(gMovesInfo[MOVE_SUBSTITUTE].effect == EFFECT_SUBSTITUTE); + ASSUME(MoveAlwaysCrits(MOVE_FROST_BREATH)); + ASSUME(GetMoveEffect(MOVE_SUBSTITUTE) == EFFECT_SUBSTITUTE); PLAYER(SPECIES_PRIMEAPE) { Ability(ABILITY_ANGER_POINT); Speed(2); } OPPONENT(SPECIES_SNORUNT) { Speed(1); } } WHEN { diff --git a/test/battle/ability/anger_shell.c b/test/battle/ability/anger_shell.c index cf28fad28c07..0dde568ca088 100644 --- a/test/battle/ability/anger_shell.c +++ b/test/battle/ability/anger_shell.c @@ -14,7 +14,7 @@ SINGLE_BATTLE_TEST("Anger Shell activates only if the target had more than 50% o PARAMETRIZE { hp = 254; activates = TRUE; } GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); PLAYER(SPECIES_KLAWF) { Ability(ABILITY_ANGER_SHELL); MaxHP(maxHp); HP(hp); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -41,7 +41,7 @@ SINGLE_BATTLE_TEST("Anger Shell lowers Def/Sp.Def by 1 and raises Atk/Sp.Atk/Spd { u16 maxHp = 500; GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); PLAYER(SPECIES_KLAWF) { Ability(ABILITY_ANGER_SHELL); MaxHP(maxHp); HP(maxHp / 2 + 1); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -73,7 +73,7 @@ SINGLE_BATTLE_TEST("Anger Shell activates after all hits from a multi-hit move") u32 j; u16 maxHp = 500; GIVEN { - ASSUME(gMovesInfo[MOVE_DOUBLE_SLAP].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_DOUBLE_SLAP) == EFFECT_MULTI_HIT); PLAYER(SPECIES_KLAWF) { Ability(ABILITY_ANGER_SHELL); MaxHP(maxHp); HP(maxHp / 2 + 1); } OPPONENT(SPECIES_SHELLDER) { Ability(ABILITY_SKILL_LINK); } // Always hits 5 times. } WHEN { diff --git a/test/battle/ability/battle_bond.c b/test/battle/ability/battle_bond.c index ef2b2753b3b4..f48036779818 100644 --- a/test/battle/ability/battle_bond.c +++ b/test/battle/ability/battle_bond.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(!IS_MOVE_STATUS(MOVE_WATER_GUN)); + ASSUME(!IsBattleMoveStatus(MOVE_WATER_GUN)); } SINGLE_BATTLE_TEST("Battle Bond does not transform species other than Greninja") diff --git a/test/battle/ability/beads_of_ruin.c b/test/battle/ability/beads_of_ruin.c index bbc71f6c2b34..63b07d7c8a62 100644 --- a/test/battle/ability/beads_of_ruin.c +++ b/test/battle/ability/beads_of_ruin.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_WATER_GUN].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_ROLE_PLAY].effect == EFFECT_ROLE_PLAY); + ASSUME(GetMoveCategory(MOVE_WATER_GUN) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveEffect(MOVE_ROLE_PLAY) == EFFECT_ROLE_PLAY); } SINGLE_BATTLE_TEST("Beads of Ruin reduces Sp. Def if opposing mon's ability doesn't match") @@ -33,7 +33,7 @@ SINGLE_BATTLE_TEST("Beads of Ruin reduces Sp. Def if opposing mon's ability does SINGLE_BATTLE_TEST("Beads of Ruin's message displays correctly after all battlers fainted - Player") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET) { HP(1);} PLAYER(SPECIES_CHI_YU); OPPONENT(SPECIES_WOBBUFFET); @@ -55,7 +55,7 @@ SINGLE_BATTLE_TEST("Beads of Ruin's message displays correctly after all battler SINGLE_BATTLE_TEST("Beads of Ruin's message displays correctly after all battlers fainted - Opponent") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { HP(1);} diff --git a/test/battle/ability/berserk.c b/test/battle/ability/berserk.c index 7d7f905170ee..c96bb260f84e 100644 --- a/test/battle/ability/berserk.c +++ b/test/battle/ability/berserk.c @@ -14,7 +14,7 @@ SINGLE_BATTLE_TEST("Berserk activates only if the target had more than 50% of it PARAMETRIZE { hp = 254; activates = TRUE; } GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); PLAYER(SPECIES_DRAMPA) { Ability(ABILITY_BERSERK); MaxHP(maxHp); HP(hp); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -37,7 +37,7 @@ SINGLE_BATTLE_TEST("Berserk raises Sp.Atk by 1") { u16 maxHp = 500; GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); PLAYER(SPECIES_DRAMPA) { Ability(ABILITY_BERSERK); MaxHP(maxHp); HP(maxHp / 2 + 1); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -57,7 +57,7 @@ SINGLE_BATTLE_TEST("Berserk activates after all hits from a multi-hit move") u32 j; u16 maxHp = 500; GIVEN { - ASSUME(gMovesInfo[MOVE_DOUBLE_SLAP].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_DOUBLE_SLAP) == EFFECT_MULTI_HIT); PLAYER(SPECIES_DRAMPA) { Ability(ABILITY_BERSERK); MaxHP(maxHp); HP(maxHp / 2 + 1); } OPPONENT(SPECIES_SHELLDER) { Ability(ABILITY_SKILL_LINK); } // Always hits 5 times. } WHEN { diff --git a/test/battle/ability/blaze.c b/test/battle/ability/blaze.c index a21d133359bf..c68c7466a165 100644 --- a/test/battle/ability/blaze.c +++ b/test/battle/ability/blaze.c @@ -7,7 +7,7 @@ SINGLE_BATTLE_TEST("Blaze boosts Fire-type moves in a pinch", s16 damage) PARAMETRIZE { hp = 99; } PARAMETRIZE { hp = 33; } GIVEN { - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); PLAYER(SPECIES_CHARMANDER) { Ability(ABILITY_BLAZE); MaxHP(99); HP(hp); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/clear_body.c b/test/battle/ability/clear_body.c index 1e955431a1b6..89b89e96bf31 100644 --- a/test/battle/ability/clear_body.c +++ b/test/battle/ability/clear_body.c @@ -58,13 +58,13 @@ SINGLE_BATTLE_TEST("Clear Body, Full Metal Body, and White Smoke prevent stat st } GIVEN { - ASSUME(gMovesInfo[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); - ASSUME(gMovesInfo[MOVE_LEER].effect == EFFECT_DEFENSE_DOWN); - ASSUME(gMovesInfo[MOVE_CONFIDE].effect == EFFECT_SPECIAL_ATTACK_DOWN); - ASSUME(gMovesInfo[MOVE_FAKE_TEARS].effect == EFFECT_SPECIAL_DEFENSE_DOWN_2); - ASSUME(gMovesInfo[MOVE_SCARY_FACE].effect == EFFECT_SPEED_DOWN_2); - ASSUME(gMovesInfo[MOVE_SWEET_SCENT].effect == (B_UPDATED_MOVE_DATA >= GEN_6 ? EFFECT_EVASION_DOWN_2 : EFFECT_EVASION_DOWN)); - ASSUME(gMovesInfo[MOVE_SAND_ATTACK].effect == EFFECT_ACCURACY_DOWN); + ASSUME(GetMoveEffect(MOVE_GROWL) == EFFECT_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_LEER) == EFFECT_DEFENSE_DOWN); + ASSUME(GetMoveEffect(MOVE_CONFIDE) == EFFECT_SPECIAL_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_FAKE_TEARS) == EFFECT_SPECIAL_DEFENSE_DOWN_2); + ASSUME(GetMoveEffect(MOVE_SCARY_FACE) == EFFECT_SPEED_DOWN_2); + ASSUME(GetMoveEffect(MOVE_SWEET_SCENT) == (B_UPDATED_MOVE_DATA >= GEN_6 ? EFFECT_EVASION_DOWN_2 : EFFECT_EVASION_DOWN)); + ASSUME(GetMoveEffect(MOVE_SAND_ATTACK) == EFFECT_ACCURACY_DOWN); PLAYER(SPECIES_WOBBUFFET) OPPONENT(species) { Ability(ability); } } WHEN { @@ -91,7 +91,7 @@ SINGLE_BATTLE_TEST("Clear Body, Full Metal Body, and White Smoke prevent Sticky PARAMETRIZE{ species = SPECIES_SOLGALEO; ability = ABILITY_FULL_METAL_BODY; } PARAMETRIZE{ species = SPECIES_TORKOAL; ability = ABILITY_WHITE_SMOKE; } GIVEN { - ASSUME(gMovesInfo[MOVE_STICKY_WEB].effect == EFFECT_STICKY_WEB); + ASSUME(GetMoveEffect(MOVE_STICKY_WEB) == EFFECT_STICKY_WEB); PLAYER(SPECIES_WOBBUFFET) OPPONENT(SPECIES_WOBBUFFET) OPPONENT(species) { Ability(ability); } @@ -166,13 +166,13 @@ SINGLE_BATTLE_TEST("Mold Breaker, Teravolt, and Turboblaze ignore Clear Body and } GIVEN { - ASSUME(gMovesInfo[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); - ASSUME(gMovesInfo[MOVE_LEER].effect == EFFECT_DEFENSE_DOWN); - ASSUME(gMovesInfo[MOVE_CONFIDE].effect == EFFECT_SPECIAL_ATTACK_DOWN); - ASSUME(gMovesInfo[MOVE_FAKE_TEARS].effect == EFFECT_SPECIAL_DEFENSE_DOWN_2); - ASSUME(gMovesInfo[MOVE_SCARY_FACE].effect == EFFECT_SPEED_DOWN_2); - ASSUME(gMovesInfo[MOVE_SWEET_SCENT].effect == (B_UPDATED_MOVE_DATA >= GEN_6 ? EFFECT_EVASION_DOWN_2 : EFFECT_EVASION_DOWN)); - ASSUME(gMovesInfo[MOVE_SAND_ATTACK].effect == EFFECT_ACCURACY_DOWN); + ASSUME(GetMoveEffect(MOVE_GROWL) == EFFECT_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_LEER) == EFFECT_DEFENSE_DOWN); + ASSUME(GetMoveEffect(MOVE_CONFIDE) == EFFECT_SPECIAL_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_FAKE_TEARS) == EFFECT_SPECIAL_DEFENSE_DOWN_2); + ASSUME(GetMoveEffect(MOVE_SCARY_FACE) == EFFECT_SPEED_DOWN_2); + ASSUME(GetMoveEffect(MOVE_SWEET_SCENT) == (B_UPDATED_MOVE_DATA >= GEN_6 ? EFFECT_EVASION_DOWN_2 : EFFECT_EVASION_DOWN)); + ASSUME(GetMoveEffect(MOVE_SAND_ATTACK) == EFFECT_ACCURACY_DOWN); PLAYER(SPECIES_WOBBUFFET) { Ability(breakerAbility); } OPPONENT(species) { Ability(ability); } } WHEN { @@ -284,7 +284,7 @@ SINGLE_BATTLE_TEST("Clear Body, Full Metal Body, and White Smoke don't prevent A PARAMETRIZE{ species = SPECIES_TORKOAL; ability = ABILITY_WHITE_SMOKE; burned = FALSE; } PARAMETRIZE{ species = SPECIES_TORKOAL; ability = ABILITY_WHITE_SMOKE; burned = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET) OPPONENT(species) { Ability(ability); if (burned) Status1(STATUS1_BURN); } } WHEN { @@ -306,8 +306,8 @@ SINGLE_BATTLE_TEST("Clear Body, Full Metal Body, and White Smoke don't prevent r PARAMETRIZE{ species = SPECIES_TORKOAL; ability = ABILITY_WHITE_SMOKE; } GIVEN { - ASSUME(gMovesInfo[MOVE_SCARY_FACE].effect == EFFECT_SPEED_DOWN_2); - ASSUME(gMovesInfo[MOVE_BATON_PASS].effect == EFFECT_BATON_PASS); + ASSUME(GetMoveEffect(MOVE_SCARY_FACE) == EFFECT_SPEED_DOWN_2); + ASSUME(GetMoveEffect(MOVE_BATON_PASS) == EFFECT_BATON_PASS); PLAYER(SPECIES_WOBBUFFET) { Speed(4); } OPPONENT(SPECIES_WOBBUFFET) { Speed(3); } OPPONENT(species) { Speed(6); Ability(ability); } @@ -336,9 +336,9 @@ SINGLE_BATTLE_TEST("Clear Body, Full Metal Body, and White Smoke don't prevent T PARAMETRIZE{ species = SPECIES_TORKOAL; ability = ABILITY_WHITE_SMOKE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TOPSY_TURVY].effect == EFFECT_TOPSY_TURVY); - ASSUME(gMovesInfo[MOVE_SCARY_FACE].effect == EFFECT_SPEED_DOWN_2); - ASSUME(gMovesInfo[MOVE_BATON_PASS].effect == EFFECT_BATON_PASS); + ASSUME(GetMoveEffect(MOVE_TOPSY_TURVY) == EFFECT_TOPSY_TURVY); + ASSUME(GetMoveEffect(MOVE_SCARY_FACE) == EFFECT_SPEED_DOWN_2); + ASSUME(GetMoveEffect(MOVE_BATON_PASS) == EFFECT_BATON_PASS); PLAYER(SPECIES_WOBBUFFET) { Speed(4); } OPPONENT(SPECIES_WOBBUFFET) { Speed(3); } OPPONENT(species) { Speed(6); Ability(ability); } @@ -378,7 +378,7 @@ SINGLE_BATTLE_TEST("Clear Body, Full Metal Body, and White Smoke don't prevent S GIVEN { ASSUME(MoveHasAdditionalEffect(MOVE_SPECTRAL_THIEF, MOVE_EFFECT_SPECTRAL_THIEF) == TRUE); - ASSUME(gMovesInfo[MOVE_AGILITY].effect == EFFECT_SPEED_UP_2); + ASSUME(GetMoveEffect(MOVE_AGILITY) == EFFECT_SPEED_UP_2); PLAYER(SPECIES_WOBBUFFET) { Speed(4); } OPPONENT(species) { Speed(5); Ability(ability); } } WHEN { diff --git a/test/battle/ability/cloud_nine.c b/test/battle/ability/cloud_nine.c index fb87b7f2ba35..613ea86e0acf 100644 --- a/test/battle/ability/cloud_nine.c +++ b/test/battle/ability/cloud_nine.c @@ -7,7 +7,7 @@ SINGLE_BATTLE_TEST("Cloud Nine/Air Lock prevent basic weather effects, but witho PARAMETRIZE { species = SPECIES_PSYDUCK; ability = ABILITY_CLOUD_NINE; } PARAMETRIZE { species = SPECIES_RAYQUAZA; ability = ABILITY_AIR_LOCK; } GIVEN { - ASSUME(gMovesInfo[MOVE_SANDSTORM].effect == EFFECT_SANDSTORM); + ASSUME(GetMoveEffect(MOVE_SANDSTORM) == EFFECT_SANDSTORM); PLAYER(species) { Ability(ability); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/commander.c b/test/battle/ability/commander.c index 26f5574ba827..2220fb9ec204 100644 --- a/test/battle/ability/commander.c +++ b/test/battle/ability/commander.c @@ -175,7 +175,7 @@ DOUBLE_BATTLE_TEST("Commander prevents Red Card from working while Commander is DOUBLE_BATTLE_TEST("Commander Tatsugiri is not damaged by a double target move if Dondozo faints") { GIVEN { - ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_SURF) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_DONDOZO) { HP(1); }; PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } PLAYER(SPECIES_WYNAUT); @@ -308,7 +308,7 @@ DOUBLE_BATTLE_TEST("Commander Tatsugiri is still affected by Haze while controll DOUBLE_BATTLE_TEST("Commander Attacker is kept (Dondozo Left Slot)") { GIVEN { - ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_SURF) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } PLAYER(SPECIES_DONDOZO); @@ -331,7 +331,7 @@ DOUBLE_BATTLE_TEST("Commander Attacker is kept (Dondozo Left Slot)") DOUBLE_BATTLE_TEST("Commander Attacker is kept (Dondozo Right Slot)") { GIVEN { - ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_SURF) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_DONDOZO); @@ -380,7 +380,7 @@ DOUBLE_BATTLE_TEST("Commander Tatsugiri does not attack if Dondozo faints the sa DOUBLE_BATTLE_TEST("Commander Tatsugiri does not get hit by Dragon Darts when a commanded Dondozo faints") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_DARTS].effect == EFFECT_DRAGON_DARTS); + ASSUME(GetMoveEffect(MOVE_DRAGON_DARTS) == EFFECT_DRAGON_DARTS); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_DONDOZO) { HP(1); } PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } @@ -402,7 +402,7 @@ DOUBLE_BATTLE_TEST("Commander Tatsugiri does not get hit by Dragon Darts when co PARAMETRIZE { targetPlayerRight = TRUE; } PARAMETRIZE { targetPlayerRight = FALSE; } GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_DARTS].effect == EFFECT_DRAGON_DARTS); + ASSUME(GetMoveEffect(MOVE_DRAGON_DARTS) == EFFECT_DRAGON_DARTS); PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } PLAYER(SPECIES_DONDOZO); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/ability/compound_eyes.c b/test/battle/ability/compound_eyes.c index 32fa1dda2edf..338da6bf21d9 100644 --- a/test/battle/ability/compound_eyes.c +++ b/test/battle/ability/compound_eyes.c @@ -5,7 +5,7 @@ SINGLE_BATTLE_TEST("Compound Eyes raises accuracy") { PASSES_RANDOMLY(91, 100, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_THUNDER].accuracy == 70); + ASSUME(GetMoveAccuracy(MOVE_THUNDER) == 70); PLAYER(SPECIES_BUTTERFREE) { Ability(ABILITY_COMPOUND_EYES); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -20,8 +20,8 @@ SINGLE_BATTLE_TEST("Compound Eyes does not affect OHKO moves") { PASSES_RANDOMLY(30, 100, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_FISSURE].accuracy == 30); - ASSUME(gMovesInfo[MOVE_FISSURE].effect == EFFECT_OHKO); + ASSUME(GetMoveAccuracy(MOVE_FISSURE) == 30); + ASSUME(GetMoveEffect(MOVE_FISSURE) == EFFECT_OHKO); PLAYER(SPECIES_BUTTERFREE) { Ability(ABILITY_COMPOUND_EYES); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/contrary.c b/test/battle/ability/contrary.c index 56eb6abf6521..3c9c3e6dff9b 100644 --- a/test/battle/ability/contrary.c +++ b/test/battle/ability/contrary.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); } SINGLE_BATTLE_TEST("Contrary raises Attack when Intimidated in a single battle", s16 damage) @@ -83,7 +83,7 @@ SINGLE_BATTLE_TEST("Contrary raises stats after using a move which would normall PARAMETRIZE { ability = ABILITY_TANGLED_FEET; } GIVEN { ASSUME(MoveHasAdditionalEffectSelf(MOVE_OVERHEAT, MOVE_EFFECT_SP_ATK_MINUS_2) == TRUE); - ASSUME(gMovesInfo[MOVE_OVERHEAT].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_OVERHEAT) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_SPINDA) { Ability(ability); } } WHEN { @@ -126,7 +126,7 @@ SINGLE_BATTLE_TEST("Contrary lowers a stat after using a move which would normal PARAMETRIZE { ability = ABILITY_CONTRARY; } PARAMETRIZE { ability = ABILITY_TANGLED_FEET; } GIVEN { - ASSUME(gMovesInfo[MOVE_SWORDS_DANCE].effect == EFFECT_ATTACK_UP_2); + ASSUME(GetMoveEffect(MOVE_SWORDS_DANCE) == EFFECT_ATTACK_UP_2); PLAYER(SPECIES_WOBBUFFET) { Defense(102); } OPPONENT(SPECIES_SPINDA) { Ability(ability); Attack(100); } } WHEN { @@ -163,7 +163,7 @@ SINGLE_BATTLE_TEST("Contrary raises a stat after using a move which would normal PARAMETRIZE { ability = ABILITY_CONTRARY; } PARAMETRIZE { ability = ABILITY_TANGLED_FEET; } GIVEN { - ASSUME(gMovesInfo[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_GROWL) == EFFECT_ATTACK_DOWN); PLAYER(SPECIES_WOBBUFFET) { Speed(3); } OPPONENT(SPECIES_SPINDA) { Ability(ability); Speed(2); } } WHEN { @@ -194,7 +194,7 @@ SINGLE_BATTLE_TEST("Contrary lowers a stat after using a move which would normal PARAMETRIZE { ability = ABILITY_CONTRARY; } PARAMETRIZE { ability = ABILITY_TANGLED_FEET; } GIVEN { - ASSUME(gMovesInfo[MOVE_BELLY_DRUM].effect == EFFECT_BELLY_DRUM); + ASSUME(GetMoveEffect(MOVE_BELLY_DRUM) == EFFECT_BELLY_DRUM); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_SPINDA) { Ability(ability); } } WHEN { diff --git a/test/battle/ability/corrosion.c b/test/battle/ability/corrosion.c index 8addbd90faab..8541c21f271e 100644 --- a/test/battle/ability/corrosion.c +++ b/test/battle/ability/corrosion.c @@ -30,8 +30,8 @@ SINGLE_BATTLE_TEST("Corrosion can poison or badly poison a Steel type with a sta PARAMETRIZE { move = MOVE_TOXIC; } GIVEN { - ASSUME(gMovesInfo[MOVE_POISON_POWDER].effect == EFFECT_POISON); - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_POISON_POWDER) == EFFECT_POISON); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); PLAYER(SPECIES_SALANDIT) { Ability(ABILITY_CORROSION); } OPPONENT(SPECIES_BELDUM); } WHEN { @@ -72,7 +72,7 @@ SINGLE_BATTLE_TEST("Corrosion can poison Poison- and Steel-type targets if it us PARAMETRIZE { heldItem = ITEM_TOXIC_ORB; } GIVEN { - ASSUME(gMovesInfo[MOVE_FLING].effect == EFFECT_FLING); + ASSUME(GetMoveEffect(MOVE_FLING) == EFFECT_FLING); ASSUME(gItemsInfo[ITEM_POISON_BARB].holdEffect == HOLD_EFFECT_POISON_POWER); ASSUME(gItemsInfo[ITEM_TOXIC_ORB].holdEffect == HOLD_EFFECT_TOXIC_ORB); PLAYER(SPECIES_SALANDIT) { Ability(ABILITY_CORROSION); Item(heldItem); } @@ -110,8 +110,8 @@ SINGLE_BATTLE_TEST("If a Poison- or Steel-type Pokémon with Corrosion poisons a PARAMETRIZE { move = MOVE_TOXIC; } PARAMETRIZE { move = MOVE_POISON_POWDER; } GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); - ASSUME(gMovesInfo[MOVE_POISON_POWDER].effect == EFFECT_POISON); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_POISON_POWDER) == EFFECT_POISON); PLAYER(SPECIES_SALANDIT) { Ability(ABILITY_CORROSION); } OPPONENT(SPECIES_ABRA) { Ability(ABILITY_SYNCHRONIZE); } } WHEN { @@ -137,8 +137,8 @@ SINGLE_BATTLE_TEST("Corrosion cannot bypass moves that prevent poisoning such as PARAMETRIZE { move = MOVE_TOXIC; } PARAMETRIZE { move = MOVE_POISON_POWDER; } GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); - ASSUME(gMovesInfo[MOVE_POISON_POWDER].effect == EFFECT_POISON); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_POISON_POWDER) == EFFECT_POISON); PLAYER(SPECIES_SALANDIT) { Ability(ABILITY_CORROSION); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -159,8 +159,8 @@ SINGLE_BATTLE_TEST("Corrosion cannot bypass abilities that prevent poisoning suc PARAMETRIZE { move = MOVE_TOXIC; } PARAMETRIZE { move = MOVE_POISON_POWDER; } GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); - ASSUME(gMovesInfo[MOVE_POISON_POWDER].effect == EFFECT_POISON); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_POISON_POWDER) == EFFECT_POISON); PLAYER(SPECIES_SALANDIT) { Ability(ABILITY_CORROSION); } OPPONENT(SPECIES_SNORLAX) { Ability(ABILITY_IMMUNITY); } } WHEN { @@ -181,9 +181,9 @@ SINGLE_BATTLE_TEST("Corrosion allows the Pokémon with the ability to poison a S PARAMETRIZE { move = MOVE_TOXIC; } PARAMETRIZE { move = MOVE_POISON_POWDER; } GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); - ASSUME(gMovesInfo[MOVE_POISON_POWDER].effect == EFFECT_POISON); - ASSUME(gMovesInfo[MOVE_MAGIC_COAT].effect == EFFECT_MAGIC_COAT); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_POISON_POWDER) == EFFECT_POISON); + ASSUME(GetMoveEffect(MOVE_MAGIC_COAT) == EFFECT_MAGIC_COAT); PLAYER(SPECIES_SALANDIT) { Ability(ABILITY_CORROSION); } OPPONENT(SPECIES_BELDUM); } WHEN { @@ -205,9 +205,9 @@ SINGLE_BATTLE_TEST("Corrosion's effect is lost if the move used by the Pokémon PARAMETRIZE { move = MOVE_TOXIC; } PARAMETRIZE { move = MOVE_POISON_POWDER; } GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); - ASSUME(gMovesInfo[MOVE_POISON_POWDER].effect == EFFECT_POISON); - ASSUME(gMovesInfo[MOVE_MAGIC_COAT].effect == EFFECT_MAGIC_COAT); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_POISON_POWDER) == EFFECT_POISON); + ASSUME(GetMoveEffect(MOVE_MAGIC_COAT) == EFFECT_MAGIC_COAT); PLAYER(SPECIES_SALANDIT) { Ability(ABILITY_CORROSION); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/cud_chew.c b/test/battle/ability/cud_chew.c index b3dd92ecd5f9..9ac5593474aa 100644 --- a/test/battle/ability/cud_chew.c +++ b/test/battle/ability/cud_chew.c @@ -5,7 +5,7 @@ SINGLE_BATTLE_TEST("Cud Chew will activate Kee Berry effect again on the next tu { GIVEN { ASSUME(gItemsInfo[ITEM_KEE_BERRY].holdEffect == HOLD_EFFECT_KEE_BERRY); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_TAUROS_PALDEA_COMBAT) { Ability(ABILITY_CUD_CHEW); Item(ITEM_KEE_BERRY); } } WHEN { @@ -28,8 +28,8 @@ SINGLE_BATTLE_TEST("Cud Chew will activate Oran Berry effect again on the next t GIVEN { ASSUME(gItemsInfo[ITEM_ORAN_BERRY].holdEffect == HOLD_EFFECT_RESTORE_HP); ASSUME(gItemsInfo[ITEM_ORAN_BERRY].holdEffectParam == 10); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].argument.fixedDamage == 40); + ASSUME(GetMoveEffect(MOVE_DRAGON_RAGE) == EFFECT_FIXED_DAMAGE_ARG); + ASSUME(GetMoveFixedDamage(MOVE_DRAGON_RAGE) == 40); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_TAUROS_PALDEA_COMBAT) { MaxHP(60); HP(60); Ability(ABILITY_CUD_CHEW); Item(ITEM_ORAN_BERRY); } } WHEN { diff --git a/test/battle/ability/cute_charm.c b/test/battle/ability/cute_charm.c index e6eee0ae0862..55e64b3226b5 100644 --- a/test/battle/ability/cute_charm.c +++ b/test/battle/ability/cute_charm.c @@ -7,15 +7,15 @@ SINGLE_BATTLE_TEST("Cute Charm inflicts infatuation on contact") PARAMETRIZE { move = MOVE_TACKLE; } PARAMETRIZE { move = MOVE_SWIFT; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(!gMovesInfo[MOVE_SWIFT].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(!MoveMakesContact(MOVE_SWIFT)); PLAYER(SPECIES_WOBBUFFET) { Gender(MON_MALE); } OPPONENT(SPECIES_CLEFAIRY) { Gender(MON_FEMALE); Ability(ABILITY_CUTE_CHARM); } } WHEN { TURN { MOVE(player, move); } TURN { MOVE(player, move); } } SCENE { - if (gMovesInfo[move].makesContact) { + if (MoveMakesContact(move)) { ABILITY_POPUP(opponent, ABILITY_CUTE_CHARM); ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_INFATUATION, player); MESSAGE("The opposing Clefairy's Cute Charm infatuated Wobbuffet!"); @@ -51,7 +51,7 @@ SINGLE_BATTLE_TEST("Cute Charm triggers 30% of the time") PASSES_RANDOMLY(3, 10, RNG_CUTE_CHARM); GIVEN { ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_4); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET) { Gender(MON_MALE); } OPPONENT(SPECIES_CLEFAIRY) { Gender(MON_FEMALE); Ability(ABILITY_CUTE_CHARM); } } WHEN { diff --git a/test/battle/ability/damp.c b/test/battle/ability/damp.c index b567293aa09b..1088a7a17e92 100644 --- a/test/battle/ability/damp.c +++ b/test/battle/ability/damp.c @@ -60,7 +60,7 @@ SINGLE_BATTLE_TEST("Damp prevents explosion-like moves from self") SINGLE_BATTLE_TEST("Damp prevents damage from Aftermath") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_PARAS) { Ability(ABILITY_DAMP); } OPPONENT(SPECIES_VOLTORB) { Ability(ABILITY_AFTERMATH); HP(1); } OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/ability/dancer.c b/test/battle/ability/dancer.c index 5519ac3222c4..657a126470ee 100644 --- a/test/battle/ability/dancer.c +++ b/test/battle/ability/dancer.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Dancer can copy a dance move immediately after it was used and allow the user of Dancer to still use its move") { GIVEN { - ASSUME(gMovesInfo[MOVE_QUIVER_DANCE].danceMove == TRUE); + ASSUME(IsDanceMove(MOVE_QUIVER_DANCE)); PLAYER(SPECIES_WOBBUFFET) OPPONENT(SPECIES_ORICORIO) { Ability(ABILITY_DANCER); } } WHEN { @@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("Dancer can copy a dance move immediately after it was used a SINGLE_BATTLE_TEST("Dancer can copy Teeter Dance") { GIVEN { - ASSUME(gMovesInfo[MOVE_TEETER_DANCE].danceMove == TRUE); + ASSUME(IsDanceMove(MOVE_TEETER_DANCE)); PLAYER(SPECIES_WOBBUFFET) OPPONENT(SPECIES_ORICORIO) { Ability(ABILITY_DANCER); Item(ITEM_LUM_BERRY); } } WHEN { @@ -37,7 +37,7 @@ SINGLE_BATTLE_TEST("Dancer can copy Teeter Dance") DOUBLE_BATTLE_TEST("Dancer can copy Teeter Dance and confuse both opposing targets") { GIVEN { - ASSUME(gMovesInfo[MOVE_TEETER_DANCE].danceMove == TRUE); + ASSUME(IsDanceMove(MOVE_TEETER_DANCE)); ASSUME(gItemsInfo[ITEM_LUM_BERRY].holdEffect == HOLD_EFFECT_CURE_STATUS); PLAYER(SPECIES_WOBBUFFET) PLAYER(SPECIES_WYNAUT) { Item(ITEM_LUM_BERRY); } @@ -57,7 +57,7 @@ DOUBLE_BATTLE_TEST("Dancer can copy Teeter Dance and confuse both opposing targe DOUBLE_BATTLE_TEST("Dancer triggers from slowest to fastest") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); + ASSUME(IsDanceMove(MOVE_DRAGON_DANCE)); PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_DANCER); Speed(10); } PLAYER(SPECIES_WYNAUT) { Speed(50); } OPPONENT(SPECIES_ORICORIO) { Ability(ABILITY_DANCER); Speed(20); } @@ -83,7 +83,7 @@ SINGLE_BATTLE_TEST("Dancer doesn't trigger if the original user flinches") { GIVEN { ASSUME(MoveHasAdditionalEffectWithChance(MOVE_FAKE_OUT, MOVE_EFFECT_FLINCH, 100)); - ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); + ASSUME(IsDanceMove(MOVE_DRAGON_DANCE)); PLAYER(SPECIES_WOBBUFFET) OPPONENT(SPECIES_ORICORIO) { Ability(ABILITY_DANCER); } } WHEN { @@ -102,7 +102,7 @@ DOUBLE_BATTLE_TEST("Dancer still triggers if another dancer flinches") { GIVEN { ASSUME(MoveHasAdditionalEffectWithChance(MOVE_FAKE_OUT, MOVE_EFFECT_FLINCH, 100)); - ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); + ASSUME(IsDanceMove(MOVE_DRAGON_DANCE)); PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_DANCER); Speed(10); } PLAYER(SPECIES_WYNAUT) { Speed(5); } OPPONENT(SPECIES_ORICORIO) { Ability(ABILITY_DANCER); Speed(20); } @@ -130,8 +130,8 @@ DOUBLE_BATTLE_TEST("Dancer still triggers if another dancer flinches") SINGLE_BATTLE_TEST("Dancer-called attacks have their type updated") { GIVEN { - ASSUME(gMovesInfo[MOVE_REVELATION_DANCE].danceMove == TRUE); - ASSUME(gMovesInfo[MOVE_REVELATION_DANCE].effect == EFFECT_REVELATION_DANCE); + ASSUME(IsDanceMove(MOVE_REVELATION_DANCE)); + ASSUME(GetMoveEffect(MOVE_REVELATION_DANCE) == EFFECT_REVELATION_DANCE); PLAYER(SPECIES_TANGROWTH); OPPONENT(SPECIES_ORICORIO_BAILE); } WHEN { @@ -149,8 +149,8 @@ SINGLE_BATTLE_TEST("Dancer-called attacks have their type updated") DOUBLE_BATTLE_TEST("Dancer doesn't trigger on a snatched move") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); - ASSUME(gMovesInfo[MOVE_SNATCH].effect == EFFECT_SNATCH); + ASSUME(IsDanceMove(MOVE_DRAGON_DANCE)); + ASSUME(GetMoveEffect(MOVE_SNATCH) == EFFECT_SNATCH); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_ORICORIO); @@ -173,9 +173,9 @@ DOUBLE_BATTLE_TEST("Dancer doesn't trigger on a snatched move") DOUBLE_BATTLE_TEST("Dancer triggers on Instructed dance moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); - ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].instructBanned == FALSE); - ASSUME(gMovesInfo[MOVE_INSTRUCT].effect == EFFECT_INSTRUCT); + ASSUME(IsDanceMove(MOVE_DRAGON_DANCE)); + ASSUME(!IsMoveInstructBanned(MOVE_DRAGON_DANCE)); + ASSUME(GetMoveEffect(MOVE_INSTRUCT) == EFFECT_INSTRUCT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_ORICORIO); @@ -200,9 +200,9 @@ DOUBLE_BATTLE_TEST("Dancer triggers on Instructed dance moves") DOUBLE_BATTLE_TEST("Dancer-called move doesn't update move to be Instructed") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); - ASSUME(gMovesInfo[MOVE_TACKLE].instructBanned == FALSE); - ASSUME(gMovesInfo[MOVE_INSTRUCT].effect == EFFECT_INSTRUCT); + ASSUME(IsDanceMove(MOVE_DRAGON_DANCE)); + ASSUME(!IsMoveInstructBanned(MOVE_TACKLE)); + ASSUME(GetMoveEffect(MOVE_INSTRUCT) == EFFECT_INSTRUCT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_ORICORIO); @@ -228,8 +228,8 @@ DOUBLE_BATTLE_TEST("Dancer-called move doesn't update move to be Instructed") DOUBLE_BATTLE_TEST("Dancer doesn't call a move that didn't execute due to Powder") { GIVEN { - ASSUME(gMovesInfo[MOVE_FIERY_DANCE].danceMove == TRUE); - ASSUME(gMovesInfo[MOVE_FIERY_DANCE].type == TYPE_FIRE); + ASSUME(IsDanceMove(MOVE_FIERY_DANCE)); + ASSUME(GetMoveType(MOVE_FIERY_DANCE) == TYPE_FIRE); PLAYER(SPECIES_VOLCARONA); PLAYER(SPECIES_ORICORIO); OPPONENT(SPECIES_WYNAUT); diff --git a/test/battle/ability/dazzling.c b/test/battle/ability/dazzling.c index 9eedb56a4957..cc77e9a3bdee 100644 --- a/test/battle/ability/dazzling.c +++ b/test/battle/ability/dazzling.c @@ -4,7 +4,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority > 0); + ASSUME(GetMovePriority(MOVE_QUICK_ATTACK) > 0); } DOUBLE_BATTLE_TEST("Dazzling, Queenly Majesty and Armor Tail protect the user from priority moves") diff --git a/test/battle/ability/defeatist.c b/test/battle/ability/defeatist.c index d2866d6f300b..18d8186a50e8 100644 --- a/test/battle/ability/defeatist.c +++ b/test/battle/ability/defeatist.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_ECHOED_VOICE].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_ECHOED_VOICE) == DAMAGE_CATEGORY_SPECIAL); } SINGLE_BATTLE_TEST("Defeatist halves Attack when HP <= 50%", s16 damage) diff --git a/test/battle/ability/defiant.c b/test/battle/ability/defiant.c index 9b767b8323c2..b1bd1024531e 100644 --- a/test/battle/ability/defiant.c +++ b/test/battle/ability/defiant.c @@ -277,7 +277,7 @@ SINGLE_BATTLE_TEST("Defiant activates before White Herb") SINGLE_BATTLE_TEST("Defiant activates for each stat that is lowered") { GIVEN { - ASSUME(gMovesInfo[MOVE_TICKLE].effect == EFFECT_TICKLE); + ASSUME(GetMoveEffect(MOVE_TICKLE) == EFFECT_TICKLE); PLAYER(SPECIES_MANKEY) { Ability(ABILITY_DEFIANT); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/desolate_land.c b/test/battle/ability/desolate_land.c index 18fe76b0c905..5bf1358503b1 100644 --- a/test/battle/ability/desolate_land.c +++ b/test/battle/ability/desolate_land.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(!IS_MOVE_STATUS(MOVE_WATER_GUN)); - ASSUME(gMovesInfo[MOVE_WATER_GUN].type == TYPE_WATER); + ASSUME(!IsBattleMoveStatus(MOVE_WATER_GUN)); + ASSUME(GetMoveType(MOVE_WATER_GUN) == TYPE_WATER); } SINGLE_BATTLE_TEST("Desolate Land blocks damaging Water-type moves") @@ -32,9 +32,9 @@ SINGLE_BATTLE_TEST("Desolate Land blocks damaging Water-type moves") DOUBLE_BATTLE_TEST("Desolate Land blocks damaging Water-type moves and prints the message only once with moves hitting multiple targets") { GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_SURF)); - ASSUME(gMovesInfo[MOVE_SURF].type == TYPE_WATER); - ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(!IsBattleMoveStatus(MOVE_SURF)); + ASSUME(GetMoveType(MOVE_SURF) == TYPE_WATER); + ASSUME(GetMoveTarget(MOVE_SURF) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_GROUDON) {Item(ITEM_RED_ORB); {Speed(5);}} PLAYER(SPECIES_WOBBUFFET) {Speed(5);} OPPONENT(SPECIES_WOBBUFFET) {Speed(10);} diff --git a/test/battle/ability/disguise.c b/test/battle/ability/disguise.c index 9c5f917e9db0..b1d854f0cfe0 100644 --- a/test/battle/ability/disguise.c +++ b/test/battle/ability/disguise.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_AERIAL_ACE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_AERIAL_ACE) == DAMAGE_CATEGORY_PHYSICAL); } SINGLE_BATTLE_TEST("Disguised Mimikyu will lose 1/8 of its max HP upon changing to its busted form") @@ -28,7 +28,7 @@ SINGLE_BATTLE_TEST("Disguised Mimikyu will lose 1/8 of its max HP upon changing SINGLE_BATTLE_TEST("Disguised Mimikyu takes no damage from a confusion hit and changes to its busted form") { GIVEN { - ASSUME(gMovesInfo[MOVE_CONFUSE_RAY].effect == EFFECT_CONFUSE); + ASSUME(GetMoveEffect(MOVE_CONFUSE_RAY) == EFFECT_CONFUSE); PLAYER(SPECIES_MIMIKYU_DISGUISED) { Ability(ABILITY_DISGUISE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -69,7 +69,7 @@ SINGLE_BATTLE_TEST("Disguised Mimikyu's Air Balloon will pop upon changing to it SINGLE_BATTLE_TEST("Disguised Mimikyu takes damage from secondary damage without breaking the disguise") { GIVEN { - ASSUME(gMovesInfo[MOVE_STEALTH_ROCK].effect == EFFECT_STEALTH_ROCK); + ASSUME(GetMoveEffect(MOVE_STEALTH_ROCK) == EFFECT_STEALTH_ROCK); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_MIMIKYU_DISGUISED) { Ability(ABILITY_DISGUISE); } OPPONENT(SPECIES_WOBBUFFET); @@ -138,7 +138,7 @@ SINGLE_BATTLE_TEST("Disguised Mimikyu is ignored by Mold Breaker") SINGLE_BATTLE_TEST("Disguised Mimikyu's types revert back to Ghost/Fairy when Disguise is broken") { GIVEN { - ASSUME(gMovesInfo[MOVE_SHADOW_CLAW].type == TYPE_GHOST); + ASSUME(GetMoveType(MOVE_SHADOW_CLAW) == TYPE_GHOST); PLAYER(SPECIES_MIMIKYU_DISGUISED) { Ability(ABILITY_DISGUISE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -158,7 +158,7 @@ SINGLE_BATTLE_TEST("Disguised Mimikyu's types revert back to Ghost/Fairy when Di SINGLE_BATTLE_TEST("Disguised Mimikyu blocks a move after getting Gastro Acid Batton Passed") { GIVEN { - ASSUME(gMovesInfo[MOVE_BATON_PASS].effect == EFFECT_BATON_PASS); + ASSUME(GetMoveEffect(MOVE_BATON_PASS) == EFFECT_BATON_PASS); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_MIMIKYU_DISGUISED) { Ability(ABILITY_DISGUISE); } OPPONENT(SPECIES_WOBBUFFET); @@ -177,7 +177,7 @@ SINGLE_BATTLE_TEST("Disguised Mimikyu blocks a move after getting Gastro Acid Ba SINGLE_BATTLE_TEST("Disguise does not break from a teammate's Wish") { GIVEN { - ASSUME(gMovesInfo[MOVE_WISH].effect == EFFECT_WISH); + ASSUME(GetMoveEffect(MOVE_WISH) == EFFECT_WISH); PLAYER(SPECIES_JIRACHI); PLAYER(SPECIES_MIMIKYU_DISGUISED) { Ability(ABILITY_DISGUISE); HP(219); MaxHP(220); } OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/ability/download.c b/test/battle/ability/download.c index 480f0bf10e5c..eec380e4218c 100644 --- a/test/battle/ability/download.c +++ b/test/battle/ability/download.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_TRI_ATTACK].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TRI_ATTACK) == DAMAGE_CATEGORY_SPECIAL); } SINGLE_BATTLE_TEST("Download raises Attack if player has lower Def than Sp. Def", s16 damage) @@ -60,7 +60,7 @@ SINGLE_BATTLE_TEST("Download doesn't activate if target hasn't been sent out yet PARAMETRIZE { ability = ABILITY_TRACE; } PARAMETRIZE { ability = ABILITY_DOWNLOAD; } GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET) { Speed(100); } PLAYER(SPECIES_PORYGON) { Ability(ability); Defense(400); SpDefense(300); Speed(300); Attack(100); } OPPONENT(SPECIES_WOBBUFFET) { HP(1); Speed(100); } diff --git a/test/battle/ability/dragons_maw.c b/test/battle/ability/dragons_maw.c index 401c4244c86a..d7e1ebd79378 100644 --- a/test/battle/ability/dragons_maw.c +++ b/test/battle/ability/dragons_maw.c @@ -14,11 +14,11 @@ SINGLE_BATTLE_TEST("Dragon's Maw increases Dragon-type move damage", s16 damage) PARAMETRIZE { move = MOVE_DRAGON_BREATH; ability = ABILITY_DRAGONS_MAW; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].type != TYPE_DRAGON); - ASSUME(gMovesInfo[MOVE_DRAGON_CLAW].type == TYPE_DRAGON); - ASSUME(gMovesInfo[MOVE_DRAGON_BREATH].type == TYPE_DRAGON); - ASSUME(gMovesInfo[MOVE_DRAGON_CLAW].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_DRAGON_BREATH].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveType(MOVE_TACKLE) != TYPE_DRAGON); + ASSUME(GetMoveType(MOVE_DRAGON_CLAW) == TYPE_DRAGON); + ASSUME(GetMoveType(MOVE_DRAGON_BREATH) == TYPE_DRAGON); + ASSUME(GetMoveCategory(MOVE_DRAGON_CLAW) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_DRAGON_BREATH) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_REGIDRAGO) { Ability(ability); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/dry_skin.c b/test/battle/ability/dry_skin.c index 5709a58a9448..95a0cd8fa84d 100644 --- a/test/battle/ability/dry_skin.c +++ b/test/battle/ability/dry_skin.c @@ -39,8 +39,8 @@ SINGLE_BATTLE_TEST("Dry Skin increases damage taken from Fire-type moves by 25%" PARAMETRIZE { ability = ABILITY_EFFECT_SPORE; } PARAMETRIZE { ability = ABILITY_DRY_SKIN; } GIVEN { - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); - ASSUME(gMovesInfo[MOVE_EMBER].power == 40); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); + ASSUME(GetMovePower(MOVE_EMBER) == 40); ASSUME(gSpeciesInfo[SPECIES_PARASECT].types[0] == TYPE_BUG); ASSUME(gSpeciesInfo[SPECIES_PARASECT].types[1] == TYPE_GRASS); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] == TYPE_PSYCHIC); @@ -64,7 +64,7 @@ SINGLE_BATTLE_TEST("Dry Skin increases damage taken from Fire-type moves by 25%" SINGLE_BATTLE_TEST("Dry Skin heals 25% when hit by water type moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_BUBBLE].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_BUBBLE) == TYPE_WATER); PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(200); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -79,7 +79,7 @@ SINGLE_BATTLE_TEST("Dry Skin heals 25% when hit by water type moves") SINGLE_BATTLE_TEST("Dry Skin does not activate if protected") { GIVEN { - ASSUME(gMovesInfo[MOVE_BUBBLE].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_BUBBLE) == TYPE_WATER); PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(200); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -92,8 +92,8 @@ SINGLE_BATTLE_TEST("Dry Skin does not activate if protected") SINGLE_BATTLE_TEST("Dry Skin is only triggered once on multi strike moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_WATER_SHURIKEN].type == TYPE_WATER); - ASSUME(gMovesInfo[MOVE_WATER_SHURIKEN].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveType(MOVE_WATER_SHURIKEN) == TYPE_WATER); + ASSUME(GetMoveEffect(MOVE_WATER_SHURIKEN) == EFFECT_MULTI_HIT); PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(200); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -111,7 +111,7 @@ SINGLE_BATTLE_TEST("Dry Skin prevents Absorb Bulb and Luminous Moss from activat PARAMETRIZE { item = ITEM_ABSORB_BULB; } PARAMETRIZE { item = ITEM_LUMINOUS_MOSS; } GIVEN { - ASSUME(gMovesInfo[MOVE_BUBBLE].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_BUBBLE) == TYPE_WATER); PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(200); Item(item); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/earth_eater.c b/test/battle/ability/earth_eater.c index 2e6ae6dab561..c30b9674f50e 100644 --- a/test/battle/ability/earth_eater.c +++ b/test/battle/ability/earth_eater.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Earth Eater heals 25% when hit by ground type moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_MUD_SLAP].type == TYPE_GROUND); + ASSUME(GetMoveType(MOVE_MUD_SLAP) == TYPE_GROUND); PLAYER(SPECIES_ORTHWORM) { Ability(ABILITY_EARTH_EATER); HP(1); MaxHP(100); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -19,7 +19,7 @@ SINGLE_BATTLE_TEST("Earth Eater heals 25% when hit by ground type moves") SINGLE_BATTLE_TEST("Earth Eater does not activate if protected") { GIVEN { - ASSUME(gMovesInfo[MOVE_MUD_SLAP].type == TYPE_GROUND); + ASSUME(GetMoveType(MOVE_MUD_SLAP) == TYPE_GROUND); PLAYER(SPECIES_ORTHWORM) { Ability(ABILITY_EARTH_EATER); HP(1); MaxHP(100); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -35,8 +35,8 @@ SINGLE_BATTLE_TEST("Earth Eater does not activate if protected") SINGLE_BATTLE_TEST("Earth Eater activates on status moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_SAND_ATTACK].type == TYPE_GROUND); - ASSUME(gMovesInfo[MOVE_SAND_ATTACK].category == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveType(MOVE_SAND_ATTACK) == TYPE_GROUND); + ASSUME(GetMoveCategory(MOVE_SAND_ATTACK) == DAMAGE_CATEGORY_STATUS); PLAYER(SPECIES_ORTHWORM) { Ability(ABILITY_EARTH_EATER); HP(1); MaxHP(100); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/effect_spore.c b/test/battle/ability/effect_spore.c index 49750c4797b9..06ac84f39a11 100644 --- a/test/battle/ability/effect_spore.c +++ b/test/battle/ability/effect_spore.c @@ -8,15 +8,15 @@ SINGLE_BATTLE_TEST("Effect Spore only inflicts status on contact") PARAMETRIZE { move = MOVE_TACKLE; } PARAMETRIZE { move = MOVE_SWIFT; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(!gMovesInfo[MOVE_SWIFT].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(!MoveMakesContact(MOVE_SWIFT)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); } } WHEN { TURN { MOVE(player, move, WITH_RNG(RNG_EFFECT_SPORE, 1)); } TURN {} } SCENE { - if (gMovesInfo[move].makesContact) { + if (MoveMakesContact(move)) { ABILITY_POPUP(opponent, ABILITY_EFFECT_SPORE); ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, player); MESSAGE("Wobbuffet was poisoned by the opposing Breloom's Effect Spore!"); @@ -37,7 +37,7 @@ SINGLE_BATTLE_TEST("Effect Spore causes poison 9% of the time") PASSES_RANDOMLY(9, 100, RNG_EFFECT_SPORE); GIVEN { ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); } } WHEN { @@ -56,7 +56,7 @@ SINGLE_BATTLE_TEST("Effect Spore causes paralysis 10% of the time") PASSES_RANDOMLY(10, 100, RNG_EFFECT_SPORE); GIVEN { ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); } } WHEN { @@ -75,7 +75,7 @@ SINGLE_BATTLE_TEST("Effect Spore causes sleep 11% of the time") PASSES_RANDOMLY(11, 100, RNG_EFFECT_SPORE); GIVEN { ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); } } WHEN { diff --git a/test/battle/ability/electromorphosis.c b/test/battle/ability/electromorphosis.c index 0f0ac1c39a1f..38a61f4c2910 100644 --- a/test/battle/ability/electromorphosis.c +++ b/test/battle/ability/electromorphosis.c @@ -10,12 +10,12 @@ SINGLE_BATTLE_TEST("Electromorphosis sets up Charge when hit by any move") PARAMETRIZE {move = MOVE_GUST; } GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); - ASSUME(!IS_MOVE_STATUS(MOVE_GUST)); - ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(!IS_MOVE_STATUS(MOVE_THUNDER_SHOCK)); - ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); + ASSUME(!IsBattleMoveStatus(MOVE_GUST)); + ASSUME(GetMoveCategory(MOVE_GUST) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(!IsBattleMoveStatus(MOVE_THUNDER_SHOCK)); + ASSUME(GetMoveType(MOVE_THUNDER_SHOCK) == TYPE_ELECTRIC); PLAYER(SPECIES_BELLIBOLT) { Ability(ABILITY_ELECTROMORPHOSIS); Speed(10); } OPPONENT(SPECIES_WOBBUFFET) {Ability(ABILITY_LIMBER); Speed(5) ;} // Limber, so it doesn't get paralyzed. diff --git a/test/battle/ability/flame_body.c b/test/battle/ability/flame_body.c index b8fa850b65ab..95afa862c1df 100644 --- a/test/battle/ability/flame_body.c +++ b/test/battle/ability/flame_body.c @@ -7,14 +7,14 @@ SINGLE_BATTLE_TEST("Flame Body inflicts burn on contact") PARAMETRIZE { move = MOVE_TACKLE; } PARAMETRIZE { move = MOVE_SWIFT; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(!gMovesInfo[MOVE_SWIFT].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(!MoveMakesContact(MOVE_SWIFT)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_MAGMAR) { Ability(ABILITY_FLAME_BODY); } } WHEN { TURN { MOVE(player, move); } } SCENE { - if (gMovesInfo[move].makesContact) { + if (MoveMakesContact(move)) { ABILITY_POPUP(opponent, ABILITY_FLAME_BODY); ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_BRN, player); MESSAGE("The opposing Magmar's Flame Body burned Wobbuffet!"); @@ -35,7 +35,7 @@ SINGLE_BATTLE_TEST("Flame Body triggers 30% of the time") PASSES_RANDOMLY(3, 10, RNG_FLAME_BODY); GIVEN { ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_4); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_MAGMAR) { Ability(ABILITY_FLAME_BODY); } } WHEN { diff --git a/test/battle/ability/flower_gift.c b/test/battle/ability/flower_gift.c index 5ceb26c5c121..4f09e84a9a52 100644 --- a/test/battle/ability/flower_gift.c +++ b/test/battle/ability/flower_gift.c @@ -96,7 +96,7 @@ DOUBLE_BATTLE_TEST("Flower Gift increases the attack of Cherrim and its allies b PARAMETRIZE { sunny = FALSE; } PARAMETRIZE { sunny = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_CHERRIM_OVERCAST) { Ability(ABILITY_FLOWER_GIFT); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -131,7 +131,7 @@ DOUBLE_BATTLE_TEST("Flower Gift increases the Sp. Def of Cherrim and its allies PARAMETRIZE { sunny = FALSE; } PARAMETRIZE { sunny = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_HYPER_VOICE].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_HYPER_VOICE) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_CHERRIM_OVERCAST) { Ability(ABILITY_FLOWER_GIFT); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/ability/fluffy.c b/test/battle/ability/fluffy.c index 30a8b83182d0..5c51ec2627ab 100644 --- a/test/battle/ability/fluffy.c +++ b/test/battle/ability/fluffy.c @@ -3,11 +3,11 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(gMovesInfo[MOVE_FIRE_PUNCH].makesContact); - ASSUME(gMovesInfo[MOVE_FIRE_PUNCH].type == TYPE_FIRE); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(MoveMakesContact(MOVE_FIRE_PUNCH)); + ASSUME(GetMoveType(MOVE_FIRE_PUNCH) == TYPE_FIRE); } SINGLE_BATTLE_TEST("Fluffy halves damage taken from moves that make direct contact", s16 damage) diff --git a/test/battle/ability/frisk.c b/test/battle/ability/frisk.c index 28bd477a35dc..e6d7f275fb98 100644 --- a/test/battle/ability/frisk.c +++ b/test/battle/ability/frisk.c @@ -42,7 +42,7 @@ DOUBLE_BATTLE_TEST("Frisk triggers for player in a Double Battle after switching PARAMETRIZE { target = playerRight; } GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_POUND)); + ASSUME(!IsBattleMoveStatus(MOVE_POUND)); PLAYER(SPECIES_WOBBUFFET) { HP(1); } PLAYER(SPECIES_WOBBUFFET) { HP(1); } PLAYER(SPECIES_FURRET) { Ability(ABILITY_FRISK); }; @@ -65,7 +65,7 @@ DOUBLE_BATTLE_TEST("Frisk triggers for opponent in a Double Battle after switchi PARAMETRIZE { target = opponentRight; } GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_POUND)); + ASSUME(!IsBattleMoveStatus(MOVE_POUND)); PLAYER(SPECIES_WYNAUT) { Item(ITEM_POTION); } PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET) { HP(1); } diff --git a/test/battle/ability/gale_wings.c b/test/battle/ability/gale_wings.c index c7a03d09148b..df8f02532649 100644 --- a/test/battle/ability/gale_wings.c +++ b/test/battle/ability/gale_wings.c @@ -10,7 +10,7 @@ SINGLE_BATTLE_TEST("Gale Wings only grants priority at full HP (Gen 7+)") PARAMETRIZE { hp = 99; config = GEN_6; } GIVEN { WITH_CONFIG(GEN_CONFIG_GALE_WINGS, config); - ASSUME(gMovesInfo[MOVE_AERIAL_ACE].type == TYPE_FLYING); + ASSUME(GetMoveType(MOVE_AERIAL_ACE) == TYPE_FLYING); PLAYER(SPECIES_TALONFLAME) { Ability(ABILITY_GALE_WINGS); HP(hp); MaxHP(100); Speed(1);} OPPONENT(SPECIES_WOBBUFFET) { Speed(100);}; } WHEN { @@ -33,8 +33,8 @@ SINGLE_BATTLE_TEST("Gale Wings only grants priority to Flying-type moves") PARAMETRIZE { move = MOVE_AERIAL_ACE; } PARAMETRIZE { move = MOVE_FLARE_BLITZ; } GIVEN { - ASSUME(gMovesInfo[MOVE_AERIAL_ACE].type == TYPE_FLYING); - ASSUME(gMovesInfo[MOVE_FLARE_BLITZ].type == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_AERIAL_ACE) == TYPE_FLYING); + ASSUME(GetMoveType(MOVE_FLARE_BLITZ) == TYPE_FIRE); PLAYER(SPECIES_TALONFLAME) { Ability(ABILITY_GALE_WINGS); HP(100); MaxHP(100); Speed(1);} OPPONENT(SPECIES_WOBBUFFET) { Speed(100);}; } WHEN { @@ -59,11 +59,11 @@ SINGLE_BATTLE_TEST("Gale Wings doesn't increase priority of Flying-type Natural PARAMETRIZE { move = MOVE_JUDGMENT; heldItem = ITEM_SKY_PLATE; } PARAMETRIZE { move = MOVE_HIDDEN_POWER; heldItem = ITEM_NONE; } GIVEN { - ASSUME(gMovesInfo[MOVE_NATURAL_GIFT].effect == EFFECT_NATURAL_GIFT); - ASSUME(gMovesInfo[MOVE_JUDGMENT].effect == EFFECT_CHANGE_TYPE_ON_ITEM); + ASSUME(GetMoveEffect(MOVE_NATURAL_GIFT) == EFFECT_NATURAL_GIFT); + ASSUME(GetMoveEffect(MOVE_JUDGMENT) == EFFECT_CHANGE_TYPE_ON_ITEM); // IV combinations sourced from https://www.smogon.com/forums/threads/hidden-power-iv-combinations.78083/ - ASSUME(gMovesInfo[MOVE_HIDDEN_POWER].effect == EFFECT_HIDDEN_POWER); - ASSUME(gMovesInfo[MOVE_TERA_BLAST].effect == EFFECT_TERA_BLAST); + ASSUME(GetMoveEffect(MOVE_HIDDEN_POWER) == EFFECT_HIDDEN_POWER); + ASSUME(GetMoveEffect(MOVE_TERA_BLAST) == EFFECT_TERA_BLAST); ASSUME(gItemsInfo[ITEM_SKY_PLATE].holdEffect == HOLD_EFFECT_PLATE); ASSUME(gItemsInfo[ITEM_SKY_PLATE].secondaryId == TYPE_FLYING); ASSUME(gNaturalGiftTable[ITEM_TO_BERRY(ITEM_LUM_BERRY)].type == TYPE_FLYING); diff --git a/test/battle/ability/galvanize.c b/test/battle/ability/galvanize.c index 1da82e861dfb..6de5675b6a8a 100644 --- a/test/battle/ability/galvanize.c +++ b/test/battle/ability/galvanize.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); } SINGLE_BATTLE_TEST("Galvanize turns a normal type move into Electric") @@ -29,9 +29,9 @@ SINGLE_BATTLE_TEST("Galvanize can not turn certain moves into Electric type move PARAMETRIZE { move = MOVE_MULTI_ATTACK; } GIVEN { - ASSUME(gMovesInfo[MOVE_HIDDEN_POWER].effect == EFFECT_HIDDEN_POWER); - ASSUME(gMovesInfo[MOVE_WEATHER_BALL].effect == EFFECT_WEATHER_BALL); - ASSUME(gMovesInfo[MOVE_MULTI_ATTACK].effect == EFFECT_CHANGE_TYPE_ON_ITEM); + ASSUME(GetMoveEffect(MOVE_HIDDEN_POWER) == EFFECT_HIDDEN_POWER); + ASSUME(GetMoveEffect(MOVE_WEATHER_BALL) == EFFECT_WEATHER_BALL); + ASSUME(GetMoveEffect(MOVE_MULTI_ATTACK) == EFFECT_CHANGE_TYPE_ON_ITEM); PLAYER(SPECIES_KRABBY); OPPONENT(SPECIES_GEODUDE_ALOLA) { Ability(ABILITY_GALVANIZE); } } WHEN { diff --git a/test/battle/ability/good_as_gold.c b/test/battle/ability/good_as_gold.c index 40561ee767ee..fc6c6bc8c467 100644 --- a/test/battle/ability/good_as_gold.c +++ b/test/battle/ability/good_as_gold.c @@ -5,7 +5,7 @@ SINGLE_BATTLE_TEST("Good as Gold protects from status moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].category == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveCategory(MOVE_TOXIC) == DAMAGE_CATEGORY_STATUS); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_GHOLDENGO) { Ability(ABILITY_GOOD_AS_GOLD); } } WHEN { @@ -20,7 +20,7 @@ SINGLE_BATTLE_TEST("Good as Gold protects from status moves") SINGLE_BATTLE_TEST("Good as Gold doesn't protect the user from it's own moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_NASTY_PLOT].category == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveCategory(MOVE_NASTY_PLOT) == DAMAGE_CATEGORY_STATUS); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_GHOLDENGO) { Ability(ABILITY_GOOD_AS_GOLD); } } WHEN { @@ -37,8 +37,8 @@ SINGLE_BATTLE_TEST("Good as Gold doesn't protect the user from it's own moves") SINGLE_BATTLE_TEST("Good as Gold doesn't protect from moves that target the field") { GIVEN { - ASSUME(gMovesInfo[MOVE_STEALTH_ROCK].category == DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_STEALTH_ROCK].target == MOVE_TARGET_OPPONENTS_FIELD); + ASSUME(GetMoveCategory(MOVE_STEALTH_ROCK) == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveTarget(MOVE_STEALTH_ROCK) == MOVE_TARGET_OPPONENTS_FIELD); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_GHOLDENGO) { Ability(ABILITY_GOOD_AS_GOLD); } } WHEN { @@ -55,7 +55,7 @@ SINGLE_BATTLE_TEST("Good as Gold doesn't protect from moves that target the fiel DOUBLE_BATTLE_TEST("Good as Gold protects from partner's status moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_HELPING_HAND].category == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveCategory(MOVE_HELPING_HAND) == DAMAGE_CATEGORY_STATUS); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_GHOLDENGO) { Ability(ABILITY_GOOD_AS_GOLD); } diff --git a/test/battle/ability/grim_neigh.c b/test/battle/ability/grim_neigh.c index 6e0073f955b7..c58487722be5 100644 --- a/test/battle/ability/grim_neigh.c +++ b/test/battle/ability/grim_neigh.c @@ -7,7 +7,7 @@ DOUBLE_BATTLE_TEST("Grim Neigh raises Sp. Attack by one stage after directly cau PARAMETRIZE { species = SPECIES_SPECTRIER; ability = ABILITY_GRIM_NEIGH; abilityPopUp = ABILITY_GRIM_NEIGH; } PARAMETRIZE { species = SPECIES_CALYREX_SHADOW; ability = ABILITY_AS_ONE_SHADOW_RIDER; abilityPopUp = ABILITY_GRIM_NEIGH; } GIVEN { - ASSUME(gMovesInfo[MOVE_DISCHARGE].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_DISCHARGE) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(species) { Ability(ability); } PLAYER(SPECIES_SNORUNT) { HP(1); } OPPONENT(SPECIES_GLALIE) { HP(1); } @@ -81,7 +81,7 @@ DOUBLE_BATTLE_TEST("Grim Neigh does not increase damage done by the same move th PARAMETRIZE { species = SPECIES_CALYREX_SHADOW; ability = ABILITY_AS_ONE_SHADOW_RIDER; abilityPopUp = ABILITY_GRIM_NEIGH; } GIVEN { - ASSUME(gMovesInfo[MOVE_DISCHARGE].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_DISCHARGE) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(species) { Ability(ability); } PLAYER(SPECIES_ABRA) { HP(1); } OPPONENT(SPECIES_GLALIE); diff --git a/test/battle/ability/gulp_missile.c b/test/battle/ability/gulp_missile.c index 189702a4bef9..72e826b252a9 100644 --- a/test/battle/ability/gulp_missile.c +++ b/test/battle/ability/gulp_missile.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - // ASSUME(gMovesInfo[MOVE_AERIAL_ACE].category == DAMAGE_CATEGORY_PHYSICAL); + // ASSUME(GetMoveCategory(MOVE_AERIAL_ACE) == DAMAGE_CATEGORY_PHYSICAL); } SINGLE_BATTLE_TEST("(Gulp Missile) If base Cramorant hits target with Surf it transforms into Gulping form if max HP is over 1/2") @@ -167,7 +167,7 @@ SINGLE_BATTLE_TEST("(Gulp Missile) Transformed Cramorant Gulping lowers defense PARAMETRIZE { ability = ABILITY_INFILTRATOR; } PARAMETRIZE { ability = ABILITY_CLEAR_BODY; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact == TRUE); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_CRAMORANT) { Ability(ABILITY_GULP_MISSILE); Item(ITEM_ROCKY_HELMET); } OPPONENT(SPECIES_DRAGAPULT) { Ability(ability); } } WHEN { diff --git a/test/battle/ability/harvest.c b/test/battle/ability/harvest.c index 03e13b394e33..92e7517df5e7 100644 --- a/test/battle/ability/harvest.c +++ b/test/battle/ability/harvest.c @@ -5,7 +5,7 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_SITRUS_BERRY].holdEffect == HOLD_EFFECT_RESTORE_PCT_HP); ASSUME(I_SITRUS_BERRY_HEAL >= GEN_4); - ASSUME(gMovesInfo[MOVE_SUNNY_DAY].effect == EFFECT_SUNNY_DAY); + ASSUME(GetMoveEffect(MOVE_SUNNY_DAY) == EFFECT_SUNNY_DAY); } SINGLE_BATTLE_TEST("Harvest has a 50% chance to restore a Berry at the end of the turn") @@ -61,7 +61,7 @@ SINGLE_BATTLE_TEST("Harvest doesn't always restore a Berry if Cloud Nine/Air Loc SINGLE_BATTLE_TEST("Harvest restores a Berry even after being switched out and back in") { GIVEN { - ASSUME(gMovesInfo[MOVE_PARTING_SHOT].effect == EFFECT_PARTING_SHOT); + ASSUME(GetMoveEffect(MOVE_PARTING_SHOT) == EFFECT_PARTING_SHOT); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_EXEGGUTOR) { Ability(ABILITY_HARVEST); MaxHP(500); HP(251); Item(ITEM_SITRUS_BERRY); } OPPONENT(SPECIES_WOBBUFFET); @@ -80,7 +80,7 @@ SINGLE_BATTLE_TEST("Harvest restores a Berry even after being switched out and b SINGLE_BATTLE_TEST("Harvest restores a Berry consumed by Fling") { GIVEN { - ASSUME(gMovesInfo[MOVE_FLING].effect == EFFECT_FLING); + ASSUME(GetMoveEffect(MOVE_FLING) == EFFECT_FLING); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_EXEGGUTOR) { Ability(ABILITY_HARVEST); Item(ITEM_SITRUS_BERRY); } } WHEN { @@ -97,7 +97,7 @@ SINGLE_BATTLE_TEST("Harvest restores a Berry consumed by Fling") SINGLE_BATTLE_TEST("Harvest restores a Berry consumed by Natural Gift") { GIVEN { - ASSUME(gMovesInfo[MOVE_NATURAL_GIFT].effect == EFFECT_NATURAL_GIFT); + ASSUME(GetMoveEffect(MOVE_NATURAL_GIFT) == EFFECT_NATURAL_GIFT); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_EXEGGUTOR) { Ability(ABILITY_HARVEST); Item(ITEM_SITRUS_BERRY); } } WHEN { @@ -209,7 +209,7 @@ DOUBLE_BATTLE_TEST("Harvest order is affected by speed") SINGLE_BATTLE_TEST("Harvest doesn't restore a Berry when transfered to another Pokémon") { GIVEN { - ASSUME(gMovesInfo[MOVE_TRICK].effect == EFFECT_TRICK); + ASSUME(GetMoveEffect(MOVE_TRICK) == EFFECT_TRICK); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_EXEGGUTOR) { Ability(ABILITY_HARVEST); Item(ITEM_SITRUS_BERRY); } } WHEN { @@ -226,7 +226,7 @@ SINGLE_BATTLE_TEST("Harvest doesn't restore a Berry when transfered to another P SINGLE_BATTLE_TEST("Harvest can restore a Berry that was transferred from another Pokémon") { GIVEN { - ASSUME(gMovesInfo[MOVE_TRICK].effect == EFFECT_TRICK); + ASSUME(GetMoveEffect(MOVE_TRICK) == EFFECT_TRICK); PLAYER(SPECIES_TORKOAL) { Ability(ABILITY_DROUGHT); Item(ITEM_SITRUS_BERRY); } OPPONENT(SPECIES_EXEGGUTOR) { Ability(ABILITY_HARVEST); HP(100); MaxHP(500); } } WHEN { @@ -245,7 +245,7 @@ SINGLE_BATTLE_TEST("Harvest can restore a Berry that was transferred from anothe SINGLE_BATTLE_TEST("Harvest can only restore the newest berry consumed that was transferred from another Pokémon instead of its original Berry") { GIVEN { - ASSUME(gMovesInfo[MOVE_TRICK].effect == EFFECT_TRICK); + ASSUME(GetMoveEffect(MOVE_TRICK) == EFFECT_TRICK); ASSUME(gItemsInfo[ITEM_APICOT_BERRY].holdEffect == HOLD_EFFECT_SP_DEFENSE_UP); PLAYER(SPECIES_TORKOAL) { Ability(ABILITY_DROUGHT); Item(ITEM_SITRUS_BERRY); } OPPONENT(SPECIES_EXEGGUTOR) { Ability(ABILITY_HARVEST); HP(100); MaxHP(500); Item(ITEM_APICOT_BERRY); } diff --git a/test/battle/ability/hyper_cutter.c b/test/battle/ability/hyper_cutter.c index a688da25319c..7bd5504965e6 100644 --- a/test/battle/ability/hyper_cutter.c +++ b/test/battle/ability/hyper_cutter.c @@ -29,7 +29,7 @@ SINGLE_BATTLE_TEST("Hyper Cutter prevents intimidate") SINGLE_BATTLE_TEST("Hyper Cutter prevents Attack stage reduction from moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_GROWL) == EFFECT_ATTACK_DOWN); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_KRABBY) { Ability(ABILITY_HYPER_CUTTER); } } WHEN { @@ -43,7 +43,7 @@ SINGLE_BATTLE_TEST("Hyper Cutter prevents Attack stage reduction from moves") SINGLE_BATTLE_TEST("Hyper Cutter doesn't prevent Attack reduction from burn") { GIVEN { - ASSUME(gMovesInfo[MOVE_WILL_O_WISP].effect == EFFECT_WILL_O_WISP); + ASSUME(GetMoveEffect(MOVE_WILL_O_WISP) == EFFECT_WILL_O_WISP); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_KRABBY) { Ability(ABILITY_HYPER_CUTTER); } } WHEN { @@ -59,7 +59,7 @@ SINGLE_BATTLE_TEST("Hyper Cutter doesn't prevent Attack reduction from burn") SINGLE_BATTLE_TEST("Hyper Cutter is ignored by Mold Breaker") { GIVEN { - ASSUME(gMovesInfo[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_GROWL) == EFFECT_ATTACK_DOWN); PLAYER(SPECIES_PINSIR) { Ability(ABILITY_MOLD_BREAKER); } OPPONENT(SPECIES_KRABBY) { Ability(ABILITY_HYPER_CUTTER); } } WHEN { @@ -97,8 +97,8 @@ SINGLE_BATTLE_TEST("Hyper Cutter doesn't prevent Attack stage reduction from mov SINGLE_BATTLE_TEST("Hyper Cutter doesn't prevent Topsy-Turvy") { GIVEN { - ASSUME(gMovesInfo[MOVE_SWORDS_DANCE].effect == EFFECT_ATTACK_UP_2); - ASSUME(gMovesInfo[MOVE_TOPSY_TURVY].effect == EFFECT_TOPSY_TURVY); + ASSUME(GetMoveEffect(MOVE_SWORDS_DANCE) == EFFECT_ATTACK_UP_2); + ASSUME(GetMoveEffect(MOVE_TOPSY_TURVY) == EFFECT_TOPSY_TURVY); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_KRABBY) { Ability(ABILITY_HYPER_CUTTER); } } WHEN { @@ -116,7 +116,7 @@ SINGLE_BATTLE_TEST("Hyper Cutter doesn't prevent Topsy-Turvy") SINGLE_BATTLE_TEST("Hyper Cutter doesn't prevent Spectral Thief from resetting positive Attack stage changes") { GIVEN { - ASSUME(gMovesInfo[MOVE_SWORDS_DANCE].effect == EFFECT_ATTACK_UP_2); + ASSUME(GetMoveEffect(MOVE_SWORDS_DANCE) == EFFECT_ATTACK_UP_2); ASSUME(MoveHasAdditionalEffect(MOVE_SPECTRAL_THIEF, MOVE_EFFECT_SPECTRAL_THIEF)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_KRABBY) { Ability(ABILITY_HYPER_CUTTER); } @@ -135,8 +135,8 @@ SINGLE_BATTLE_TEST("Hyper Cutter doesn't prevent Spectral Thief from resetting p SINGLE_BATTLE_TEST("Hyper Cutter doesn't prevent receiving negative Attack stage changes from Baton Pass") { GIVEN { - ASSUME(gMovesInfo[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); - ASSUME(gMovesInfo[MOVE_BATON_PASS].effect == EFFECT_BATON_PASS); + ASSUME(GetMoveEffect(MOVE_GROWL) == EFFECT_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_BATON_PASS) == EFFECT_BATON_PASS); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_KRABBY) { Ability(ABILITY_HYPER_CUTTER); } diff --git a/test/battle/ability/ice_body.c b/test/battle/ability/ice_body.c index 3f278a50cd5e..07890d52f222 100644 --- a/test/battle/ability/ice_body.c +++ b/test/battle/ability/ice_body.c @@ -2,8 +2,8 @@ #include "test/battle.h" ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_HAIL].effect == EFFECT_HAIL); - ASSUME(gMovesInfo[MOVE_SNOWSCAPE].effect == EFFECT_SNOWSCAPE); + ASSUME(GetMoveEffect(MOVE_HAIL) == EFFECT_HAIL); + ASSUME(GetMoveEffect(MOVE_SNOWSCAPE) == EFFECT_SNOWSCAPE); } SINGLE_BATTLE_TEST("Ice Body prevents damage from hail") diff --git a/test/battle/ability/ice_face.c b/test/battle/ability/ice_face.c index 22b67a7a5369..a462b8026533 100644 --- a/test/battle/ability/ice_face.c +++ b/test/battle/ability/ice_face.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Ice Face blocks physical moves, changing Eiscue into its Noice Face form") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_EISCUE); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -18,8 +18,8 @@ SINGLE_BATTLE_TEST("Ice Face blocks physical moves, changing Eiscue into its Noi SINGLE_BATTLE_TEST("Ice Face does not block special moves, Eiscue stays in Ice Face form") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_EMBER].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_EMBER) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_EISCUE); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -35,9 +35,9 @@ SINGLE_BATTLE_TEST("Ice Face is restored if hail or snow begins while Noice Face PARAMETRIZE { move = MOVE_SNOWSCAPE; } PARAMETRIZE { move = MOVE_HAIL; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_SNOWSCAPE].effect == EFFECT_SNOWSCAPE); - ASSUME(gMovesInfo[MOVE_HAIL].effect == EFFECT_HAIL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveEffect(MOVE_SNOWSCAPE) == EFFECT_SNOWSCAPE); + ASSUME(GetMoveEffect(MOVE_HAIL) == EFFECT_HAIL); PLAYER(SPECIES_EISCUE); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -60,9 +60,9 @@ SINGLE_BATTLE_TEST("Ice Face is restored if Noice Face Eiscue is sent in while h PARAMETRIZE { move = MOVE_SNOWSCAPE; } PARAMETRIZE { move = MOVE_HAIL; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_SNOWSCAPE].effect == EFFECT_SNOWSCAPE); - ASSUME(gMovesInfo[MOVE_HAIL].effect == EFFECT_HAIL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveEffect(MOVE_SNOWSCAPE) == EFFECT_SNOWSCAPE); + ASSUME(GetMoveEffect(MOVE_HAIL) == EFFECT_HAIL); PLAYER(SPECIES_EISCUE); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -86,9 +86,9 @@ SINGLE_BATTLE_TEST("Ice Face is not restored if Eiscue changes into Noice Face f PARAMETRIZE { move = MOVE_SNOWSCAPE; } PARAMETRIZE { move = MOVE_HAIL; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_SNOWSCAPE].effect == EFFECT_SNOWSCAPE); - ASSUME(gMovesInfo[MOVE_HAIL].effect == EFFECT_HAIL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveEffect(MOVE_SNOWSCAPE) == EFFECT_SNOWSCAPE); + ASSUME(GetMoveEffect(MOVE_HAIL) == EFFECT_HAIL); PLAYER(SPECIES_EISCUE) { HP(1); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -105,7 +105,7 @@ SINGLE_BATTLE_TEST("Ice Face is not restored if Eiscue changes into Noice Face f SINGLE_BATTLE_TEST("Ice Face form change persists after switching out") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_EISCUE) { HP(1); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -123,7 +123,7 @@ SINGLE_BATTLE_TEST("Ice Face form change persists after switching out") SINGLE_BATTLE_TEST("Ice Face doesn't transform Eiscue if Cloud Nine/Air Lock is on the field") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_EISCUE) { HP(1); } OPPONENT(SPECIES_RAYQUAZA) { Ability(ABILITY_AIR_LOCK); } } WHEN { @@ -142,9 +142,9 @@ SINGLE_BATTLE_TEST("Ice Face is not restored if hail or snow and Eiscue are alre PARAMETRIZE { move = MOVE_SNOWSCAPE; } PARAMETRIZE { move = MOVE_HAIL; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_SNOWSCAPE].effect == EFFECT_SNOWSCAPE); - ASSUME(gMovesInfo[MOVE_HAIL].effect == EFFECT_HAIL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveEffect(MOVE_SNOWSCAPE) == EFFECT_SNOWSCAPE); + ASSUME(GetMoveEffect(MOVE_HAIL) == EFFECT_HAIL); PLAYER(SPECIES_EISCUE); OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WYNAUT); diff --git a/test/battle/ability/ice_scales.c b/test/battle/ability/ice_scales.c index fd262147a57b..37c5aa0944cb 100644 --- a/test/battle/ability/ice_scales.c +++ b/test/battle/ability/ice_scales.c @@ -12,10 +12,10 @@ SINGLE_BATTLE_TEST("Ice Scales halves the damage from special moves", s16 damage PARAMETRIZE { ability = ABILITY_SHIELD_DUST; move = MOVE_TACKLE; } PARAMETRIZE { ability = ABILITY_ICE_SCALES; move = MOVE_TACKLE; } GIVEN { - ASSUME(gMovesInfo[MOVE_PSYCHIC].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_PSYSHOCK].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_PSYSHOCK].effect == EFFECT_PSYSHOCK); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_PSYCHIC) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_PSYSHOCK) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveEffect(MOVE_PSYSHOCK) == EFFECT_PSYSHOCK); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_FROSMOTH) { Ability(ability); } } WHEN { diff --git a/test/battle/ability/immunity.c b/test/battle/ability/immunity.c index 2fa90686c53a..92e32d31f32e 100644 --- a/test/battle/ability/immunity.c +++ b/test/battle/ability/immunity.c @@ -18,7 +18,7 @@ SINGLE_BATTLE_TEST("Immunity prevents Poison Sting poison") SINGLE_BATTLE_TEST("Immunity prevents Toxic bad poison") { GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_SNORLAX) { Ability(ABILITY_IMMUNITY); } } WHEN { @@ -34,7 +34,7 @@ SINGLE_BATTLE_TEST("Immunity prevents Toxic bad poison") SINGLE_BATTLE_TEST("Immunity prevents Toxic Spikes poison") { GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC_SPIKES].effect == EFFECT_TOXIC_SPIKES); + ASSUME(GetMoveEffect(MOVE_TOXIC_SPIKES) == EFFECT_TOXIC_SPIKES); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_SNORLAX) { Ability(ABILITY_IMMUNITY); } diff --git a/test/battle/ability/innards_out.c b/test/battle/ability/innards_out.c index 5837b98d1f68..5613ff72f6b4 100644 --- a/test/battle/ability/innards_out.c +++ b/test/battle/ability/innards_out.c @@ -14,8 +14,8 @@ SINGLE_BATTLE_TEST("Innards Out deal dmg on fainting equal to the amount of dmg PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { HP(70); SpAttack(1000); } OPPONENT(SPECIES_WOBBUFFET); - ASSUME(!IS_MOVE_STATUS(MOVE_PSYCHIC)); - ASSUME(gMovesInfo[MOVE_PSYCHIC].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(!IsBattleMoveStatus(MOVE_PSYCHIC)); + ASSUME(GetMoveCategory(MOVE_PSYCHIC) == DAMAGE_CATEGORY_SPECIAL); } WHEN { TURN { MOVE(opponent, MOVE_PSYCHIC); SEND_OUT(player, 1); if (hp == 100) { SEND_OUT(opponent, 1); } } } SCENE { @@ -32,8 +32,8 @@ SINGLE_BATTLE_TEST("Innards Out does not trigger after Gastro Acid has been used PLAYER(SPECIES_PYUKUMUKU) { HP(1); Ability(ABILITY_INNARDS_OUT); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); - ASSUME(!IS_MOVE_STATUS(MOVE_PSYCHIC)); - ASSUME(gMovesInfo[MOVE_GASTRO_ACID].effect == EFFECT_GASTRO_ACID); + ASSUME(!IsBattleMoveStatus(MOVE_PSYCHIC)); + ASSUME(GetMoveEffect(MOVE_GASTRO_ACID) == EFFECT_GASTRO_ACID); } WHEN { TURN { MOVE(opponent, MOVE_GASTRO_ACID); } TURN { MOVE(opponent, MOVE_PSYCHIC); SEND_OUT(player, 1); } @@ -55,7 +55,7 @@ SINGLE_BATTLE_TEST("Innards Out does not damage Magic Guard Pokemon") PLAYER(SPECIES_PYUKUMUKU) { HP(1); Ability(ABILITY_INNARDS_OUT); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_CLEFABLE) { Ability(ABILITY_MAGIC_GUARD); } - ASSUME(!IS_MOVE_STATUS(MOVE_PSYCHIC)); + ASSUME(!IsBattleMoveStatus(MOVE_PSYCHIC)); } WHEN { TURN { MOVE(opponent, MOVE_PSYCHIC); SEND_OUT(player, 1); } } SCENE { diff --git a/test/battle/ability/insomnia.c b/test/battle/ability/insomnia.c index 3098ce6d3f4b..65a69cbbc336 100644 --- a/test/battle/ability/insomnia.c +++ b/test/battle/ability/insomnia.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Insomnia prevents sleep") { GIVEN { - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_DROWZEE) { Ability(ABILITY_INSOMNIA); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("Insomnia prevents sleep") SINGLE_BATTLE_TEST("Insomnia prevents yawn") { GIVEN { - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); PLAYER(SPECIES_DROWZEE) { Ability(ABILITY_INSOMNIA); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -42,7 +42,7 @@ SINGLE_BATTLE_TEST("Insomnia prevents yawn") SINGLE_BATTLE_TEST("Insomnia prevents rest") { GIVEN { - ASSUME(gMovesInfo[MOVE_REST].effect == EFFECT_REST); + ASSUME(GetMoveEffect(MOVE_REST) == EFFECT_REST); PLAYER(SPECIES_DROWZEE) { Ability(ABILITY_INSOMNIA); HP(1); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/intimidate.c b/test/battle/ability/intimidate.c index e0f97d5bdaf2..2553c2755f7b 100644 --- a/test/battle/ability/intimidate.c +++ b/test/battle/ability/intimidate.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); } SINGLE_BATTLE_TEST("Intimidate (opponent) lowers player's attack after switch out", s16 damage) @@ -60,7 +60,7 @@ SINGLE_BATTLE_TEST("Intimidate (opponent) lowers player's attack after KO", s16 DOUBLE_BATTLE_TEST("Intimidate doesn't activate on an empty field in a double battle") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET) { HP(1); } PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); } @@ -271,9 +271,9 @@ SINGLE_BATTLE_TEST("Intimidate activates when it's no longer affected by Neutral PARAMETRIZE { move = MOVE_HEALING_WISH; } PARAMETRIZE { move = MOVE_BATON_PASS; } GIVEN { - ASSUME(gMovesInfo[MOVE_U_TURN].effect == EFFECT_HIT_ESCAPE); - ASSUME(gMovesInfo[MOVE_HEALING_WISH].effect == EFFECT_HEALING_WISH); - ASSUME(gMovesInfo[MOVE_BATON_PASS].effect == EFFECT_BATON_PASS); + ASSUME(GetMoveEffect(MOVE_U_TURN) == EFFECT_HIT_ESCAPE); + ASSUME(GetMoveEffect(MOVE_HEALING_WISH) == EFFECT_HEALING_WISH); + ASSUME(GetMoveEffect(MOVE_BATON_PASS) == EFFECT_BATON_PASS); PLAYER(SPECIES_WEEZING) { Ability(ABILITY_NEUTRALIZING_GAS); } PLAYER(SPECIES_WOBBUFFET) { HP(1); } OPPONENT(SPECIES_ARBOK) { Ability(ABILITY_INTIMIDATE); } @@ -302,9 +302,9 @@ SINGLE_BATTLE_TEST("Intimidate activates when it's no longer affected by Neutral GIVEN { ASSUME(gItemsInfo[ITEM_EJECT_BUTTON].holdEffect == HOLD_EFFECT_EJECT_BUTTON); ASSUME(gItemsInfo[ITEM_EJECT_PACK].holdEffect == HOLD_EFFECT_EJECT_PACK); - ASSUME(gMovesInfo[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); - ASSUME(gMovesInfo[MOVE_ROAR].effect == EFFECT_ROAR); - ASSUME(gMovesInfo[MOVE_DRAGON_TAIL].effect == EFFECT_HIT_SWITCH_TARGET); + ASSUME(GetMoveEffect(MOVE_GROWL) == EFFECT_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_ROAR) == EFFECT_ROAR); + ASSUME(GetMoveEffect(MOVE_DRAGON_TAIL) == EFFECT_HIT_SWITCH_TARGET); PLAYER(SPECIES_WEEZING) { Ability(ABILITY_NEUTRALIZING_GAS); Item(item); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_ARBOK) { Ability(ABILITY_INTIMIDATE); } @@ -333,7 +333,7 @@ SINGLE_BATTLE_TEST("Intimidate activates when it's no longer affected by Neutral SINGLE_BATTLE_TEST("Intimidate activates when it's no longer affected by Neutralizing Gas - fainted") { GIVEN { - ASSUME(gMovesInfo[MOVE_FELL_STINGER].effect == EFFECT_FELL_STINGER); + ASSUME(GetMoveEffect(MOVE_FELL_STINGER) == EFFECT_FELL_STINGER); PLAYER(SPECIES_WEEZING) { Ability(ABILITY_NEUTRALIZING_GAS); HP(1); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_ARBOK) { Ability(ABILITY_INTIMIDATE); } diff --git a/test/battle/ability/intrepid_sword.c b/test/battle/ability/intrepid_sword.c index 68300fb229d6..58fd9883ebfa 100644 --- a/test/battle/ability/intrepid_sword.c +++ b/test/battle/ability/intrepid_sword.c @@ -67,7 +67,7 @@ SINGLE_BATTLE_TEST("Intrepid Sword activates when it's no longer effected by Neu SINGLE_BATTLE_TEST("Intrepid Sword and Dauntless Shield both can be Skill Swapped and active their effects on the Skill Swap user") { GIVEN { - ASSUME(gMovesInfo[MOVE_SKILL_SWAP].effect == EFFECT_SKILL_SWAP); + ASSUME(GetMoveEffect(MOVE_SKILL_SWAP) == EFFECT_SKILL_SWAP); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_ZACIAN) { Ability(ABILITY_INTREPID_SWORD); } OPPONENT(SPECIES_ZAMAZENTA) { Ability(ABILITY_DAUNTLESS_SHIELD); } diff --git a/test/battle/ability/keen_eye.c b/test/battle/ability/keen_eye.c index b047ec988f71..0268477ded26 100644 --- a/test/battle/ability/keen_eye.c +++ b/test/battle/ability/keen_eye.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].accuracy == 100); - ASSUME(gMovesInfo[MOVE_SAND_ATTACK].effect == EFFECT_ACCURACY_DOWN); + ASSUME(GetMoveAccuracy(MOVE_TACKLE) == 100); + ASSUME(GetMoveEffect(MOVE_SAND_ATTACK) == EFFECT_ACCURACY_DOWN); ASSUME(B_ILLUMINATE_EFFECT >= GEN_9); } @@ -47,7 +47,7 @@ SINGLE_BATTLE_TEST("Keen Eye, Gen9+ Illuminate & Minds Eye ignore target's evasi PASSES_RANDOMLY(100, 100, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_DOUBLE_TEAM].effect == EFFECT_EVASION_UP); + ASSUME(GetMoveEffect(MOVE_DOUBLE_TEAM) == EFFECT_EVASION_UP); PLAYER(SPECIES_WOBBUFFET); OPPONENT(species) { Ability(ability); } } WHEN { @@ -78,7 +78,7 @@ SINGLE_BATTLE_TEST("Keen Eye, Gen9+ Illuminate & Minds Eye are ignored by Mold B PARAMETRIZE { speciesOpponent = SPECIES_URSALUNA_BLOODMOON; abilityOpponent = ABILITY_MINDS_EYE; } } - PASSES_RANDOMLY(gMovesInfo[MOVE_TACKLE].accuracy * 3 / 4, 100, RNG_ACCURACY); + PASSES_RANDOMLY(GetMoveAccuracy(MOVE_TACKLE) * 3 / 4, 100, RNG_ACCURACY); GIVEN { PLAYER(speciesPlayer) { Ability(abilityPlayer); } OPPONENT(speciesOpponent) { Ability(abilityOpponent); } @@ -102,8 +102,8 @@ SINGLE_BATTLE_TEST("Keen Eye, Gen9+ Illuminate & Minds Eye don't prevent Topsy-T PARAMETRIZE { species = SPECIES_URSALUNA_BLOODMOON; ability = ABILITY_MINDS_EYE; } GIVEN { - ASSUME(gMovesInfo[MOVE_HONE_CLAWS].effect == EFFECT_ATTACK_ACCURACY_UP); - ASSUME(gMovesInfo[MOVE_TOPSY_TURVY].effect == EFFECT_TOPSY_TURVY); + ASSUME(GetMoveEffect(MOVE_HONE_CLAWS) == EFFECT_ATTACK_ACCURACY_UP); + ASSUME(GetMoveEffect(MOVE_TOPSY_TURVY) == EFFECT_TOPSY_TURVY); PLAYER(SPECIES_WOBBUFFET); OPPONENT(species) { Ability(ability); } } WHEN { @@ -141,7 +141,7 @@ SINGLE_BATTLE_TEST("Keen Eye, Gen9+ Illuminate & Minds Eye don't prevent receivi PARAMETRIZE { species = SPECIES_URSALUNA_BLOODMOON; ability = ABILITY_MINDS_EYE; } GIVEN { - ASSUME(gMovesInfo[MOVE_BATON_PASS].effect == EFFECT_BATON_PASS); + ASSUME(GetMoveEffect(MOVE_BATON_PASS) == EFFECT_BATON_PASS); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); OPPONENT(species) { Ability(ability); } @@ -173,7 +173,7 @@ SINGLE_BATTLE_TEST("Keen Eye & Gen9+ Illuminate don't prevent Spectral Thief fro PARAMETRIZE { species = SPECIES_STARYU; ability = ABILITY_ILLUMINATE; } GIVEN { - ASSUME(gMovesInfo[MOVE_HONE_CLAWS].effect == EFFECT_ATTACK_ACCURACY_UP); + ASSUME(GetMoveEffect(MOVE_HONE_CLAWS) == EFFECT_ATTACK_ACCURACY_UP); ASSUME(MoveHasAdditionalEffect(MOVE_SPECTRAL_THIEF, MOVE_EFFECT_SPECTRAL_THIEF) == TRUE); PLAYER(SPECIES_WOBBUFFET); OPPONENT(species) { Ability(ability); } diff --git a/test/battle/ability/leaf_guard.c b/test/battle/ability/leaf_guard.c index af113f1bb640..e04881ecb4fd 100644 --- a/test/battle/ability/leaf_guard.c +++ b/test/battle/ability/leaf_guard.c @@ -11,10 +11,10 @@ SINGLE_BATTLE_TEST("Leaf Guard prevents non-volatile status conditions in sun") PARAMETRIZE { move = MOVE_TOXIC; status = STATUS1_TOXIC_POISON; } // PARAMETRIZE { move = MOVE_POWDER_SNOW; status = STATUS1_FREEZE; } // Pointless since you can't freeze in sunlight anyway GIVEN { - ASSUME(gMovesInfo[MOVE_WILL_O_WISP].effect == EFFECT_WILL_O_WISP); - ASSUME(gMovesInfo[MOVE_HYPNOSIS].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_THUNDER_WAVE].effect == EFFECT_PARALYZE); - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_WILL_O_WISP) == EFFECT_WILL_O_WISP); + ASSUME(GetMoveEffect(MOVE_HYPNOSIS) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_THUNDER_WAVE) == EFFECT_PARALYZE); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); PLAYER(SPECIES_LEAFEON) { Ability(ABILITY_LEAF_GUARD); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -57,7 +57,7 @@ SINGLE_BATTLE_TEST("Leaf Guard prevents Rest during sun") { GIVEN { ASSUME(B_LEAF_GUARD_PREVENTS_REST >= GEN_5); - ASSUME(gMovesInfo[MOVE_REST].effect == EFFECT_REST); + ASSUME(GetMoveEffect(MOVE_REST) == EFFECT_REST); PLAYER(SPECIES_LEAFEON) { Ability(ABILITY_LEAF_GUARD); HP(100); MaxHP(200); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/lightning_rod.c b/test/battle/ability/lightning_rod.c index c719ee145d41..4a90a8573ce2 100644 --- a/test/battle/ability/lightning_rod.c +++ b/test/battle/ability/lightning_rod.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Lightning Rod absorbs Electric-type moves and increases the Sp. Attack [Gen5+]") { GIVEN { - ASSUME(gMovesInfo[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_THUNDERBOLT) == TYPE_ELECTRIC); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_RAICHU) { Ability(ABILITY_LIGHTNING_ROD); } } WHEN { @@ -34,7 +34,7 @@ SINGLE_BATTLE_TEST("Lightning Rod absorbs Electric-type moves and increases the DOUBLE_BATTLE_TEST("Lightning Rod forces single-target Electric-type moves to target the Pokémon with this Ability.") { GIVEN { - ASSUME(gMovesInfo[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_THUNDERBOLT) == TYPE_ELECTRIC); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_RAICHU) { Ability(ABILITY_LIGHTNING_ROD); } diff --git a/test/battle/ability/liquid_ooze.c b/test/battle/ability/liquid_ooze.c index bb4da48f8641..05b78dce7343 100644 --- a/test/battle/ability/liquid_ooze.c +++ b/test/battle/ability/liquid_ooze.c @@ -42,7 +42,7 @@ SINGLE_BATTLE_TEST("Liquid Ooze causes Leech Seed users to lose HP instead of he DOUBLE_BATTLE_TEST("Liquid Ooze causes Matcha Gatcha users to lose HP instead of heal") { GIVEN { - ASSUME(gMovesInfo[MOVE_MATCHA_GOTCHA].effect == EFFECT_ABSORB); + ASSUME(GetMoveEffect(MOVE_MATCHA_GOTCHA) == EFFECT_ABSORB); PLAYER(SPECIES_WOBBUFFET) { HP(1); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_TENTACOOL) { Ability(ABILITY_LIQUID_OOZE); } @@ -61,7 +61,7 @@ DOUBLE_BATTLE_TEST("Liquid Ooze causes Matcha Gatcha users to lose HP instead of DOUBLE_BATTLE_TEST("Liquid Ooze will faint Matcha Gatcha users if it deals enough damage") { GIVEN { - ASSUME(gMovesInfo[MOVE_MATCHA_GOTCHA].effect == EFFECT_ABSORB); + ASSUME(GetMoveEffect(MOVE_MATCHA_GOTCHA) == EFFECT_ABSORB); PLAYER(SPECIES_WOBBUFFET) { HP(1); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_TENTACOOL) { Ability(ABILITY_LIQUID_OOZE); } diff --git a/test/battle/ability/magic_bounce.c b/test/battle/ability/magic_bounce.c index a643b228248f..2731a21fede4 100644 --- a/test/battle/ability/magic_bounce.c +++ b/test/battle/ability/magic_bounce.c @@ -5,7 +5,7 @@ SINGLE_BATTLE_TEST("Magic Bounce bounces back status moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE); } } WHEN { @@ -22,8 +22,8 @@ SINGLE_BATTLE_TEST("Magic Bounce bounces back status moves") SINGLE_BATTLE_TEST("Magic Bounce bounces back powder moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_STUN_SPORE].powderMove); - ASSUME(gMovesInfo[MOVE_STUN_SPORE].effect == EFFECT_PARALYZE); + ASSUME(IsPowderMove(MOVE_STUN_SPORE)); + ASSUME(GetMoveEffect(MOVE_STUN_SPORE) == EFFECT_PARALYZE); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE); } } WHEN { @@ -40,7 +40,7 @@ SINGLE_BATTLE_TEST("Magic Bounce bounces back powder moves") SINGLE_BATTLE_TEST("Magic Bounce cannot bounce back powder moves against Grass Types") { GIVEN { - ASSUME(gMovesInfo[MOVE_STUN_SPORE].powderMove); + ASSUME(IsPowderMove(MOVE_STUN_SPORE)); ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS); PLAYER(SPECIES_ODDISH); OPPONENT(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE); } @@ -59,8 +59,8 @@ SINGLE_BATTLE_TEST("Magic Bounce cannot bounce back powder moves against Grass T DOUBLE_BATTLE_TEST("Magic Bounce bounces back moves hitting both foes at two foes") { GIVEN { - ASSUME(gMovesInfo[MOVE_LEER].effect == EFFECT_DEFENSE_DOWN); - ASSUME(gMovesInfo[MOVE_LEER].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveEffect(MOVE_LEER) == EFFECT_DEFENSE_DOWN); + ASSUME(GetMoveTarget(MOVE_LEER) == MOVE_TARGET_BOTH); PLAYER(SPECIES_ABRA); PLAYER(SPECIES_KADABRA); OPPONENT(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE); } @@ -92,7 +92,7 @@ DOUBLE_BATTLE_TEST("Magic Bounce bounces back moves hitting foes field") battlerTwo = SPECIES_ESPEON; abilityBattlerTwo = ABILITY_MAGIC_BOUNCE; } GIVEN { - ASSUME(gMovesInfo[MOVE_STEALTH_ROCK].target == MOVE_TARGET_OPPONENTS_FIELD); + ASSUME(GetMoveTarget(MOVE_STEALTH_ROCK) == MOVE_TARGET_OPPONENTS_FIELD); PLAYER(SPECIES_ABRA); PLAYER(SPECIES_KADABRA); OPPONENT(battlerOne) { Ability(abilityBattlerOne); } @@ -118,7 +118,7 @@ DOUBLE_BATTLE_TEST("Magic Bounce bounces back moves hitting foes field") SINGLE_BATTLE_TEST("Magic Bounce bounced back status moves can not be bounced back by Magic Bounce") { GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); PLAYER(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE); } OPPONENT(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE); } } WHEN { diff --git a/test/battle/ability/magic_guard.c b/test/battle/ability/magic_guard.c index 20e8eb779c34..8941fb21303a 100644 --- a/test/battle/ability/magic_guard.c +++ b/test/battle/ability/magic_guard.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Magic Guard prevents recoil damage to the user") { GIVEN { - ASSUME(gMovesInfo[MOVE_DOUBLE_EDGE].recoil == 33); + ASSUME(GetMoveRecoil(MOVE_DOUBLE_EDGE) == 33); PLAYER(SPECIES_CLEFABLE) { Ability(ABILITY_MAGIC_GUARD); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/magician.c b/test/battle/ability/magician.c index 14e553a76330..f622ac07df0a 100644 --- a/test/battle/ability/magician.c +++ b/test/battle/ability/magician.c @@ -5,7 +5,7 @@ SINGLE_BATTLE_TEST("Magician does not get self-damage recoil after stealing Life { GIVEN { ASSUME(gItemsInfo[ITEM_LIFE_ORB].holdEffect == HOLD_EFFECT_LIFE_ORB); - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); PLAYER(SPECIES_DELPHOX) { Ability(ABILITY_MAGICIAN); Item(ITEM_NONE); } OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_LIFE_ORB); } } WHEN { diff --git a/test/battle/ability/minds_eye.c b/test/battle/ability/minds_eye.c index bf50fa0e2eeb..59c81746c74f 100644 --- a/test/battle/ability/minds_eye.c +++ b/test/battle/ability/minds_eye.c @@ -48,7 +48,7 @@ AI_SINGLE_BATTLE_TEST("AI doesn't use accuracy-lowering moves if it knows that t for (j = MOVE_NONE + 1; j < MOVES_COUNT; j++) { - if (gMovesInfo[j].effect == EFFECT_ACCURACY_DOWN || gMovesInfo[j].effect == EFFECT_ACCURACY_DOWN_2) { + if (GetMoveEffect(j) == EFFECT_ACCURACY_DOWN || GetMoveEffect(j) == EFFECT_ACCURACY_DOWN_2) { PARAMETRIZE { moveAI = j; abilityAI = ABILITY_SWIFT_SWIM; } PARAMETRIZE { moveAI = j; abilityAI = ABILITY_MOLD_BREAKER; } } diff --git a/test/battle/ability/mirror_armor.c b/test/battle/ability/mirror_armor.c index 288fe72334eb..5aa2b55ef317 100644 --- a/test/battle/ability/mirror_armor.c +++ b/test/battle/ability/mirror_armor.c @@ -171,8 +171,8 @@ DOUBLE_BATTLE_TEST("Mirror Armor lowers Speed of the partner Pokemon after Court { KNOWN_FAILING; GIVEN { - ASSUME(gMovesInfo[MOVE_STICKY_WEB].effect == EFFECT_STICKY_WEB); - ASSUME(gMovesInfo[MOVE_COURT_CHANGE].effect == EFFECT_COURT_CHANGE); + ASSUME(GetMoveEffect(MOVE_STICKY_WEB) == EFFECT_STICKY_WEB); + ASSUME(GetMoveEffect(MOVE_COURT_CHANGE) == EFFECT_COURT_CHANGE); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_CORVIKNIGHT) {Ability(ABILITY_MIRROR_ARMOR); Item(ITEM_IRON_BALL); } diff --git a/test/battle/ability/moxie.c b/test/battle/ability/moxie.c index d6c7d11d9d89..35ae64d164b9 100644 --- a/test/battle/ability/moxie.c +++ b/test/battle/ability/moxie.c @@ -8,7 +8,7 @@ DOUBLE_BATTLE_TEST("Moxie/Chilling Neigh raises Attack by one stage after direct PARAMETRIZE { species = SPECIES_GLASTRIER; ability = ABILITY_CHILLING_NEIGH; abilityPopUp = ABILITY_CHILLING_NEIGH; } PARAMETRIZE { species = SPECIES_CALYREX_ICE; ability = ABILITY_AS_ONE_ICE_RIDER; abilityPopUp = ABILITY_CHILLING_NEIGH; } GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_EARTHQUAKE) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(species) { Ability(ability); } PLAYER(SPECIES_SNORUNT) { HP(1); } OPPONENT(SPECIES_GLALIE) { HP(1); } @@ -84,7 +84,7 @@ SINGLE_BATTLE_TEST("Moxie/Chilling Neigh does not trigger when already at maximu PARAMETRIZE { species = SPECIES_GLASTRIER; ability = ABILITY_CHILLING_NEIGH; abilityPopUp = ABILITY_CHILLING_NEIGH; } PARAMETRIZE { species = SPECIES_CALYREX_ICE; ability = ABILITY_AS_ONE_ICE_RIDER; abilityPopUp = ABILITY_CHILLING_NEIGH; } GIVEN { - ASSUME(gMovesInfo[MOVE_BELLY_DRUM].effect == EFFECT_BELLY_DRUM); + ASSUME(GetMoveEffect(MOVE_BELLY_DRUM) == EFFECT_BELLY_DRUM); PLAYER(species) { Ability(ability); } OPPONENT(SPECIES_SNORUNT) { HP(1); } OPPONENT(SPECIES_SNORUNT); @@ -123,7 +123,7 @@ DOUBLE_BATTLE_TEST("Moxie/Chilling Neigh does not increase damage done by the sa PARAMETRIZE { species = SPECIES_CALYREX_ICE; ability = ABILITY_AS_ONE_ICE_RIDER; abilityPopUp = ABILITY_CHILLING_NEIGH; } GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_EARTHQUAKE) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(species) { Ability(ability); } PLAYER(SPECIES_ABRA) { HP(1); } OPPONENT(SPECIES_GLALIE); diff --git a/test/battle/ability/mummy.c b/test/battle/ability/mummy.c index 74461ec2ee24..f03e453e5cb0 100644 --- a/test/battle/ability/mummy.c +++ b/test/battle/ability/mummy.c @@ -10,14 +10,14 @@ SINGLE_BATTLE_TEST("Mummy/Lingering Aroma replace the attacker's ability on cont PARAMETRIZE { move = MOVE_AQUA_JET; ability = ABILITY_LINGERING_AROMA; species = SPECIES_OINKOLOGNE; } PARAMETRIZE { move = MOVE_WATER_GUN; ability = ABILITY_LINGERING_AROMA; species = SPECIES_OINKOLOGNE; } GIVEN { - ASSUME(gMovesInfo[MOVE_AQUA_JET].makesContact); - ASSUME(!gMovesInfo[MOVE_WATER_GUN].makesContact); + ASSUME(MoveMakesContact(MOVE_AQUA_JET)); + ASSUME(!MoveMakesContact(MOVE_WATER_GUN)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(species) { Ability(ability); } } WHEN { TURN { MOVE(player, move); } } SCENE { - if (gMovesInfo[move].makesContact) { + if (MoveMakesContact(move)) { ABILITY_POPUP(opponent, ability); if (ability == ABILITY_MUMMY) MESSAGE("Wobbuffet acquired Mummy!"); @@ -43,7 +43,7 @@ SINGLE_BATTLE_TEST("Mummy and Lingering Aroma don't replace each other") PARAMETRIZE { ability1 = ABILITY_MUMMY; species1 = SPECIES_YAMASK; ability2 = ABILITY_LINGERING_AROMA; species2 = SPECIES_OINKOLOGNE; } PARAMETRIZE { ability1 = ability2 = ABILITY_LINGERING_AROMA; species1 = species2 = SPECIES_OINKOLOGNE; } GIVEN { - ASSUME(gMovesInfo[MOVE_AQUA_JET].makesContact); + ASSUME(MoveMakesContact(MOVE_AQUA_JET)); PLAYER(species1) { Ability(ability1); Speed(2); } OPPONENT(species2) { Ability(ability2); Speed(1); } } WHEN { diff --git a/test/battle/ability/neuroforce.c b/test/battle/ability/neuroforce.c index 88af00b722d3..bd40982d0295 100644 --- a/test/battle/ability/neuroforce.c +++ b/test/battle/ability/neuroforce.c @@ -10,8 +10,8 @@ SINGLE_BATTLE_TEST("Neuroforce increases the strength of super-effective moves b PARAMETRIZE { ability = ABILITY_NEUROFORCE; move = MOVE_TACKLE; } PARAMETRIZE { ability = ABILITY_KLUTZ; move = MOVE_TACKLE; } GIVEN { - ASSUME(gMovesInfo[MOVE_SHADOW_BALL].type == TYPE_GHOST); - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_SHADOW_BALL) == TYPE_GHOST); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); PLAYER(SPECIES_NECROZMA_ULTRA) { Ability(ability); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/oblivious.c b/test/battle/ability/oblivious.c index 70bf94192370..3ac979a271ba 100644 --- a/test/battle/ability/oblivious.c +++ b/test/battle/ability/oblivious.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Oblivious prevents Infatuation") { GIVEN { - ASSUME(gMovesInfo[MOVE_ATTRACT].effect == EFFECT_ATTRACT); + ASSUME(GetMoveEffect(MOVE_ATTRACT) == EFFECT_ATTRACT); PLAYER(SPECIES_SLOWPOKE) { Ability(ABILITY_OBLIVIOUS); Gender(MON_MALE); } OPPONENT(SPECIES_WOBBUFFET) { Gender(MON_FEMALE); } } WHEN { @@ -19,7 +19,7 @@ SINGLE_BATTLE_TEST("Oblivious prevents Infatuation") SINGLE_BATTLE_TEST("Oblivious prevents Captivate") { GIVEN { - ASSUME(gMovesInfo[MOVE_CAPTIVATE].effect == EFFECT_CAPTIVATE); + ASSUME(GetMoveEffect(MOVE_CAPTIVATE) == EFFECT_CAPTIVATE); PLAYER(SPECIES_SLOWPOKE) { Ability(ABILITY_OBLIVIOUS); Gender(MON_MALE); } OPPONENT(SPECIES_WOBBUFFET) { Gender(MON_FEMALE); } } WHEN { @@ -34,7 +34,7 @@ SINGLE_BATTLE_TEST("Oblivious prevents Captivate") SINGLE_BATTLE_TEST("Oblivious prevents Taunt") { GIVEN { - ASSUME(gMovesInfo[MOVE_TAUNT].effect == EFFECT_TAUNT); + ASSUME(GetMoveEffect(MOVE_TAUNT) == EFFECT_TAUNT); ASSUME(B_OBLIVIOUS_TAUNT >= GEN_6); PLAYER(SPECIES_SLOWPOKE) { Ability(ABILITY_OBLIVIOUS); } OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/ability/opportunist.c b/test/battle/ability/opportunist.c index 662d442dbc8c..2abd4834666f 100644 --- a/test/battle/ability/opportunist.c +++ b/test/battle/ability/opportunist.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); } SINGLE_BATTLE_TEST("Opportunist only copies foe's positive stat changes in a turn", s16 damage) diff --git a/test/battle/ability/overcoat.c b/test/battle/ability/overcoat.c index b73f098e783c..96f3ffcb087c 100644 --- a/test/battle/ability/overcoat.c +++ b/test/battle/ability/overcoat.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Overcoat blocks powder and spore moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_STUN_SPORE].powderMove); + ASSUME(IsPowderMove(MOVE_STUN_SPORE)); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_PINECO) { Ability(ABILITY_OVERCOAT); } } WHEN { diff --git a/test/battle/ability/overgrow.c b/test/battle/ability/overgrow.c index 0bc2d7cdd597..3ba779009306 100644 --- a/test/battle/ability/overgrow.c +++ b/test/battle/ability/overgrow.c @@ -7,7 +7,7 @@ SINGLE_BATTLE_TEST("Overgrow boosts Grass-type moves in a pinch", s16 damage) PARAMETRIZE { hp = 99; } PARAMETRIZE { hp = 33; } GIVEN { - ASSUME(gMovesInfo[MOVE_VINE_WHIP].type == TYPE_GRASS); + ASSUME(GetMoveType(MOVE_VINE_WHIP) == TYPE_GRASS); PLAYER(SPECIES_BULBASAUR) { Ability(ABILITY_OVERGROW); MaxHP(99); HP(hp); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/own_tempo.c b/test/battle/ability/own_tempo.c index 4b3c42053b77..a6dd8c459171 100644 --- a/test/battle/ability/own_tempo.c +++ b/test/battle/ability/own_tempo.c @@ -5,7 +5,7 @@ SINGLE_BATTLE_TEST("Own Tempo prevents Intimidate but no other stat down changes { GIVEN { ASSUME(B_UPDATED_INTIMIDATE >= GEN_8); - ASSUME(gMovesInfo[MOVE_CONFUSE_RAY].effect == EFFECT_CONFUSE); + ASSUME(GetMoveEffect(MOVE_CONFUSE_RAY) == EFFECT_CONFUSE); PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }; OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); }; } WHEN { @@ -25,7 +25,7 @@ SINGLE_BATTLE_TEST("Own Tempo prevents Intimidate but no other stat down changes SINGLE_BATTLE_TEST("Own Tempo prevents confusion from moves by the opponent") { GIVEN { - ASSUME(gMovesInfo[MOVE_CONFUSE_RAY].effect == EFFECT_CONFUSE); + ASSUME(GetMoveEffect(MOVE_CONFUSE_RAY) == EFFECT_CONFUSE); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); }; } WHEN { @@ -60,7 +60,7 @@ SINGLE_BATTLE_TEST("Own Tempo is ignored by Mold Breaker") { KNOWN_FAILING; // Ideally the func CanBeConfused should be split into AttackerCanBeConfused and TargetCanBeConfused or we do it in the same func but have a check for when battlerAtk == battlerDef GIVEN { - ASSUME(gMovesInfo[MOVE_CONFUSE_RAY].effect == EFFECT_CONFUSE); + ASSUME(GetMoveEffect(MOVE_CONFUSE_RAY) == EFFECT_CONFUSE); PLAYER(SPECIES_PINSIR) { Ability(ABILITY_MOLD_BREAKER); } OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); }; } WHEN { @@ -77,7 +77,7 @@ SINGLE_BATTLE_TEST("Own Tempo cures confusion obtained from an opponent with Mol { KNOWN_FAILING; GIVEN { - ASSUME(gMovesInfo[MOVE_CONFUSE_RAY].effect == EFFECT_CONFUSE); + ASSUME(GetMoveEffect(MOVE_CONFUSE_RAY) == EFFECT_CONFUSE); PLAYER(SPECIES_PINSIR) { Ability(ABILITY_MOLD_BREAKER); }; OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); }; } WHEN { @@ -96,8 +96,8 @@ SINGLE_BATTLE_TEST("Own Tempo cures confusion obtained from an opponent with Mol SINGLE_BATTLE_TEST("Own Tempo cures confusion if it's obtained via Skill Swap") { GIVEN { - ASSUME(gMovesInfo[MOVE_CONFUSE_RAY].effect == EFFECT_CONFUSE); - ASSUME(gMovesInfo[MOVE_SKILL_SWAP].effect == EFFECT_SKILL_SWAP); + ASSUME(GetMoveEffect(MOVE_CONFUSE_RAY) == EFFECT_CONFUSE); + ASSUME(GetMoveEffect(MOVE_SKILL_SWAP) == EFFECT_SKILL_SWAP); PLAYER(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); }; OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/parental_bond.c b/test/battle/ability/parental_bond.c index a1614a8ffc32..29f137f6af2e 100644 --- a/test/battle/ability/parental_bond.c +++ b/test/battle/ability/parental_bond.c @@ -4,9 +4,9 @@ SINGLE_BATTLE_TEST("Parental Bond converts Tackle into a two-strike move") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category != DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_TACKLE].strikeCount < 2); - ASSUME(gMovesInfo[MOVE_TACKLE].effect == EFFECT_HIT); + ASSUME(GetMoveCategory(MOVE_TACKLE) != DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveStrikeCount(MOVE_TACKLE) < 2); + ASSUME(GetMoveEffect(MOVE_TACKLE) == EFFECT_HIT); PLAYER(SPECIES_KANGASKHAN) { Item(ITEM_KANGASKHANITE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -27,8 +27,8 @@ SINGLE_BATTLE_TEST("Parental Bond converts Tackle into a two-strike move") SINGLE_BATTLE_TEST("Parental Bond does not convert a move with three or more strikes to a two-strike move") { GIVEN { - ASSUME(gMovesInfo[MOVE_TRIPLE_KICK].category != DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_TRIPLE_KICK].strikeCount == 3); + ASSUME(GetMoveCategory(MOVE_TRIPLE_KICK) != DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveStrikeCount(MOVE_TRIPLE_KICK) == 3); PLAYER(SPECIES_KANGASKHAN) { Item(ITEM_KANGASKHANITE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -54,10 +54,10 @@ SINGLE_BATTLE_TEST("Parental Bond converts multi-target moves into a two-strike PARAMETRIZE { move = MOVE_ICY_WIND; } GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].strikeCount < 2); - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); - ASSUME(gMovesInfo[MOVE_ICY_WIND].strikeCount < 2); - ASSUME(gMovesInfo[MOVE_ICY_WIND].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveStrikeCount(MOVE_EARTHQUAKE) < 2); + ASSUME(GetMoveTarget(MOVE_EARTHQUAKE) == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveStrikeCount(MOVE_ICY_WIND) < 2); + ASSUME(GetMoveTarget(MOVE_ICY_WIND) == MOVE_TARGET_BOTH); PLAYER(SPECIES_KANGASKHAN) { Item(ITEM_KANGASKHANITE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -78,8 +78,8 @@ SINGLE_BATTLE_TEST("Parental Bond converts multi-target moves into a two-strike DOUBLE_BATTLE_TEST("Parental Bond does not convert multi-target moves into a two-strike move in Double Battles, even if it only damages one") { GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].strikeCount < 2); - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveStrikeCount(MOVE_EARTHQUAKE) < 2); + ASSUME(GetMoveTarget(MOVE_EARTHQUAKE) == MOVE_TARGET_FOES_AND_ALLY); ASSUME(gSpeciesInfo[SPECIES_PIDGEY].types[1] == TYPE_FLYING); PLAYER(SPECIES_KANGASKHAN) { Item(ITEM_KANGASKHANITE); } PLAYER(SPECIES_PIDGEY); @@ -109,8 +109,8 @@ SINGLE_BATTLE_TEST("Parental Bond-converted moves only hit once on Lightning Rod PARAMETRIZE { move = MOVE_THUNDERBOLT; ability = ABILITY_LIGHTNING_ROD; species = SPECIES_RAICHU; type = TYPE_ELECTRIC; } PARAMETRIZE { move = MOVE_SURF; ability = ABILITY_STORM_DRAIN; species = SPECIES_LILEEP; type = TYPE_WATER; } GIVEN { - ASSUME(gMovesInfo[move].strikeCount < 2); - ASSUME(gMovesInfo[move].type == type); + ASSUME(GetMoveStrikeCount(move) < 2); + ASSUME(GetMoveType(move) == type); PLAYER(SPECIES_KANGASKHAN) { Item(ITEM_KANGASKHANITE); } OPPONENT(species) { Ability(ability); } } WHEN { @@ -137,8 +137,8 @@ SINGLE_BATTLE_TEST("Parental Bond has no affect on multi hit moves and they stil GIVEN { ASSUME(B_MULTI_HIT_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_COMET_PUNCH].category != DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_COMET_PUNCH].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveCategory(MOVE_COMET_PUNCH) != DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveEffect(MOVE_COMET_PUNCH) == EFFECT_MULTI_HIT); PLAYER(SPECIES_KANGASKHAN) { Item(ITEM_KANGASKHANITE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -163,8 +163,8 @@ SINGLE_BATTLE_TEST("Parental Bond has no affect on multi hit moves and they stil GIVEN { ASSUME(B_MULTI_HIT_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_COMET_PUNCH].category != DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_COMET_PUNCH].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveCategory(MOVE_COMET_PUNCH) != DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveEffect(MOVE_COMET_PUNCH) == EFFECT_MULTI_HIT); PLAYER(SPECIES_KANGASKHAN) { Item(ITEM_KANGASKHANITE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -190,8 +190,8 @@ SINGLE_BATTLE_TEST("Parental Bond has no affect on multi hit moves and they stil GIVEN { ASSUME(B_MULTI_HIT_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_COMET_PUNCH].category != DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_COMET_PUNCH].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveCategory(MOVE_COMET_PUNCH) != DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveEffect(MOVE_COMET_PUNCH) == EFFECT_MULTI_HIT); PLAYER(SPECIES_KANGASKHAN) { Item(ITEM_KANGASKHANITE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -218,8 +218,8 @@ SINGLE_BATTLE_TEST("Parental Bond has no affect on multi hit moves and they stil GIVEN { ASSUME(B_MULTI_HIT_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_COMET_PUNCH].category != DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_COMET_PUNCH].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveCategory(MOVE_COMET_PUNCH) != DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveEffect(MOVE_COMET_PUNCH) == EFFECT_MULTI_HIT); PLAYER(SPECIES_KANGASKHAN) { Item(ITEM_KANGASKHANITE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -242,8 +242,8 @@ SINGLE_BATTLE_TEST("Parental Bond has no affect on multi hit moves and they stil SINGLE_BATTLE_TEST("Parental Bond Smack Down effect triggers after 2nd hit") { GIVEN { - ASSUME(gMovesInfo[MOVE_SMACK_DOWN].category != DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_SMACK_DOWN].strikeCount < 2); + ASSUME(GetMoveCategory(MOVE_SMACK_DOWN) != DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveStrikeCount(MOVE_SMACK_DOWN) < 2); ASSUME(MoveHasAdditionalEffect(MOVE_SMACK_DOWN, MOVE_EFFECT_SMACK_DOWN)); PLAYER(SPECIES_KANGASKHAN) { Item(ITEM_KANGASKHANITE); } OPPONENT(SPECIES_SKARMORY); @@ -267,7 +267,7 @@ SINGLE_BATTLE_TEST("Parental Bond Snore strikes twice while asleep") { s16 damage[2]; GIVEN { - ASSUME(gMovesInfo[MOVE_SNORE].effect == EFFECT_SNORE); + ASSUME(GetMoveEffect(MOVE_SNORE) == EFFECT_SNORE); PLAYER(SPECIES_KANGASKHAN_MEGA) { Status1(STATUS1_SLEEP); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -289,7 +289,7 @@ SINGLE_BATTLE_TEST("Parental Bond Snore strikes twice while asleep") SINGLE_BATTLE_TEST("Parental Bond only triggers Dragon Tail's target switch out on the second hit") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_TAIL].effect == EFFECT_HIT_SWITCH_TARGET); + ASSUME(GetMoveEffect(MOVE_DRAGON_TAIL) == EFFECT_HIT_SWITCH_TARGET); PLAYER(SPECIES_KANGASKHAN) { Item(ITEM_KANGASKHANITE); } OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WYNAUT); diff --git a/test/battle/ability/pastel_veil.c b/test/battle/ability/pastel_veil.c index a6b6168547eb..686ca0ff85df 100644 --- a/test/battle/ability/pastel_veil.c +++ b/test/battle/ability/pastel_veil.c @@ -35,7 +35,7 @@ SINGLE_BATTLE_TEST("Pastel Veil immediately cures Mold Breaker poison") { KNOWN_FAILING; GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); PLAYER(SPECIES_PINSIR) { Ability(ABILITY_MOLD_BREAKER); } OPPONENT(SPECIES_PONYTA_GALAR) { Ability(ABILITY_PASTEL_VEIL); } } WHEN { @@ -53,7 +53,7 @@ SINGLE_BATTLE_TEST("Pastel Veil immediately cures Mold Breaker poison") DOUBLE_BATTLE_TEST("Pastel Veil does not cure Mold Breaker poison on partner") { GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); PLAYER(SPECIES_PINSIR) { Ability(ABILITY_MOLD_BREAKER); } PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_PONYTA_GALAR) { Ability(ABILITY_PASTEL_VEIL); } @@ -70,7 +70,7 @@ DOUBLE_BATTLE_TEST("Pastel Veil does not cure Mold Breaker poison on partner") SINGLE_BATTLE_TEST("Pastel Veil prevents Toxic bad poison") { GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_PONYTA_GALAR) { Ability(ABILITY_PASTEL_VEIL); } } WHEN { @@ -86,7 +86,7 @@ SINGLE_BATTLE_TEST("Pastel Veil prevents Toxic bad poison") DOUBLE_BATTLE_TEST("Pastel Veil prevents Toxic bad poison on partner") { GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_PONYTA_GALAR) { Ability(ABILITY_PASTEL_VEIL); } @@ -104,7 +104,7 @@ DOUBLE_BATTLE_TEST("Pastel Veil prevents Toxic bad poison on partner") SINGLE_BATTLE_TEST("Pastel Veil prevents Toxic Spikes poison") { GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC_SPIKES].effect == EFFECT_TOXIC_SPIKES); + ASSUME(GetMoveEffect(MOVE_TOXIC_SPIKES) == EFFECT_TOXIC_SPIKES); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_PONYTA_GALAR) { Ability(ABILITY_PASTEL_VEIL); } @@ -120,7 +120,7 @@ SINGLE_BATTLE_TEST("Pastel Veil prevents Toxic Spikes poison") DOUBLE_BATTLE_TEST("Pastel Veil prevents Toxic Spikes poison on partner") { GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC_SPIKES].effect == EFFECT_TOXIC_SPIKES); + ASSUME(GetMoveEffect(MOVE_TOXIC_SPIKES) == EFFECT_TOXIC_SPIKES); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_PONYTA_GALAR) { Ability(ABILITY_PASTEL_VEIL); } diff --git a/test/battle/ability/pickup.c b/test/battle/ability/pickup.c index a6dabb66cc91..22db259399a6 100644 --- a/test/battle/ability/pickup.c +++ b/test/battle/ability/pickup.c @@ -120,7 +120,7 @@ SINGLE_BATTLE_TEST("Pickup doesn't grant an item after its holder faints") SINGLE_BATTLE_TEST("Pickup doesn't grant an used item if holder is replaced") { GIVEN { - ASSUME(gMovesInfo[MOVE_PARTING_SHOT].effect == EFFECT_PARTING_SHOT); + ASSUME(GetMoveEffect(MOVE_PARTING_SHOT) == EFFECT_PARTING_SHOT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_ZIGZAGOON) { Ability(ABILITY_PICKUP); } OPPONENT(SPECIES_WOBBUFFET) { MaxHP(300); HP(151); Item(ITEM_SITRUS_BERRY); } @@ -202,7 +202,7 @@ SINGLE_BATTLE_TEST("Pickup doesn't grant an item if the user eats it with Bug Bi SINGLE_BATTLE_TEST("Pickup doesn't grant an used item if its user already restored it") { GIVEN { - ASSUME(gMovesInfo[MOVE_RECYCLE].effect == EFFECT_RECYCLE); + ASSUME(GetMoveEffect(MOVE_RECYCLE) == EFFECT_RECYCLE); PLAYER(SPECIES_ZIGZAGOON) { Ability(ABILITY_PICKUP); } OPPONENT(SPECIES_WOBBUFFET) { MaxHP(100); HP(51); Item(ITEM_SITRUS_BERRY); } } WHEN { @@ -222,7 +222,7 @@ SINGLE_BATTLE_TEST("Pickup doesn't grant an used item if its user already restor SINGLE_BATTLE_TEST("Pickup restores an item that has been Flinged") { GIVEN { - ASSUME(gMovesInfo[MOVE_FLING].effect == EFFECT_FLING); + ASSUME(GetMoveEffect(MOVE_FLING) == EFFECT_FLING); PLAYER(SPECIES_ZIGZAGOON) { Ability(ABILITY_PICKUP); } OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_SITRUS_BERRY); } } WHEN { @@ -239,7 +239,7 @@ SINGLE_BATTLE_TEST("Pickup restores an item that has been Flinged") SINGLE_BATTLE_TEST("Pickup restores an item that was used by Natural Gift") { GIVEN { - ASSUME(gMovesInfo[MOVE_NATURAL_GIFT].effect == EFFECT_NATURAL_GIFT); + ASSUME(GetMoveEffect(MOVE_NATURAL_GIFT) == EFFECT_NATURAL_GIFT); PLAYER(SPECIES_ZIGZAGOON) { Ability(ABILITY_PICKUP); } OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_SITRUS_BERRY); } } WHEN { diff --git a/test/battle/ability/pixilate.c b/test/battle/ability/pixilate.c index 97c9c37a0c7c..44289769a6f9 100644 --- a/test/battle/ability/pixilate.c +++ b/test/battle/ability/pixilate.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); } SINGLE_BATTLE_TEST("Pixilate turns a Normal-type move into a Fairy-type move") diff --git a/test/battle/ability/poison_point.c b/test/battle/ability/poison_point.c index 9f9cd5e900cd..635698379cbb 100644 --- a/test/battle/ability/poison_point.c +++ b/test/battle/ability/poison_point.c @@ -7,15 +7,15 @@ SINGLE_BATTLE_TEST("Poison Point inflicts poison on contact") PARAMETRIZE { move = MOVE_TACKLE; } PARAMETRIZE { move = MOVE_SWIFT; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(!gMovesInfo[MOVE_SWIFT].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(!MoveMakesContact(MOVE_SWIFT)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_NIDORAN_M) { Ability(ABILITY_POISON_POINT); } } WHEN { TURN { MOVE(player, move); } TURN {} } SCENE { - if (gMovesInfo[move].makesContact) { + if (MoveMakesContact(move)) { ABILITY_POPUP(opponent, ABILITY_POISON_POINT); ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, player); MESSAGE("Wobbuffet was poisoned by the opposing Nidoran♂'s Poison Point!"); @@ -36,7 +36,7 @@ SINGLE_BATTLE_TEST("Poison Point triggers 30% of the time") PASSES_RANDOMLY(3, 10, RNG_POISON_POINT); GIVEN { ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_4); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_NIDORAN_M) { Ability(ABILITY_POISON_POINT); } } WHEN { diff --git a/test/battle/ability/poison_puppeteer.c b/test/battle/ability/poison_puppeteer.c index b8124b975bef..d5c470ad3747 100644 --- a/test/battle/ability/poison_puppeteer.c +++ b/test/battle/ability/poison_puppeteer.c @@ -53,7 +53,7 @@ SINGLE_BATTLE_TEST("Poison Puppeteer confuses target if it was (badly) poisoned SINGLE_BATTLE_TEST("Poison Puppeteer does not trigger if poison is Toxic Spikes induced") { GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC_SPIKES].effect == EFFECT_TOXIC_SPIKES); + ASSUME(GetMoveEffect(MOVE_TOXIC_SPIKES) == EFFECT_TOXIC_SPIKES); PLAYER(SPECIES_PECHARUNT) { Ability(ABILITY_POISON_PUPPETEER); } OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/ability/poison_touch.c b/test/battle/ability/poison_touch.c index 8fb4d243fb71..530d36179438 100644 --- a/test/battle/ability/poison_touch.c +++ b/test/battle/ability/poison_touch.c @@ -5,8 +5,8 @@ SINGLE_BATTLE_TEST("Poison Touch has a 30% chance to poison when attacking with { PASSES_RANDOMLY(3, 10, RNG_POISON_TOUCH); GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_GRIMER) { Ability(ABILITY_POISON_TOUCH); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -27,15 +27,15 @@ SINGLE_BATTLE_TEST("Poison Touch only applies when using contact moves") PARAMETRIZE { move = MOVE_TACKLE; } PARAMETRIZE { move = MOVE_SWIFT; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(!gMovesInfo[MOVE_SWIFT].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(!MoveMakesContact(MOVE_SWIFT)); PLAYER(SPECIES_GRIMER) { Ability(ABILITY_POISON_TOUCH); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(player, move); } } SCENE { ANIMATION(ANIM_TYPE_MOVE, move, player); - if (gMovesInfo[move].makesContact) { + if (MoveMakesContact(move)) { ABILITY_POPUP(player, ABILITY_POISON_TOUCH); ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponent); MESSAGE("The opposing Wobbuffet was poisoned by Grimer's Poison Touch!"); @@ -54,8 +54,8 @@ SINGLE_BATTLE_TEST("Poison Touch only applies when using contact moves") SINGLE_BATTLE_TEST("Poison Touch applies between multi-hit move hits") { GIVEN { - ASSUME(gMovesInfo[MOVE_ARM_THRUST].effect == EFFECT_MULTI_HIT); - ASSUME(gMovesInfo[MOVE_ARM_THRUST].makesContact); + ASSUME(GetMoveEffect(MOVE_ARM_THRUST) == EFFECT_MULTI_HIT); + ASSUME(MoveMakesContact(MOVE_ARM_THRUST)); ASSUME(gItemsInfo[ITEM_PECHA_BERRY].holdEffect == HOLD_EFFECT_CURE_PSN); PLAYER(SPECIES_GRIMER) { Ability(ABILITY_POISON_TOUCH); } OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_PECHA_BERRY); }; diff --git a/test/battle/ability/prankster.c b/test/battle/ability/prankster.c index c56950672930..cf297214d9ab 100644 --- a/test/battle/ability/prankster.c +++ b/test/battle/ability/prankster.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(gSpeciesInfo[SPECIES_UMBREON].types[0] == TYPE_DARK); - ASSUME(gMovesInfo[MOVE_CONFUSE_RAY].category == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveCategory(MOVE_CONFUSE_RAY) == DAMAGE_CATEGORY_STATUS); } SINGLE_BATTLE_TEST("Prankster-affected moves don't affect Dark-type Pokémon") @@ -135,7 +135,7 @@ SINGLE_BATTLE_TEST("Prankster is blocked by Quick Guard in Gen5+") DOUBLE_BATTLE_TEST("Prankster-affected moves that target all Pokémon are successful regardless of the presence of Dark-type Pokémon") { GIVEN { - ASSUME(gMovesInfo[MOVE_CAPTIVATE].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_CAPTIVATE) == MOVE_TARGET_BOTH); PLAYER(SPECIES_ILLUMISE) { Ability(ABILITY_PRANKSTER); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_UMBREON); diff --git a/test/battle/ability/primordial_sea.c b/test/battle/ability/primordial_sea.c index 01ed892874a4..e895d8ba4834 100644 --- a/test/battle/ability/primordial_sea.c +++ b/test/battle/ability/primordial_sea.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(!IS_MOVE_STATUS(MOVE_EMBER)); - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(!IsBattleMoveStatus(MOVE_EMBER)); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); } SINGLE_BATTLE_TEST("Primordial Sea blocks damaging Fire-type moves") @@ -32,9 +32,9 @@ SINGLE_BATTLE_TEST("Primordial Sea blocks damaging Fire-type moves") DOUBLE_BATTLE_TEST("Primordial Sea blocks damaging Fire-type moves and prints the message only once with moves hitting multiple targets") { GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_ERUPTION)); - ASSUME(gMovesInfo[MOVE_ERUPTION].type == TYPE_FIRE); - ASSUME(gMovesInfo[MOVE_ERUPTION].target == MOVE_TARGET_BOTH); + ASSUME(!IsBattleMoveStatus(MOVE_ERUPTION)); + ASSUME(GetMoveType(MOVE_ERUPTION) == TYPE_FIRE); + ASSUME(GetMoveTarget(MOVE_ERUPTION) == MOVE_TARGET_BOTH); PLAYER(SPECIES_KYOGRE) {Item(ITEM_BLUE_ORB); {Speed(5);}} PLAYER(SPECIES_WOBBUFFET) {Speed(5);} OPPONENT(SPECIES_WOBBUFFET) {Speed(10);} diff --git a/test/battle/ability/protosynthesis.c b/test/battle/ability/protosynthesis.c index 2be9f81d284d..5a468893e5c1 100644 --- a/test/battle/ability/protosynthesis.c +++ b/test/battle/ability/protosynthesis.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_ROUND].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_ROUND) == DAMAGE_CATEGORY_SPECIAL); } SINGLE_BATTLE_TEST("Protosynthesis boosts the highest stat") diff --git a/test/battle/ability/purifying_salt.c b/test/battle/ability/purifying_salt.c index 495ce01a468f..cb8fc6ca569c 100644 --- a/test/battle/ability/purifying_salt.c +++ b/test/battle/ability/purifying_salt.c @@ -7,7 +7,7 @@ SINGLE_BATTLE_TEST("Purifying Salt halves damage from Ghost-type moves", s16 dam PARAMETRIZE { ability = ABILITY_STURDY; } PARAMETRIZE { ability = ABILITY_PURIFYING_SALT; } GIVEN { - ASSUME(gMovesInfo[MOVE_SHADOW_BALL].type == TYPE_GHOST); + ASSUME(GetMoveType(MOVE_SHADOW_BALL) == TYPE_GHOST); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_GARGANACL) { Ability(ability); } } WHEN { @@ -25,7 +25,7 @@ SINGLE_BATTLE_TEST("Purifying Salt halves damage from dynamic Ghost-type moves", PARAMETRIZE { ability = ABILITY_STURDY; } PARAMETRIZE { ability = ABILITY_PURIFYING_SALT; } GIVEN { - ASSUME(gMovesInfo[MOVE_TERA_BLAST].effect == EFFECT_TERA_BLAST); + ASSUME(GetMoveEffect(MOVE_TERA_BLAST) == EFFECT_TERA_BLAST); PLAYER(SPECIES_WOBBUFFET) { TeraType(TYPE_GHOST); } OPPONENT(SPECIES_GARGANACL) { Ability(ability); } } WHEN { @@ -61,10 +61,10 @@ SINGLE_BATTLE_TEST("Purifying Salt grants immunity to status effects") PARAMETRIZE { move = MOVE_TOXIC; status = STATUS1_TOXIC_POISON; } PARAMETRIZE { move = MOVE_POWDER_SNOW; status = STATUS1_FREEZE; } GIVEN { - ASSUME(gMovesInfo[MOVE_WILL_O_WISP].effect == EFFECT_WILL_O_WISP); - ASSUME(gMovesInfo[MOVE_HYPNOSIS].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_THUNDER_WAVE].effect == EFFECT_PARALYZE); - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_WILL_O_WISP) == EFFECT_WILL_O_WISP); + ASSUME(GetMoveEffect(MOVE_HYPNOSIS) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_THUNDER_WAVE) == EFFECT_PARALYZE); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); ASSUME(MoveHasAdditionalEffect(MOVE_POWDER_SNOW, MOVE_EFFECT_FREEZE_OR_FROSTBITE) == TRUE); PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_PURIFYING_SALT); } OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/ability/quark_drive.c b/test/battle/ability/quark_drive.c index 928ee45eb581..edefdc130595 100644 --- a/test/battle/ability/quark_drive.c +++ b/test/battle/ability/quark_drive.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_ROUND].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_ROUND) == DAMAGE_CATEGORY_SPECIAL); } SINGLE_BATTLE_TEST("Quark Drive boosts the highest stat") diff --git a/test/battle/ability/rain_dish.c b/test/battle/ability/rain_dish.c index 93f642c633a2..dc7de954c377 100644 --- a/test/battle/ability/rain_dish.c +++ b/test/battle/ability/rain_dish.c @@ -2,7 +2,7 @@ #include "test/battle.h" ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_RAIN_DANCE].effect == EFFECT_RAIN_DANCE); + ASSUME(GetMoveEffect(MOVE_RAIN_DANCE) == EFFECT_RAIN_DANCE); } SINGLE_BATTLE_TEST("Rain Dish recovers 1/16th of Max HP in Rain") diff --git a/test/battle/ability/rattled.c b/test/battle/ability/rattled.c index da8157d28af7..465a6889515c 100644 --- a/test/battle/ability/rattled.c +++ b/test/battle/ability/rattled.c @@ -3,14 +3,14 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_FURY_CUTTER].type == TYPE_BUG); - ASSUME(!IS_MOVE_STATUS(MOVE_FURY_CUTTER)); - ASSUME(gMovesInfo[MOVE_FEINT_ATTACK].type == TYPE_DARK); - ASSUME(!IS_MOVE_STATUS(MOVE_FEINT_ATTACK)); - ASSUME(gMovesInfo[MOVE_SHADOW_PUNCH].type == TYPE_GHOST); - ASSUME(!IS_MOVE_STATUS(MOVE_SHADOW_PUNCH)); - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(GetMoveType(MOVE_FURY_CUTTER) == TYPE_BUG); + ASSUME(!IsBattleMoveStatus(MOVE_FURY_CUTTER)); + ASSUME(GetMoveType(MOVE_FEINT_ATTACK) == TYPE_DARK); + ASSUME(!IsBattleMoveStatus(MOVE_FEINT_ATTACK)); + ASSUME(GetMoveType(MOVE_SHADOW_PUNCH) == TYPE_GHOST); + ASSUME(!IsBattleMoveStatus(MOVE_SHADOW_PUNCH)); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); } SINGLE_BATTLE_TEST("Rattled boosts speed by 1 when hit by Bug, Dark or Ghost type move") @@ -73,8 +73,8 @@ SINGLE_BATTLE_TEST("Rattled boosts speed by 1 when affected by Intimidate") SINGLE_BATTLE_TEST("Rattled triggers correctly when hit by U-Turn") // Specific test here, because of #3124 { GIVEN { - ASSUME(gMovesInfo[MOVE_U_TURN].effect == EFFECT_HIT_ESCAPE); - ASSUME(gMovesInfo[MOVE_U_TURN].type == TYPE_BUG); + ASSUME(GetMoveEffect(MOVE_U_TURN) == EFFECT_HIT_ESCAPE); + ASSUME(GetMoveType(MOVE_U_TURN) == TYPE_BUG); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_SUDOWOODO) {Ability(ABILITY_RATTLED); } diff --git a/test/battle/ability/refrigerate.c b/test/battle/ability/refrigerate.c index dbbaa30eb8dd..b3f7b59a9e83 100644 --- a/test/battle/ability/refrigerate.c +++ b/test/battle/ability/refrigerate.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); } SINGLE_BATTLE_TEST("Refrigerate turns a Normal-type move into a Ice-type move") diff --git a/test/battle/ability/rocky_payload.c b/test/battle/ability/rocky_payload.c index 27cc45fda0f5..6756b98b8b16 100644 --- a/test/battle/ability/rocky_payload.c +++ b/test/battle/ability/rocky_payload.c @@ -14,11 +14,11 @@ SINGLE_BATTLE_TEST("Rocky Payload increases Rock-type move damage", s16 damage) PARAMETRIZE { move = MOVE_POWER_GEM; ability = ABILITY_ROCKY_PAYLOAD; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].type != TYPE_ROCK); - ASSUME(gMovesInfo[MOVE_ROCK_THROW].type == TYPE_ROCK); - ASSUME(gMovesInfo[MOVE_POWER_GEM].type == TYPE_ROCK); - ASSUME(gMovesInfo[MOVE_ROCK_THROW].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_POWER_GEM].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveType(MOVE_TACKLE) != TYPE_ROCK); + ASSUME(GetMoveType(MOVE_ROCK_THROW) == TYPE_ROCK); + ASSUME(GetMoveType(MOVE_POWER_GEM) == TYPE_ROCK); + ASSUME(GetMoveCategory(MOVE_ROCK_THROW) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_POWER_GEM) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_BOMBIRDIER) { Ability(ability); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/sand_veil.c b/test/battle/ability/sand_veil.c index f42c2672734b..7622d1876367 100644 --- a/test/battle/ability/sand_veil.c +++ b/test/battle/ability/sand_veil.c @@ -18,7 +18,7 @@ SINGLE_BATTLE_TEST("Sand Veil increases evasion during sandstorm") { PASSES_RANDOMLY(4, 5, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_POUND].accuracy == 100); + ASSUME(GetMoveAccuracy(MOVE_POUND) == 100); PLAYER(SPECIES_SANDSHREW) { Ability(ABILITY_SAND_VEIL); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/sap_sipper.c b/test/battle/ability/sap_sipper.c index d691d4e91a96..aeb746d2c66a 100644 --- a/test/battle/ability/sap_sipper.c +++ b/test/battle/ability/sap_sipper.c @@ -61,7 +61,7 @@ SINGLE_BATTLE_TEST("Sap Sipper does not increase Attack if already maxed") SINGLE_BATTLE_TEST("Sap Sipper blocks multi-hit grass type moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_BULLET_SEED].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_BULLET_SEED) == EFFECT_MULTI_HIT); PLAYER(SPECIES_MARILL) { Ability(ABILITY_SAP_SIPPER); } OPPONENT(SPECIES_SHELLDER) { Ability(ABILITY_SKILL_LINK); } } WHEN { diff --git a/test/battle/ability/seed_sower.c b/test/battle/ability/seed_sower.c index 5134bc131194..ad4beea515ea 100644 --- a/test/battle/ability/seed_sower.c +++ b/test/battle/ability/seed_sower.c @@ -49,8 +49,8 @@ DOUBLE_BATTLE_TEST("Multi-target moves hit correct battlers after Seed Sower is } GIVEN { - ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH); - ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_HYPER_VOICE) == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_SURF) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_ARBOLIVA) { Ability(abilities[B_POSITION_PLAYER_LEFT]); } PLAYER(SPECIES_ARBOLIVA) { Ability(abilities[B_POSITION_PLAYER_RIGHT]); } OPPONENT(SPECIES_ARBOLIVA) { Ability(abilities[B_POSITION_OPPONENT_LEFT]); } diff --git a/test/battle/ability/sharpness.c b/test/battle/ability/sharpness.c index 8ecb07671db1..38ed79f86fc5 100644 --- a/test/battle/ability/sharpness.c +++ b/test/battle/ability/sharpness.c @@ -11,8 +11,8 @@ SINGLE_BATTLE_TEST("Sharpness increases the power of slicing moves", s16 damage) PARAMETRIZE { move = MOVE_SCRATCH; ability = ABILITY_STEADFAST; } GIVEN { - ASSUME(gMovesInfo[MOVE_AERIAL_ACE].slicingMove); - ASSUME(!gMovesInfo[MOVE_SCRATCH].slicingMove); + ASSUME(IsSlicingMove(MOVE_AERIAL_ACE)); + ASSUME(!IsSlicingMove(MOVE_SCRATCH)); PLAYER(SPECIES_GALLADE) { Ability(ability); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/shed_skin.c b/test/battle/ability/shed_skin.c index e4ab6b736c66..2df293ecb4a8 100644 --- a/test/battle/ability/shed_skin.c +++ b/test/battle/ability/shed_skin.c @@ -8,7 +8,7 @@ SINGLE_BATTLE_TEST("Shed Skin triggers 33% of the time") else PASSES_RANDOMLY(33, 100, RNG_SHED_SKIN); GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_ARBOK) { Status1(STATUS1_POISON); Ability(ABILITY_SHED_SKIN); } } WHEN { diff --git a/test/battle/ability/sheer_force.c b/test/battle/ability/sheer_force.c index e06e56c2c5bd..c5add71df0a2 100644 --- a/test/battle/ability/sheer_force.c +++ b/test/battle/ability/sheer_force.c @@ -616,7 +616,7 @@ DOUBLE_BATTLE_TEST("Sheer Force only boosts the damage of moves it's supposed to s16 damage1, damage2; u32 move = 0; for (u32 j = 1; j < MOVES_COUNT; j += 4) - if (gMovesInfo[j].category != DAMAGE_CATEGORY_STATUS && !IgnoreMoveForSheerForceBoost(j)) + if (GetMoveCategory(j) != DAMAGE_CATEGORY_STATUS && !IgnoreMoveForSheerForceBoost(j)) PARAMETRIZE { move = j; } GIVEN { PLAYER(SPECIES_STEELIX) { Ability(ABILITY_SHEER_FORCE); Item(ITEM_BLUK_BERRY); } @@ -653,23 +653,26 @@ DOUBLE_BATTLE_TEST("Sheer Force only boosts the damage of moves it's supposed to } else TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } - if (gMovesInfo[move].effect == EFFECT_TWO_TURNS_ATTACK || gMovesInfo[move].effect == EFFECT_SEMI_INVULNERABLE || gMovesInfo[move].effect == EFFECT_SOLAR_BEAM || gMovesInfo[move].effect == EFFECT_SKY_DROP) + switch (GetMoveEffect(move)) { + case EFFECT_TWO_TURNS_ATTACK: + case EFFECT_SEMI_INVULNERABLE: + case EFFECT_SOLAR_BEAM: + case EFFECT_SKY_DROP: TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } TURN { ; } - } - if (gMovesInfo[move].effect == EFFECT_FUTURE_SIGHT) - { - TURN { ; } - TURN { ; } - } - if (gMovesInfo[move].effect == EFFECT_BIDE) - { + break; + case EFFECT_FUTURE_SIGHT: + TURN { ; } + TURN { ; } + break; + case EFFECT_BIDE: TURN { MOVE(opponentRight, MOVE_WATER_GUN, target: playerLeft); MOVE(playerRight, MOVE_WATER_GUN, target: opponentLeft); SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + break; } } SCENE { - if (gMovesInfo[move].effect != EFFECT_FUTURE_SIGHT) + if (GetMoveEffect(move) != EFFECT_FUTURE_SIGHT) { HP_BAR(opponentRight, captureDamage: &damage1); HP_BAR(playerRight, captureDamage: &damage2); @@ -691,7 +694,7 @@ DOUBLE_BATTLE_TEST("Sheer Force only boosts the damage of moves it's supposed to s16 damage1, damage2; u32 move = 0; for (u32 j = 2; j < MOVES_COUNT; j += 4) - if (gMovesInfo[j].category != DAMAGE_CATEGORY_STATUS && !IgnoreMoveForSheerForceBoost(j)) + if (GetMoveCategory(j) != DAMAGE_CATEGORY_STATUS && !IgnoreMoveForSheerForceBoost(j)) PARAMETRIZE { move = j; } GIVEN { PLAYER(SPECIES_STEELIX) { Ability(ABILITY_SHEER_FORCE); Item(ITEM_BLUK_BERRY); } @@ -728,23 +731,26 @@ DOUBLE_BATTLE_TEST("Sheer Force only boosts the damage of moves it's supposed to } else TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } - if (gMovesInfo[move].effect == EFFECT_TWO_TURNS_ATTACK || gMovesInfo[move].effect == EFFECT_SEMI_INVULNERABLE || gMovesInfo[move].effect == EFFECT_SOLAR_BEAM || gMovesInfo[move].effect == EFFECT_SKY_DROP) + switch (GetMoveEffect(move)) { + case EFFECT_TWO_TURNS_ATTACK: + case EFFECT_SEMI_INVULNERABLE: + case EFFECT_SOLAR_BEAM: + case EFFECT_SKY_DROP: TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } TURN { ; } - } - if (gMovesInfo[move].effect == EFFECT_FUTURE_SIGHT) - { - TURN { ; } - TURN { ; } - } - if (gMovesInfo[move].effect == EFFECT_BIDE) - { + break; + case EFFECT_FUTURE_SIGHT: + TURN { ; } + TURN { ; } + break; + case EFFECT_BIDE: TURN { MOVE(opponentRight, MOVE_WATER_GUN, target: playerLeft); MOVE(playerRight, MOVE_WATER_GUN, target: opponentLeft); SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + break; } } SCENE { - if (gMovesInfo[move].effect != EFFECT_FUTURE_SIGHT) + if (GetMoveEffect(move) != EFFECT_FUTURE_SIGHT) { HP_BAR(opponentRight, captureDamage: &damage1); HP_BAR(playerRight, captureDamage: &damage2); @@ -766,7 +772,7 @@ DOUBLE_BATTLE_TEST("Sheer Force only boosts the damage of moves it's supposed to s16 damage1, damage2; u32 move = 0; for (u32 j = 3; j < MOVES_COUNT; j += 4) - if (gMovesInfo[j].category != DAMAGE_CATEGORY_STATUS && !IgnoreMoveForSheerForceBoost(j)) + if (GetMoveCategory(j) != DAMAGE_CATEGORY_STATUS && !IgnoreMoveForSheerForceBoost(j)) PARAMETRIZE { move = j; } GIVEN { PLAYER(SPECIES_STEELIX) { Ability(ABILITY_SHEER_FORCE); Item(ITEM_BLUK_BERRY); } @@ -803,23 +809,26 @@ DOUBLE_BATTLE_TEST("Sheer Force only boosts the damage of moves it's supposed to } else TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } - if (gMovesInfo[move].effect == EFFECT_TWO_TURNS_ATTACK || gMovesInfo[move].effect == EFFECT_SEMI_INVULNERABLE || gMovesInfo[move].effect == EFFECT_SOLAR_BEAM || gMovesInfo[move].effect == EFFECT_SKY_DROP) + switch (GetMoveEffect(move)) { + case EFFECT_TWO_TURNS_ATTACK: + case EFFECT_SEMI_INVULNERABLE: + case EFFECT_SOLAR_BEAM: + case EFFECT_SKY_DROP: TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } TURN { ; } - } - if (gMovesInfo[move].effect == EFFECT_FUTURE_SIGHT) - { - TURN { ; } - TURN { ; } - } - if (gMovesInfo[move].effect == EFFECT_BIDE) - { + break; + case EFFECT_FUTURE_SIGHT: + TURN { ; } + TURN { ; } + break; + case EFFECT_BIDE: TURN { MOVE(opponentRight, MOVE_WATER_GUN, target: playerLeft); MOVE(playerRight, MOVE_WATER_GUN, target: opponentLeft); SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + break; } } SCENE { - if (gMovesInfo[move].effect != EFFECT_FUTURE_SIGHT) + if (GetMoveEffect(move) != EFFECT_FUTURE_SIGHT) { HP_BAR(opponentRight, captureDamage: &damage1); HP_BAR(playerRight, captureDamage: &damage2); @@ -842,7 +851,7 @@ DOUBLE_BATTLE_TEST("Sheer Force only boosts the damage of moves it's supposed to u32 move = 0; for (u32 j = 4; j < MOVES_COUNT; j += 4) { - if (gMovesInfo[j].category != DAMAGE_CATEGORY_STATUS && !IgnoreMoveForSheerForceBoost(j)) + if (GetMoveCategory(j) != DAMAGE_CATEGORY_STATUS && !IgnoreMoveForSheerForceBoost(j)) PARAMETRIZE { move = j; } } GIVEN { @@ -880,23 +889,26 @@ DOUBLE_BATTLE_TEST("Sheer Force only boosts the damage of moves it's supposed to } else TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } - if (gMovesInfo[move].effect == EFFECT_TWO_TURNS_ATTACK || gMovesInfo[move].effect == EFFECT_SEMI_INVULNERABLE || gMovesInfo[move].effect == EFFECT_SOLAR_BEAM || gMovesInfo[move].effect == EFFECT_SKY_DROP) + switch (GetMoveEffect(move)) { + case EFFECT_TWO_TURNS_ATTACK: + case EFFECT_SEMI_INVULNERABLE: + case EFFECT_SOLAR_BEAM: + case EFFECT_SKY_DROP: TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } TURN { ; } - } - if (gMovesInfo[move].effect == EFFECT_FUTURE_SIGHT) - { - TURN { ; } - TURN { ; } - } - if (gMovesInfo[move].effect == EFFECT_BIDE) - { + break; + case EFFECT_FUTURE_SIGHT: + TURN { ; } + TURN { ; } + break; + case EFFECT_BIDE: TURN { MOVE(opponentRight, MOVE_WATER_GUN, target: playerLeft); MOVE(playerRight, MOVE_WATER_GUN, target: opponentLeft); SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + break; } } SCENE { - if (gMovesInfo[move].effect != EFFECT_FUTURE_SIGHT) + if (GetMoveEffect(move) != EFFECT_FUTURE_SIGHT) { HP_BAR(opponentRight, captureDamage: &damage1); HP_BAR(playerRight, captureDamage: &damage2); diff --git a/test/battle/ability/snow_cloak.c b/test/battle/ability/snow_cloak.c index a4d1acadb7c5..4e129c3ff723 100644 --- a/test/battle/ability/snow_cloak.c +++ b/test/battle/ability/snow_cloak.c @@ -17,7 +17,7 @@ SINGLE_BATTLE_TEST("Snow Cloak increases evasion during hail") { PASSES_RANDOMLY(4, 5, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_POUND].accuracy == 100); + ASSUME(GetMoveAccuracy(MOVE_POUND) == 100); PLAYER(SPECIES_GLACEON) { Ability(ABILITY_SNOW_CLOAK); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/stalwart.c b/test/battle/ability/stalwart.c index 6f8acd6d8290..22debe74cd99 100644 --- a/test/battle/ability/stalwart.c +++ b/test/battle/ability/stalwart.c @@ -24,8 +24,8 @@ DOUBLE_BATTLE_TEST("Stalwart stops Lightning Rod and Storm Drain from redirectin PARAMETRIZE { ability = ABILITY_STORM_DRAIN; species = SPECIES_LUMINEON; } PARAMETRIZE { ability = ABILITY_LIGHTNING_ROD; species = SPECIES_RAICHU; } GIVEN { - ASSUME(gMovesInfo[MOVE_SPARK].type == TYPE_ELECTRIC); - ASSUME(gMovesInfo[MOVE_WATER_GUN].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_SPARK) == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_WATER_GUN) == TYPE_WATER); PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_STALWART); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(species) { Ability(ability); } diff --git a/test/battle/ability/stamina.c b/test/battle/ability/stamina.c index 5bf7dc09a67e..172154cc8541 100644 --- a/test/battle/ability/stamina.c +++ b/test/battle/ability/stamina.c @@ -24,10 +24,10 @@ SINGLE_BATTLE_TEST("Stamina raises Defense by 1 when hit by a move") PARAMETRIZE {move = MOVE_GUST; } GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); - ASSUME(!IS_MOVE_STATUS(MOVE_GUST)); - ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); + ASSUME(!IsBattleMoveStatus(MOVE_GUST)); + ASSUME(GetMoveCategory(MOVE_GUST) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_STAMINA); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -56,7 +56,7 @@ DOUBLE_BATTLE_TEST("Stamina activates correctly for every battler with the abili PARAMETRIZE {abilityLeft = ABILITY_STAMINA, abilityRight = ABILITY_STAMINA; } GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_EARTHQUAKE) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_WOBBUFFET) { Ability(abilityLeft); Speed(10); } PLAYER(SPECIES_WOBBUFFET) { Ability(abilityRight); Speed(5); } OPPONENT(SPECIES_WOBBUFFET) {Speed(20); } diff --git a/test/battle/ability/stance_change.c b/test/battle/ability/stance_change.c index f8a0c70b3e48..d6e08909f9e0 100644 --- a/test/battle/ability/stance_change.c +++ b/test/battle/ability/stance_change.c @@ -64,7 +64,7 @@ SINGLE_BATTLE_TEST("Stance Change changes Aegislash from Blade to Shield when us SINGLE_BATTLE_TEST("Stance Change doesn't change Aegislash to Shield if King's Shield is called by a different move - Sleep Talk") { GIVEN { - ASSUME(gMovesInfo[MOVE_SLEEP_TALK].effect == EFFECT_SLEEP_TALK); + ASSUME(GetMoveEffect(MOVE_SLEEP_TALK) == EFFECT_SLEEP_TALK); PLAYER(SPECIES_AEGISLASH_BLADE) { Moves(MOVE_KINGS_SHIELD, MOVE_SLEEP_TALK); Status1(STATUS1_SLEEP_TURN(3)); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/static.c b/test/battle/ability/static.c index 3c5d042cd0c9..8d5a27c6b5ba 100644 --- a/test/battle/ability/static.c +++ b/test/battle/ability/static.c @@ -7,14 +7,14 @@ SINGLE_BATTLE_TEST("Static inflicts paralysis on contact") PARAMETRIZE { move = MOVE_TACKLE; } PARAMETRIZE { move = MOVE_SWIFT; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(!gMovesInfo[MOVE_SWIFT].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(!MoveMakesContact(MOVE_SWIFT)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_PIKACHU) { Ability(ABILITY_STATIC); } } WHEN { TURN { MOVE(player, move); } } SCENE { - if (gMovesInfo[move].makesContact) { + if (MoveMakesContact(move)) { ABILITY_POPUP(opponent, ABILITY_STATIC); ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PRZ, player); MESSAGE("The opposing Pikachu's Static paralyzed Wobbuffet, so it may be unable to move!"); @@ -35,7 +35,7 @@ SINGLE_BATTLE_TEST("Static triggers 30% of the time") PASSES_RANDOMLY(3, 10, RNG_STATIC); GIVEN { ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_4); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_PIKACHU) { Ability(ABILITY_STATIC); } } WHEN { diff --git a/test/battle/ability/steelworker.c b/test/battle/ability/steelworker.c index 7e8ecbb56886..23d4be2917e6 100644 --- a/test/battle/ability/steelworker.c +++ b/test/battle/ability/steelworker.c @@ -14,11 +14,11 @@ SINGLE_BATTLE_TEST("Steelworker increases Steel-type move damage", s16 damage) PARAMETRIZE { move = MOVE_FLASH_CANNON; ability = ABILITY_STEELWORKER; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].type != TYPE_STEEL); - ASSUME(gMovesInfo[MOVE_ANCHOR_SHOT].type == TYPE_STEEL); - ASSUME(gMovesInfo[MOVE_FLASH_CANNON].type == TYPE_STEEL); - ASSUME(gMovesInfo[MOVE_ANCHOR_SHOT].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_FLASH_CANNON].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveType(MOVE_TACKLE) != TYPE_STEEL); + ASSUME(GetMoveType(MOVE_ANCHOR_SHOT) == TYPE_STEEL); + ASSUME(GetMoveType(MOVE_FLASH_CANNON) == TYPE_STEEL); + ASSUME(GetMoveCategory(MOVE_ANCHOR_SHOT) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_FLASH_CANNON) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_DHELMISE) { Ability(ability); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/stench.c b/test/battle/ability/stench.c index 76b36f3ff342..f1484de6c941 100644 --- a/test/battle/ability/stench.c +++ b/test/battle/ability/stench.c @@ -5,7 +5,7 @@ SINGLE_BATTLE_TEST("Stench has a 10% chance to flinch") { PASSES_RANDOMLY(1, 10, RNG_STENCH); GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); PLAYER(SPECIES_GRIMER) { Ability(ABILITY_STENCH); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -20,7 +20,7 @@ SINGLE_BATTLE_TEST("Stench does not stack with King's Rock") PASSES_RANDOMLY(1, 10, RNG_STENCH); GIVEN { ASSUME(gItemsInfo[ITEM_KINGS_ROCK].holdEffect == HOLD_EFFECT_FLINCH); - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); PLAYER(SPECIES_GRIMER) { Ability(ABILITY_STENCH); Item(ITEM_KINGS_ROCK); } OPPONENT(SPECIES_WOBBUFFET); @@ -34,7 +34,7 @@ SINGLE_BATTLE_TEST("Stench does not stack with King's Rock") DOUBLE_BATTLE_TEST("Stench only triggers if target takes damage") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); ASSUME(MoveHasAdditionalEffectWithChance(MOVE_FAKE_OUT, MOVE_EFFECT_FLINCH, 100)); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); @@ -58,7 +58,7 @@ DOUBLE_BATTLE_TEST("Stench only triggers if target takes damage") DOUBLE_BATTLE_TEST("Stench doesn't trigger if partner uses a move") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); ASSUME(MoveHasAdditionalEffectWithChance(MOVE_FAKE_OUT, MOVE_EFFECT_FLINCH, 100)); PLAYER(SPECIES_WOBBUFFET) { Speed(20); } PLAYER(SPECIES_WYNAUT) { Speed(10); } diff --git a/test/battle/ability/storm_drain.c b/test/battle/ability/storm_drain.c index b4d5a2c1691d..962317b10858 100644 --- a/test/battle/ability/storm_drain.c +++ b/test/battle/ability/storm_drain.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Storm Drain absorbs Water-type moves and increases the Sp. Attack [Gen5+]") { GIVEN { - ASSUME(gMovesInfo[MOVE_WATER_GUN].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_WATER_GUN) == TYPE_WATER); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_GASTRODON_EAST) { Ability(ABILITY_STORM_DRAIN); } } WHEN { @@ -34,7 +34,7 @@ SINGLE_BATTLE_TEST("Storm Drain absorbs Water-type moves and increases the Sp. A DOUBLE_BATTLE_TEST("Storm Drain forces single-target Water-type moves to target the Pokémon with this Ability.") { GIVEN { - ASSUME(gMovesInfo[MOVE_WATER_GUN].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_WATER_GUN) == TYPE_WATER); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_GASTRODON_EAST) { Ability(ABILITY_STORM_DRAIN); } diff --git a/test/battle/ability/sturdy.c b/test/battle/ability/sturdy.c index b79fd5e92196..5ba7e16ea8e8 100644 --- a/test/battle/ability/sturdy.c +++ b/test/battle/ability/sturdy.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Sturdy prevents OHKO moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_FISSURE].effect == EFFECT_OHKO); + ASSUME(GetMoveEffect(MOVE_FISSURE) == EFFECT_OHKO); PLAYER(SPECIES_GEODUDE) { Ability(ABILITY_STURDY); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/supreme_overlord.c b/test/battle/ability/supreme_overlord.c index f8868b4afb98..eec81e89eda9 100644 --- a/test/battle/ability/supreme_overlord.c +++ b/test/battle/ability/supreme_overlord.c @@ -95,7 +95,7 @@ SINGLE_BATTLE_TEST("Supreme Overlord does not boost attack if party members are SINGLE_BATTLE_TEST("Supreme Overlord's message displays correctly after all battlers fainted - Player") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET) { HP(1);} PLAYER(SPECIES_KINGAMBIT) { Ability(ABILITY_SUPREME_OVERLORD); } OPPONENT(SPECIES_WOBBUFFET); @@ -116,7 +116,7 @@ SINGLE_BATTLE_TEST("Supreme Overlord's message displays correctly after all batt SINGLE_BATTLE_TEST("Supreme Overlord's message displays correctly after all battlers fainted - Opponent") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { HP(1);} diff --git a/test/battle/ability/swarm.c b/test/battle/ability/swarm.c index c3da16f6b6a8..a70c1ffb5544 100644 --- a/test/battle/ability/swarm.c +++ b/test/battle/ability/swarm.c @@ -7,9 +7,9 @@ SINGLE_BATTLE_TEST("Swarm boosts Bug-type moves in a pinch", s16 damage) PARAMETRIZE { hp = 99; } PARAMETRIZE { hp = 33; } GIVEN { - ASSUME(gMovesInfo[MOVE_BUG_BITE].type == TYPE_BUG); - ASSUME(gMovesInfo[MOVE_BUG_BITE].power == 60); - ASSUME(gMovesInfo[MOVE_BUG_BITE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveType(MOVE_BUG_BITE) == TYPE_BUG); + ASSUME(GetMovePower(MOVE_BUG_BITE) == 60); + ASSUME(GetMoveCategory(MOVE_BUG_BITE) == DAMAGE_CATEGORY_PHYSICAL); ASSUME(gSpeciesInfo[SPECIES_LEDYBA].types[0] == TYPE_BUG); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] == TYPE_PSYCHIC); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[1] == TYPE_PSYCHIC); diff --git a/test/battle/ability/sword_of_ruin.c b/test/battle/ability/sword_of_ruin.c index 3498522423a9..9501322ab7df 100644 --- a/test/battle/ability/sword_of_ruin.c +++ b/test/battle/ability/sword_of_ruin.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_ROLE_PLAY].effect == EFFECT_ROLE_PLAY); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveEffect(MOVE_ROLE_PLAY) == EFFECT_ROLE_PLAY); } SINGLE_BATTLE_TEST("Sword of Ruin reduces Defense if opposing mon's ability doesn't match") @@ -33,7 +33,7 @@ SINGLE_BATTLE_TEST("Sword of Ruin reduces Defense if opposing mon's ability does SINGLE_BATTLE_TEST("Sword of Ruin's message displays correctly after all battlers fainted - Player") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET) { HP(1);} PLAYER(SPECIES_CHIEN_PAO); OPPONENT(SPECIES_WOBBUFFET); @@ -55,7 +55,7 @@ SINGLE_BATTLE_TEST("Sword of Ruin's message displays correctly after all battler SINGLE_BATTLE_TEST("Sword of Ruin's message displays correctly after all battlers fainted - Opponent") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { HP(1);} diff --git a/test/battle/ability/tablets_of_ruin.c b/test/battle/ability/tablets_of_ruin.c index c98384b805f3..976f929bbe35 100644 --- a/test/battle/ability/tablets_of_ruin.c +++ b/test/battle/ability/tablets_of_ruin.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_ENTRAINMENT].effect == EFFECT_ENTRAINMENT); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveEffect(MOVE_ENTRAINMENT) == EFFECT_ENTRAINMENT); } SINGLE_BATTLE_TEST("Tablets of Ruin reduces Attack if opposing mon's ability doesn't match") @@ -33,7 +33,7 @@ SINGLE_BATTLE_TEST("Tablets of Ruin reduces Attack if opposing mon's ability doe SINGLE_BATTLE_TEST("Tablets of Ruin's message displays correctly after all battlers fainted - Player") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET) { HP(1);} PLAYER(SPECIES_WO_CHIEN); OPPONENT(SPECIES_WOBBUFFET); @@ -55,7 +55,7 @@ SINGLE_BATTLE_TEST("Tablets of Ruin's message displays correctly after all battl SINGLE_BATTLE_TEST("Tablets of Ruin's message displays correctly after all battlers fainted - Opponent") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { HP(1);} diff --git a/test/battle/ability/tangling_hair.c b/test/battle/ability/tangling_hair.c index f663465163c6..45f6282fb878 100644 --- a/test/battle/ability/tangling_hair.c +++ b/test/battle/ability/tangling_hair.c @@ -3,9 +3,9 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].effect == EFFECT_HIT); - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact == TRUE); + ASSUME(GetMoveEffect(MOVE_TACKLE) == EFFECT_HIT); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); + ASSUME(MoveMakesContact(MOVE_TACKLE) == TRUE); } @@ -17,7 +17,7 @@ SINGLE_BATTLE_TEST("Tangling Hair drops opposing mon's speed if ability user got PARAMETRIZE { move = MOVE_SWIFT; } GIVEN { - ASSUME(gMovesInfo[MOVE_SWIFT].makesContact == FALSE); + ASSUME(MoveMakesContact(MOVE_SWIFT) == FALSE); PLAYER(SPECIES_DUGTRIO) { Ability(ABILITY_TANGLING_HAIR); } OPPONENT(SPECIES_WYNAUT); } WHEN { diff --git a/test/battle/ability/teraform_zero.c b/test/battle/ability/teraform_zero.c index 819d0eef3d16..09ce92193161 100644 --- a/test/battle/ability/teraform_zero.c +++ b/test/battle/ability/teraform_zero.c @@ -39,8 +39,8 @@ DOUBLE_BATTLE_TEST("Teraform Zero can be supressed") SINGLE_BATTLE_TEST("Teraform Zero can be replaced") { GIVEN { - ASSUME(gMovesInfo[MOVE_WORRY_SEED].effect == EFFECT_WORRY_SEED); - ASSUME(gMovesInfo[MOVE_REST].effect == EFFECT_REST); + ASSUME(GetMoveEffect(MOVE_WORRY_SEED) == EFFECT_WORRY_SEED); + ASSUME(GetMoveEffect(MOVE_REST) == EFFECT_REST); PLAYER(SPECIES_TERAPAGOS); OPPONENT(SPECIES_WHIMSICOTT) { Ability(ABILITY_PRANKSTER); } } WHEN { @@ -57,7 +57,7 @@ SINGLE_BATTLE_TEST("Teraform Zero can be replaced") SINGLE_BATTLE_TEST("Teraform Zero cannot be swapped") { GIVEN { - ASSUME(gMovesInfo[MOVE_SKILL_SWAP].effect == EFFECT_SKILL_SWAP); + ASSUME(GetMoveEffect(MOVE_SKILL_SWAP) == EFFECT_SKILL_SWAP); PLAYER(SPECIES_TERAPAGOS); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -71,7 +71,7 @@ SINGLE_BATTLE_TEST("Teraform Zero cannot be swapped") SINGLE_BATTLE_TEST("Teraform Zero cannot be copied") { GIVEN { - ASSUME(gMovesInfo[MOVE_ROLE_PLAY].effect == EFFECT_ROLE_PLAY); + ASSUME(GetMoveEffect(MOVE_ROLE_PLAY) == EFFECT_ROLE_PLAY); PLAYER(SPECIES_TERAPAGOS); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/torrent.c b/test/battle/ability/torrent.c index df27d8e99670..f0da964b93ee 100644 --- a/test/battle/ability/torrent.c +++ b/test/battle/ability/torrent.c @@ -7,7 +7,7 @@ SINGLE_BATTLE_TEST("Torrent boosts Water-type moves in a pinch", s16 damage) PARAMETRIZE { hp = 99; } PARAMETRIZE { hp = 33; } GIVEN { - ASSUME(gMovesInfo[MOVE_BUBBLE].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_BUBBLE) == TYPE_WATER); PLAYER(SPECIES_SQUIRTLE) { Ability(ABILITY_TORRENT); MaxHP(99); HP(hp); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/toxic_chain.c b/test/battle/ability/toxic_chain.c index c233f5fc92ac..97c3fdf4f917 100644 --- a/test/battle/ability/toxic_chain.c +++ b/test/battle/ability/toxic_chain.c @@ -5,8 +5,8 @@ SINGLE_BATTLE_TEST("Toxic Chain inflicts bad poison when attacking") { PASSES_RANDOMLY(3, 10, RNG_TOXIC_CHAIN); GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category != DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMoveCategory(MOVE_TACKLE) != DAMAGE_CATEGORY_STATUS); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); PLAYER(SPECIES_OKIDOGI) { Ability(ABILITY_TOXIC_CHAIN); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -24,9 +24,9 @@ SINGLE_BATTLE_TEST("Toxic Chain inflicts bad poison when attacking") SINGLE_BATTLE_TEST("Toxic Chain inflicts bad poison on any hit of a multi-hit move") { GIVEN { - ASSUME(gMovesInfo[MOVE_DOUBLE_SLAP].category != DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_DOUBLE_SLAP].effect == EFFECT_MULTI_HIT); - ASSUME(gMovesInfo[MOVE_DOUBLE_SLAP].power > 0); + ASSUME(GetMoveCategory(MOVE_DOUBLE_SLAP) != DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveEffect(MOVE_DOUBLE_SLAP) == EFFECT_MULTI_HIT); + ASSUME(GetMovePower(MOVE_DOUBLE_SLAP) > 0); ASSUME(gItemsInfo[ITEM_PECHA_BERRY].holdEffect == HOLD_EFFECT_CURE_PSN); PLAYER(SPECIES_OKIDOGI) { Ability(ABILITY_TOXIC_CHAIN); } OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_PECHA_BERRY); } @@ -51,9 +51,9 @@ SINGLE_BATTLE_TEST("Toxic Chain inflicts bad poison on any hit of a multi-hit mo DOUBLE_BATTLE_TEST("Toxic Chain can inflict bad poison on both foes") { GIVEN { - ASSUME(gMovesInfo[MOVE_RAZOR_LEAF].category != DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_RAZOR_LEAF].target == MOVE_TARGET_BOTH); - ASSUME(gMovesInfo[MOVE_RAZOR_LEAF].power > 0); + ASSUME(GetMoveCategory(MOVE_RAZOR_LEAF) != DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveTarget(MOVE_RAZOR_LEAF) == MOVE_TARGET_BOTH); + ASSUME(GetMovePower(MOVE_RAZOR_LEAF) > 0); PLAYER(SPECIES_OKIDOGI) { Ability(ABILITY_TOXIC_CHAIN); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -85,9 +85,9 @@ SINGLE_BATTLE_TEST("Toxic Chain makes Lum/Pecha Berry trigger before being knock PARAMETRIZE { item = ITEM_LUM_BERRY; } GIVEN { - ASSUME(gMovesInfo[MOVE_KNOCK_OFF].category != DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_KNOCK_OFF].effect == EFFECT_KNOCK_OFF); - ASSUME(gMovesInfo[MOVE_KNOCK_OFF].power > 0); + ASSUME(GetMoveCategory(MOVE_KNOCK_OFF) != DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveEffect(MOVE_KNOCK_OFF) == EFFECT_KNOCK_OFF); + ASSUME(GetMovePower(MOVE_KNOCK_OFF) > 0); ASSUME(gItemsInfo[ITEM_PECHA_BERRY].holdEffect == HOLD_EFFECT_CURE_PSN); ASSUME(gItemsInfo[ITEM_LUM_BERRY].holdEffect == HOLD_EFFECT_CURE_STATUS); PLAYER(SPECIES_OKIDOGI) { Ability(ABILITY_TOXIC_CHAIN); } diff --git a/test/battle/ability/toxic_debris.c b/test/battle/ability/toxic_debris.c index c4a50a5d1363..b3b9dbbb2e1f 100644 --- a/test/battle/ability/toxic_debris.c +++ b/test/battle/ability/toxic_debris.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_SWIFT].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_SWIFT) == DAMAGE_CATEGORY_SPECIAL); } SINGLE_BATTLE_TEST("Toxic Debris sets Toxic Spikes on the opposing side if hit by a physical attack") diff --git a/test/battle/ability/transistor.c b/test/battle/ability/transistor.c index 8dd1a1bdb362..eb3c015af7d2 100644 --- a/test/battle/ability/transistor.c +++ b/test/battle/ability/transistor.c @@ -17,11 +17,11 @@ SINGLE_BATTLE_TEST("Transistor increases Electric-type attack / special attack", PARAMETRIZE { move = MOVE_THUNDER_SHOCK; ability = ABILITY_TRANSISTOR; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].type != TYPE_ELECTRIC); - ASSUME(gMovesInfo[MOVE_WILD_CHARGE].type == TYPE_ELECTRIC); - ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC); - ASSUME(gMovesInfo[MOVE_WILD_CHARGE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveType(MOVE_TACKLE) != TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_WILD_CHARGE) == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_THUNDER_SHOCK) == TYPE_ELECTRIC); + ASSUME(GetMoveCategory(MOVE_WILD_CHARGE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_THUNDER_SHOCK) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_REGIELEKI) { Ability(ability); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -43,7 +43,7 @@ SINGLE_BATTLE_TEST("Transistor is blocked by neutralizing gas", s16 damage) PARAMETRIZE { ability = ABILITY_LEVITATE; } GIVEN { - ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_THUNDER_SHOCK) == TYPE_ELECTRIC); PLAYER(SPECIES_REGIELEKI) { Ability(ABILITY_TRANSISTOR); } OPPONENT(SPECIES_KOFFING) { Ability(ability); } } WHEN { diff --git a/test/battle/ability/vessel_of_ruin.c b/test/battle/ability/vessel_of_ruin.c index 6531cbbf3aae..4d159c0b0e18 100644 --- a/test/battle/ability/vessel_of_ruin.c +++ b/test/battle/ability/vessel_of_ruin.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_WATER_GUN].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_ENTRAINMENT].effect == EFFECT_ENTRAINMENT); + ASSUME(GetMoveCategory(MOVE_WATER_GUN) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveEffect(MOVE_ENTRAINMENT) == EFFECT_ENTRAINMENT); } SINGLE_BATTLE_TEST("Vessel of Ruin reduces Sp. Atk if opposing mon's ability doesn't match") @@ -33,7 +33,7 @@ SINGLE_BATTLE_TEST("Vessel of Ruin reduces Sp. Atk if opposing mon's ability doe SINGLE_BATTLE_TEST("Vessel of Ruin's message displays correctly after all battlers fainted - Player") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET) { HP(1);} PLAYER(SPECIES_TING_LU); OPPONENT(SPECIES_WOBBUFFET); @@ -55,7 +55,7 @@ SINGLE_BATTLE_TEST("Vessel of Ruin's message displays correctly after all battle SINGLE_BATTLE_TEST("Vessel of Ruin's message displays correctly after all battlers fainted - Opponent") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { HP(1);} diff --git a/test/battle/ability/volt_absorb.c b/test/battle/ability/volt_absorb.c index 93498bd1c711..5d88cb95e4d4 100644 --- a/test/battle/ability/volt_absorb.c +++ b/test/battle/ability/volt_absorb.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Volt Absorb heals 25% when hit by electric type moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_THUNDER_SHOCK) == TYPE_ELECTRIC); PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(100); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -19,7 +19,7 @@ SINGLE_BATTLE_TEST("Volt Absorb heals 25% when hit by electric type moves") SINGLE_BATTLE_TEST("Volt Absorb does not activate if protected") { GIVEN { - ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_THUNDER_SHOCK) == TYPE_ELECTRIC); PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(100); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -32,8 +32,8 @@ SINGLE_BATTLE_TEST("Volt Absorb does not activate if protected") SINGLE_BATTLE_TEST("Volt Absorb activates on status moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_THUNDER_WAVE].type == TYPE_ELECTRIC); - ASSUME(gMovesInfo[MOVE_THUNDER_WAVE].category == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveType(MOVE_THUNDER_WAVE) == TYPE_ELECTRIC); + ASSUME(GetMoveCategory(MOVE_THUNDER_WAVE) == DAMAGE_CATEGORY_STATUS); PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(100); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -48,8 +48,8 @@ SINGLE_BATTLE_TEST("Volt Absorb activates on status moves") SINGLE_BATTLE_TEST("Volt Absorb is only triggered once on multi strike moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_FURY_SWIPES].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_FURY_SWIPES].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveType(MOVE_FURY_SWIPES) == TYPE_NORMAL); + ASSUME(GetMoveEffect(MOVE_FURY_SWIPES) == EFFECT_MULTI_HIT); PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(100); } OPPONENT(SPECIES_GRAVELER_ALOLA) { Ability(ABILITY_GALVANIZE); } } WHEN { @@ -65,8 +65,8 @@ DOUBLE_BATTLE_TEST("Volt Absorb does not stop Electric Typed Explosion from dama { s16 damage1, damage2; GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); - ASSUME(gMovesInfo[MOVE_EXPLOSION].type == TYPE_NORMAL); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); + ASSUME(GetMoveType(MOVE_EXPLOSION) == TYPE_NORMAL); PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(100); } PLAYER(SPECIES_ABRA); OPPONENT(SPECIES_GRAVELER_ALOLA) { Ability(ABILITY_GALVANIZE); } @@ -88,7 +88,7 @@ DOUBLE_BATTLE_TEST("Volt Absorb does not stop Electric Typed Explosion from dama SINGLE_BATTLE_TEST("Volt Absorb prevents Cell Battery from activating") { GIVEN { - ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_THUNDER_SHOCK) == TYPE_ELECTRIC); PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); HP(1); MaxHP(100); Item(ITEM_CELL_BATTERY); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/water_absorb.c b/test/battle/ability/water_absorb.c index 842a448bab8c..1c0406ebdc47 100644 --- a/test/battle/ability/water_absorb.c +++ b/test/battle/ability/water_absorb.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Water Absorb heals 25% when hit by water type moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_BUBBLE].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_BUBBLE) == TYPE_WATER); PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -19,7 +19,7 @@ SINGLE_BATTLE_TEST("Water Absorb heals 25% when hit by water type moves") SINGLE_BATTLE_TEST("Water Absorb does not activate if protected") { GIVEN { - ASSUME(gMovesInfo[MOVE_BUBBLE].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_BUBBLE) == TYPE_WATER); PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -32,8 +32,8 @@ SINGLE_BATTLE_TEST("Water Absorb does not activate if protected") SINGLE_BATTLE_TEST("Water Absorb activates on status moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_SOAK].type == TYPE_WATER); - ASSUME(gMovesInfo[MOVE_SOAK].category == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveType(MOVE_SOAK) == TYPE_WATER); + ASSUME(GetMoveCategory(MOVE_SOAK) == DAMAGE_CATEGORY_STATUS); PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -48,8 +48,8 @@ SINGLE_BATTLE_TEST("Water Absorb activates on status moves") SINGLE_BATTLE_TEST("Water Absorb is only triggered once on multi strike moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_WATER_SHURIKEN].type == TYPE_WATER); - ASSUME(gMovesInfo[MOVE_WATER_SHURIKEN].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveType(MOVE_WATER_SHURIKEN) == TYPE_WATER); + ASSUME(GetMoveEffect(MOVE_WATER_SHURIKEN) == EFFECT_MULTI_HIT); PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -67,7 +67,7 @@ SINGLE_BATTLE_TEST("Water Absorb prevents Absorb Bulb and Luminous Moss from act PARAMETRIZE { item = ITEM_ABSORB_BULB; } PARAMETRIZE { item = ITEM_LUMINOUS_MOSS; } GIVEN { - ASSUME(gMovesInfo[MOVE_BUBBLE].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_BUBBLE) == TYPE_WATER); PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); Item(item); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/ability/weak_armor.c b/test/battle/ability/weak_armor.c index 0d264e7ff93d..12e9ef3bcc11 100644 --- a/test/battle/ability/weak_armor.c +++ b/test/battle/ability/weak_armor.c @@ -3,10 +3,10 @@ ASSUMPTIONS { - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); - ASSUME(!IS_MOVE_STATUS(MOVE_GUST)); - ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); + ASSUME(!IsBattleMoveStatus(MOVE_GUST)); + ASSUME(GetMoveCategory(MOVE_GUST) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); ASSUME(B_WEAK_ARMOR_SPEED >= GEN_7); } @@ -50,8 +50,8 @@ SINGLE_BATTLE_TEST("Weak Armor lowers Defense by 1 and boosts Speed by 2 when hi SINGLE_BATTLE_TEST("Weak Armor does not trigger when brought in by Dragon Tail and taking Stealth Rock damage") { GIVEN { - ASSUME(gMovesInfo[MOVE_STEALTH_ROCK].effect == EFFECT_STEALTH_ROCK); - ASSUME(gMovesInfo[MOVE_DRAGON_TAIL].effect == EFFECT_HIT_SWITCH_TARGET); + ASSUME(GetMoveEffect(MOVE_STEALTH_ROCK) == EFFECT_STEALTH_ROCK); + ASSUME(GetMoveEffect(MOVE_DRAGON_TAIL) == EFFECT_HIT_SWITCH_TARGET); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_SLUGMA) { Ability(ABILITY_WEAK_ARMOR); } OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/ability/wind_power.c b/test/battle/ability/wind_power.c index 9ad42fad0f20..fd4a4b95f56a 100644 --- a/test/battle/ability/wind_power.c +++ b/test/battle/ability/wind_power.c @@ -3,16 +3,16 @@ ASSUMPTIONS { - ASSUME(!IS_MOVE_STATUS(MOVE_THUNDERBOLT)); - ASSUME(gMovesInfo[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); - ASSUME(!IS_MOVE_STATUS(MOVE_AIR_CUTTER)); - ASSUME(gMovesInfo[MOVE_AIR_CUTTER].target == MOVE_TARGET_BOTH); - ASSUME(gMovesInfo[MOVE_AIR_CUTTER].windMove == TRUE); - ASSUME(!IS_MOVE_STATUS(MOVE_PETAL_BLIZZARD)); - ASSUME(gMovesInfo[MOVE_PETAL_BLIZZARD].target == MOVE_TARGET_FOES_AND_ALLY); - ASSUME(gMovesInfo[MOVE_PETAL_BLIZZARD].windMove == TRUE); - ASSUME(gMovesInfo[MOVE_TACKLE].windMove == FALSE); + ASSUME(!IsBattleMoveStatus(MOVE_THUNDERBOLT)); + ASSUME(GetMoveType(MOVE_THUNDERBOLT) == TYPE_ELECTRIC); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); + ASSUME(!IsBattleMoveStatus(MOVE_AIR_CUTTER)); + ASSUME(GetMoveTarget(MOVE_AIR_CUTTER) == MOVE_TARGET_BOTH); + ASSUME(IsWindMove(MOVE_AIR_CUTTER)); + ASSUME(!IsBattleMoveStatus(MOVE_PETAL_BLIZZARD)); + ASSUME(GetMoveTarget(MOVE_PETAL_BLIZZARD) == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(IsWindMove(MOVE_PETAL_BLIZZARD)); + ASSUME(!IsWindMove(MOVE_TACKLE)); } SINGLE_BATTLE_TEST("Wind Power sets up Charge for player when hit by a wind move") @@ -193,7 +193,7 @@ DOUBLE_BATTLE_TEST("Wind Power activates correctly when Tailwind is used") PARAMETRIZE {opponentSide = FALSE;} GIVEN { - ASSUME(gMovesInfo[MOVE_TAILWIND].effect == EFFECT_TAILWIND); + ASSUME(GetMoveEffect(MOVE_TAILWIND) == EFFECT_TAILWIND); PLAYER(SPECIES_WATTREL) { Ability(ABILITY_WIND_POWER); Speed(10); } PLAYER(SPECIES_WATTREL) { Ability(ABILITY_WIND_POWER); Speed(5); } OPPONENT(SPECIES_WATTREL) { Ability(ABILITY_WIND_POWER); Speed(20); } diff --git a/test/battle/ability/wind_rider.c b/test/battle/ability/wind_rider.c index 44baacc8a229..d68414d060b7 100644 --- a/test/battle/ability/wind_rider.c +++ b/test/battle/ability/wind_rider.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TAILWIND].effect == EFFECT_TAILWIND); - ASSUME(gMovesInfo[MOVE_TAILWIND].windMove == TRUE); + ASSUME(GetMoveEffect(MOVE_TAILWIND) == EFFECT_TAILWIND); + ASSUME(IsWindMove(MOVE_TAILWIND)); } SINGLE_BATTLE_TEST("Wind Rider raises Attack by one stage if it sets up Tailwind") @@ -108,7 +108,7 @@ SINGLE_BATTLE_TEST("Wind Rider activates when it's no longer effected by Neutral SINGLE_BATTLE_TEST("Wind Rider absorbs Wind moves and raises Attack by one stage") { GIVEN { - ASSUME(gMovesInfo[MOVE_GUST].windMove == TRUE); + ASSUME(IsWindMove(MOVE_GUST)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_BRAMBLIN) { Ability(ABILITY_WIND_RIDER); } } WHEN { diff --git a/test/battle/ability/zero_to_hero.c b/test/battle/ability/zero_to_hero.c index 733104f15301..195bb4428992 100644 --- a/test/battle/ability/zero_to_hero.c +++ b/test/battle/ability/zero_to_hero.c @@ -60,7 +60,7 @@ SINGLE_BATTLE_TEST("Zero to Hero transforms both player and opponent") SINGLE_BATTLE_TEST("Zero to Hero will activate if a switch move is used") { GIVEN { - ASSUME(gMovesInfo[MOVE_FLIP_TURN].effect == EFFECT_HIT_ESCAPE); + ASSUME(GetMoveEffect(MOVE_FLIP_TURN) == EFFECT_HIT_ESCAPE); PLAYER(SPECIES_PALAFIN_ZERO) { Ability(ABILITY_ZERO_TO_HERO); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -83,9 +83,9 @@ SINGLE_BATTLE_TEST("Gastro Acid, Worry Seed, and Simple Beam fail if the target PARAMETRIZE { move = MOVE_SIMPLE_BEAM; } GIVEN { - ASSUME(gMovesInfo[MOVE_GASTRO_ACID].effect == EFFECT_GASTRO_ACID); - ASSUME(gMovesInfo[MOVE_WORRY_SEED].effect == EFFECT_WORRY_SEED); - ASSUME(gMovesInfo[MOVE_SIMPLE_BEAM].effect == EFFECT_SIMPLE_BEAM); + ASSUME(GetMoveEffect(MOVE_GASTRO_ACID) == EFFECT_GASTRO_ACID); + ASSUME(GetMoveEffect(MOVE_WORRY_SEED) == EFFECT_WORRY_SEED); + ASSUME(GetMoveEffect(MOVE_SIMPLE_BEAM) == EFFECT_SIMPLE_BEAM); PLAYER(SPECIES_PALAFIN_ZERO) { Ability(ABILITY_ZERO_TO_HERO); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -139,7 +139,7 @@ SINGLE_BATTLE_TEST("Imposter doesn't apply the heroic transformation message whe SINGLE_BATTLE_TEST("Zero to Hero's message displays correctly after all battlers fainted - Player") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_PALAFIN_ZERO); PLAYER(SPECIES_WOBBUFFET) { HP(1);} OPPONENT(SPECIES_WOBBUFFET); @@ -162,7 +162,7 @@ SINGLE_BATTLE_TEST("Zero to Hero's message displays correctly after all battlers SINGLE_BATTLE_TEST("Zero to Hero's message displays correctly after all battlers fainted - Opponent") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_PALAFIN_ZERO); diff --git a/test/battle/ai/ai.c b/test/battle/ai/ai.c index 0883e3cc5996..e9b5a2e51c68 100644 --- a/test/battle/ai/ai.c +++ b/test/battle/ai/ai.c @@ -80,25 +80,25 @@ AI_SINGLE_BATTLE_TEST("AI prefers moves with better accuracy, but only if they b AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { HP(hp); } PLAYER(SPECIES_WOBBUFFET); - ASSUME(gMovesInfo[MOVE_SWIFT].accuracy == 0); - ASSUME(gMovesInfo[MOVE_SLAM].power == gMovesInfo[MOVE_STRENGTH].power); - ASSUME(gMovesInfo[MOVE_MEGA_KICK].power > gMovesInfo[MOVE_STRENGTH].power); - ASSUME(gMovesInfo[MOVE_SLAM].accuracy < gMovesInfo[MOVE_STRENGTH].accuracy); - ASSUME(gMovesInfo[MOVE_MEGA_KICK].accuracy < gMovesInfo[MOVE_STRENGTH].accuracy); - ASSUME(gMovesInfo[MOVE_TACKLE].accuracy == 100); - ASSUME(gMovesInfo[MOVE_GUST].accuracy == 100); - ASSUME(gMovesInfo[MOVE_SHOCK_WAVE].accuracy == 0); - ASSUME(gMovesInfo[MOVE_THUNDERBOLT].accuracy == 100); - ASSUME(gMovesInfo[MOVE_ICY_WIND].accuracy != 100); - ASSUME(gMovesInfo[MOVE_SLAM].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_STRENGTH].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_MEGA_KICK].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_SWIFT].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_SHOCK_WAVE].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_ICY_WIND].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_THUNDERBOLT].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveAccuracy(MOVE_SWIFT) == 0); + ASSUME(GetMovePower(MOVE_SLAM) == GetMovePower(MOVE_STRENGTH)); + ASSUME(GetMovePower(MOVE_MEGA_KICK) > GetMovePower(MOVE_STRENGTH)); + ASSUME(GetMoveAccuracy(MOVE_SLAM) < GetMoveAccuracy(MOVE_STRENGTH)); + ASSUME(GetMoveAccuracy(MOVE_MEGA_KICK) < GetMoveAccuracy(MOVE_STRENGTH)); + ASSUME(GetMoveAccuracy(MOVE_TACKLE) == 100); + ASSUME(GetMoveAccuracy(MOVE_GUST) == 100); + ASSUME(GetMoveAccuracy(MOVE_SHOCK_WAVE) == 0); + ASSUME(GetMoveAccuracy(MOVE_THUNDERBOLT) == 100); + ASSUME(GetMoveAccuracy(MOVE_ICY_WIND) != 100); + ASSUME(GetMoveCategory(MOVE_SLAM) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_STRENGTH) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_MEGA_KICK) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_SWIFT) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_SHOCK_WAVE) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_ICY_WIND) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_THUNDERBOLT) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_GUST) == DAMAGE_CATEGORY_SPECIAL); OPPONENT(SPECIES_EXPLOUD) { Moves(move1, move2, move3, move4); Ability(abilityAtk); SpAttack(50); } // Low Sp.Atk, so Swift deals less damage than Strength. } WHEN { switch (turns) @@ -146,10 +146,10 @@ AI_SINGLE_BATTLE_TEST("AI prefers moves which deal more damage instead of moves PARAMETRIZE { move1 = MOVE_POISON_JAB; move2 = MOVE_WATER_GUN; expectedMove = MOVE_POISON_JAB; abilityDef = ABILITY_IMMUNITY; turns = 3; } GIVEN { - ASSUME(gMovesInfo[MOVE_WATERFALL].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_SCALD].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_POISON_JAB].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_WATER_GUN].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_WATERFALL) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_SCALD) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_POISON_JAB) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_WATER_GUN) == DAMAGE_CATEGORY_SPECIAL); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_TYPHLOSION) { Ability(abilityDef); } PLAYER(SPECIES_WOBBUFFET); @@ -176,8 +176,8 @@ AI_SINGLE_BATTLE_TEST("AI prefers Earthquake over Drill Run if both require the { // Drill Run has less accuracy than E-quake, but can score a higher crit. However the chance is too small, so AI should ignore it. GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].category == DAMAGE_CATEGORY_PHYSICAL); // Added because Geodude has to KO Typhlosion - ASSUME(gMovesInfo[MOVE_DRILL_RUN].category == DAMAGE_CATEGORY_PHYSICAL); // Added because Geodude has to KO Typhlosion + ASSUME(GetMoveCategory(MOVE_EARTHQUAKE) == DAMAGE_CATEGORY_PHYSICAL); // Added because Geodude has to KO Typhlosion + ASSUME(GetMoveCategory(MOVE_DRILL_RUN) == DAMAGE_CATEGORY_PHYSICAL); // Added because Geodude has to KO Typhlosion AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_TYPHLOSION); PLAYER(SPECIES_WOBBUFFET); @@ -202,8 +202,8 @@ AI_SINGLE_BATTLE_TEST("AI prefers a weaker move over a one with a downside effec PARAMETRIZE { move1 = MOVE_OVERHEAT; move2 = MOVE_FLAMETHROWER; hp = 250; expectedMove = MOVE_OVERHEAT; turns = 1; } GIVEN { - ASSUME(gMovesInfo[MOVE_FLAMETHROWER].category == DAMAGE_CATEGORY_SPECIAL); // Added because Typhlosion has to KO Wobbuffet - ASSUME(gMovesInfo[MOVE_OVERHEAT].category == DAMAGE_CATEGORY_SPECIAL); // Added because Typhlosion has to KO Wobbuffet + ASSUME(GetMoveCategory(MOVE_FLAMETHROWER) == DAMAGE_CATEGORY_SPECIAL); // Added because Typhlosion has to KO Wobbuffet + ASSUME(GetMoveCategory(MOVE_OVERHEAT) == DAMAGE_CATEGORY_SPECIAL); // Added because Typhlosion has to KO Wobbuffet AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { HP(hp); } PLAYER(SPECIES_WOBBUFFET); @@ -242,8 +242,8 @@ AI_SINGLE_BATTLE_TEST("AI prefers moves with the best possible score, chosen ran AI_SINGLE_BATTLE_TEST("AI can choose a status move that boosts the attack by two") { GIVEN { - ASSUME(gMovesInfo[MOVE_STRENGTH].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_HORN_ATTACK].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_STRENGTH) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_HORN_ATTACK) == DAMAGE_CATEGORY_PHYSICAL); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { HP(277); }; PLAYER(SPECIES_WOBBUFFET); @@ -330,8 +330,8 @@ AI_SINGLE_BATTLE_TEST("AI won't use Solar Beam if there is no Sun up or the user PARAMETRIZE { } GIVEN { - ASSUME(gMovesInfo[MOVE_SOLAR_BEAM].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_GRASS_PLEDGE].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_SOLAR_BEAM) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_GRASS_PLEDGE) == DAMAGE_CATEGORY_SPECIAL); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { HP(211); } PLAYER(SPECIES_WOBBUFFET); @@ -355,7 +355,7 @@ AI_SINGLE_BATTLE_TEST("AI won't use Solar Beam if there is no Sun up or the user AI_SINGLE_BATTLE_TEST("AI won't use ground type attacks against flying type Pokemon unless Gravity is in effect") { GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].category == DAMAGE_CATEGORY_PHYSICAL); // Otherwise, it doesn't KO Crobat + ASSUME(GetMoveCategory(MOVE_EARTHQUAKE) == DAMAGE_CATEGORY_PHYSICAL); // Otherwise, it doesn't KO Crobat AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_CROBAT); PLAYER(SPECIES_WOBBUFFET); @@ -430,7 +430,7 @@ AI_DOUBLE_BATTLE_TEST("AI will not use a status move if partner already chose He for (j = MOVE_NONE + 1; j < MOVES_COUNT; j++) { - if (gMovesInfo[j].category == DAMAGE_CATEGORY_STATUS) { + if (GetMoveCategory(j) == DAMAGE_CATEGORY_STATUS) { PARAMETRIZE { statusMove = j; } } } @@ -509,9 +509,9 @@ AI_SINGLE_BATTLE_TEST("AI will choose either Rock Tomb or Bulldoze if Stat drop AI_SINGLE_BATTLE_TEST("First Impression is preferred on the first turn of the species if it's the best dmg move") { GIVEN { - ASSUME(gMovesInfo[MOVE_FIRST_IMPRESSION].effect == EFFECT_FIRST_TURN_ONLY); - ASSUME(gMovesInfo[MOVE_FIRST_IMPRESSION].power == 90); - ASSUME(gMovesInfo[MOVE_LUNGE].power == 80); + ASSUME(GetMoveEffect(MOVE_FIRST_IMPRESSION) == EFFECT_FIRST_TURN_ONLY); + ASSUME(GetMovePower(MOVE_FIRST_IMPRESSION) == 90); + ASSUME(GetMovePower(MOVE_LUNGE) == 80); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_KANGASKHAN); OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_FIRST_IMPRESSION, MOVE_LUNGE); } @@ -531,9 +531,9 @@ AI_SINGLE_BATTLE_TEST("First Impression is not chosen if it's blocked by certain PARAMETRIZE { species = SPECIES_TSAREENA; ability = ABILITY_QUEENLY_MAJESTY; } GIVEN { - ASSUME(gMovesInfo[MOVE_FIRST_IMPRESSION].effect == EFFECT_FIRST_TURN_ONLY); - ASSUME(gMovesInfo[MOVE_FIRST_IMPRESSION].power == 90); - ASSUME(gMovesInfo[MOVE_LUNGE].power == 80); + ASSUME(GetMoveEffect(MOVE_FIRST_IMPRESSION) == EFFECT_FIRST_TURN_ONLY); + ASSUME(GetMovePower(MOVE_FIRST_IMPRESSION) == 90); + ASSUME(GetMovePower(MOVE_LUNGE) == 80); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_OMNISCIENT); PLAYER(species) { Ability(ability); } OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_FIRST_IMPRESSION, MOVE_LUNGE); } @@ -545,7 +545,7 @@ AI_SINGLE_BATTLE_TEST("First Impression is not chosen if it's blocked by certain AI_SINGLE_BATTLE_TEST("AI will not choose Burn Up if the user lost the Fire typing") { GIVEN { - ASSUME(gMovesInfo[MOVE_BURN_UP].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE); + ASSUME(GetMoveEffect(MOVE_BURN_UP) == EFFECT_FAIL_IF_NOT_ARG_TYPE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_CYNDAQUIL) { Moves(MOVE_BURN_UP, MOVE_EXTRASENSORY, MOVE_FLAMETHROWER); } @@ -559,7 +559,7 @@ AI_SINGLE_BATTLE_TEST("AI will only choose Surf 1/3 times if the opposing mon ha { PASSES_RANDOMLY(1, 3, RNG_AI_ABILITY); GIVEN { - ASSUME(gMovesInfo[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_THUNDERBOLT) == TYPE_ELECTRIC); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); }; OPPONENT(SPECIES_LANTURN) { Moves(MOVE_THUNDERBOLT, MOVE_ICE_BEAM, MOVE_SURF); } @@ -576,7 +576,7 @@ AI_SINGLE_BATTLE_TEST("AI will choose Thunderbolt then Surf 2/3 times if the opp { PASSES_RANDOMLY(2, 3, RNG_AI_ABILITY); GIVEN { - ASSUME(gMovesInfo[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_THUNDERBOLT) == TYPE_ELECTRIC); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); }; OPPONENT(SPECIES_LANTURN) { Moves(MOVE_THUNDERBOLT, MOVE_ICE_BEAM, MOVE_SURF); } @@ -596,10 +596,10 @@ AI_SINGLE_BATTLE_TEST("AI will choose Scratch over Power-up Punch with Contrary" PARAMETRIZE {ability = ABILITY_SUCTION_CUPS; } PARAMETRIZE {ability = ABILITY_CONTRARY; } GIVEN { - ASSUME(gMovesInfo[MOVE_SCRATCH].power == 40); - ASSUME(gMovesInfo[MOVE_SCRATCH].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_POWER_UP_PUNCH].power == 40); - ASSUME(gMovesInfo[MOVE_POWER_UP_PUNCH].type == TYPE_FIGHTING); + ASSUME(GetMovePower(MOVE_SCRATCH) == 40); + ASSUME(GetMoveType(MOVE_SCRATCH) == TYPE_NORMAL); + ASSUME(GetMovePower(MOVE_POWER_UP_PUNCH) == 40); + ASSUME(GetMoveType(MOVE_POWER_UP_PUNCH) == TYPE_FIGHTING); ASSUME(gSpeciesInfo[SPECIES_SQUIRTLE].types[0] == TYPE_WATER); ASSUME(gSpeciesInfo[SPECIES_SQUIRTLE].types[1] == TYPE_WATER); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); @@ -622,10 +622,10 @@ AI_SINGLE_BATTLE_TEST("AI will choose Superpower over Outrage with Contrary") PARAMETRIZE {ability = ABILITY_SUCTION_CUPS; } PARAMETRIZE {ability = ABILITY_CONTRARY; } GIVEN { - ASSUME(gMovesInfo[MOVE_SUPERPOWER].power == 120); - ASSUME(gMovesInfo[MOVE_SUPERPOWER].type == TYPE_FIGHTING); - ASSUME(gMovesInfo[MOVE_OUTRAGE].power == 120); - ASSUME(gMovesInfo[MOVE_OUTRAGE].type == TYPE_DRAGON); + ASSUME(GetMovePower(MOVE_SUPERPOWER) == 120); + ASSUME(GetMoveType(MOVE_SUPERPOWER) == TYPE_FIGHTING); + ASSUME(GetMovePower(MOVE_OUTRAGE) == 120); + ASSUME(GetMoveType(MOVE_OUTRAGE) == TYPE_DRAGON); ASSUME(gSpeciesInfo[SPECIES_SQUIRTLE].types[0] == TYPE_WATER); ASSUME(gSpeciesInfo[SPECIES_SQUIRTLE].types[1] == TYPE_WATER); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); @@ -650,7 +650,7 @@ AI_DOUBLE_BATTLE_TEST("AI will not choose Earthquake if it damages the partner") PARAMETRIZE { species = SPECIES_CHIKORITA; } GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_EARTHQUAKE) == MOVE_TARGET_FOES_AND_ALLY); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); @@ -667,7 +667,7 @@ AI_DOUBLE_BATTLE_TEST("AI will not choose Earthquake if it damages the partner") AI_DOUBLE_BATTLE_TEST("AI will choose Earthquake if partner is not alive") { GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_EARTHQUAKE) == MOVE_TARGET_FOES_AND_ALLY); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); @@ -682,7 +682,7 @@ AI_DOUBLE_BATTLE_TEST("AI will choose Earthquake if partner is not alive") AI_DOUBLE_BATTLE_TEST("AI will choose Earthquake if it kill an opposing mon and does 1/3 of damage to AI") { GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_EARTHQUAKE) == MOVE_TARGET_FOES_AND_ALLY); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET) { HP(1); } @@ -700,7 +700,7 @@ AI_DOUBLE_BATTLE_TEST("AI will the see a corresponding absorbing ability on part PARAMETRIZE { ability = ABILITY_STATIC; } GIVEN { - ASSUME(gMovesInfo[MOVE_DISCHARGE].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_DISCHARGE) == MOVE_TARGET_FOES_AND_ALLY); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); @@ -721,11 +721,11 @@ AI_SINGLE_BATTLE_TEST("AI calculates guaranteed criticals and detects critical i PARAMETRIZE { ability = ABILITY_SHELL_ARMOR; } GIVEN { - ASSUME(gMovesInfo[MOVE_STORM_THROW].alwaysCriticalHit); - ASSUME(gMovesInfo[MOVE_STORM_THROW].power == 60); - ASSUME(gMovesInfo[MOVE_BRICK_BREAK].power == 75); - ASSUME(gMovesInfo[MOVE_STORM_THROW].type == gMovesInfo[MOVE_BRICK_BREAK].type); - ASSUME(gMovesInfo[MOVE_STORM_THROW].category == gMovesInfo[MOVE_BRICK_BREAK].category); + ASSUME(MoveAlwaysCrits(MOVE_STORM_THROW)); + ASSUME(GetMovePower(MOVE_STORM_THROW) == 60); + ASSUME(GetMovePower(MOVE_BRICK_BREAK) == 75); + ASSUME(GetMoveType(MOVE_STORM_THROW) == GetMoveType(MOVE_BRICK_BREAK)); + ASSUME(GetMoveCategory(MOVE_STORM_THROW) == GetMoveCategory(MOVE_BRICK_BREAK)); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_OMNISCIENT); PLAYER(SPECIES_OMASTAR) { Ability(ability); } OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_STORM_THROW, MOVE_BRICK_BREAK); } @@ -761,11 +761,11 @@ AI_SINGLE_BATTLE_TEST("AI avoids contact moves against rocky helmet") PARAMETRIZE { item = ITEM_ROCKY_HELMET; } GIVEN { - ASSUME(gMovesInfo[MOVE_BRANCH_POKE].makesContact); - ASSUME(!gMovesInfo[MOVE_LEAFAGE].makesContact); - ASSUME(gMovesInfo[MOVE_BRANCH_POKE].power == gMovesInfo[MOVE_LEAFAGE].power); - ASSUME(gMovesInfo[MOVE_BRANCH_POKE].type == gMovesInfo[MOVE_LEAFAGE].type); - ASSUME(gMovesInfo[MOVE_BRANCH_POKE].category == gMovesInfo[MOVE_LEAFAGE].category); + ASSUME(MoveMakesContact(MOVE_BRANCH_POKE)); + ASSUME(!MoveMakesContact(MOVE_LEAFAGE)); + ASSUME(GetMovePower(MOVE_BRANCH_POKE) == GetMovePower(MOVE_LEAFAGE)); + ASSUME(GetMoveType(MOVE_BRANCH_POKE) == GetMoveType(MOVE_LEAFAGE)); + ASSUME(GetMoveCategory(MOVE_BRANCH_POKE) == GetMoveCategory(MOVE_LEAFAGE)); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_OMNISCIENT); PLAYER(SPECIES_WOBBUFFET) { Item(item); } OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_BRANCH_POKE, MOVE_LEAFAGE); } @@ -785,11 +785,11 @@ AI_SINGLE_BATTLE_TEST("AI uses a guaranteed KO move instead of the move with the PARAMETRIZE { flags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT; } GIVEN { - ASSUME(gMovesInfo[MOVE_SLASH].criticalHitStage == 1); - ASSUME(gMovesInfo[MOVE_SLASH].power == 70); - ASSUME(gMovesInfo[MOVE_STRENGTH].power == 80); - ASSUME(gMovesInfo[MOVE_SLASH].type == gMovesInfo[MOVE_STRENGTH].type); - ASSUME(gMovesInfo[MOVE_SLASH].category == gMovesInfo[MOVE_STRENGTH].category); + ASSUME(GetMoveCriticalHitStage(MOVE_SLASH) == 1); + ASSUME(GetMovePower(MOVE_SLASH) == 70); + ASSUME(GetMovePower(MOVE_STRENGTH) == 80); + ASSUME(GetMoveType(MOVE_SLASH) == GetMoveType(MOVE_STRENGTH)); + ASSUME(GetMoveCategory(MOVE_SLASH) == GetMoveCategory(MOVE_STRENGTH)); AI_FLAGS(flags); PLAYER(SPECIES_WOBBUFFET) { HP(225); } OPPONENT(SPECIES_ABSOL) { Ability(ABILITY_SUPER_LUCK); Moves(MOVE_SLASH, MOVE_STRENGTH); } @@ -818,10 +818,10 @@ AI_SINGLE_BATTLE_TEST("AI stays choice locked into moves in spite of the player' GIVEN { ASSUME(gItemsInfo[ITEM_CHOICE_BAND].holdEffect == HOLD_EFFECT_CHOICE_BAND); - ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1); - ASSUME(gMovesInfo[MOVE_BOOMBURST].soundMove == TRUE); - ASSUME(gMovesInfo[MOVE_BULLET_SEED].ballisticMove == TRUE); - ASSUME(gMovesInfo[MOVE_TAIL_WHIP].category == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMovePriority(MOVE_QUICK_ATTACK) == 1); + ASSUME(IsSoundMove(MOVE_BOOMBURST)); + ASSUME(IsBallisticMove(MOVE_BULLET_SEED)); + ASSUME(GetMoveCategory(MOVE_TAIL_WHIP) == DAMAGE_CATEGORY_STATUS); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET); PLAYER(playerMon) { Ability(ability); } diff --git a/test/battle/ai/ai_calc_best_move_score.c b/test/battle/ai/ai_calc_best_move_score.c index bece527f3069..f3b339debaee 100644 --- a/test/battle/ai/ai_calc_best_move_score.c +++ b/test/battle/ai/ai_calc_best_move_score.c @@ -10,9 +10,9 @@ AI_SINGLE_BATTLE_TEST("AI will not further increase Attack / Sp. Atk stat if it PARAMETRIZE { move = MOVE_CALM_MIND; } GIVEN { - ASSUME(gMovesInfo[MOVE_SKY_UPPERCUT].power == 85); - ASSUME(gMovesInfo[MOVE_HOWL].effect == EFFECT_ATTACK_UP_USER_ALLY); - ASSUME(gMovesInfo[MOVE_CALM_MIND].effect == EFFECT_CALM_MIND); + ASSUME(GetMovePower(MOVE_SKY_UPPERCUT) == 85); + ASSUME(GetMoveEffect(MOVE_HOWL) == EFFECT_ATTACK_UP_USER_ALLY); + ASSUME(GetMoveEffect(MOVE_CALM_MIND) == EFFECT_CALM_MIND); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_COMBUSKEN) { Speed(15); Moves(MOVE_SKY_UPPERCUT, MOVE_CELEBRATE); }; OPPONENT(SPECIES_KANGASKHAN) { Speed(20); Moves(MOVE_CHIP_AWAY, MOVE_SWIFT, move); } @@ -30,9 +30,9 @@ AI_SINGLE_BATTLE_TEST("AI will not further increase Attack / Sp. Atk stat if it PARAMETRIZE { move = MOVE_CALM_MIND; } GIVEN { - ASSUME(gMovesInfo[MOVE_SKY_UPPERCUT].power == 85); - ASSUME(gMovesInfo[MOVE_HOWL].effect == EFFECT_ATTACK_UP_USER_ALLY); - ASSUME(gMovesInfo[MOVE_CALM_MIND].effect == EFFECT_CALM_MIND); + ASSUME(GetMovePower(MOVE_SKY_UPPERCUT) == 85); + ASSUME(GetMoveEffect(MOVE_HOWL) == EFFECT_ATTACK_UP_USER_ALLY); + ASSUME(GetMoveEffect(MOVE_CALM_MIND) == EFFECT_CALM_MIND); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_COMBUSKEN) { Speed(20); Moves(MOVE_DOUBLE_KICK, MOVE_CELEBRATE); }; OPPONENT(SPECIES_KANGASKHAN) { Speed(15); Moves(MOVE_CHIP_AWAY, MOVE_SWIFT, move); } @@ -62,9 +62,9 @@ AI_SINGLE_BATTLE_TEST("AI will correctly predict what move the opposing mon goin PARAMETRIZE { move = MOVE_CALM_MIND; } GIVEN { - ASSUME(gMovesInfo[MOVE_SKY_UPPERCUT].power == 85); - ASSUME(gMovesInfo[MOVE_HOWL].effect == EFFECT_ATTACK_UP_USER_ALLY); - ASSUME(gMovesInfo[MOVE_CALM_MIND].effect == EFFECT_CALM_MIND); + ASSUME(GetMovePower(MOVE_SKY_UPPERCUT) == 85); + ASSUME(GetMoveEffect(MOVE_HOWL) == EFFECT_ATTACK_UP_USER_ALLY); + ASSUME(GetMoveEffect(MOVE_CALM_MIND) == EFFECT_CALM_MIND); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_OMNISCIENT); PLAYER(SPECIES_COMBUSKEN) { Speed(15); Moves(MOVE_SKY_UPPERCUT, MOVE_DOUBLE_KICK, MOVE_FLAME_WHEEL, MOVE_CELEBRATE); }; OPPONENT(SPECIES_KANGASKHAN) { Speed(20); Moves(MOVE_CHIP_AWAY, MOVE_SWIFT, move); } @@ -77,10 +77,10 @@ AI_SINGLE_BATTLE_TEST("AI will correctly predict what move the opposing mon goin AI_SINGLE_BATTLE_TEST("AI will not use Throat Chop if opposing mon has a better move") { GIVEN { - ASSUME(gMovesInfo[MOVE_PSYCHIC_FANGS].power == 85); - ASSUME(gMovesInfo[MOVE_THROAT_CHOP].power == 80); - ASSUME(gMovesInfo[MOVE_DISARMING_VOICE].power == 40); - ASSUME(gMovesInfo[MOVE_FLAME_BURST].power == 70); + ASSUME(GetMovePower(MOVE_PSYCHIC_FANGS) == 85); + ASSUME(GetMovePower(MOVE_THROAT_CHOP) == 80); + ASSUME(GetMovePower(MOVE_DISARMING_VOICE) == 40); + ASSUME(GetMovePower(MOVE_FLAME_BURST) == 70); ASSUME(MoveHasAdditionalEffect(MOVE_THROAT_CHOP, MOVE_EFFECT_THROAT_CHOP) == TRUE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_REGIROCK) { Speed(15); Moves(MOVE_DISARMING_VOICE, MOVE_FLAME_BURST); }; @@ -96,10 +96,10 @@ AI_SINGLE_BATTLE_TEST("AI will select Throat Chop if the sound move is the best { GIVEN { ASSUME(MoveHasAdditionalEffect(MOVE_THROAT_CHOP, MOVE_EFFECT_THROAT_CHOP) == TRUE); - ASSUME(gMovesInfo[MOVE_PSYCHIC_FANGS].power == 85); - ASSUME(gMovesInfo[MOVE_THROAT_CHOP].power == 80); - ASSUME(gMovesInfo[MOVE_FLAME_BURST].power == 70); - ASSUME(gMovesInfo[MOVE_HYPER_VOICE].power == 90); + ASSUME(GetMovePower(MOVE_PSYCHIC_FANGS) == 85); + ASSUME(GetMovePower(MOVE_THROAT_CHOP) == 80); + ASSUME(GetMovePower(MOVE_FLAME_BURST) == 70); + ASSUME(GetMovePower(MOVE_HYPER_VOICE) == 90); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_REGIROCK) { Speed(15); Moves(MOVE_HYPER_VOICE, MOVE_FLAME_BURST); }; OPPONENT(SPECIES_WOBBUFFET) { Speed(20); Moves(MOVE_THROAT_CHOP, MOVE_PSYCHIC_FANGS); } diff --git a/test/battle/ai/ai_check_viability.c b/test/battle/ai/ai_check_viability.c index 7279085ff2c3..2c20a08db639 100644 --- a/test/battle/ai/ai_check_viability.c +++ b/test/battle/ai/ai_check_viability.c @@ -15,7 +15,7 @@ AI_SINGLE_BATTLE_TEST("AI sees increased base power of Facade") PARAMETRIZE { status1 = STATUS1_BURN; expectedMove = MOVE_FACADE; } GIVEN { - ASSUME(gMovesInfo[MOVE_FACADE].effect == EFFECT_FACADE); + ASSUME(GetMoveEffect(MOVE_FACADE) == EFFECT_FACADE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { HP(60); } OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_BODY_SLAM, MOVE_FACADE); Status1(status1); } @@ -36,8 +36,8 @@ AI_SINGLE_BATTLE_TEST("AI sees increased base power of Smelling Salt") GIVEN { ASSUME(B_UPDATED_MOVE_DATA >= GEN_6); - ASSUME(gMovesInfo[MOVE_SMELLING_SALTS].effect == EFFECT_DOUBLE_POWER_ON_ARG_STATUS); - ASSUME(gMovesInfo[MOVE_SMELLING_SALTS].argument.status == STATUS1_PARALYSIS); + ASSUME(GetMoveEffect(MOVE_SMELLING_SALTS) == EFFECT_DOUBLE_POWER_ON_ARG_STATUS); + ASSUME(GetMoveEffectArg_Status(MOVE_SMELLING_SALTS) == STATUS1_PARALYSIS); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { HP(60); Status1(status1); } OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_BODY_SLAM, MOVE_SMELLING_SALTS); } @@ -58,8 +58,8 @@ AI_SINGLE_BATTLE_TEST("AI sees increased base power of Wake Up Slap") GIVEN { ASSUME(B_UPDATED_MOVE_DATA >= GEN_6); - ASSUME(gMovesInfo[MOVE_WAKE_UP_SLAP].effect == EFFECT_DOUBLE_POWER_ON_ARG_STATUS); - ASSUME(gMovesInfo[MOVE_WAKE_UP_SLAP].argument.status == STATUS1_SLEEP); + ASSUME(GetMoveEffect(MOVE_WAKE_UP_SLAP) == EFFECT_DOUBLE_POWER_ON_ARG_STATUS); + ASSUME(GetMoveEffectArg_Status(MOVE_WAKE_UP_SLAP) == STATUS1_SLEEP); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_MEGANIUM) { HP(35); Status1(status1); } OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_BODY_SLAM, MOVE_WAKE_UP_SLAP); } @@ -80,8 +80,8 @@ AI_SINGLE_BATTLE_TEST("AI sees increased base power of Grav Apple") PARAMETRIZE { movePlayer = MOVE_GRAVITY; expectedMove = MOVE_GRAV_APPLE; } GIVEN { - ASSUME(gMovesInfo[MOVE_GRAV_APPLE].effect == EFFECT_GRAV_APPLE); - ASSUME(gMovesInfo[MOVE_GRAV_APPLE].power == gMovesInfo[MOVE_DRUM_BEATING].power); + ASSUME(GetMoveEffect(MOVE_GRAV_APPLE) == EFFECT_GRAV_APPLE); + ASSUME(GetMovePower(MOVE_GRAV_APPLE) == GetMovePower(MOVE_DRUM_BEATING)); ASSUME(MoveHasAdditionalEffect(MOVE_DRUM_BEATING, MOVE_EFFECT_SPD_MINUS_1) == TRUE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { HP(81); Speed(20); } @@ -103,7 +103,7 @@ AI_SINGLE_BATTLE_TEST("AI sees increased base power of Flail") PARAMETRIZE { hp = 5; expectedMove = MOVE_FLAIL; } GIVEN { - ASSUME(gMovesInfo[MOVE_FLAIL].effect == EFFECT_FLAIL); + ASSUME(GetMoveEffect(MOVE_FLAIL) == EFFECT_FLAIL); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { Speed(10); } OPPONENT(SPECIES_WOBBUFFET) { HP(hp); MaxHP(490); Speed(20); Moves(MOVE_BODY_SLAM, MOVE_FLAIL); } @@ -134,8 +134,8 @@ AI_SINGLE_BATTLE_TEST("AI will only use Dream Eater if target is asleep") AI_SINGLE_BATTLE_TEST("AI sees increased base power of Spit Up") { GIVEN { - ASSUME(gMovesInfo[MOVE_STOCKPILE].effect == EFFECT_STOCKPILE); - ASSUME(gMovesInfo[MOVE_SPIT_UP].effect == EFFECT_SPIT_UP); + ASSUME(GetMoveEffect(MOVE_STOCKPILE) == EFFECT_STOCKPILE); + ASSUME(GetMoveEffect(MOVE_SPIT_UP) == EFFECT_SPIT_UP); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { HP(43); } OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_STOCKPILE, MOVE_SPIT_UP, MOVE_TACKLE); } @@ -155,10 +155,10 @@ AI_SINGLE_BATTLE_TEST("AI can choose Counter or Mirror Coat if the predicted mov PARAMETRIZE { playerMove = MOVE_POWER_GEM; opponentMove = MOVE_MIRROR_COAT; } GIVEN { - ASSUME(gMovesInfo[MOVE_COUNTER].effect == EFFECT_COUNTER); - ASSUME(gMovesInfo[MOVE_MIRROR_COAT].effect == EFFECT_MIRROR_COAT); - ASSUME(gMovesInfo[MOVE_STRENGTH].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_POWER_GEM].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveEffect(MOVE_COUNTER) == EFFECT_COUNTER); + ASSUME(GetMoveEffect(MOVE_MIRROR_COAT) == EFFECT_MIRROR_COAT); + ASSUME(GetMoveCategory(MOVE_STRENGTH) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_POWER_GEM) == DAMAGE_CATEGORY_SPECIAL); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { Speed(1); } OPPONENT(SPECIES_WOBBUFFET) { HP(102); Speed(100); Moves(opponentMove, MOVE_STRENGTH); } @@ -202,7 +202,7 @@ AI_DOUBLE_BATTLE_TEST("AI chooses moves that cure self or partner") PARAMETRIZE { status1_0 = STATUS1_NONE; status1_1 = STATUS1_PARALYSIS; partnerAbility = ABILITY_SOUNDPROOF; } GIVEN { - ASSUME(gMovesInfo[MOVE_HEAL_BELL].effect == EFFECT_HEAL_BELL); + ASSUME(GetMoveEffect(MOVE_HEAL_BELL) == EFFECT_HEAL_BELL); ASSUME(B_HEAL_BELL_SOUNDPROOF >= GEN_8); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET); @@ -226,7 +226,7 @@ AI_SINGLE_BATTLE_TEST("AI chooses moves that cure inactive party members") PARAMETRIZE { status = STATUS1_TOXIC_POISON; ability = ABILITY_SOUNDPROOF; } GIVEN { - ASSUME(gMovesInfo[MOVE_HEAL_BELL].effect == EFFECT_HEAL_BELL); + ASSUME(GetMoveEffect(MOVE_HEAL_BELL) == EFFECT_HEAL_BELL); ASSUME(B_HEAL_BELL_SOUNDPROOF >= GEN_5); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET); @@ -243,8 +243,8 @@ AI_SINGLE_BATTLE_TEST("AI chooses moves that cure inactive party members") AI_DOUBLE_BATTLE_TEST("AI prioritizes Skill Swapping Contrary to allied mons that would benefit from it") { GIVEN { - ASSUME(gMovesInfo[MOVE_SKILL_SWAP].effect == EFFECT_SKILL_SWAP); - ASSUME(gMovesInfo[MOVE_OVERHEAT].additionalEffects[0].moveEffect == MOVE_EFFECT_SP_ATK_MINUS_2); + ASSUME(GetMoveEffect(MOVE_SKILL_SWAP) == EFFECT_SKILL_SWAP); + ASSUME(GetMoveAdditionalEffectById(MOVE_OVERHEAT, 0)->moveEffect == MOVE_EFFECT_SP_ATK_MINUS_2); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY | AI_FLAG_DOUBLE_BATTLE); PLAYER(SPECIES_WOBBUFFET) { Speed(3); } PLAYER(SPECIES_WOBBUFFET) { Speed(3); } diff --git a/test/battle/ai/ai_choice.c b/test/battle/ai/ai_choice.c index c9992d2cab5f..f1f13a373ee8 100644 --- a/test/battle/ai/ai_choice.c +++ b/test/battle/ai/ai_choice.c @@ -25,8 +25,8 @@ AI_SINGLE_BATTLE_TEST("Choiced Pokémon switch out after using a status move onc } GIVEN { - ASSUME(gMovesInfo[MOVE_YAWN].category == DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveCategory(MOVE_YAWN) == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_RHYDON) OPPONENT(SPECIES_LOPUNNY) { Moves(MOVE_YAWN, MOVE_TACKLE); Item(heldItem); Ability(ability); } @@ -60,7 +60,7 @@ AI_SINGLE_BATTLE_TEST("Choiced Pokémon won't use stat boosting moves") } GIVEN { - ASSUME(gMovesInfo[MOVE_SWORDS_DANCE].target == MOVE_TARGET_USER); + ASSUME(GetMoveTarget(MOVE_SWORDS_DANCE) == MOVE_TARGET_USER); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_RHYDON) OPPONENT(SPECIES_LOPUNNY) { Moves(MOVE_SWORDS_DANCE, MOVE_TACKLE); Item(heldItem); Ability(ability); } @@ -94,8 +94,8 @@ AI_SINGLE_BATTLE_TEST("Choiced Pokémon won't use status move if they are the on } GIVEN { - ASSUME(gMovesInfo[MOVE_YAWN].category == DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveCategory(MOVE_YAWN) == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_RHYDON) OPPONENT(SPECIES_LOPUNNY) { Moves(MOVE_YAWN, MOVE_TACKLE); Item(heldItem); Ability(ability); } @@ -129,8 +129,8 @@ AI_SINGLE_BATTLE_TEST("Choiced Pokémon won't use status move if they don't have } GIVEN { - ASSUME(gMovesInfo[MOVE_YAWN].category == DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveCategory(MOVE_YAWN) == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_RHYDON) OPPONENT(SPECIES_LOPUNNY) { Moves(MOVE_YAWN, MOVE_TACKLE); Item(heldItem); Ability(ability); } @@ -164,8 +164,8 @@ AI_SINGLE_BATTLE_TEST("Choiced Pokémon won't use status move if they are trappe } GIVEN { - ASSUME(gMovesInfo[MOVE_YAWN].category == DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveCategory(MOVE_YAWN) == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(species) { Ability(playerAbility); } OPPONENT(SPECIES_LOPUNNY) { Moves(MOVE_YAWN, MOVE_TACKLE); Item(heldItem); Ability(aiAbility); } diff --git a/test/battle/ai/ai_double_ace.c b/test/battle/ai/ai_double_ace.c index aec37b9307e5..5e49c0d6e15e 100644 --- a/test/battle/ai/ai_double_ace.c +++ b/test/battle/ai/ai_double_ace.c @@ -2,8 +2,8 @@ #include "test/battle.h" ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_U_TURN].effect == EFFECT_HIT_ESCAPE); - ASSUME(gMovesInfo[MOVE_CRUNCH].type == TYPE_DARK); + ASSUME(GetMoveEffect(MOVE_U_TURN) == EFFECT_HIT_ESCAPE); + ASSUME(GetMoveType(MOVE_CRUNCH) == TYPE_DARK); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] == TYPE_PSYCHIC); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[1] == TYPE_PSYCHIC); } diff --git a/test/battle/ai/ai_flag_predict_ability.c b/test/battle/ai/ai_flag_predict_ability.c index ab934698b8a0..9d85773e3eaf 100644 --- a/test/battle/ai/ai_flag_predict_ability.c +++ b/test/battle/ai/ai_flag_predict_ability.c @@ -6,7 +6,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_WEIGH_ABILITY_PREDICTION: AI will predict opposin { PASSES_RANDOMLY(7, 14, RNG_AI_PREDICT_ABILITY); GIVEN { - ASSUME(gMovesInfo[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_THUNDERBOLT) == TYPE_ELECTRIC); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_WEIGH_ABILITY_PREDICTION); PLAYER(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); }; OPPONENT(SPECIES_LANTURN) { Moves(MOVE_THUNDERBOLT, MOVE_ICE_BEAM, MOVE_SURF); } diff --git a/test/battle/ai/ai_flag_risky.c b/test/battle/ai/ai_flag_risky.c index 87be344ab8d4..bbc9a640a652 100644 --- a/test/battle/ai/ai_flag_risky.c +++ b/test/battle/ai/ai_flag_risky.c @@ -9,7 +9,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_RISKY: AI will blindly Mirror Coat against specia PARAMETRIZE { aiRiskyFlag = AI_FLAG_RISKY; } GIVEN { - ASSUME(gMovesInfo[MOVE_MIRROR_COAT].effect == EFFECT_MIRROR_COAT); + ASSUME(GetMoveEffect(MOVE_MIRROR_COAT) == EFFECT_MIRROR_COAT); ASSUME(gSpeciesInfo[SPECIES_GROVYLE].baseSpAttack == 85); ASSUME(gSpeciesInfo[SPECIES_GROVYLE].baseAttack == 65); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | aiRiskyFlag); @@ -28,7 +28,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_RISKY: AI will blindly Counter against physical a PARAMETRIZE { aiRiskyFlag = AI_FLAG_RISKY; } GIVEN { - ASSUME(gMovesInfo[MOVE_COUNTER].effect == EFFECT_COUNTER); + ASSUME(GetMoveEffect(MOVE_COUNTER) == EFFECT_COUNTER); ASSUME(gSpeciesInfo[SPECIES_MARSHTOMP].baseAttack == 85); ASSUME(gSpeciesInfo[SPECIES_MARSHTOMP].baseSpAttack == 60); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | aiRiskyFlag); @@ -47,7 +47,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_RISKY: AI will prioritize Revenge if slower") PARAMETRIZE { aiRiskyFlag = AI_FLAG_RISKY; } GIVEN { - ASSUME(gMovesInfo[MOVE_REVENGE].effect == EFFECT_REVENGE); + ASSUME(GetMoveEffect(MOVE_REVENGE) == EFFECT_REVENGE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | aiRiskyFlag); PLAYER(SPECIES_GROVYLE) { Level(20); Speed(4); Moves(MOVE_ENERGY_BALL); } OPPONENT(SPECIES_CASTFORM) { Level(19); Speed(3); Moves(MOVE_TACKLE, MOVE_REVENGE); } diff --git a/test/battle/ai/ai_flag_sequence_switching.c b/test/battle/ai/ai_flag_sequence_switching.c index 8502efbba77c..56d7eb881f7e 100644 --- a/test/battle/ai/ai_flag_sequence_switching.c +++ b/test/battle/ai/ai_flag_sequence_switching.c @@ -48,8 +48,8 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SEQUENCE_SWITCHING: Roar and Dragon Tail still fo PASSES_RANDOMLY(1, 2, RNG_FORCE_RANDOM_SWITCH); GIVEN { - ASSUME(gMovesInfo[MOVE_ROAR].effect == EFFECT_ROAR); - ASSUME(gMovesInfo[MOVE_DRAGON_TAIL].effect == EFFECT_HIT_SWITCH_TARGET); + ASSUME(GetMoveEffect(MOVE_ROAR) == EFFECT_ROAR); + ASSUME(GetMoveEffect(MOVE_DRAGON_TAIL) == EFFECT_HIT_SWITCH_TARGET); AI_FLAGS(AI_FLAG_SEQUENCE_SWITCHING); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -82,10 +82,10 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SEQUENCE_SWITCHING: AI will always switch into lo } GIVEN { - ASSUME(gMovesInfo[MOVE_U_TURN].effect == EFFECT_HIT_ESCAPE); - ASSUME(gMovesInfo[MOVE_PARTING_SHOT].effect == EFFECT_PARTING_SHOT); - ASSUME(gMovesInfo[MOVE_BATON_PASS].effect == EFFECT_BATON_PASS); - ASSUME(gMovesInfo[MOVE_CHILLY_RECEPTION].effect == EFFECT_CHILLY_RECEPTION); + ASSUME(GetMoveEffect(MOVE_U_TURN) == EFFECT_HIT_ESCAPE); + ASSUME(GetMoveEffect(MOVE_PARTING_SHOT) == EFFECT_PARTING_SHOT); + ASSUME(GetMoveEffect(MOVE_BATON_PASS) == EFFECT_BATON_PASS); + ASSUME(GetMoveEffect(MOVE_CHILLY_RECEPTION) == EFFECT_CHILLY_RECEPTION); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | aiSequenceSwitchingFlag); PLAYER(SPECIES_SWELLOW) { Level (50); } OPPONENT(SPECIES_MACHOP) { Level(1); Moves(move); } diff --git a/test/battle/ai/ai_powerful_status.c b/test/battle/ai/ai_powerful_status.c index 4a14c0bf8025..99aff1938404 100644 --- a/test/battle/ai/ai_powerful_status.c +++ b/test/battle/ai/ai_powerful_status.c @@ -5,8 +5,8 @@ AI_SINGLE_BATTLE_TEST("AI prefers to set up a powerful Status over fainting a target") { GIVEN { - ASSUME(gMovesInfo[MOVE_TRICK_ROOM].effect == EFFECT_TRICK_ROOM); - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMoveEffect(MOVE_TRICK_ROOM) == EFFECT_TRICK_ROOM); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY | AI_FLAG_POWERFUL_STATUS); PLAYER(SPECIES_WOBBUFFET) { HP(1); } PLAYER(SPECIES_WYNAUT); @@ -23,8 +23,8 @@ AI_SINGLE_BATTLE_TEST("AI will try to do damage on target instead of setting up { GIVEN { ASSUME(MoveHasAdditionalEffectSelf(MOVE_RAPID_SPIN, MOVE_EFFECT_RAPID_SPIN) == TRUE); - ASSUME(gMovesInfo[MOVE_STEALTH_ROCK].effect == EFFECT_STEALTH_ROCK); - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMoveEffect(MOVE_STEALTH_ROCK) == EFFECT_STEALTH_ROCK); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_POWERFUL_STATUS | AI_FLAG_OMNISCIENT); PLAYER(SPECIES_WOBBUFFET) { HP(1); Moves(MOVE_RAPID_SPIN, MOVE_DEFOG, MOVE_CELEBRATE); } PLAYER(SPECIES_WYNAUT); @@ -40,8 +40,8 @@ AI_SINGLE_BATTLE_TEST("AI will try to do damage on target instead of setting up AI_SINGLE_BATTLE_TEST("AI will not set up Rain if it is already raining") { GIVEN { - ASSUME(gMovesInfo[MOVE_RAIN_DANCE].effect == EFFECT_RAIN_DANCE); - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMoveEffect(MOVE_RAIN_DANCE) == EFFECT_RAIN_DANCE); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY | AI_FLAG_POWERFUL_STATUS); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); diff --git a/test/battle/ai/ai_switching.c b/test/battle/ai/ai_switching.c index 00caff5932ff..6b741e7857a1 100644 --- a/test/battle/ai/ai_switching.c +++ b/test/battle/ai/ai_switching.c @@ -93,7 +93,7 @@ AI_DOUBLE_BATTLE_TEST("AI will not try to switch for the same pokemon for 2 spot AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_MON_CHOICES: U-Turn will send out Ace Mon if it's the only one remaining") { GIVEN { - ASSUME(gMovesInfo[MOVE_U_TURN].effect == EFFECT_HIT_ESCAPE); + ASSUME(GetMoveEffect(MOVE_U_TURN) == EFFECT_HIT_ESCAPE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_MON_CHOICES | AI_FLAG_ACE_POKEMON); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_U_TURN); } @@ -168,11 +168,11 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_MON_CHOICES: AI will not switch in a Pokemo PARAMETRIZE { speedAlakazm = 400; alakazamFirst = TRUE; aiSmartSwitchFlags = AI_FLAG_SMART_SWITCHING | AI_FLAG_SMART_MON_CHOICES; } // AI_FLAG_SMART_MON_CHOICES recognizes that Alakazam is faster and can KO, and will switch it in GIVEN { - ASSUME(gMovesInfo[MOVE_PSYCHIC].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_FOCUS_BLAST].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_BUBBLE_BEAM].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_WATER_GUN].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_STRENGTH].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_PSYCHIC) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_FOCUS_BLAST) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_BUBBLE_BEAM) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_WATER_GUN) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_STRENGTH) == DAMAGE_CATEGORY_PHYSICAL); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | aiSmartSwitchFlags); PLAYER(SPECIES_WEAVILE) { Speed(300); Ability(ABILITY_SHADOW_TAG); } // Weavile has Shadow Tag, so AI can't switch on the first turn, but has to do it after fainting. OPPONENT(SPECIES_KADABRA) { Speed(200); Moves(MOVE_PSYCHIC, MOVE_DISABLE, MOVE_TAUNT, MOVE_CALM_MIND); } @@ -250,7 +250,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_MON_CHOICES: Mid-battle switches prioritize AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_MON_CHOICES: Mid-battle switches prioritize offensive options after slow U-Turn") { GIVEN { - ASSUME(gMovesInfo[MOVE_FALSE_SWIPE].effect == EFFECT_FALSE_SWIPE); + ASSUME(GetMoveEffect(MOVE_FALSE_SWIPE) == EFFECT_FALSE_SWIPE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_MON_CHOICES); PLAYER(SPECIES_SWELLOW) { Level(30); Moves(MOVE_FALSE_SWIPE, MOVE_BOOMBURST); Speed(5); SpAttack(50); } OPPONENT(SPECIES_PONYTA) { Level(1); Moves(MOVE_U_TURN); Speed(4); } // Forces switchout @@ -265,7 +265,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_MON_CHOICES: Mid-battle switches prioritize { GIVEN { ASSUME(gItemsInfo[ITEM_EJECT_BUTTON].holdEffect == HOLD_EFFECT_EJECT_BUTTON); - ASSUME(gMovesInfo[MOVE_FALSE_SWIPE].effect == EFFECT_FALSE_SWIPE); + ASSUME(GetMoveEffect(MOVE_FALSE_SWIPE) == EFFECT_FALSE_SWIPE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_MON_CHOICES); PLAYER(SPECIES_SWELLOW) { Level(30); Moves(MOVE_FALSE_SWIPE, MOVE_BOOMBURST); Speed(5); SpAttack(50); } OPPONENT(SPECIES_PONYTA) { Level(1); Item(ITEM_EJECT_BUTTON); Moves(MOVE_TACKLE); Speed(4); } // Forces switchout @@ -280,7 +280,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_MON_CHOICES: Mid-battle switches prioritize { GIVEN { ASSUME(gItemsInfo[ITEM_EJECT_PACK].holdEffect == HOLD_EFFECT_EJECT_PACK); - ASSUME(gMovesInfo[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_GROWL) == EFFECT_ATTACK_DOWN); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_MON_CHOICES); PLAYER(SPECIES_SWELLOW) { Level(30); Moves(MOVE_GROWL, MOVE_BOOMBURST); Speed(5); SpAttack(50); } OPPONENT(SPECIES_PONYTA) { Level(1); Item(ITEM_EJECT_PACK); Moves(MOVE_TACKLE); Speed(4); } // Forces switchout @@ -337,7 +337,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_MON_CHOICES: Post-KO switches prioritize of AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_MON_CHOICES: Post-KO switches factor in Trick Room for revenge killing") { GIVEN { - ASSUME(gMovesInfo[MOVE_TRICK_ROOM].effect == EFFECT_TRICK_ROOM); + ASSUME(GetMoveEffect(MOVE_TRICK_ROOM) == EFFECT_TRICK_ROOM); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_MON_CHOICES); PLAYER(SPECIES_SWELLOW) { Level(30); Speed(10); Moves(MOVE_WING_ATTACK, MOVE_GROWL); } OPPONENT(SPECIES_BALTOY) { Level(1); Speed(10); Moves(MOVE_TRICK_ROOM); } @@ -371,10 +371,10 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will not switch out if Pokemo PARAMETRIZE { move1 = MOVE_RAPID_SPIN; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_RAPID_SPIN].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_HEADBUTT].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_RAPID_SPIN) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_EARTHQUAKE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_HEADBUTT) == DAMAGE_CATEGORY_PHYSICAL); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_HITMONTOP) { Level(30); Moves(MOVE_CHARM, MOVE_TACKLE, MOVE_STEALTH_ROCK, MOVE_EARTHQUAKE); Ability(ABILITY_INTIMIDATE); Speed(5); } OPPONENT(SPECIES_GRIMER) { Level(30); Moves(MOVE_TACKLE); Item(ITEM_FOCUS_SASH); Speed(4); } @@ -462,8 +462,8 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if mon would ASSUME(gSpeciesInfo[SPECIES_RHYDON].types[0] == TYPE_GROUND); ASSUME(gSpeciesInfo[SPECIES_PELIPPER].types[0] == TYPE_WATER); ASSUME(gSpeciesInfo[SPECIES_PELIPPER].types[1] == TYPE_FLYING); - ASSUME(gMovesInfo[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].type == TYPE_GROUND); + ASSUME(GetMoveType(MOVE_THUNDERBOLT) == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_EARTHQUAKE) == TYPE_GROUND); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING | AI_FLAG_SMART_MON_CHOICES); PLAYER(SPECIES_ELECTRODE) { Moves(MOVE_THUNDERBOLT, MOVE_THUNDER_WAVE, MOVE_THUNDER_SHOCK); } @@ -482,8 +482,8 @@ AI_SINGLE_BATTLE_TEST("Switch AI: AI will switch out if it can't deal damage to ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].abilities[0] == ABILITY_WONDER_GUARD); ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].abilities[1] == ABILITY_NONE); ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].abilities[2] == ABILITY_NONE); - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_SHADOW_BALL].type == TYPE_GHOST); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_SHADOW_BALL) == TYPE_GHOST); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_SHEDINJA) { Moves(MOVE_TACKLE); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } @@ -501,8 +501,8 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it can't d ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].abilities[0] == ABILITY_WONDER_GUARD); ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].abilities[1] == ABILITY_NONE); ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].abilities[2] == ABILITY_NONE); - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_SHADOW_BALL].type == TYPE_GHOST); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_SHADOW_BALL) == TYPE_GHOST); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_SHEDINJA) { Moves(MOVE_TACKLE); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } @@ -519,7 +519,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has bee PARAMETRIZE { species = SPECIES_HARIYAMA, odds = 50; } PASSES_RANDOMLY(odds, 100, RNG_AI_SWITCH_BADLY_POISONED); GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE, MOVE_CELEBRATE, MOVE_TOXIC, MOVE_AURA_SPHERE); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } @@ -535,7 +535,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has bee { PASSES_RANDOMLY(50, 100, RNG_AI_SWITCH_CURSED); GIVEN { - ASSUME(gMovesInfo[MOVE_CURSE].effect == EFFECT_CURSE); + ASSUME(GetMoveEffect(MOVE_CURSE) == EFFECT_CURSE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_DUSCLOPS) { Moves(MOVE_FIRE_PUNCH, MOVE_CURSE); } PLAYER(SPECIES_MILOTIC) { Moves(MOVE_WATER_GUN); } @@ -551,7 +551,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has bee { PASSES_RANDOMLY(33, 100, RNG_AI_SWITCH_NIGHTMARE); GIVEN { - ASSUME(gMovesInfo[MOVE_NIGHTMARE].effect == EFFECT_NIGHTMARE); + ASSUME(GetMoveEffect(MOVE_NIGHTMARE) == EFFECT_NIGHTMARE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_GENGAR) { Moves(MOVE_NIGHTMARE); } OPPONENT(SPECIES_DUSCLOPS) { Moves(MOVE_SHADOW_BALL); Status1(STATUS1_SLEEP); } @@ -566,7 +566,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has bee { PASSES_RANDOMLY(25, 100, RNG_AI_SWITCH_SEEDED); GIVEN { - ASSUME(gMovesInfo[MOVE_LEECH_SEED].effect == EFFECT_LEECH_SEED); + ASSUME(GetMoveEffect(MOVE_LEECH_SEED) == EFFECT_LEECH_SEED); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_WHIMSICOTT) { Moves(MOVE_LEECH_SEED); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } @@ -580,7 +580,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has bee AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has been infatuated") { GIVEN { - ASSUME(gMovesInfo[MOVE_ATTRACT].effect == EFFECT_ATTRACT); + ASSUME(GetMoveEffect(MOVE_ATTRACT) == EFFECT_ATTRACT); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_LUVDISC) { Moves(MOVE_ATTRACT); Gender(MON_FEMALE); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); Gender(MON_MALE); } @@ -597,7 +597,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has bee PARAMETRIZE { hp = 30; } PARAMETRIZE { hp = 10; } GIVEN { - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_SLAKOTH) { Moves(MOVE_TACKLE, MOVE_YAWN); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); HP(hp); MaxHP(30); } @@ -617,7 +617,7 @@ AI_DOUBLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has bee PARAMETRIZE { hp = 30; } PARAMETRIZE { hp = 10; } GIVEN { - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_SLAKOTH) { Moves(MOVE_TACKLE, MOVE_CELEBRATE, MOVE_YAWN); } PLAYER(SPECIES_SLAKOTH) { Moves(MOVE_TACKLE, MOVE_CELEBRATE, MOVE_YAWN); } @@ -637,7 +637,7 @@ AI_DOUBLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has bee AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if player's mon is semi-invulnerable and it has an absorber") { GIVEN { - ASSUME(gMovesInfo[MOVE_DIVE].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_DIVE) == TYPE_WATER); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_LUVDISC) { Moves(MOVE_DIVE); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } @@ -652,7 +652,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has an { PASSES_RANDOMLY(33, 100, RNG_AI_SWITCH_ABSORBING); GIVEN { - ASSUME(gMovesInfo[MOVE_WATER_GUN].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_WATER_GUN) == TYPE_WATER); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_LUVDISC) { Moves(MOVE_WATER_GUN); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_SHOCK_WAVE); } @@ -667,7 +667,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if player's m { PASSES_RANDOMLY(100, 100, RNG_AI_SWITCH_ABSORBING); GIVEN { - ASSUME(gMovesInfo[MOVE_SOLAR_BEAM].type == TYPE_GRASS); + ASSUME(GetMoveType(MOVE_SOLAR_BEAM) == TYPE_GRASS); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_BELLOSSOM) { Moves(MOVE_SOLAR_BEAM); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } @@ -681,7 +681,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if player's m AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if player's mon is charging and it has a good switchin immunity (type)") { GIVEN { - ASSUME(gMovesInfo[MOVE_DIG].type == TYPE_GROUND); + ASSUME(GetMoveType(MOVE_DIG) == TYPE_GROUND); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_SANDSHREW) { Moves(MOVE_DIG); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } @@ -695,7 +695,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if player's m AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if player's mon is charging and it has a good switchin immunity (ability)") { GIVEN { - ASSUME(gMovesInfo[MOVE_DIG].type == TYPE_GROUND); + ASSUME(GetMoveType(MOVE_DIG) == TYPE_GROUND); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_SANDSHREW) { Moves(MOVE_DIG); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } @@ -723,7 +723,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has an PARAMETRIZE { aiMon = SPECIES_ELECTRODE; absorbingAbility = ABILITY_SOUNDPROOF; move = MOVE_HYPER_VOICE;} GIVEN { ASSUME(B_REDIRECT_ABILITY_IMMUNITY >= GEN_5); - ASSUME(gMovesInfo[MOVE_WATER_GUN].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_WATER_GUN) == TYPE_WATER); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_ZIGZAGOON) { Moves(move); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } @@ -741,8 +741,8 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if opponent u PARAMETRIZE { move = MOVE_FLY; } GIVEN { - ASSUME(gMovesInfo[MOVE_FLY].effect == EFFECT_SEMI_INVULNERABLE); - ASSUME(gMovesInfo[MOVE_SKY_ATTACK].effect == EFFECT_TWO_TURNS_ATTACK); + ASSUME(GetMoveEffect(MOVE_FLY) == EFFECT_SEMI_INVULNERABLE); + ASSUME(GetMoveEffect(MOVE_SKY_ATTACK) == EFFECT_TWO_TURNS_ATTACK); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_SWELLOW) { Moves(move); } OPPONENT(SPECIES_MILOTIC) { Moves(MOVE_SURF); } @@ -783,7 +783,7 @@ AI_SINGLE_BATTLE_TEST("Switch AI: AI will switch out if it has <= 66% HP remaini AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has been Encore'd into a status move") { GIVEN { - ASSUME(gMovesInfo[MOVE_ENCORE].effect == EFFECT_ENCORE); + ASSUME(GetMoveEffect(MOVE_ENCORE) == EFFECT_ENCORE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_AZURILL) { Moves(MOVE_TACKLE, MOVE_ENCORE); } OPPONENT(SPECIES_ODDISH) { Moves(MOVE_TOXIC, MOVE_SWEET_SCENT, MOVE_INGRAIN, MOVE_TACKLE); } @@ -797,7 +797,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it has bee AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will stay in if Encore'd into super effective move") { GIVEN { - ASSUME(gMovesInfo[MOVE_ENCORE].effect == EFFECT_ENCORE); + ASSUME(GetMoveEffect(MOVE_ENCORE) == EFFECT_ENCORE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_AZURILL) { Moves(MOVE_TACKLE, MOVE_ENCORE); } OPPONENT(SPECIES_ODDISH) { Moves(MOVE_ACID); } @@ -813,7 +813,7 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if Encore'd i KNOWN_FAILING; // AI still switches even if ShouldSwitch is set to immediately return FALSE, something external seems to be triggering this PASSES_RANDOMLY(50, 100, RNG_AI_SWITCH_ENCORE); GIVEN { - ASSUME(gMovesInfo[MOVE_ENCORE].effect == EFFECT_ENCORE); + ASSUME(GetMoveEffect(MOVE_ENCORE) == EFFECT_ENCORE); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_AZURILL) { Moves(MOVE_TACKLE, MOVE_ENCORE); } OPPONENT(SPECIES_ODDISH) { Moves(MOVE_TACKLE); } @@ -859,8 +859,8 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if main attac PARAMETRIZE {move = MOVE_EERIE_IMPULSE; aiSpecies = SPECIES_ESPEON; aiMove = MOVE_CONFUSION; }; GIVEN { - ASSUME(gMovesInfo[MOVE_CHARM].effect == EFFECT_ATTACK_DOWN_2); - ASSUME(gMovesInfo[MOVE_EERIE_IMPULSE].effect == EFFECT_SPECIAL_ATTACK_DOWN_2); + ASSUME(GetMoveEffect(MOVE_CHARM) == EFFECT_ATTACK_DOWN_2); + ASSUME(GetMoveEffect(MOVE_EERIE_IMPULSE) == EFFECT_SPECIAL_ATTACK_DOWN_2); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_ARON) { Moves(move, MOVE_TACKLE); } OPPONENT(aiSpecies) { Moves(aiMove); } @@ -880,8 +880,8 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if main attac PARAMETRIZE {move = MOVE_CONFIDE; move2 = MOVE_EERIE_IMPULSE; aiSpecies = SPECIES_ESPEON; aiMove = MOVE_STORED_POWER; }; GIVEN { - ASSUME(gMovesInfo[MOVE_CHARM].effect == EFFECT_ATTACK_DOWN_2); - ASSUME(gMovesInfo[MOVE_EERIE_IMPULSE].effect == EFFECT_SPECIAL_ATTACK_DOWN_2); + ASSUME(GetMoveEffect(MOVE_CHARM) == EFFECT_ATTACK_DOWN_2); + ASSUME(GetMoveEffect(MOVE_EERIE_IMPULSE) == EFFECT_SPECIAL_ATTACK_DOWN_2); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); PLAYER(SPECIES_ARON) { Moves(move, move2, MOVE_TACKLE); } OPPONENT(aiSpecies) { Moves(aiMove); } diff --git a/test/battle/ai/ai_trytofaint.c b/test/battle/ai/ai_trytofaint.c index 10eca2d676b1..a1a23efdec04 100644 --- a/test/battle/ai/ai_trytofaint.c +++ b/test/battle/ai/ai_trytofaint.c @@ -5,7 +5,7 @@ AI_SINGLE_BATTLE_TEST("AI prefers priority moves if it's slower and can kill target") { GIVEN { - ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1); + ASSUME(GetMovePriority(MOVE_QUICK_ATTACK) == 1); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { HP(1); Speed(100); } PLAYER(SPECIES_WOBBUFFET) { Speed(100); } @@ -20,7 +20,7 @@ AI_SINGLE_BATTLE_TEST("AI prefers priority moves if it's slower and can kill tar AI_SINGLE_BATTLE_TEST("AI will choose a random move if it's faster and can kill target") { GIVEN { - ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1); + ASSUME(GetMovePriority(MOVE_QUICK_ATTACK) == 1); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { HP(1); Speed(1); } PLAYER(SPECIES_WOBBUFFET) { Speed(1); } @@ -35,7 +35,7 @@ AI_SINGLE_BATTLE_TEST("AI will choose a random move if it's faster and can kill AI_SINGLE_BATTLE_TEST("AI will choose a priority move if it is slower then the target and will be killed") { GIVEN { - ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1); + ASSUME(GetMovePriority(MOVE_QUICK_ATTACK) == 1); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { Speed(100); } OPPONENT(SPECIES_WOBBUFFET) { HP(60); Speed(1); Moves(MOVE_QUICK_ATTACK, MOVE_STRENGTH); } diff --git a/test/battle/crit_chance.c b/test/battle/crit_chance.c index 0d83b142620f..32c4c3380df9 100644 --- a/test/battle/crit_chance.c +++ b/test/battle/crit_chance.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Crit Chance: Side effected by Lucky Chant blocks critical hits") { GIVEN { - ASSUME(gMovesInfo[MOVE_LUCKY_CHANT].effect == EFFECT_LUCKY_CHANT); + ASSUME(GetMoveEffect(MOVE_LUCKY_CHANT) == EFFECT_LUCKY_CHANT); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -43,7 +43,7 @@ SINGLE_BATTLE_TEST("Crit Chance: Flag ignoresTargetAbility ignores Battle Armor PARAMETRIZE { species = SPECIES_ARMALDO; ability = ABILITY_BATTLE_ARMOR; } GIVEN { - ASSUME(gMovesInfo[MOVE_SUNSTEEL_STRIKE].ignoresTargetAbility == TRUE); + ASSUME(MoveIgnoresTargetAbility(MOVE_SUNSTEEL_STRIKE)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(species) { Ability(ability); } } WHEN { @@ -100,7 +100,7 @@ SINGLE_BATTLE_TEST("Crit Chance: Mold Breaker, Teravolt and Turboblaze ignore Ba SINGLE_BATTLE_TEST("Crit Chance: User effected by Laser Focus causes moves to result in a critical hit") { GIVEN { - ASSUME(gMovesInfo[MOVE_LASER_FOCUS].effect == EFFECT_LASER_FOCUS); + ASSUME(GetMoveEffect(MOVE_LASER_FOCUS) == EFFECT_LASER_FOCUS); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -131,7 +131,7 @@ SINGLE_BATTLE_TEST("Crit Chance: Focus Energy increases the user's critical hit PASSES_RANDOMLY(1, 2, RNG_CRITICAL_HIT); GIVEN { ASSUME(B_CRIT_CHANCE >= GEN_7); - ASSUME(gMovesInfo[MOVE_FOCUS_ENERGY].effect == EFFECT_FOCUS_ENERGY); + ASSUME(GetMoveEffect(MOVE_FOCUS_ENERGY) == EFFECT_FOCUS_ENERGY); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -149,7 +149,7 @@ SINGLE_BATTLE_TEST("Crit Chance: High crit rate increases the critical hit ratio PASSES_RANDOMLY(1, 8, RNG_CRITICAL_HIT); GIVEN { ASSUME(B_CRIT_CHANCE >= GEN_7); - ASSUME(gMovesInfo[MOVE_SLASH].criticalHitStage == 1); + ASSUME(GetMoveCriticalHitStage(MOVE_SLASH) == 1); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -195,7 +195,7 @@ SINGLE_BATTLE_TEST("Crit Chance: High crit rate, Super Luck and Scope Lens cause { GIVEN { ASSUME(B_CRIT_CHANCE >= GEN_7); - ASSUME(gMovesInfo[MOVE_SLASH].criticalHitStage == 1); + ASSUME(GetMoveCriticalHitStage(MOVE_SLASH) == 1); ASSUME(gItemsInfo[ITEM_SCOPE_LENS].holdEffect == HOLD_EFFECT_SCOPE_LENS); PLAYER(SPECIES_TOGEKISS) { Ability(ABILITY_SUPER_LUCK); Item(ITEM_SCOPE_LENS); }; OPPONENT(SPECIES_WOBBUFFET); @@ -257,8 +257,8 @@ SINGLE_BATTLE_TEST("Crit Chance: Focus Energy increases critical hit ratio by tw PASSES_RANDOMLY(8, 8, RNG_CRITICAL_HIT); GIVEN { ASSUME(B_CRIT_CHANCE >= GEN_7); - ASSUME(gMovesInfo[MOVE_SLASH].criticalHitStage == 1); - ASSUME(gMovesInfo[MOVE_FOCUS_ENERGY].effect == EFFECT_FOCUS_ENERGY); + ASSUME(GetMoveCriticalHitStage(MOVE_SLASH) == 1); + ASSUME(GetMoveEffect(MOVE_FOCUS_ENERGY) == EFFECT_FOCUS_ENERGY); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/damage_formula.c b/test/battle/damage_formula.c index 049bbf4051fc..067972551018 100644 --- a/test/battle/damage_formula.c +++ b/test/battle/damage_formula.c @@ -24,7 +24,7 @@ SINGLE_BATTLE_TEST("Damage calculation matches Gen5+") PARAMETRIZE { expectedDamage = 168; } PARAMETRIZE { expectedDamage = 168; } GIVEN { - ASSUME(gMovesInfo[MOVE_ICE_FANG].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_ICE_FANG) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_GLACEON) { Level(75); Attack(123); } OPPONENT(SPECIES_GARCHOMP) { Defense(163); } } WHEN { @@ -62,7 +62,7 @@ SINGLE_BATTLE_TEST("Damage calculation matches Gen5+ (Muscle Band, crit)") PARAMETRIZE { expectedDamage = 276; } PARAMETRIZE { expectedDamage = 268; } GIVEN { - ASSUME(gMovesInfo[MOVE_ICE_FANG].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_ICE_FANG) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_GLACEON) { Level(75); Attack(123); Item(ITEM_MUSCLE_BAND); } OPPONENT(SPECIES_GARCHOMP) { Defense(163); } } WHEN { @@ -100,7 +100,7 @@ SINGLE_BATTLE_TEST("Damage calculation matches Gen5+ (Marshadow vs Mawile)") PARAMETRIZE { expectedDamage = 124; } PARAMETRIZE { expectedDamage = 123; } GIVEN { - ASSUME(gMovesInfo[MOVE_SPECTRAL_THIEF].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_SPECTRAL_THIEF) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_MARSHADOW) { Level(100); Attack(286); } OPPONENT(SPECIES_MAWILE) { Level(100); Defense(226); HP(241); } } WHEN { @@ -248,10 +248,10 @@ DOUBLE_BATTLE_TEST("Transistor Damage calculation", s16 damage) } } GIVEN { - ASSUME(gMovesInfo[MOVE_WILD_CHARGE].type == TYPE_ELECTRIC); - ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC); - ASSUME(gMovesInfo[MOVE_WILD_CHARGE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveType(MOVE_WILD_CHARGE) == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_THUNDER_SHOCK) == TYPE_ELECTRIC); + ASSUME(GetMoveCategory(MOVE_WILD_CHARGE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_THUNDER_SHOCK) == DAMAGE_CATEGORY_SPECIAL); ASSUME(NUM_DAMAGE_SPREADS == 16); PLAYER(SPECIES_REGIELEKI) { Ability(ABILITY_KLUTZ); } diff --git a/test/battle/form_change/mega_evolution.c b/test/battle/form_change/mega_evolution.c index 4c97c2c1519d..3d9d9cf5079b 100644 --- a/test/battle/form_change/mega_evolution.c +++ b/test/battle/form_change/mega_evolution.c @@ -108,7 +108,7 @@ SINGLE_BATTLE_TEST("Abilities replaced by Mega Evolution do not affect turn orde DOUBLE_BATTLE_TEST("Mega Evolution happens after switching, but before Focus Punch-like Moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_FOCUS_PUNCH].effect == EFFECT_FOCUS_PUNCH); + ASSUME(GetMoveEffect(MOVE_FOCUS_PUNCH) == EFFECT_FOCUS_PUNCH); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_VENUSAUR) { Item(ITEM_VENUSAURITE); } OPPONENT(SPECIES_WYNAUT); @@ -157,7 +157,7 @@ SINGLE_BATTLE_TEST("Regular Mega Evolution and Fervent Wish Mega Evolution can h SINGLE_BATTLE_TEST("Mega Evolved Pokemon do not change abilities after fainting") { GIVEN { - ASSUME(gMovesInfo[MOVE_CRUNCH].makesContact == TRUE); + ASSUME(MoveMakesContact(MOVE_CRUNCH) == TRUE); ASSUME(gSpeciesInfo[SPECIES_GARCHOMP_MEGA].abilities[0] != ABILITY_ROUGH_SKIN); ASSUME(gSpeciesInfo[SPECIES_GARCHOMP_MEGA].abilities[1] != ABILITY_ROUGH_SKIN); ASSUME(gSpeciesInfo[SPECIES_GARCHOMP_MEGA].abilities[2] != ABILITY_ROUGH_SKIN); diff --git a/test/battle/form_change/primal_reversion.c b/test/battle/form_change/primal_reversion.c index d4e682e8de78..d7d956d64b82 100644 --- a/test/battle/form_change/primal_reversion.c +++ b/test/battle/form_change/primal_reversion.c @@ -120,7 +120,7 @@ DOUBLE_BATTLE_TEST("Primal reversion's order is determined by Speed - player fas SINGLE_BATTLE_TEST("Primal reversion happens after a mon is sent out after a mon is fainted") { GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET) {HP(1); } PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } OPPONENT(SPECIES_WOBBUFFET); @@ -156,7 +156,7 @@ SINGLE_BATTLE_TEST("Primal reversion happens after a mon is switched in") SINGLE_BATTLE_TEST("Primal reversion happens after a switch-in caused by Eject Button") { GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); ASSUME(gItemsInfo[ITEM_EJECT_BUTTON].holdEffect == HOLD_EFFECT_EJECT_BUTTON); PLAYER(SPECIES_WOBBUFFET) {Item(ITEM_EJECT_BUTTON); } PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } @@ -177,7 +177,7 @@ SINGLE_BATTLE_TEST("Primal reversion happens after a switch-in caused by Eject B SINGLE_BATTLE_TEST("Primal reversion happens after a switch-in caused by Red Card") { GIVEN { - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); ASSUME(gItemsInfo[ITEM_RED_CARD].holdEffect == HOLD_EFFECT_RED_CARD); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } @@ -197,7 +197,7 @@ SINGLE_BATTLE_TEST("Primal reversion happens after a switch-in caused by Red Car SINGLE_BATTLE_TEST("Primal reversion happens after the entry hazards damage") { GIVEN { - ASSUME(gMovesInfo[MOVE_SPIKES].effect == EFFECT_SPIKES); + ASSUME(GetMoveEffect(MOVE_SPIKES) == EFFECT_SPIKES); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } OPPONENT(SPECIES_WOBBUFFET); @@ -239,7 +239,7 @@ SINGLE_BATTLE_TEST("Primal reversion happens immediately if it was brought in by DOUBLE_BATTLE_TEST("Primal reversion triggers for multiple battlers if multiple fainted the previous turn") { GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_EARTHQUAKE) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_CATERPIE) { HP(1); } PLAYER(SPECIES_RESHIRAM); @@ -262,8 +262,8 @@ DOUBLE_BATTLE_TEST("Primal reversion triggers for multiple battlers if multiple DOUBLE_BATTLE_TEST("Primal reversion triggers for all battlers if multiple fainted the previous turn") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); - ASSUME(gMovesInfo[MOVE_EXPLOSION].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); + ASSUME(GetMoveTarget(MOVE_EXPLOSION) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_CATERPIE) { HP(1); } PLAYER(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); } @@ -290,11 +290,11 @@ DOUBLE_BATTLE_TEST("Primal reversion triggers for all battlers if multiple faint DOUBLE_BATTLE_TEST("Primal reversion and other switch-in effects trigger for all battlers if multiple fainted the previous turn") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); - ASSUME(gMovesInfo[MOVE_EXPLOSION].target == MOVE_TARGET_FOES_AND_ALLY); - ASSUME(gMovesInfo[MOVE_STICKY_WEB].effect == EFFECT_STICKY_WEB); - ASSUME(gMovesInfo[MOVE_SPIKES].effect == EFFECT_SPIKES); - ASSUME(gMovesInfo[MOVE_TOXIC_SPIKES].effect == EFFECT_TOXIC_SPIKES); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); + ASSUME(GetMoveTarget(MOVE_EXPLOSION) == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveEffect(MOVE_STICKY_WEB) == EFFECT_STICKY_WEB); + ASSUME(GetMoveEffect(MOVE_SPIKES) == EFFECT_SPIKES); + ASSUME(GetMoveEffect(MOVE_TOXIC_SPIKES) == EFFECT_TOXIC_SPIKES); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_CATERPIE) { HP(1); } PLAYER(SPECIES_SCRAFTY) { Ability(ABILITY_INTIMIDATE); } diff --git a/test/battle/form_change/ultra_burst.c b/test/battle/form_change/ultra_burst.c index 8eb21866f334..640db3f881ab 100644 --- a/test/battle/form_change/ultra_burst.c +++ b/test/battle/form_change/ultra_burst.c @@ -74,7 +74,7 @@ SINGLE_BATTLE_TEST("Ultra Burst affects turn order") DOUBLE_BATTLE_TEST("Ultra Burst happens after switching, but before Focus Punch-like Moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_FOCUS_PUNCH].effect == EFFECT_FOCUS_PUNCH); + ASSUME(GetMoveEffect(MOVE_FOCUS_PUNCH) == EFFECT_FOCUS_PUNCH); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_NECROZMA_DUSK_MANE) { Item(ITEM_ULTRANECROZIUM_Z); } OPPONENT(SPECIES_WYNAUT); diff --git a/test/battle/gimmick/dynamax.c b/test/battle/gimmick/dynamax.c index b646249011a6..b2248f651c20 100644 --- a/test/battle/gimmick/dynamax.c +++ b/test/battle/gimmick/dynamax.c @@ -58,7 +58,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Dynamax expires after three turns", u16 hp) SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon cannot be flinched") { GIVEN { - ASSUME(gMovesInfo[MOVE_FAKE_OUT].effect == EFFECT_FIRST_TURN_ONLY); + ASSUME(GetMoveEffect(MOVE_FAKE_OUT) == EFFECT_FIRST_TURN_ONLY); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -73,7 +73,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon cannot be flinched") SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon cannot be hit by weight-based moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_HEAVY_SLAM].effect == EFFECT_HEAT_CRASH); + ASSUME(GetMoveEffect(MOVE_HEAVY_SLAM) == EFFECT_HEAT_CRASH); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -89,7 +89,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon cannot be hit by weight-based mo SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon cannot be hit by OHKO moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_FISSURE].effect == EFFECT_OHKO); + ASSUME(GetMoveEffect(MOVE_FISSURE) == EFFECT_OHKO); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_MACHAMP) { Ability(ABILITY_NO_GUARD); } } WHEN { @@ -120,8 +120,8 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon are affected by Grudge") SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon are not affected by phazing moves, but still take damage") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_TAIL].effect == EFFECT_HIT_SWITCH_TARGET); - ASSUME(gMovesInfo[MOVE_WHIRLWIND].effect == EFFECT_ROAR); + ASSUME(GetMoveEffect(MOVE_DRAGON_TAIL) == EFFECT_HIT_SWITCH_TARGET); + ASSUME(GetMoveEffect(MOVE_WHIRLWIND) == EFFECT_ROAR); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); @@ -142,7 +142,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon are not affected by phazing move SINGLE_BATTLE_TEST("(DYNAMAX) Dynamaxed Pokemon are not affected by phazing moves but no block message is printed if they faint") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_TAIL].effect == EFFECT_HIT_SWITCH_TARGET); + ASSUME(GetMoveEffect(MOVE_DRAGON_TAIL) == EFFECT_HIT_SWITCH_TARGET); PLAYER(SPECIES_WOBBUFFET) { HP(1); }; PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); @@ -497,7 +497,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Endeavor uses a Pokemon's non-Dynamax HP", s16 dam PARAMETRIZE { dynamax = GIMMICK_NONE; } PARAMETRIZE { dynamax = GIMMICK_DYNAMAX; } GIVEN { - ASSUME(gMovesInfo[MOVE_ENDEAVOR].effect == EFFECT_ENDEAVOR); + ASSUME(GetMoveEffect(MOVE_ENDEAVOR) == EFFECT_ENDEAVOR); PLAYER(SPECIES_WOBBUFFET) { Speed(50); } OPPONENT(SPECIES_WOBBUFFET) { HP(1); Speed(100); } } WHEN { @@ -516,7 +516,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Super Fang uses a Pokemon's non-Dynamax HP", s16 d PARAMETRIZE { dynamax = GIMMICK_NONE; } PARAMETRIZE { dynamax = GIMMICK_DYNAMAX; } GIVEN { - ASSUME(gMovesInfo[MOVE_SUPER_FANG].effect == EFFECT_SUPER_FANG); + ASSUME(GetMoveEffect(MOVE_SUPER_FANG) == EFFECT_SUPER_FANG); PLAYER(SPECIES_WOBBUFFET) { Speed(50); } OPPONENT(SPECIES_WOBBUFFET) { Speed(100); } } WHEN { @@ -535,7 +535,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Pain Split uses a Pokemon's non-Dynamax HP", s16 d PARAMETRIZE { dynamax = GIMMICK_NONE; } PARAMETRIZE { dynamax = GIMMICK_DYNAMAX; } GIVEN { - ASSUME(gMovesInfo[MOVE_PAIN_SPLIT].effect == EFFECT_PAIN_SPLIT); + ASSUME(GetMoveEffect(MOVE_PAIN_SPLIT) == EFFECT_PAIN_SPLIT); PLAYER(SPECIES_WOBBUFFET) { Speed(50); } OPPONENT(SPECIES_WOBBUFFET) { HP(1); Speed(100); } } WHEN { @@ -574,7 +574,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Heal Pulse heals based on a Pokemon's non-Dynamax PARAMETRIZE { dynamax = GIMMICK_NONE; } PARAMETRIZE { dynamax = GIMMICK_DYNAMAX; } GIVEN { - ASSUME(gMovesInfo[MOVE_HEAL_PULSE].effect == EFFECT_HEAL_PULSE); + ASSUME(GetMoveEffect(MOVE_HEAL_PULSE) == EFFECT_HEAL_PULSE); PLAYER(SPECIES_WOBBUFFET) { HP(1); Speed(50); } OPPONENT(SPECIES_WOBBUFFET) { MaxHP(100); Speed(100); } } WHEN { @@ -592,7 +592,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Strike lowers single opponent's speed") { GIVEN { // Fails?: ASSUME(GetMaxMove(B_POSITION_PLAYER_LEFT, MOVE_TACKLE) == MOVE_MAX_STRIKE); - ASSUME(gMovesInfo[MOVE_MAX_STRIKE].argument.maxEffect == MAX_EFFECT_LOWER_SPEED); + ASSUME(GetMoveMaxEffect(MOVE_MAX_STRIKE) == MAX_EFFECT_LOWER_SPEED); OPPONENT(SPECIES_WOBBUFFET) { Speed(100); } PLAYER(SPECIES_WOBBUFFET) { Speed(80); } } WHEN { @@ -616,7 +616,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Strike lowers single opponent's speed") DOUBLE_BATTLE_TEST("(DYNAMAX) Max Strike lowers both opponents' speed") { GIVEN { - ASSUME(gMovesInfo[MOVE_MAX_STRIKE].argument.maxEffect == MAX_EFFECT_LOWER_SPEED); + ASSUME(GetMoveMaxEffect(MOVE_MAX_STRIKE) == MAX_EFFECT_LOWER_SPEED); PLAYER(SPECIES_WOBBUFFET) { Speed(80); } PLAYER(SPECIES_WOBBUFFET) { Speed(79); } OPPONENT(SPECIES_WOBBUFFET) {Speed(100); } @@ -653,9 +653,9 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) Max Knuckle raises both allies' attack") { s16 damage[4]; GIVEN { - ASSUME(gMovesInfo[MOVE_MAX_KNUCKLE].argument.maxEffect == MAX_EFFECT_RAISE_TEAM_ATTACK); - ASSUME(gMovesInfo[MOVE_CLOSE_COMBAT].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveMaxEffect(MOVE_MAX_KNUCKLE) == MAX_EFFECT_RAISE_TEAM_ATTACK); + ASSUME(GetMoveCategory(MOVE_CLOSE_COMBAT) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); @@ -695,7 +695,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) Max Knuckle raises both allies' attack") SINGLE_BATTLE_TEST("(DYNAMAX) Max Flare sets up sunlight") { GIVEN { - ASSUME(gMovesInfo[MOVE_MAX_FLARE].argument.maxEffect == MAX_EFFECT_SUN); + ASSUME(GetMoveMaxEffect(MOVE_MAX_FLARE) == MAX_EFFECT_SUN); OPPONENT(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); } WHEN { @@ -711,7 +711,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Flare sets up sunlight") SINGLE_BATTLE_TEST("(DYNAMAX) Max Geyser sets up heavy rain") { GIVEN { - ASSUME(gMovesInfo[MOVE_MAX_GEYSER].argument.maxEffect == MAX_EFFECT_RAIN); + ASSUME(GetMoveMaxEffect(MOVE_MAX_GEYSER) == MAX_EFFECT_RAIN); OPPONENT(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); } WHEN { @@ -727,7 +727,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Geyser sets up heavy rain") SINGLE_BATTLE_TEST("(DYNAMAX) Max Hailstorm sets up hail") { GIVEN { - ASSUME(gMovesInfo[MOVE_MAX_HAILSTORM].argument.maxEffect == MAX_EFFECT_HAIL); + ASSUME(GetMoveMaxEffect(MOVE_MAX_HAILSTORM) == MAX_EFFECT_HAIL); OPPONENT(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); } WHEN { @@ -743,7 +743,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Hailstorm sets up hail") SINGLE_BATTLE_TEST("(DYNAMAX) Max Rockfall sets up a sandstorm") { GIVEN { - ASSUME(gMovesInfo[MOVE_MAX_ROCKFALL].argument.maxEffect == MAX_EFFECT_SANDSTORM); + ASSUME(GetMoveMaxEffect(MOVE_MAX_ROCKFALL) == MAX_EFFECT_SANDSTORM); OPPONENT(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); } WHEN { @@ -760,7 +760,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Overgrowth sets up Grassy Terrain") { s32 maxHP = 490; // Because of recalculated stats upon Dynamaxing GIVEN { - ASSUME(gMovesInfo[MOVE_MAX_OVERGROWTH].argument.maxEffect == MAX_EFFECT_GRASSY_TERRAIN); + ASSUME(GetMoveMaxEffect(MOVE_MAX_OVERGROWTH) == MAX_EFFECT_GRASSY_TERRAIN); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].baseHP == 190); OPPONENT(SPECIES_WOBBUFFET) { MaxHP(maxHP); HP(maxHP / 2); }; PLAYER(SPECIES_WOBBUFFET) { MaxHP(maxHP); HP(maxHP / 2); }; @@ -780,7 +780,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Overgrowth sets up Grassy Terrain") SINGLE_BATTLE_TEST("(DYNAMAX) Max Mindstorm sets up Psychic Terrain") { GIVEN { - ASSUME(gMovesInfo[MOVE_MAX_MINDSTORM].argument.maxEffect == MAX_EFFECT_PSYCHIC_TERRAIN); + ASSUME(GetMoveMaxEffect(MOVE_MAX_MINDSTORM) == MAX_EFFECT_PSYCHIC_TERRAIN); OPPONENT(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); } WHEN { @@ -797,7 +797,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Mindstorm sets up Psychic Terrain") SINGLE_BATTLE_TEST("(DYNAMAX) Max Lightning sets up Electric Terrain") { GIVEN { - ASSUME(gMovesInfo[MOVE_MAX_LIGHTNING].argument.maxEffect == MAX_EFFECT_ELECTRIC_TERRAIN); + ASSUME(GetMoveMaxEffect(MOVE_MAX_LIGHTNING) == MAX_EFFECT_ELECTRIC_TERRAIN); OPPONENT(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); } WHEN { @@ -812,7 +812,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Lightning sets up Electric Terrain") SINGLE_BATTLE_TEST("(DYNAMAX) Max Starfall sets up Misty Terrain") { GIVEN { - ASSUME(gMovesInfo[MOVE_MAX_STARFALL].argument.maxEffect == MAX_EFFECT_MISTY_TERRAIN); + ASSUME(GetMoveMaxEffect(MOVE_MAX_STARFALL) == MAX_EFFECT_MISTY_TERRAIN); OPPONENT(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); } WHEN { @@ -827,7 +827,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Starfall sets up Misty Terrain") SINGLE_BATTLE_TEST("(DYNAMAX) G-Max Stonesurge sets up Stealth Rocks") { GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_STONESURGE].argument.maxEffect == MAX_EFFECT_STEALTH_ROCK); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_STONESURGE) == MAX_EFFECT_STEALTH_ROCK); PLAYER(SPECIES_DREDNAW) { GigantamaxFactor(TRUE); } OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -847,7 +847,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) G-Max Stonesurge sets up Stealth Rocks") SINGLE_BATTLE_TEST("(DYNAMAX) G-Max Steelsurge sets up sharp steel") { GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_STEELSURGE].argument.maxEffect == MAX_EFFECT_STEELSURGE); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_STEELSURGE) == MAX_EFFECT_STEELSURGE); PLAYER(SPECIES_COPPERAJAH) { GigantamaxFactor(TRUE); } OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_HATTERENE); @@ -878,7 +878,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) G-Max Hydrosnipe has fixed power and ignores abili PARAMETRIZE { move = MOVE_WATER_GUN; } PARAMETRIZE { move = MOVE_HYDRO_CANNON; } GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_HYDROSNIPE].argument.maxEffect == MAX_EFFECT_FIXED_POWER); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_HYDROSNIPE) == MAX_EFFECT_FIXED_POWER); PLAYER(SPECIES_INTELEON) { GigantamaxFactor(TRUE); } OPPONENT(SPECIES_ARCTOVISH) { Ability(ABILITY_WATER_ABSORB); } } WHEN { @@ -894,7 +894,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) G-Max Hydrosnipe has fixed power and ignores abili DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Volt Crash paralyzes both opponents") { GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_VOLT_CRASH].argument.maxEffect == MAX_EFFECT_PARALYZE_FOES); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_VOLT_CRASH) == MAX_EFFECT_PARALYZE_FOES); PLAYER(SPECIES_PIKACHU) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_PICHU); OPPONENT(SPECIES_WOBBUFFET); @@ -921,7 +921,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Stun Shock paralyzes or poisons both opponen PARAMETRIZE { statusAnim = B_ANIM_STATUS_PRZ; rng = STATUS1_PARALYSIS; } PARAMETRIZE { statusAnim = B_ANIM_STATUS_PSN; rng = STATUS1_POISON; } GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_STUN_SHOCK].argument.maxEffect == MAX_EFFECT_POISON_PARALYZE_FOES); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_STUN_SHOCK) == MAX_EFFECT_POISON_PARALYZE_FOES); PLAYER(SPECIES_TOXTRICITY) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_TOXEL); OPPONENT(SPECIES_WOBBUFFET); @@ -958,7 +958,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Stun Shock paralyzes or poisons both opponen DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Stun Shock chooses statuses before considering immunities") { GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_STUN_SHOCK].argument.maxEffect == MAX_EFFECT_POISON_PARALYZE_FOES); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_STUN_SHOCK) == MAX_EFFECT_POISON_PARALYZE_FOES); PLAYER(SPECIES_TOXTRICITY) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_TOXEL); OPPONENT(SPECIES_GARBODOR); @@ -991,7 +991,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Befuddle paralyzes, poisons, or sleeps both PARAMETRIZE { statusAnim = B_ANIM_STATUS_PSN; rng = STATUS1_POISON; } PARAMETRIZE { statusAnim = B_ANIM_STATUS_SLP; rng = STATUS1_SLEEP; } GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_BEFUDDLE].argument.maxEffect == MAX_EFFECT_EFFECT_SPORE_FOES); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_BEFUDDLE) == MAX_EFFECT_EFFECT_SPORE_FOES); PLAYER(SPECIES_BUTTERFREE) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_CATERPIE); OPPONENT(SPECIES_WOBBUFFET); @@ -1035,7 +1035,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Befuddle paralyzes, poisons, or sleeps both DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Gold Rush confuses both opponents and generates money") { GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_GOLD_RUSH].argument.maxEffect == MAX_EFFECT_CONFUSE_FOES_PAY_DAY); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_GOLD_RUSH) == MAX_EFFECT_CONFUSE_FOES_PAY_DAY); PLAYER(SPECIES_MEOWTH) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_PERSIAN); OPPONENT(SPECIES_WOBBUFFET); @@ -1055,7 +1055,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Gold Rush confuses both opponents and genera DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Smite confuses both opponents") { GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_SMITE].argument.maxEffect == MAX_EFFECT_CONFUSE_FOES); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_SMITE) == MAX_EFFECT_CONFUSE_FOES); PLAYER(SPECIES_HATTERENE) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_HATENNA); OPPONENT(SPECIES_WOBBUFFET); @@ -1074,7 +1074,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Smite confuses both opponents") DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Cuddle infatuates both opponents, if possible") { GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_CUDDLE].argument.maxEffect == MAX_EFFECT_INFATUATE_FOES); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_CUDDLE) == MAX_EFFECT_INFATUATE_FOES); PLAYER(SPECIES_EEVEE) { Gender(MON_MALE); GigantamaxFactor(TRUE); } PLAYER(SPECIES_EEVEE); OPPONENT(SPECIES_WOBBUFFET) { Gender(MON_FEMALE); } @@ -1095,7 +1095,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Cuddle infatuates both opponents, if possibl DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Terror traps both opponents") { GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_TERROR].argument.maxEffect == MAX_EFFECT_MEAN_LOOK); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_TERROR) == MAX_EFFECT_MEAN_LOOK); PLAYER(SPECIES_GENGAR) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_GASTLY); OPPONENT(SPECIES_WOBBUFFET); @@ -1116,7 +1116,7 @@ TO_DO_BATTLE_TEST("(DYNAMAX) Baton Pass passes G-Max Terror's escape prevention DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Meltdown torments both opponents for 3 turns") { GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_MELTDOWN].argument.maxEffect == MAX_EFFECT_TORMENT_FOES); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_MELTDOWN) == MAX_EFFECT_TORMENT_FOES); PLAYER(SPECIES_MELMETAL) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_MELTAN); OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_SPLASH, MOVE_CELEBRATE); } @@ -1153,7 +1153,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Wildfire sets a field effect that damages no { s16 damage; GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_WILDFIRE].argument.maxEffect == MAX_EFFECT_WILDFIRE); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_WILDFIRE) == MAX_EFFECT_WILDFIRE); PLAYER(SPECIES_CHARIZARD) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_CHARMANDER); OPPONENT(SPECIES_WOBBUFFET) { HP(600); MaxHP(600); } @@ -1199,7 +1199,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Replenish recycles allies' berries 50\% of t { PASSES_RANDOMLY(1, 2, RNG_G_MAX_REPLENISH); GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_REPLENISH].argument.maxEffect == MAX_EFFECT_RECYCLE_BERRIES); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_REPLENISH) == MAX_EFFECT_RECYCLE_BERRIES); PLAYER(SPECIES_SNORLAX) { Item(ITEM_APICOT_BERRY); GigantamaxFactor(TRUE); } PLAYER(SPECIES_MUNCHLAX) { Item(ITEM_APICOT_BERRY); Ability(ABILITY_THICK_FAT); } OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_APICOT_BERRY); } @@ -1227,8 +1227,8 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Snooze makes only the target drowsy") { PASSES_RANDOMLY(1, 2, RNG_G_MAX_SNOOZE); GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_SNOOZE].argument.maxEffect == MAX_EFFECT_YAWN_FOE); - ASSUME(gMovesInfo[MOVE_DARK_PULSE].category == DAMAGE_CATEGORY_SPECIAL); // Otherwise, Blissey faints. + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_SNOOZE) == MAX_EFFECT_YAWN_FOE); + ASSUME(GetMoveCategory(MOVE_DARK_PULSE) == DAMAGE_CATEGORY_SPECIAL); // Otherwise, Blissey faints. PLAYER(SPECIES_GRIMMSNARL) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_IMPIDIMP); OPPONENT(SPECIES_BLISSEY); @@ -1251,7 +1251,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Finale heals allies by 1/6 of their health") { s16 damage1, damage2; GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_FINALE].argument.maxEffect == MAX_EFFECT_HEAL_TEAM); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_FINALE) == MAX_EFFECT_HEAL_TEAM); PLAYER(SPECIES_ALCREMIE) { HP(1); GigantamaxFactor(TRUE); } PLAYER(SPECIES_MILCERY) { HP(1); } OPPONENT(SPECIES_WOBBUFFET); @@ -1271,7 +1271,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Finale heals allies by 1/6 of their health") DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Sweetness cures allies' status conditions") { GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_SWEETNESS].argument.maxEffect == MAX_EFFECT_AROMATHERAPY); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_SWEETNESS) == MAX_EFFECT_AROMATHERAPY); PLAYER(SPECIES_APPLETUN) { Status1(STATUS1_POISON); GigantamaxFactor(TRUE); } PLAYER(SPECIES_APPLIN) { Status1(STATUS1_POISON); } OPPONENT(SPECIES_WOBBUFFET); @@ -1291,7 +1291,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Sweetness cures allies' status conditions") DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Centiferno traps both opponents in Fire Spin") { GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_CENTIFERNO].argument.maxEffect == MAX_EFFECT_FIRE_SPIN_FOES); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_CENTIFERNO) == MAX_EFFECT_FIRE_SPIN_FOES); PLAYER(SPECIES_CENTISKORCH) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_SIZZLIPEDE); PLAYER(SPECIES_SIZZLIPEDE); @@ -1320,7 +1320,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Chi Strike boosts allies' crit chance") u32 j; GIVEN { ASSUME(B_CRIT_CHANCE >= GEN_6); - ASSUME(gMovesInfo[MOVE_G_MAX_CHI_STRIKE].argument.maxEffect == MAX_EFFECT_CRIT_PLUS); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_CHI_STRIKE) == MAX_EFFECT_CRIT_PLUS); PLAYER(SPECIES_MACHAMP) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_MACHOP); OPPONENT(SPECIES_WOBBUFFET); @@ -1351,8 +1351,8 @@ TO_DO_BATTLE_TEST("(DYNAMAX) Baton Pass doesn't pass G-Max Chi Strike's effect") DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max Depletion takes away 2 PP from the target's last move") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_CLAW].category == DAMAGE_CATEGORY_PHYSICAL); // Otherwise Sableye faints. - ASSUME(gMovesInfo[MOVE_G_MAX_DEPLETION].argument.maxEffect == MAX_EFFECT_SPITE); + ASSUME(GetMoveCategory(MOVE_DRAGON_CLAW) == DAMAGE_CATEGORY_PHYSICAL); // Otherwise Sableye faints. + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_DEPLETION) == MAX_EFFECT_SPITE); PLAYER(SPECIES_DURALUDON) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_WYNAUT); // Dynamax behaves weird with test turn order because stats are recalculated. @@ -1374,7 +1374,7 @@ DOUBLE_BATTLE_TEST("(DYNAMAX) G-Max One Blow bypasses Max Guard for full damage" PARAMETRIZE { protect = TRUE; } PARAMETRIZE { protect = FALSE; } GIVEN { - ASSUME(gMovesInfo[MOVE_G_MAX_ONE_BLOW].argument.maxEffect == MAX_EFFECT_BYPASS_PROTECT); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_ONE_BLOW) == MAX_EFFECT_BYPASS_PROTECT); PLAYER(SPECIES_URSHIFU) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_KUBFU); OPPONENT(SPECIES_WOBBUFFET); @@ -1432,7 +1432,7 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Moves don't execute effects on fainted battler SINGLE_BATTLE_TEST("(DYNAMAX) Moxie clones can be triggered by Max Moves fainting opponents") { GIVEN { - ASSUME(gMovesInfo[MOVE_WATERFALL].power > 0); + ASSUME(GetMovePower(MOVE_WATERFALL) > 0); PLAYER(SPECIES_GYARADOS) { Ability(ABILITY_MOXIE); } OPPONENT(SPECIES_WOBBUFFET) { HP(1); } OPPONENT(SPECIES_WYNAUT); @@ -1474,11 +1474,11 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Moves don't bypass absorbing abilities") PARAMETRIZE { move = MOVE_VINE_WHIP; ability = ABILITY_SAP_SIPPER; species = SPECIES_MILTANK; } GIVEN { - ASSUME(gMovesInfo[MOVE_WATER_GUN].type == TYPE_WATER); - ASSUME(gMovesInfo[MOVE_SPARK].type == TYPE_ELECTRIC); - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); - ASSUME(gMovesInfo[MOVE_MUD_BOMB].type == TYPE_GROUND); - ASSUME(gMovesInfo[MOVE_VINE_WHIP].type == TYPE_GRASS); + ASSUME(GetMoveType(MOVE_WATER_GUN) == TYPE_WATER); + ASSUME(GetMoveType(MOVE_SPARK) == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_MUD_BOMB) == TYPE_GROUND); + ASSUME(GetMoveType(MOVE_VINE_WHIP) == TYPE_GRASS); PLAYER(SPECIES_WOBBUFFET); OPPONENT(species) { Ability(ability); } } WHEN { diff --git a/test/battle/gimmick/terastal.c b/test/battle/gimmick/terastal.c index a9e8fca871d3..709e658c3864 100644 --- a/test/battle/gimmick/terastal.c +++ b/test/battle/gimmick/terastal.c @@ -92,7 +92,7 @@ SINGLE_BATTLE_TEST("(TERA) Terastallizing boosts moves of the same type to 60 BP PARAMETRIZE { tera = GIMMICK_NONE; } PARAMETRIZE { tera = GIMMICK_TERA; } GIVEN { - ASSUME(gMovesInfo[MOVE_ABSORB].power == 20); + ASSUME(GetMovePower(MOVE_ABSORB) == 20); PLAYER(SPECIES_WOBBUFFET) { TeraType(TYPE_GRASS); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -113,7 +113,7 @@ SINGLE_BATTLE_TEST("(TERA) Terastallization's 60 BP floor occurs after Technicia PARAMETRIZE { tera = GIMMICK_NONE; } PARAMETRIZE { tera = GIMMICK_TERA; } GIVEN { - ASSUME(gMovesInfo[MOVE_MEGA_DRAIN].power == 40); + ASSUME(GetMovePower(MOVE_MEGA_DRAIN) == 40); PLAYER(SPECIES_MR_MIME) { Ability(ABILITY_TECHNICIAN); TeraType(TYPE_GRASS); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -393,7 +393,7 @@ SINGLE_BATTLE_TEST("(TERA) Double Shock does not remove the user's Electric type { s16 damage[4]; GIVEN { - ASSUME(gMovesInfo[MOVE_DOUBLE_SHOCK].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE); + ASSUME(GetMoveEffect(MOVE_DOUBLE_SHOCK) == EFFECT_FAIL_IF_NOT_ARG_TYPE); PLAYER(SPECIES_PICHU) { TeraType(TYPE_ELECTRIC); } PLAYER(SPECIES_WOBBUFFET) OPPONENT(SPECIES_WOBBUFFET); @@ -608,8 +608,8 @@ SINGLE_BATTLE_TEST("(TERA) Terastallizing into the Stellar type boosts all moves { s16 damage[4]; GIVEN { - ASSUME(gMovesInfo[MOVE_MEGA_DRAIN].power == 40); - ASSUME(gMovesInfo[MOVE_BUBBLE].power == 40); + ASSUME(GetMovePower(MOVE_MEGA_DRAIN) == 40); + ASSUME(GetMovePower(MOVE_BUBBLE) == 40); PLAYER(SPECIES_WOBBUFFET) { TeraType(TYPE_STELLAR); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -688,7 +688,7 @@ SINGLE_BATTLE_TEST("(TERA) Stellar type's one-time boost factors in dynamically- { s16 damage[4]; GIVEN { - ASSUME(gMovesInfo[MOVE_WEATHER_BALL].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_WEATHER_BALL) == TYPE_NORMAL); PLAYER(SPECIES_PELIPPER) { Ability(ABILITY_DRIZZLE); TeraType(TYPE_STELLAR); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -731,8 +731,8 @@ SINGLE_BATTLE_TEST("(TERA) Terapagos retains the Stellar type boost at all times PARAMETRIZE { move = MOVE_TACKLE; } PARAMETRIZE { move = MOVE_MACH_PUNCH; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_MACH_PUNCH].type != TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_MACH_PUNCH) != TYPE_NORMAL); PLAYER(SPECIES_TERAPAGOS); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/gimmick/zmove.c b/test/battle/gimmick/zmove.c index eb44184e5aed..358e38d031aa 100644 --- a/test/battle/gimmick/zmove.c +++ b/test/battle/gimmick/zmove.c @@ -6,7 +6,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Moves do not retain priority") { GIVEN { - ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_QUICK_ATTACK) == TYPE_NORMAL); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Moves do not retain priority") SINGLE_BATTLE_TEST("(Z-MOVE) Z-Moves are not affected by -ate abilities") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); ASSUME(gSpeciesInfo[SPECIES_SWELLOW].types[1] == TYPE_FLYING); PLAYER(SPECIES_AURORUS) { Ability(ABILITY_REFRIGERATE); Item(ITEM_NORMALIUM_Z); } OPPONENT(SPECIES_SWELLOW); @@ -38,8 +38,8 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Moves are not affected by -ate abilities") SINGLE_BATTLE_TEST("(Z-MOVE) Z-Moves are affected by Ion Deluge") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_ION_DELUGE].effect == EFFECT_ION_DELUGE); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); + ASSUME(GetMoveEffect(MOVE_ION_DELUGE) == EFFECT_ION_DELUGE); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); } OPPONENT(SPECIES_SWELLOW); } WHEN { @@ -57,8 +57,8 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Moves deal 1/4 damage through protect", s16 damag PARAMETRIZE { protected = TRUE; } PARAMETRIZE { protected = FALSE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_PROTECT].effect == EFFECT_PROTECT); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); + ASSUME(GetMoveEffect(MOVE_PROTECT) == EFFECT_PROTECT); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -77,7 +77,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Moves deal 1/4 damage through protect", s16 damag SINGLE_BATTLE_TEST("(Z-MOVE) Z_EFFECT_RESET_STATS clears a battler's negative stat stages") { GIVEN { - ASSUME(gMovesInfo[MOVE_LEECH_SEED].zMove.effect == Z_EFFECT_RESET_STATS); + ASSUME(GetMoveZEffect(MOVE_LEECH_SEED) == Z_EFFECT_RESET_STATS); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_GRASSIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -96,8 +96,8 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z_EFFECT_RESET_STATS clears a battler's negative st SINGLE_BATTLE_TEST("(Z-MOVE) Z_EFFECT_ALL_STATS_UP raises all of a battler's stat stages by one") { GIVEN { - ASSUME(gMovesInfo[MOVE_CELEBRATE].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_CELEBRATE].zMove.effect == Z_EFFECT_ALL_STATS_UP_1); + ASSUME(GetMoveType(MOVE_CELEBRATE) == TYPE_NORMAL); + ASSUME(GetMoveZEffect(MOVE_CELEBRATE) == Z_EFFECT_ALL_STATS_UP_1); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -118,8 +118,8 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z_EFFECT_BOOST_CRITS raises a battler's critical hi { PASSES_RANDOMLY(1, 2, RNG_CRITICAL_HIT); GIVEN { - ASSUME(gMovesInfo[MOVE_FORESIGHT].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_FORESIGHT].zMove.effect == Z_EFFECT_BOOST_CRITS); + ASSUME(GetMoveType(MOVE_FORESIGHT) == TYPE_NORMAL); + ASSUME(GetMoveZEffect(MOVE_FORESIGHT) == Z_EFFECT_BOOST_CRITS); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -136,8 +136,8 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z_EFFECT_BOOST_CRITS raises a battler's critical hi DOUBLE_BATTLE_TEST("(Z-MOVE) Z_EFFECT_FOLLOW_ME redirects attacks to the user") { GIVEN { - ASSUME(gMovesInfo[MOVE_DESTINY_BOND].type == TYPE_GHOST); - ASSUME(gMovesInfo[MOVE_DESTINY_BOND].zMove.effect == Z_EFFECT_FOLLOW_ME); + ASSUME(GetMoveType(MOVE_DESTINY_BOND) == TYPE_GHOST); + ASSUME(GetMoveZEffect(MOVE_DESTINY_BOND) == Z_EFFECT_FOLLOW_ME); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_GHOSTIUM_Z); } PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); @@ -157,8 +157,8 @@ DOUBLE_BATTLE_TEST("(Z-MOVE) Z_EFFECT_FOLLOW_ME redirects attacks to the user") SINGLE_BATTLE_TEST("(Z-MOVE) Z_EFFECT_RESTORE_REPLACEMENT_HP fully heals the replacement battler's HP") { GIVEN { - ASSUME(gMovesInfo[MOVE_PARTING_SHOT].type == TYPE_DARK); - ASSUME(gMovesInfo[MOVE_PARTING_SHOT].zMove.effect == Z_EFFECT_RESTORE_REPLACEMENT_HP); + ASSUME(GetMoveType(MOVE_PARTING_SHOT) == TYPE_DARK); + ASSUME(GetMoveZEffect(MOVE_PARTING_SHOT) == Z_EFFECT_RESTORE_REPLACEMENT_HP); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_DARKINIUM_Z); } PLAYER(SPECIES_WYNAUT) { HP(1); } OPPONENT(SPECIES_WOBBUFFET); @@ -181,11 +181,11 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z_EFFECT_CURSE activates Z_EFFECT_RECOVER_HP or Z_E PARAMETRIZE { species = SPECIES_WOBBUFFET; } PARAMETRIZE { species = SPECIES_DUSCLOPS; } GIVEN { - ASSUME(gMovesInfo[MOVE_CURSE].type == TYPE_GHOST); + ASSUME(GetMoveType(MOVE_CURSE) == TYPE_GHOST); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_GHOST); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_GHOST); ASSUME(gSpeciesInfo[SPECIES_DUSCLOPS].types[0] == TYPE_GHOST); - ASSUME(gMovesInfo[MOVE_CURSE].zMove.effect == Z_EFFECT_CURSE); + ASSUME(GetMoveZEffect(MOVE_CURSE) == Z_EFFECT_CURSE); PLAYER(species) { Item(ITEM_GHOSTIUM_Z); HP(1); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -218,8 +218,8 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z_EFFECT_CURSE activates Z_EFFECT_RECOVER_HP or Z_E SINGLE_BATTLE_TEST("(Z-MOVE) Z-Mirror Move raises the user's attack by two stages and copies the last used non-status move as a Z-Move") { GIVEN { - ASSUME(gMovesInfo[MOVE_MIRROR_MOVE].type == TYPE_FLYING); - ASSUME(gMovesInfo[MOVE_MIRROR_MOVE].zMove.effect == Z_EFFECT_ATK_UP_2); + ASSUME(GetMoveType(MOVE_MIRROR_MOVE) == TYPE_FLYING); + ASSUME(GetMoveZEffect(MOVE_MIRROR_MOVE) == Z_EFFECT_ATK_UP_2); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_FLYINIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -240,8 +240,8 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Mirror Move raises the user's attack by two stage SINGLE_BATTLE_TEST("(Z-MOVE) Z-Mirror Move raises the user's attack by two stages and copies the last used status move regularly") { GIVEN { - ASSUME(gMovesInfo[MOVE_MIRROR_MOVE].type == TYPE_FLYING); - ASSUME(gMovesInfo[MOVE_MIRROR_MOVE].zMove.effect == Z_EFFECT_ATK_UP_2); + ASSUME(GetMoveType(MOVE_MIRROR_MOVE) == TYPE_FLYING); + ASSUME(GetMoveZEffect(MOVE_MIRROR_MOVE) == Z_EFFECT_ATK_UP_2); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_FLYINIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -259,8 +259,8 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Mirror Move raises the user's attack by two stage SINGLE_BATTLE_TEST("(Z-MOVE) Z-Copycat raises the user's accuracy by one stage and copies the last used non-status move as a Z-Move") { GIVEN { - ASSUME(gMovesInfo[MOVE_COPYCAT].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_COPYCAT].zMove.effect == Z_EFFECT_ACC_UP_1); + ASSUME(GetMoveType(MOVE_COPYCAT) == TYPE_NORMAL); + ASSUME(GetMoveZEffect(MOVE_COPYCAT) == Z_EFFECT_ACC_UP_1); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -281,8 +281,8 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Me First raises the user's speed by two stages an PARAMETRIZE { meFirst = TRUE; } PARAMETRIZE { meFirst = FALSE; } GIVEN { - ASSUME(gMovesInfo[MOVE_ME_FIRST].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_ME_FIRST].zMove.effect == Z_EFFECT_SPD_UP_2); + ASSUME(GetMoveType(MOVE_ME_FIRST) == TYPE_NORMAL); + ASSUME(GetMoveZEffect(MOVE_ME_FIRST) == Z_EFFECT_SPD_UP_2); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -313,7 +313,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Nature Power transforms into different Z-Moves ba PARAMETRIZE { terrainMove = MOVE_GRASSY_TERRAIN; zMove = gTypesInfo[TYPE_GRASS].zMove; } PARAMETRIZE { terrainMove = MOVE_MISTY_TERRAIN; zMove = gTypesInfo[TYPE_FAIRY].zMove; } GIVEN { - ASSUME(gMovesInfo[MOVE_NATURE_POWER].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_NATURE_POWER) == TYPE_NORMAL); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -334,7 +334,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Hidden Power always transforms into Breakneck Bli PARAMETRIZE { iv = 21; } PARAMETRIZE { iv = 31; } GIVEN { - ASSUME(gMovesInfo[MOVE_HIDDEN_POWER].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_HIDDEN_POWER) == TYPE_NORMAL); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); AttackIV(iv); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -354,7 +354,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Weather Ball transforms into different Z-Moves ba PARAMETRIZE { weatherMove = MOVE_SANDSTORM; zMove = gTypesInfo[TYPE_ROCK].zMove; } PARAMETRIZE { weatherMove = MOVE_HAIL; zMove = gTypesInfo[TYPE_ICE].zMove; } GIVEN { - ASSUME(gMovesInfo[MOVE_WEATHER_BALL].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_WEATHER_BALL) == TYPE_NORMAL); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -370,7 +370,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Weather Ball transforms into different Z-Moves ba SINGLE_BATTLE_TEST("(Z-MOVE) Z-Sleep Talk transforms a used non-status move into a Z-Move") { GIVEN { - ASSUME(gMovesInfo[MOVE_SLEEP_TALK].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_SLEEP_TALK) == TYPE_NORMAL); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); Status1(STATUS1_SLEEP); Moves(MOVE_SLEEP_TALK, MOVE_ABSORB); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -385,7 +385,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Sleep Talk transforms a used non-status move into SINGLE_BATTLE_TEST("(Z-MOVE) Z-Sleep Talk turns Weather Ball into Breakneck Blitz even under rain") { GIVEN { - ASSUME(gMovesInfo[MOVE_SLEEP_TALK].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_SLEEP_TALK) == TYPE_NORMAL); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); Status1(STATUS1_SLEEP); Moves(MOVE_SLEEP_TALK, MOVE_WEATHER_BALL); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -400,7 +400,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Sleep Talk turns Weather Ball into Breakneck Blit SINGLE_BATTLE_TEST("(Z-MOVE) Powder blocks Fire type Z-Moves and deals 25% of maximum HP to the user") { GIVEN { - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_FIRIUM_Z); } OPPONENT(SPECIES_VIVILLON); } WHEN { @@ -417,8 +417,8 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Powder blocks Fire type Z-Moves and deals 25% of ma DOUBLE_BATTLE_TEST("(Z-MOVE) Powder blocks Fire type Z-Moves (from Z-Mirror Move)") { GIVEN { - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); - ASSUME(gMovesInfo[MOVE_MIRROR_MOVE].type == TYPE_FLYING); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_MIRROR_MOVE) == TYPE_FLYING); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_FLYINIUM_Z); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -436,8 +436,8 @@ DOUBLE_BATTLE_TEST("(Z-MOVE) Powder blocks Fire type Z-Moves (from Z-Mirror Move SINGLE_BATTLE_TEST("(Z-MOVE) Powder blocks Fire type Z-Moves but not boosts granted") { GIVEN { - ASSUME(gMovesInfo[MOVE_WILL_O_WISP].type == TYPE_FIRE); - ASSUME(gMovesInfo[MOVE_WILL_O_WISP].zMove.effect == Z_EFFECT_ATK_UP_1); + ASSUME(GetMoveType(MOVE_WILL_O_WISP) == TYPE_FIRE); + ASSUME(GetMoveZEffect(MOVE_WILL_O_WISP) == Z_EFFECT_ATK_UP_1); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_FIRIUM_Z); } OPPONENT(SPECIES_VIVILLON); } WHEN { @@ -455,7 +455,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Powder blocks Fire type Z-Moves but not boosts gran DOUBLE_BATTLE_TEST("(Z-MOVE) Instruct fails if the target last used a Z-Move") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMALIUM_Z); } PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); @@ -474,7 +474,7 @@ DOUBLE_BATTLE_TEST("(Z-MOVE) Instruct fails if the target last used a Z-Move") DOUBLE_BATTLE_TEST("(Z-MOVE) Dancer does not use a Z-Move if the battler has used a Z-Move the same turn") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_DANCER); Item(ITEM_NORMALIUM_Z); } PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); @@ -498,7 +498,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Light That Burns the Sky uses the battler's highest PARAMETRIZE { useSwordsDance = FALSE; } PARAMETRIZE { useSwordsDance = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_SWORDS_DANCE].effect == EFFECT_ATTACK_UP_2); + ASSUME(GetMoveEffect(MOVE_SWORDS_DANCE) == EFFECT_ATTACK_UP_2); PLAYER(SPECIES_NECROZMA_DUSK_MANE) { Item(ITEM_ULTRANECROZIUM_Z); } OPPONENT(SPECIES_WOBBUFFET) { HP(1000); MaxHP(1000); }; // hits hard lol } WHEN { @@ -521,7 +521,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) 10,000,000 Volt Thunderbolt has an increased critic PASSES_RANDOMLY(1, 2, RNG_CRITICAL_HIT); GIVEN { ASSUME(B_CRIT_CHANCE >= GEN_6); - ASSUME(gMovesInfo[MOVE_10_000_000_VOLT_THUNDERBOLT].criticalHitStage == 2); + ASSUME(GetMoveCriticalHitStage(MOVE_10_000_000_VOLT_THUNDERBOLT) == 2); PLAYER(SPECIES_PIKACHU_PARTNER) { Item(ITEM_PIKASHUNIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -536,7 +536,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) 10,000,000 Volt Thunderbolt has an increased critic SINGLE_BATTLE_TEST("(Z-MOVE) Stoked Sparksurfer paralyzes the target") { GIVEN { - ASSUME(gMovesInfo[MOVE_STOKED_SPARKSURFER].additionalEffects[0].moveEffect == MOVE_EFFECT_PARALYSIS); + ASSUME(GetMoveAdditionalEffectById(MOVE_STOKED_SPARKSURFER, 0)->moveEffect == MOVE_EFFECT_PARALYSIS); PLAYER(SPECIES_RAICHU_ALOLA) { Item(ITEM_ALORAICHIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -551,7 +551,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Stoked Sparksurfer paralyzes the target") SINGLE_BATTLE_TEST("(Z-MOVE) Extreme Evoboost boosts all the user's stats by two stages") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXTREME_EVOBOOST].effect == EFFECT_EXTREME_EVOBOOST); + ASSUME(GetMoveEffect(MOVE_EXTREME_EVOBOOST) == EFFECT_EXTREME_EVOBOOST); PLAYER(SPECIES_EEVEE) { Item(ITEM_EEVIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -571,7 +571,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Extreme Evoboost boosts all the user's stats by two SINGLE_BATTLE_TEST("(Z-MOVE) Genesis Supernova sets up psychic terrain") { GIVEN { - ASSUME(gMovesInfo[MOVE_GENESIS_SUPERNOVA].effect == EFFECT_HIT_SET_REMOVE_TERRAIN); + ASSUME(GetMoveEffect(MOVE_GENESIS_SUPERNOVA) == EFFECT_HIT_SET_REMOVE_TERRAIN); PLAYER(SPECIES_MEW) { Item(ITEM_MEWNIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -588,7 +588,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Genesis Supernova sets up psychic terrain") SINGLE_BATTLE_TEST("(Z-MOVE) Splintered Stormshards removes terrain") { GIVEN { - ASSUME(gMovesInfo[MOVE_SPLINTERED_STORMSHARDS].effect == EFFECT_HIT_SET_REMOVE_TERRAIN); + ASSUME(GetMoveEffect(MOVE_SPLINTERED_STORMSHARDS) == EFFECT_HIT_SET_REMOVE_TERRAIN); PLAYER(SPECIES_LYCANROC_DUSK) { Item(ITEM_LYCANIUM_Z); } OPPONENT(SPECIES_TAPU_LELE) { Ability(ABILITY_PSYCHIC_SURGE); HP(1000); MaxHP(1000); } } WHEN { @@ -606,7 +606,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Splintered Stormshards removes terrain") SINGLE_BATTLE_TEST("(Z-MOVE) Clangorous Soulblaze boosts all the user's stats by one stage") { GIVEN { - ASSUME(gMovesInfo[MOVE_CLANGOROUS_SOULBLAZE].additionalEffects[0].moveEffect == MOVE_EFFECT_ALL_STATS_UP); + ASSUME(GetMoveAdditionalEffectById(MOVE_CLANGOROUS_SOULBLAZE, 0)->moveEffect == MOVE_EFFECT_ALL_STATS_UP); PLAYER(SPECIES_KOMMO_O) { Item(ITEM_KOMMONIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -626,7 +626,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Clangorous Soulblaze boosts all the user's stats by SINGLE_BATTLE_TEST("(Z-MOVE) Guardian of Alola deals 75\% of the target's current HP") { GIVEN { - ASSUME(gMovesInfo[MOVE_GUARDIAN_OF_ALOLA].effect == EFFECT_GUARDIAN_OF_ALOLA); + ASSUME(GetMoveEffect(MOVE_GUARDIAN_OF_ALOLA) == EFFECT_GUARDIAN_OF_ALOLA); PLAYER(SPECIES_TAPU_FINI) { Item(ITEM_TAPUNIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -662,7 +662,7 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Revelation Dance always transforms into Breakneck PARAMETRIZE { species = SPECIES_ORICORIO_POM_POM; } PARAMETRIZE { species = SPECIES_ORICORIO_SENSU; } GIVEN { - ASSUME(gMovesInfo[MOVE_REVELATION_DANCE].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_REVELATION_DANCE) == TYPE_NORMAL); PLAYER(species) { Item(ITEM_NORMALIUM_Z); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/hold_effect/air_balloon.c b/test/battle/hold_effect/air_balloon.c index 293e1d80ca1f..302a0e63971d 100644 --- a/test/battle/hold_effect/air_balloon.c +++ b/test/battle/hold_effect/air_balloon.c @@ -4,9 +4,9 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_AIR_BALLOON].holdEffect == HOLD_EFFECT_AIR_BALLOON); - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].type == TYPE_GROUND); - ASSUME(gMovesInfo[MOVE_TACKLE].type != TYPE_GROUND); - ASSUME(gMovesInfo[MOVE_RECYCLE].effect == EFFECT_RECYCLE); + ASSUME(GetMoveType(MOVE_EARTHQUAKE) == TYPE_GROUND); + ASSUME(GetMoveType(MOVE_TACKLE) != TYPE_GROUND); + ASSUME(GetMoveEffect(MOVE_RECYCLE) == EFFECT_RECYCLE); } SINGLE_BATTLE_TEST("Air Balloon prevents the holder from taking damage from ground type moves") diff --git a/test/battle/hold_effect/attack_up.c b/test/battle/hold_effect/attack_up.c index d166d8ff2ca2..63203e588a6c 100644 --- a/test/battle/hold_effect/attack_up.c +++ b/test/battle/hold_effect/attack_up.c @@ -4,8 +4,8 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_LIECHI_BERRY].holdEffect == HOLD_EFFECT_ATTACK_UP); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].argument.fixedDamage == 40); + ASSUME(GetMoveEffect(MOVE_DRAGON_RAGE) == EFFECT_FIXED_DAMAGE_ARG); + ASSUME(GetMoveFixedDamage(MOVE_DRAGON_RAGE) == 40); } SINGLE_BATTLE_TEST("Liechi Berry raises the holder's Attack by one stage when HP drops to 1/4 or below") diff --git a/test/battle/hold_effect/berserk_gene.c b/test/battle/hold_effect/berserk_gene.c index 59f78c1a12f8..1ff601fc8358 100644 --- a/test/battle/hold_effect/berserk_gene.c +++ b/test/battle/hold_effect/berserk_gene.c @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Berserk Gene sharply raises attack at the start of a single PARAMETRIZE { item = ITEM_NONE; } PARAMETRIZE { item = ITEM_BERSERK_GENE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET) { Item(item); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -37,7 +37,7 @@ DOUBLE_BATTLE_TEST("Berserk Gene sharply raises attack at the start of a double PARAMETRIZE { item = ITEM_NONE; } PARAMETRIZE { item = ITEM_BERSERK_GENE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WYNAUT); PLAYER(SPECIES_WOBBUFFET) { Item(item); } OPPONENT(SPECIES_WOBBUFFET); @@ -64,7 +64,7 @@ SINGLE_BATTLE_TEST("Berserk Gene activates on switch in", s16 damage) PARAMETRIZE { item = ITEM_NONE; } PARAMETRIZE { item = ITEM_BERSERK_GENE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WYNAUT); PLAYER(SPECIES_WOBBUFFET) { Item(item); } OPPONENT(SPECIES_WOBBUFFET); @@ -91,7 +91,7 @@ SINGLE_BATTLE_TEST("Berserk Gene does not confuse a Pokemon with Own Tempo but s PARAMETRIZE { item = ITEM_NONE; } PARAMETRIZE { item = ITEM_BERSERK_GENE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_SLOWBRO) { Ability(ABILITY_OWN_TEMPO); Item(item); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -122,7 +122,7 @@ DOUBLE_BATTLE_TEST("Berserk Gene does not confuse a Pokemon with Own Tempo but s PARAMETRIZE { item = ITEM_BERSERK_GENE; positionLeft = TRUE; } PARAMETRIZE { item = ITEM_BERSERK_GENE; positionLeft = FALSE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); if (positionLeft) { PLAYER(SPECIES_SLOWBRO) { Ability(ABILITY_OWN_TEMPO); Item(item); } PLAYER(SPECIES_WOBBUFFET); @@ -156,7 +156,7 @@ DOUBLE_BATTLE_TEST("Berserk Gene does not confuse a Pokemon with Own Tempo but s SINGLE_BATTLE_TEST("Berserk Gene does not confuse on Misty Terrain but still raises attack sharply") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_TAPU_FINI) { Ability(ABILITY_MISTY_SURGE); Item(ITEM_BERSERK_GENE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/hold_effect/blunder_policy.c b/test/battle/hold_effect/blunder_policy.c index 552ad2f6fbd5..e9215b3eb2f6 100644 --- a/test/battle/hold_effect/blunder_policy.c +++ b/test/battle/hold_effect/blunder_policy.c @@ -10,7 +10,7 @@ SINGLE_BATTLE_TEST("Blunder Policy raises the users speed by 2 stages if the use { PASSES_RANDOMLY(3, 10, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_FOCUS_BLAST].accuracy == 70); + ASSUME(GetMoveAccuracy(MOVE_FOCUS_BLAST) == 70); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BLUNDER_POLICY); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -29,7 +29,7 @@ SINGLE_BATTLE_TEST("Blunder Policy will never trigger if the move fails due to a { PASSES_RANDOMLY(10, 10, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_FOCUS_BLAST].accuracy == 70); + ASSUME(GetMoveAccuracy(MOVE_FOCUS_BLAST) == 70); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BLUNDER_POLICY); } OPPONENT(SPECIES_GASTLY); } WHEN { @@ -49,7 +49,7 @@ SINGLE_BATTLE_TEST("Blunder Policy will never trigger if the move fails due to P { PASSES_RANDOMLY(10, 10, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_FOCUS_BLAST].accuracy == 70); + ASSUME(GetMoveAccuracy(MOVE_FOCUS_BLAST) == 70); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BLUNDER_POLICY); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/hold_effect/booster_energy.c b/test/battle/hold_effect/booster_energy.c index 072eb8df60d0..f6f44a272cd8 100644 --- a/test/battle/hold_effect/booster_energy.c +++ b/test/battle/hold_effect/booster_energy.c @@ -143,7 +143,7 @@ SINGLE_BATTLE_TEST("Booster Energy increases special attack by 30% if it is the PARAMETRIZE { species = SPECIES_IRON_MOTH; ability = ABILITY_QUARK_DRIVE; item = ITEM_BOOSTER_ENERGY; } GIVEN { - ASSUME(gMovesInfo[MOVE_ROUND].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_ROUND) == DAMAGE_CATEGORY_SPECIAL); PLAYER(species) { Attack(100); Defense(100); Speed(100); SpAttack(110); SpDefense(100); Ability(ability); Item(item); } OPPONENT(SPECIES_WOBBUFFET) { Speed(100); }; } WHEN { @@ -169,7 +169,7 @@ SINGLE_BATTLE_TEST("Booster Energy increases special defense by 30% if it is the PARAMETRIZE { species = SPECIES_IRON_MOTH; ability = ABILITY_QUARK_DRIVE; item = ITEM_BOOSTER_ENERGY; } GIVEN { - ASSUME(gMovesInfo[MOVE_ROUND].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_ROUND) == DAMAGE_CATEGORY_SPECIAL); PLAYER(species) { Attack(100); Defense(100); Speed(100); SpAttack(100); SpDefense(110); Ability(ability); Item(item); } OPPONENT(SPECIES_WOBBUFFET) { Speed(100); }; } WHEN { diff --git a/test/battle/hold_effect/clear_amulet.c b/test/battle/hold_effect/clear_amulet.c index d0666ff3a91a..cc143c51e1c2 100644 --- a/test/battle/hold_effect/clear_amulet.c +++ b/test/battle/hold_effect/clear_amulet.c @@ -42,13 +42,13 @@ SINGLE_BATTLE_TEST("Clear Amulet prevents stat reducing effects") PARAMETRIZE { move = MOVE_SAND_ATTACK; } GIVEN { - ASSUME(gMovesInfo[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); - ASSUME(gMovesInfo[MOVE_LEER].effect == EFFECT_DEFENSE_DOWN); - ASSUME(gMovesInfo[MOVE_CONFIDE].effect == EFFECT_SPECIAL_ATTACK_DOWN); - ASSUME(gMovesInfo[MOVE_FAKE_TEARS].effect == EFFECT_SPECIAL_DEFENSE_DOWN_2); - ASSUME(gMovesInfo[MOVE_SCARY_FACE].effect == EFFECT_SPEED_DOWN_2); - ASSUME(gMovesInfo[MOVE_SWEET_SCENT].effect == (B_UPDATED_MOVE_DATA >= GEN_6 ? EFFECT_EVASION_DOWN_2 : EFFECT_EVASION_DOWN)); - ASSUME(gMovesInfo[MOVE_SAND_ATTACK].effect == EFFECT_ACCURACY_DOWN); + ASSUME(GetMoveEffect(MOVE_GROWL) == EFFECT_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_LEER) == EFFECT_DEFENSE_DOWN); + ASSUME(GetMoveEffect(MOVE_CONFIDE) == EFFECT_SPECIAL_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_FAKE_TEARS) == EFFECT_SPECIAL_DEFENSE_DOWN_2); + ASSUME(GetMoveEffect(MOVE_SCARY_FACE) == EFFECT_SPEED_DOWN_2); + ASSUME(GetMoveEffect(MOVE_SWEET_SCENT) == (B_UPDATED_MOVE_DATA >= GEN_6 ? EFFECT_EVASION_DOWN_2 : EFFECT_EVASION_DOWN)); + ASSUME(GetMoveEffect(MOVE_SAND_ATTACK) == EFFECT_ACCURACY_DOWN); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_CLEAR_AMULET); }; } WHEN { diff --git a/test/battle/hold_effect/critical_hit_up.c b/test/battle/hold_effect/critical_hit_up.c index 7bfe4ed74f22..ee4cb6a7d286 100644 --- a/test/battle/hold_effect/critical_hit_up.c +++ b/test/battle/hold_effect/critical_hit_up.c @@ -4,8 +4,8 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_LANSAT_BERRY].holdEffect == HOLD_EFFECT_CRITICAL_UP); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].argument.fixedDamage == 40); + ASSUME(GetMoveEffect(MOVE_DRAGON_RAGE) == EFFECT_FIXED_DAMAGE_ARG); + ASSUME(GetMoveFixedDamage(MOVE_DRAGON_RAGE) == 40); } SINGLE_BATTLE_TEST("Lansat Berry raises the holder's critical-hit-ratio by two stages when HP drops to 1/4 or below") @@ -52,7 +52,7 @@ SINGLE_BATTLE_TEST("Lansat Berry raises the holder's critical-hit-ratio by two s { PASSES_RANDOMLY(1, 2, RNG_CRITICAL_HIT); GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].criticalHitStage == 0); + ASSUME(GetMoveCriticalHitStage(MOVE_TACKLE) == 0); ASSUME(B_CRIT_CHANCE >= GEN_6); PLAYER(SPECIES_WOBBUFFET) { MaxHP(160); HP(80); Item(ITEM_LANSAT_BERRY); } OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/hold_effect/defense_up.c b/test/battle/hold_effect/defense_up.c index 87f41be7b304..1812b96d33fc 100644 --- a/test/battle/hold_effect/defense_up.c +++ b/test/battle/hold_effect/defense_up.c @@ -4,8 +4,8 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_GANLON_BERRY].holdEffect == HOLD_EFFECT_DEFENSE_UP); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].argument.fixedDamage == 40); + ASSUME(GetMoveEffect(MOVE_DRAGON_RAGE) == EFFECT_FIXED_DAMAGE_ARG); + ASSUME(GetMoveFixedDamage(MOVE_DRAGON_RAGE) == 40); } SINGLE_BATTLE_TEST("Ganlon Berry raises the holder's Defense by one stage when HP drops to 1/4 or below") diff --git a/test/battle/hold_effect/jaboca_berry.c b/test/battle/hold_effect/jaboca_berry.c index 373780be712f..756b5adf3c75 100644 --- a/test/battle/hold_effect/jaboca_berry.c +++ b/test/battle/hold_effect/jaboca_berry.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_JABOCA_BERRY].holdEffect == HOLD_EFFECT_JABOCA_BERRY); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); } SINGLE_BATTLE_TEST("Jaboca Berry causes the attacker to lose 1/8 of its max HP if a physical move was used") @@ -16,7 +16,7 @@ SINGLE_BATTLE_TEST("Jaboca Berry causes the attacker to lose 1/8 of its max HP i PARAMETRIZE { move = MOVE_TACKLE; } GIVEN { - ASSUME(gMovesInfo[MOVE_SWIFT].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_SWIFT) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_JABOCA_BERRY); } } WHEN { @@ -44,7 +44,7 @@ SINGLE_BATTLE_TEST("Jaboca Berry tirggers before Bug Bite can steal it") { KNOWN_FAILING; GIVEN { - ASSUME(gMovesInfo[MOVE_BUG_BITE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_BUG_BITE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_JABOCA_BERRY); } } WHEN { diff --git a/test/battle/hold_effect/kee_berry.c b/test/battle/hold_effect/kee_berry.c index 26cd2152a188..33de8ee004f7 100644 --- a/test/battle/hold_effect/kee_berry.c +++ b/test/battle/hold_effect/kee_berry.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_KEE_BERRY].holdEffect == HOLD_EFFECT_KEE_BERRY); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); } SINGLE_BATTLE_TEST("Kee Berry raises the holder's Defense by one stage when hit by a physical move") @@ -15,7 +15,7 @@ SINGLE_BATTLE_TEST("Kee Berry raises the holder's Defense by one stage when hit PARAMETRIZE { move = MOVE_TACKLE; } GIVEN { - ASSUME(gMovesInfo[MOVE_SWIFT].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_SWIFT) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_KEE_BERRY); } } WHEN { diff --git a/test/battle/hold_effect/maranga_berry.c b/test/battle/hold_effect/maranga_berry.c index 77cdaddf42f5..eeb1aacf94f8 100644 --- a/test/battle/hold_effect/maranga_berry.c +++ b/test/battle/hold_effect/maranga_berry.c @@ -12,8 +12,8 @@ SINGLE_BATTLE_TEST("Maranga Berry raises the holder's Sp. Def by one stage when PARAMETRIZE { move = MOVE_TACKLE; } PARAMETRIZE { move = MOVE_SWIFT; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_SWIFT].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_SWIFT) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_MARANGA_BERRY); } } WHEN { @@ -40,7 +40,7 @@ SINGLE_BATTLE_TEST("Maranga Berry raises the holder's Sp. Def by one stage when SINGLE_BATTLE_TEST("Maranga Berry raises the holder's Sp. Def by two stages with Ripen when hit by a special move") { GIVEN { - ASSUME(gMovesInfo[MOVE_SWIFT].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_SWIFT) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_APPLIN) { Item(ITEM_MARANGA_BERRY); Ability(ABILITY_RIPEN); } } WHEN { diff --git a/test/battle/hold_effect/metronome.c b/test/battle/hold_effect/metronome.c index 21ad326cf1dd..f1d756b3a7b7 100644 --- a/test/battle/hold_effect/metronome.c +++ b/test/battle/hold_effect/metronome.c @@ -112,7 +112,7 @@ SINGLE_BATTLE_TEST("Metronome Item counts charging turn of moves for its attacki PARAMETRIZE {item = ITEM_NONE; } PARAMETRIZE {item = ITEM_METRONOME; } GIVEN { - ASSUME(gMovesInfo[MOVE_SOLAR_BEAM].effect == EFFECT_SOLAR_BEAM); + ASSUME(GetMoveEffect(MOVE_SOLAR_BEAM) == EFFECT_SOLAR_BEAM); PLAYER(SPECIES_WOBBUFFET) { Item(item); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -134,7 +134,7 @@ SINGLE_BATTLE_TEST("Metronome Item doesn't increase damage per hit of multi-hit { s16 damage[3]; GIVEN { - ASSUME(gMovesInfo[MOVE_FURY_ATTACK].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_FURY_ATTACK) == EFFECT_MULTI_HIT); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_METRONOME); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/hold_effect/micle_berry.c b/test/battle/hold_effect/micle_berry.c index f196c67c967c..818eae09a664 100644 --- a/test/battle/hold_effect/micle_berry.c +++ b/test/battle/hold_effect/micle_berry.c @@ -4,8 +4,8 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_MICLE_BERRY].holdEffect == HOLD_EFFECT_MICLE_BERRY); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].argument.fixedDamage == 40); + ASSUME(GetMoveEffect(MOVE_DRAGON_RAGE) == EFFECT_FIXED_DAMAGE_ARG); + ASSUME(GetMoveFixedDamage(MOVE_DRAGON_RAGE) == 40); } SINGLE_BATTLE_TEST("Micle Berry raises the holder's accuracy by 1.2 when HP drops to 1/4 or below") @@ -52,7 +52,7 @@ SINGLE_BATTLE_TEST("Micle Berry raises the holder's accuracy by 1.2") { PASSES_RANDOMLY(24, 25, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_SUBMISSION].accuracy == 80); + ASSUME(GetMoveAccuracy(MOVE_SUBMISSION) == 80); PLAYER(SPECIES_WOBBUFFET) { MaxHP(160); HP(80); Item(ITEM_MICLE_BERRY); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -68,7 +68,7 @@ SINGLE_BATTLE_TEST("Micle Berry raises the holder's accuracy by 1.2") SINGLE_BATTLE_TEST("Micle Berry increases the accuracy of the next used move across turns") { GIVEN { - ASSUME(gMovesInfo[MOVE_ROCK_SLIDE].accuracy == 90); + ASSUME(GetMoveAccuracy(MOVE_ROCK_SLIDE) == 90); PASSES_RANDOMLY(100, 100, RNG_ACCURACY); PLAYER(SPECIES_WOBBUFFET) { MaxHP(100); HP(26); Item(ITEM_MICLE_BERRY); } OPPONENT(SPECIES_WOBBUFFET); @@ -85,7 +85,7 @@ SINGLE_BATTLE_TEST("Micle Berry increases the accuracy of the next used move acr SINGLE_BATTLE_TEST("Micle Berry increases the accuracy of the next used move the same turn the berry was triggered") { GIVEN { - ASSUME(gMovesInfo[MOVE_ROCK_SLIDE].accuracy == 90); + ASSUME(GetMoveAccuracy(MOVE_ROCK_SLIDE) == 90); PASSES_RANDOMLY(100, 100, RNG_ACCURACY); PLAYER(SPECIES_WOBBUFFET) { MaxHP(100); HP(26); Item(ITEM_MICLE_BERRY); } OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/hold_effect/mirror_herb.c b/test/battle/hold_effect/mirror_herb.c index 88a7467334d2..68294bee4312 100644 --- a/test/battle/hold_effect/mirror_herb.c +++ b/test/battle/hold_effect/mirror_herb.c @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Mirror Herb copies all of foe's positive stat changes in a t PARAMETRIZE { item = ITEM_NONE; } PARAMETRIZE { item = ITEM_MIRROR_HERB; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET) { Speed(4); } OPPONENT(SPECIES_WOBBUFFET) { Speed(5); Item(item); } } WHEN { diff --git a/test/battle/hold_effect/ogerpon_mask.c b/test/battle/hold_effect/ogerpon_mask.c index 209b854d6639..919151684a54 100644 --- a/test/battle/hold_effect/ogerpon_mask.c +++ b/test/battle/hold_effect/ogerpon_mask.c @@ -21,7 +21,7 @@ SINGLE_BATTLE_TEST("Ogerpon Masks increase the base power of moves by 20%", s16 PARAMETRIZE { species = SPECIES_OGERPON_CORNERSTONE; item = ITEM_HEARTHFLAME_MASK; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + ASSUME(GetMovePower(MOVE_TACKLE) > 0); PLAYER(species) { Item(item); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/hold_effect/protective_pads.c b/test/battle/hold_effect/protective_pads.c index 95de944b814a..843d2fa003a1 100644 --- a/test/battle/hold_effect/protective_pads.c +++ b/test/battle/hold_effect/protective_pads.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_PROTECTIVE_PADS].holdEffect == HOLD_EFFECT_PROTECTIVE_PADS); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact == TRUE); + ASSUME(MoveMakesContact(MOVE_TACKLE) == TRUE); } SINGLE_BATTLE_TEST("Protective Pads protected moves still make direct contact", s16 damage) diff --git a/test/battle/hold_effect/red_card.c b/test/battle/hold_effect/red_card.c index aa312797b284..7b14d8748de9 100644 --- a/test/battle/hold_effect/red_card.c +++ b/test/battle/hold_effect/red_card.c @@ -383,7 +383,7 @@ SINGLE_BATTLE_TEST("Red Card does not activate if attacker's Sheer Force applied SINGLE_BATTLE_TEST("Red Card is consumed after dragged out replacement has its Speed lowered by Sticky Web") { GIVEN { - ASSUME(gMovesInfo[MOVE_STICKY_WEB].effect == EFFECT_STICKY_WEB); + ASSUME(GetMoveEffect(MOVE_STICKY_WEB) == EFFECT_STICKY_WEB); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT) { Moves(MOVE_TACKLE); } OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } diff --git a/test/battle/hold_effect/restore_hp.c b/test/battle/hold_effect/restore_hp.c index 47f409ff84a7..ef96ead7e4b1 100644 --- a/test/battle/hold_effect/restore_hp.c +++ b/test/battle/hold_effect/restore_hp.c @@ -37,7 +37,7 @@ DOUBLE_BATTLE_TEST("Restore HP Item effects do not miss timing after a recoil mo PARAMETRIZE { item = ITEM_SITRUS_BERRY; } GIVEN { - ASSUME(gMovesInfo[MOVE_TAKE_DOWN].recoil == 25); + ASSUME(GetMoveRecoil(MOVE_TAKE_DOWN) == 25); ASSUME(gItemsInfo[ITEM_ORAN_BERRY].holdEffect == HOLD_EFFECT_RESTORE_HP); ASSUME(gItemsInfo[ITEM_BERRY_JUICE].holdEffect == HOLD_EFFECT_RESTORE_HP); ASSUME(gItemsInfo[ITEM_SITRUS_BERRY].holdEffect == HOLD_EFFECT_RESTORE_PCT_HP); diff --git a/test/battle/hold_effect/restore_stats.c b/test/battle/hold_effect/restore_stats.c index c0f888469cab..192ad2f65e0d 100644 --- a/test/battle/hold_effect/restore_stats.c +++ b/test/battle/hold_effect/restore_stats.c @@ -9,7 +9,7 @@ ASSUMPTIONS SINGLE_BATTLE_TEST("White Herb restores stats when they're lowered") { GIVEN { - ASSUME(gMovesInfo[MOVE_LEER].effect == EFFECT_DEFENSE_DOWN); + ASSUME(GetMoveEffect(MOVE_LEER) == EFFECT_DEFENSE_DOWN); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_WHITE_HERB); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -103,7 +103,7 @@ SINGLE_BATTLE_TEST("White Herb restores stats after all hits of a multi hit move PARAMETRIZE { species = SPECIES_DUGTRIO_ALOLA; ability = ABILITY_TANGLING_HAIR; } GIVEN { - ASSUME(gMovesInfo[MOVE_DUAL_WINGBEAT].strikeCount == 2); + ASSUME(GetMoveStrikeCount(MOVE_DUAL_WINGBEAT) == 2); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_WHITE_HERB); } OPPONENT(species) { Ability(ability); } } WHEN { @@ -133,7 +133,7 @@ SINGLE_BATTLE_TEST("White Herb wont have time to activate if it is knocked off o GIVEN { ASSUME(MoveHasAdditionalEffect(MOVE_THIEF, MOVE_EFFECT_STEAL_ITEM) == TRUE); - ASSUME(gMovesInfo[MOVE_KNOCK_OFF].effect == EFFECT_KNOCK_OFF); + ASSUME(GetMoveEffect(MOVE_KNOCK_OFF) == EFFECT_KNOCK_OFF); PLAYER(SPECIES_SLUGMA) { Ability(ABILITY_WEAK_ARMOR); Item(ITEM_WHITE_HERB); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/hold_effect/room_service.c b/test/battle/hold_effect/room_service.c index 04b6450e0510..e775ca496cf5 100644 --- a/test/battle/hold_effect/room_service.c +++ b/test/battle/hold_effect/room_service.c @@ -9,9 +9,9 @@ ASSUMPTIONS SINGLE_BATTLE_TEST("Room Serive decreases the holder's seep by one stage") { GIVEN { - ASSUME(gMovesInfo[MOVE_U_TURN].effect == EFFECT_HIT_ESCAPE); - ASSUME(gMovesInfo[MOVE_TRICK_ROOM].effect == EFFECT_TRICK_ROOM); - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_U_TURN) == EFFECT_HIT_ESCAPE); + ASSUME(GetMoveEffect(MOVE_TRICK_ROOM) == EFFECT_TRICK_ROOM); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); Item(ITEM_ROOM_SERVICE); } OPPONENT(SPECIES_WYNAUT) { HP(1); } diff --git a/test/battle/hold_effect/rowap_berry.c b/test/battle/hold_effect/rowap_berry.c index 5dc85492c31a..2ad8b9d3009e 100644 --- a/test/battle/hold_effect/rowap_berry.c +++ b/test/battle/hold_effect/rowap_berry.c @@ -15,8 +15,8 @@ SINGLE_BATTLE_TEST("Rowap Berry causes the attacker to lose 1/8 of its max HP if PARAMETRIZE { move = MOVE_TACKLE; } GIVEN { - ASSUME(gMovesInfo[MOVE_SWIFT].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_SWIFT) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_ROWAP_BERRY); } } WHEN { @@ -43,7 +43,7 @@ SINGLE_BATTLE_TEST("Rowap Berry causes the attacker to lose 1/8 of its max HP if SINGLE_BATTLE_TEST("Rowap Berry is not triggered by a physical move") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_ROWAP_BERRY); } } WHEN { diff --git a/test/battle/hold_effect/safety_goggles.c b/test/battle/hold_effect/safety_goggles.c index ec66ad8bcddb..e2d329bcf603 100644 --- a/test/battle/hold_effect/safety_goggles.c +++ b/test/battle/hold_effect/safety_goggles.c @@ -9,7 +9,7 @@ ASSUMPTIONS SINGLE_BATTLE_TEST("Safety Goggles block powder and spore moves") { GIVEN { - ASSUME(gMovesInfo[MOVE_STUN_SPORE].powderMove); + ASSUME(IsPowderMove(MOVE_STUN_SPORE)); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_ABRA) { Item(ITEM_SAFETY_GOGGLES); } } WHEN { diff --git a/test/battle/hold_effect/special_attack_up.c b/test/battle/hold_effect/special_attack_up.c index 9ae73340bf86..0199bab83cc1 100644 --- a/test/battle/hold_effect/special_attack_up.c +++ b/test/battle/hold_effect/special_attack_up.c @@ -4,8 +4,8 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_PETAYA_BERRY].holdEffect == HOLD_EFFECT_SP_ATTACK_UP); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].argument.fixedDamage == 40); + ASSUME(GetMoveEffect(MOVE_DRAGON_RAGE) == EFFECT_FIXED_DAMAGE_ARG); + ASSUME(GetMoveFixedDamage(MOVE_DRAGON_RAGE) == 40); } SINGLE_BATTLE_TEST("Petaya Berry raises the holder's Sp. Atk by one stage when HP drops to 1/4 or below") diff --git a/test/battle/hold_effect/special_defense_up.c b/test/battle/hold_effect/special_defense_up.c index c96f1680b269..e075d05c49bd 100644 --- a/test/battle/hold_effect/special_defense_up.c +++ b/test/battle/hold_effect/special_defense_up.c @@ -4,8 +4,8 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_APICOT_BERRY].holdEffect == HOLD_EFFECT_SP_DEFENSE_UP); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].argument.fixedDamage == 40); + ASSUME(GetMoveEffect(MOVE_DRAGON_RAGE) == EFFECT_FIXED_DAMAGE_ARG); + ASSUME(GetMoveFixedDamage(MOVE_DRAGON_RAGE) == 40); } SINGLE_BATTLE_TEST("Apicot Berry raises the holder's Sp. Def by one stage when HP drops to 1/4 or below") diff --git a/test/battle/hold_effect/speed_up.c b/test/battle/hold_effect/speed_up.c index a0e727fd4472..f31ee7e92409 100644 --- a/test/battle/hold_effect/speed_up.c +++ b/test/battle/hold_effect/speed_up.c @@ -4,8 +4,8 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_SALAC_BERRY].holdEffect == HOLD_EFFECT_SPEED_UP); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].argument.fixedDamage == 40); + ASSUME(GetMoveEffect(MOVE_DRAGON_RAGE) == EFFECT_FIXED_DAMAGE_ARG); + ASSUME(GetMoveFixedDamage(MOVE_DRAGON_RAGE) == 40); } SINGLE_BATTLE_TEST("Salac Berry raises the holder's Speed by one stage when HP drops to 1/4 or below") diff --git a/test/battle/hold_effect/utility_umbrella.c b/test/battle/hold_effect/utility_umbrella.c index f04a77378990..67a3be4c7a15 100644 --- a/test/battle/hold_effect/utility_umbrella.c +++ b/test/battle/hold_effect/utility_umbrella.c @@ -5,8 +5,8 @@ ASSUMPTIONS { ASSUME(gItemsInfo[ITEM_UTILITY_UMBRELLA].holdEffect == HOLD_EFFECT_UTILITY_UMBRELLA); - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); - ASSUME(gMovesInfo[MOVE_WATER_GUN].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_WATER_GUN) == TYPE_WATER); } SINGLE_BATTLE_TEST("Utility Umbrella blocks Sun damage modifiers", s16 damage) diff --git a/test/battle/item_effect/escape.c b/test/battle/item_effect/escape.c index bffa6e429261..dd27c425c244 100644 --- a/test/battle/item_effect/escape.c +++ b/test/battle/item_effect/escape.c @@ -21,7 +21,7 @@ WILD_BATTLE_TEST("Poke Toy lets the player escape from a wild battle") WILD_BATTLE_TEST("Poke Toy lets the player escape from a wild battle even if a move forbid them to") { GIVEN { - ASSUME(gMovesInfo[MOVE_MEAN_LOOK].effect == EFFECT_MEAN_LOOK); + ASSUME(GetMoveEffect(MOVE_MEAN_LOOK) == EFFECT_MEAN_LOOK); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/item_effect/increase_stat.c b/test/battle/item_effect/increase_stat.c index 9b3ced5759c6..2b9486e3a61a 100644 --- a/test/battle/item_effect/increase_stat.c +++ b/test/battle/item_effect/increase_stat.c @@ -8,7 +8,7 @@ SINGLE_BATTLE_TEST("X Attack sharply raises battler's Attack stat", s16 damage) PARAMETRIZE { useItem = TRUE; } GIVEN { ASSUME(gItemsInfo[ITEM_X_ATTACK].battleUsage == EFFECT_ITEM_INCREASE_STAT); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -32,7 +32,7 @@ SINGLE_BATTLE_TEST("X Defense sharply raises battler's Defense stat", s16 damage PARAMETRIZE { useItem = TRUE; } GIVEN { ASSUME(gItemsInfo[ITEM_X_DEFENSE].battleUsage == EFFECT_ITEM_INCREASE_STAT); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -56,7 +56,7 @@ SINGLE_BATTLE_TEST("X Sp. Atk sharply raises battler's Sp. Attack stat", s16 dam PARAMETRIZE { useItem = TRUE; } GIVEN { ASSUME(gItemsInfo[ITEM_X_SP_ATK].battleUsage == EFFECT_ITEM_INCREASE_STAT); - ASSUME(gMovesInfo[MOVE_DISARMING_VOICE].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_DISARMING_VOICE) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -80,7 +80,7 @@ SINGLE_BATTLE_TEST("X Sp. Def sharply raises battler's Sp. Defense stat", s16 da PARAMETRIZE { useItem = TRUE; } GIVEN { ASSUME(gItemsInfo[ITEM_X_SP_DEF].battleUsage == EFFECT_ITEM_INCREASE_STAT); - ASSUME(gMovesInfo[MOVE_DISARMING_VOICE].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_DISARMING_VOICE) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -134,11 +134,11 @@ SINGLE_BATTLE_TEST("X Speed sharply raises battler's Speed stat", s16 damage) SINGLE_BATTLE_TEST("X Accuracy sharply raises battler's Accuracy stat") { - ASSUME(gMovesInfo[MOVE_SING].accuracy == 55); + ASSUME(GetMoveAccuracy(MOVE_SING) == 55); if (B_X_ITEMS_BUFF >= GEN_7) - PASSES_RANDOMLY(gMovesInfo[MOVE_SING].accuracy * 5 / 3, 100, RNG_ACCURACY); + PASSES_RANDOMLY(GetMoveAccuracy(MOVE_SING) * 5 / 3, 100, RNG_ACCURACY); else - PASSES_RANDOMLY(gMovesInfo[MOVE_SING].accuracy * 4 / 3, 100, RNG_ACCURACY); + PASSES_RANDOMLY(GetMoveAccuracy(MOVE_SING) * 4 / 3, 100, RNG_ACCURACY); GIVEN { ASSUME(gItemsInfo[ITEM_X_ACCURACY].battleUsage == EFFECT_ITEM_INCREASE_STAT); PLAYER(SPECIES_WOBBUFFET); diff --git a/test/battle/move.c b/test/battle/move.c index 9ee37391ec72..ff397575b5e2 100644 --- a/test/battle/move.c +++ b/test/battle/move.c @@ -9,8 +9,8 @@ SINGLE_BATTLE_TEST("Accuracy controls the proportion of misses") PARAMETRIZE { move = MOVE_HYDRO_PUMP; } PARAMETRIZE { move = MOVE_RAZOR_LEAF; } PARAMETRIZE { move = MOVE_SCRATCH; } - ASSUME(0 < gMovesInfo[move].accuracy && gMovesInfo[move].accuracy <= 100); - PASSES_RANDOMLY(gMovesInfo[move].accuracy, 100, RNG_ACCURACY); + ASSUME(0 < GetMoveAccuracy(move) && GetMoveAccuracy(move) <= 100); + PASSES_RANDOMLY(GetMoveAccuracy(move), 100, RNG_ACCURACY); GIVEN { PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -42,7 +42,7 @@ SINGLE_BATTLE_TEST("AdditionalEffect.chance controls the proportion of secondary SINGLE_BATTLE_TEST("Turn order is determined by priority") { GIVEN { - ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority > gMovesInfo[MOVE_TACKLE].priority); + ASSUME(GetMovePriority(MOVE_QUICK_ATTACK) > GetMovePriority(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -86,10 +86,10 @@ DOUBLE_BATTLE_TEST("Turn order is determined randomly if priority and Speed tie PASSES_RANDOMLY(24, 24, RNG_SPEED_TIE); GIVEN { - ASSUME(gMovesInfo[MOVE_ENDEAVOR].effect == EFFECT_ENDEAVOR); - ASSUME(gMovesInfo[MOVE_LIFE_DEW].effect == EFFECT_JUNGLE_HEALING); - ASSUME(gMovesInfo[MOVE_CRUSH_GRIP].effect == EFFECT_POWER_BASED_ON_TARGET_HP); - ASSUME(gMovesInfo[MOVE_SUPER_FANG].effect == EFFECT_SUPER_FANG); + ASSUME(GetMoveEffect(MOVE_ENDEAVOR) == EFFECT_ENDEAVOR); + ASSUME(GetMoveEffect(MOVE_LIFE_DEW) == EFFECT_JUNGLE_HEALING); + ASSUME(GetMoveEffect(MOVE_CRUSH_GRIP) == EFFECT_POWER_BASED_ON_TARGET_HP); + ASSUME(GetMoveEffect(MOVE_SUPER_FANG) == EFFECT_SUPER_FANG); PLAYER(SPECIES_WOBBUFFET) { MaxHP(480); HP(360); Defense(100); Speed(1); } PLAYER(SPECIES_WYNAUT) { Speed(1); } OPPONENT(SPECIES_WOBBUFFET) { Attack(100); Speed(1); } @@ -153,7 +153,7 @@ SINGLE_BATTLE_TEST("Slash's critical hits occur at a 1/8 rate") PASSES_RANDOMLY(1, 8, RNG_CRITICAL_HIT); GIVEN { ASSUME(B_CRIT_CHANCE >= GEN_7); - ASSUME(gMovesInfo[MOVE_SLASH].criticalHitStage == 1); + ASSUME(GetMoveCriticalHitStage(MOVE_SLASH) == 1); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -188,7 +188,7 @@ SINGLE_BATTLE_TEST("Critical hits do not ignore positive stat stages", s16 damag PARAMETRIZE { move = MOVE_HOWL; } PARAMETRIZE { move = MOVE_TAIL_WHIP; } GIVEN { - ASSUME(gMovesInfo[MOVE_SCRATCH].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_SCRATCH) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -209,7 +209,7 @@ SINGLE_BATTLE_TEST("Critical hits ignore negative stat stages", s16 damage) PARAMETRIZE { move = MOVE_HARDEN; } PARAMETRIZE { move = MOVE_GROWL; } GIVEN { - ASSUME(gMovesInfo[MOVE_SCRATCH].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_SCRATCH) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -255,7 +255,7 @@ DOUBLE_BATTLE_TEST("Moves do not fail if an alive partner is the target") DOUBLE_BATTLE_TEST("Moves fail if they target into a pokemon that was fainted by the previous move") { GIVEN { - ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_HYPER_VOICE) == MOVE_TARGET_BOTH); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET) { HP(1); } OPPONENT(SPECIES_WOBBUFFET) { HP(1); } @@ -278,7 +278,7 @@ DOUBLE_BATTLE_TEST("Moves fail if they target into a pokemon that was fainted by DOUBLE_BATTLE_TEST("Moves that target the field are not going to fail if one mon fainted by the previous move") { GIVEN { - ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_SURF) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET) { HP(1); } OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/absorb.c b/test/battle/move_effect/absorb.c index f2497e0309f7..456c888cd483 100644 --- a/test/battle/move_effect/absorb.c +++ b/test/battle/move_effect/absorb.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ABSORB].effect == EFFECT_ABSORB); + ASSUME(GetMoveEffect(MOVE_ABSORB) == EFFECT_ABSORB); } SINGLE_BATTLE_TEST("Absorb recovers 50% of the damage dealt") @@ -50,7 +50,7 @@ DOUBLE_BATTLE_TEST("Matcha Gatcha recovers 50% of the damage dealt from both tar s16 healedRight; GIVEN { - ASSUME(gMovesInfo[MOVE_MATCHA_GOTCHA].effect == EFFECT_ABSORB); + ASSUME(GetMoveEffect(MOVE_MATCHA_GOTCHA) == EFFECT_ABSORB); PLAYER(SPECIES_PIKACHU) { HP(1); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_STARYU); diff --git a/test/battle/move_effect/accuracy_down.c b/test/battle/move_effect/accuracy_down.c index f174a7f9463e..c11001928fa5 100644 --- a/test/battle/move_effect/accuracy_down.c +++ b/test/battle/move_effect/accuracy_down.c @@ -3,14 +3,14 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SAND_ATTACK].effect == EFFECT_ACCURACY_DOWN); + ASSUME(GetMoveEffect(MOVE_SAND_ATTACK) == EFFECT_ACCURACY_DOWN); } SINGLE_BATTLE_TEST("Sand Attack lowers Accuracy by 1 stage") { - PASSES_RANDOMLY(gMovesInfo[MOVE_SCRATCH].accuracy * 3 / 4, 100, RNG_ACCURACY); + PASSES_RANDOMLY(GetMoveAccuracy(MOVE_SCRATCH) * 3 / 4, 100, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_SCRATCH].accuracy == 100); + ASSUME(GetMoveAccuracy(MOVE_SCRATCH) == 100); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/acrobatics.c b/test/battle/move_effect/acrobatics.c index 70953d0958d9..809b77f9487c 100644 --- a/test/battle/move_effect/acrobatics.c +++ b/test/battle/move_effect/acrobatics.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ACROBATICS].effect == EFFECT_ACROBATICS); - ASSUME(gMovesInfo[MOVE_ACROBATICS].type == TYPE_FLYING); + ASSUME(GetMoveEffect(MOVE_ACROBATICS) == EFFECT_ACROBATICS); + ASSUME(GetMoveType(MOVE_ACROBATICS) == TYPE_FLYING); } SINGLE_BATTLE_TEST("Acrobatics doubles in power if the user has no held item", s16 damage) diff --git a/test/battle/move_effect/after_you.c b/test/battle/move_effect/after_you.c index c1202f0f9cdd..42eb0f3ff9a1 100644 --- a/test/battle/move_effect/after_you.c +++ b/test/battle/move_effect/after_you.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_AFTER_YOU].effect == EFFECT_AFTER_YOU); + ASSUME(GetMoveEffect(MOVE_AFTER_YOU) == EFFECT_AFTER_YOU); } DOUBLE_BATTLE_TEST("After You makes the target move after user") @@ -112,7 +112,7 @@ DOUBLE_BATTLE_TEST("After You doesn't fail if the turn order remains the same af DOUBLE_BATTLE_TEST("After You ignores the effects of Quash") { GIVEN { - ASSUME(gMovesInfo[MOVE_QUASH].effect == EFFECT_QUASH); + ASSUME(GetMoveEffect(MOVE_QUASH) == EFFECT_QUASH); PLAYER(SPECIES_WOBBUFFET) { Speed(4); } PLAYER(SPECIES_WYNAUT) { Speed(1); } OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } diff --git a/test/battle/move_effect/ally_switch.c b/test/battle/move_effect/ally_switch.c index ec60dc584d9a..7222f3458772 100644 --- a/test/battle/move_effect/ally_switch.c +++ b/test/battle/move_effect/ally_switch.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ALLY_SWITCH].effect == EFFECT_ALLY_SWITCH); + ASSUME(GetMoveEffect(MOVE_ALLY_SWITCH) == EFFECT_ALLY_SWITCH); } SINGLE_BATTLE_TEST("Ally Switch fails in a single battle") @@ -41,8 +41,8 @@ DOUBLE_BATTLE_TEST("Ally Switch fails if there is no partner") DOUBLE_BATTLE_TEST("Ally Switch changes the position of battlers") { GIVEN { - ASSUME(gMovesInfo[MOVE_SCREECH].effect == EFFECT_DEFENSE_DOWN_2); - ASSUME(gMovesInfo[MOVE_SCREECH].target == MOVE_TARGET_SELECTED); + ASSUME(GetMoveEffect(MOVE_SCREECH) == EFFECT_DEFENSE_DOWN_2); + ASSUME(GetMoveTarget(MOVE_SCREECH) == MOVE_TARGET_SELECTED); PLAYER(SPECIES_WOBBUFFET) { Speed(5); } // Wobb is playerLeft, but it'll be Wynaut after Ally Switch PLAYER(SPECIES_WYNAUT) { Speed(4); } OPPONENT(SPECIES_KADABRA) { Speed(3); } @@ -72,7 +72,7 @@ DOUBLE_BATTLE_TEST("Ally Switch changes the position of battlers") DOUBLE_BATTLE_TEST("Ally Switch does not redirect the target of Snipe Shot") { GIVEN { - ASSUME(gMovesInfo[MOVE_SNIPE_SHOT].effect == EFFECT_SNIPE_SHOT); + ASSUME(GetMoveEffect(MOVE_SNIPE_SHOT) == EFFECT_SNIPE_SHOT); PLAYER(SPECIES_WOBBUFFET); // Wobb is playerLeft, but it'll be Wynaut after Ally Switch PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_KADABRA); @@ -207,7 +207,7 @@ DOUBLE_BATTLE_TEST("Ally switch swaps sky drop targets if being used by partner" { u8 visibility; GIVEN { - ASSUME(gMovesInfo[MOVE_SKY_DROP].effect == EFFECT_SKY_DROP); + ASSUME(GetMoveEffect(MOVE_SKY_DROP) == EFFECT_SKY_DROP); PLAYER(SPECIES_FEAROW) { Speed(100); } PLAYER(SPECIES_XATU) { Speed(150); } OPPONENT(SPECIES_ARON) { Speed(25); Ability(ABILITY_STURDY); } @@ -244,7 +244,7 @@ DOUBLE_BATTLE_TEST("Ally switch swaps opposing sky drop targets if partner is be { u8 visibility; GIVEN { - ASSUME(gMovesInfo[MOVE_SKY_DROP].effect == EFFECT_SKY_DROP); + ASSUME(GetMoveEffect(MOVE_SKY_DROP) == EFFECT_SKY_DROP); PLAYER(SPECIES_ARON) { Speed(25); Ability(ABILITY_STURDY); } PLAYER(SPECIES_WYNAUT) { Speed(30); } OPPONENT(SPECIES_FEAROW) { Speed(100); } @@ -283,7 +283,7 @@ DOUBLE_BATTLE_TEST("Ally Switch swaps Illusion data") { KNOWN_FAILING; // Test passes in isolation but fails on CI GIVEN { - ASSUME(gMovesInfo[MOVE_ALLY_SWITCH].effect == EFFECT_ALLY_SWITCH); + ASSUME(GetMoveEffect(MOVE_ALLY_SWITCH) == EFFECT_ALLY_SWITCH); PLAYER(SPECIES_HOOPA); PLAYER(SPECIES_ZOROARK); PLAYER(SPECIES_MAMOSWINE); // the third member here is required for zoroark diff --git a/test/battle/move_effect/assist.c b/test/battle/move_effect/assist.c index 0c9a0b612876..6036de8e8c9c 100644 --- a/test/battle/move_effect/assist.c +++ b/test/battle/move_effect/assist.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ASSIST].effect == EFFECT_ASSIST); + ASSUME(GetMoveEffect(MOVE_ASSIST) == EFFECT_ASSIST); } TO_DO_BATTLE_TEST("Assist randomly calls a move from any party member"); diff --git a/test/battle/move_effect/attack_accuracy_up.c b/test/battle/move_effect/attack_accuracy_up.c index 102f4d4d213b..25b09ab1c069 100644 --- a/test/battle/move_effect/attack_accuracy_up.c +++ b/test/battle/move_effect/attack_accuracy_up.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Hone Claws increases Attack and Accuracy by one stage each") { GIVEN { - ASSUME(gMovesInfo[MOVE_HONE_CLAWS].effect == EFFECT_ATTACK_ACCURACY_UP); + ASSUME(GetMoveEffect(MOVE_HONE_CLAWS) == EFFECT_ATTACK_ACCURACY_UP); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/attack_down.c b/test/battle/move_effect/attack_down.c index e88ef43c26fb..eb562c0c6ac3 100644 --- a/test/battle/move_effect/attack_down.c +++ b/test/battle/move_effect/attack_down.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_GROWL) == EFFECT_ATTACK_DOWN); } SINGLE_BATTLE_TEST("Growl lowers Attack by 1 stage", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Growl lowers Attack by 1 stage", s16 damage) PARAMETRIZE { lowerAttack = FALSE; } PARAMETRIZE { lowerAttack = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/attack_down_2.c b/test/battle/move_effect/attack_down_2.c index 6fefec5e45a0..896bbf947c1f 100644 --- a/test/battle/move_effect/attack_down_2.c +++ b/test/battle/move_effect/attack_down_2.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_CHARM].effect == EFFECT_ATTACK_DOWN_2); + ASSUME(GetMoveEffect(MOVE_CHARM) == EFFECT_ATTACK_DOWN_2); } SINGLE_BATTLE_TEST("Charm lowers Attack by 2 stages", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Charm lowers Attack by 2 stages", s16 damage) PARAMETRIZE { lowerAttack = FALSE; } PARAMETRIZE { lowerAttack = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/attack_spatk_up.c b/test/battle/move_effect/attack_spatk_up.c index b5aa2418a28c..671ed667a6e6 100644 --- a/test/battle/move_effect/attack_spatk_up.c +++ b/test/battle/move_effect/attack_spatk_up.c @@ -4,7 +4,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_WORK_UP].effect == EFFECT_ATTACK_SPATK_UP); + ASSUME(GetMoveEffect(MOVE_WORK_UP) == EFFECT_ATTACK_SPATK_UP); } SINGLE_BATTLE_TEST("Work Up raises Attack and Sp. Attack by 1 stage each", s16 damage) @@ -16,8 +16,8 @@ SINGLE_BATTLE_TEST("Work Up raises Attack and Sp. Attack by 1 stage each", s16 d PARAMETRIZE { raiseStats = FALSE; move = MOVE_SWIFT; } PARAMETRIZE { raiseStats = TRUE; move = MOVE_SWIFT; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_SWIFT].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_SWIFT) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/attack_up.c b/test/battle/move_effect/attack_up.c index da878fb60d49..1865c7f30e89 100644 --- a/test/battle/move_effect/attack_up.c +++ b/test/battle/move_effect/attack_up.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_MEDITATE].effect == EFFECT_ATTACK_UP); + ASSUME(GetMoveEffect(MOVE_MEDITATE) == EFFECT_ATTACK_UP); } SINGLE_BATTLE_TEST("Meditate raises Attack by 1 stage", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Meditate raises Attack by 1 stage", s16 damage) PARAMETRIZE { raiseAttack = FALSE; } PARAMETRIZE { raiseAttack = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/attack_up_2.c b/test/battle/move_effect/attack_up_2.c index 1f44efe9e3ff..fd247fad0106 100644 --- a/test/battle/move_effect/attack_up_2.c +++ b/test/battle/move_effect/attack_up_2.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SWORDS_DANCE].effect == EFFECT_ATTACK_UP_2); + ASSUME(GetMoveEffect(MOVE_SWORDS_DANCE) == EFFECT_ATTACK_UP_2); } SINGLE_BATTLE_TEST("Swords Dance raises Attack by 2 stages", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Swords Dance raises Attack by 2 stages", s16 damage) PARAMETRIZE { raiseAttack = FALSE; } PARAMETRIZE { raiseAttack = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/attack_up_user_ally.c b/test/battle/move_effect/attack_up_user_ally.c index 1d623c2bbd3c..8f9c4a338811 100644 --- a/test/battle/move_effect/attack_up_user_ally.c +++ b/test/battle/move_effect/attack_up_user_ally.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_HOWL].effect == EFFECT_ATTACK_UP_USER_ALLY); + ASSUME(GetMoveEffect(MOVE_HOWL) == EFFECT_ATTACK_UP_USER_ALLY); } SINGLE_BATTLE_TEST("Howl raises user's Attack by 1 stage", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Howl raises user's Attack by 1 stage", s16 damage) PARAMETRIZE { raiseAttack = FALSE; } PARAMETRIZE { raiseAttack = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -37,7 +37,7 @@ DOUBLE_BATTLE_TEST("Howl raises user's and partner's Attack by 1 stage", s16 dam PARAMETRIZE { raiseAttack = FALSE; } PARAMETRIZE { raiseAttack = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET) { Speed(15); } PLAYER(SPECIES_WYNAUT) { Speed(10); } OPPONENT(SPECIES_WOBBUFFET) { Speed(13); } @@ -69,7 +69,7 @@ DOUBLE_BATTLE_TEST("Howl does not work on partner if it has Soundproof") s16 damage[2]; GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET) { Speed(15); } PLAYER(SPECIES_VOLTORB) { Speed(10); Ability(ABILITY_SOUNDPROOF); } OPPONENT(SPECIES_WOBBUFFET) { Speed(5); } diff --git a/test/battle/move_effect/aura_wheel.c b/test/battle/move_effect/aura_wheel.c index 3d601f3583a7..dfd31c878f00 100644 --- a/test/battle/move_effect/aura_wheel.c +++ b/test/battle/move_effect/aura_wheel.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(MoveHasAdditionalEffectSelf(MOVE_AURA_WHEEL, MOVE_EFFECT_SPD_PLUS_1) == TRUE); - ASSUME(gMovesInfo[MOVE_AURA_WHEEL].effect == EFFECT_AURA_WHEEL); + ASSUME(GetMoveEffect(MOVE_AURA_WHEEL) == EFFECT_AURA_WHEEL); } SINGLE_BATTLE_TEST("Aura Wheel raises Speed; fails if the user is not Morpeko") diff --git a/test/battle/move_effect/aurora_veil.c b/test/battle/move_effect/aurora_veil.c index f681e965d7ec..b57c85df0626 100644 --- a/test/battle/move_effect/aurora_veil.c +++ b/test/battle/move_effect/aurora_veil.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_AURORA_VEIL].effect == EFFECT_AURORA_VEIL); + ASSUME(GetMoveEffect(MOVE_AURORA_VEIL) == EFFECT_AURORA_VEIL); } SINGLE_BATTLE_TEST("Aurora Veil can only be used in Hail and Snow") diff --git a/test/battle/move_effect/baton_pass.c b/test/battle/move_effect/baton_pass.c index 57f678470a5c..cb6530ae898f 100644 --- a/test/battle/move_effect/baton_pass.c +++ b/test/battle/move_effect/baton_pass.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_BATON_PASS].effect == EFFECT_BATON_PASS); + ASSUME(GetMoveEffect(MOVE_BATON_PASS) == EFFECT_BATON_PASS); } // This softlocked the game before. diff --git a/test/battle/move_effect/beak_blast.c b/test/battle/move_effect/beak_blast.c index e716b7717fe0..4e7e51dc5dec 100644 --- a/test/battle/move_effect/beak_blast.c +++ b/test/battle/move_effect/beak_blast.c @@ -3,13 +3,13 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_BEAK_BLAST].effect == EFFECT_BEAK_BLAST); + ASSUME(GetMoveEffect(MOVE_BEAK_BLAST) == EFFECT_BEAK_BLAST); } DOUBLE_BATTLE_TEST("Beak Blast's charging message is shown before other moves are used") { GIVEN { - ASSUME(gMovesInfo[MOVE_BEAK_BLAST].priority < 0); + ASSUME(GetMovePriority(MOVE_BEAK_BLAST) < 0); PLAYER(SPECIES_WYNAUT) { Speed(10); } PLAYER(SPECIES_WOBBUFFET) { Speed(5); } OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } @@ -36,8 +36,8 @@ DOUBLE_BATTLE_TEST("Beak Blast's charging message is shown before other moves ar DOUBLE_BATTLE_TEST("Beak Blast burns all who make contact with the pokemon") { GIVEN { - ASSUME(gMovesInfo[MOVE_BEAK_BLAST].priority < 0); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(GetMovePriority(MOVE_BEAK_BLAST) < 0); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_WYNAUT) { Speed(10); } PLAYER(SPECIES_WOBBUFFET) { Speed(5); } OPPONENT(SPECIES_WOBBUFFET) { Speed(3); } @@ -80,9 +80,9 @@ SINGLE_BATTLE_TEST("Beak Blast burns only when contact moves are used") PARAMETRIZE { move = MOVE_LEER; burn = FALSE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(!gMovesInfo[MOVE_WATER_GUN].makesContact); - ASSUME(!gMovesInfo[MOVE_LEER].makesContact); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(!MoveMakesContact(MOVE_WATER_GUN)); + ASSUME(!MoveMakesContact(MOVE_LEER)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/belch.c b/test/battle/move_effect/belch.c index f8e28929f963..1abcefb353c3 100644 --- a/test/battle/move_effect/belch.c +++ b/test/battle/move_effect/belch.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_BELCH].effect == EFFECT_BELCH); - ASSUME(gMovesInfo[MOVE_MUD_SHOT].type == TYPE_GROUND); + ASSUME(GetMoveEffect(MOVE_BELCH) == EFFECT_BELCH); + ASSUME(GetMoveType(MOVE_MUD_SHOT) == TYPE_GROUND); ASSUME(gItemsInfo[ITEM_SHUCA_BERRY].holdEffect == HOLD_EFFECT_RESIST_BERRY); ASSUME(gItemsInfo[ITEM_SHUCA_BERRY].holdEffectParam == TYPE_GROUND); ASSUME(gItemsInfo[ITEM_SHUCA_BERRY].pocket == POCKET_BERRIES); @@ -56,7 +56,7 @@ SINGLE_BATTLE_TEST("Belch cannot be used if the user has not eaten a berry") SINGLE_BATTLE_TEST("Belch can still be used after switching out") { GIVEN { - ASSUME(gMovesInfo[MOVE_STUFF_CHEEKS].effect == EFFECT_STUFF_CHEEKS); + ASSUME(GetMoveEffect(MOVE_STUFF_CHEEKS) == EFFECT_STUFF_CHEEKS); PLAYER(SPECIES_GREEDENT) { Item(ITEM_ORAN_BERRY); } PLAYER(SPECIES_SKWOVET); OPPONENT(SPECIES_WOBBUFFET); @@ -76,9 +76,9 @@ SINGLE_BATTLE_TEST("Belch can still be used after switching out") SINGLE_BATTLE_TEST("Belch can still be used after fainting") { GIVEN { - ASSUME(gMovesInfo[MOVE_STUFF_CHEEKS].effect == EFFECT_STUFF_CHEEKS); - ASSUME(gMovesInfo[MOVE_FISSURE].effect == EFFECT_OHKO); - ASSUME(gMovesInfo[MOVE_REVIVAL_BLESSING].effect == EFFECT_REVIVAL_BLESSING); + ASSUME(GetMoveEffect(MOVE_STUFF_CHEEKS) == EFFECT_STUFF_CHEEKS); + ASSUME(GetMoveEffect(MOVE_FISSURE) == EFFECT_OHKO); + ASSUME(GetMoveEffect(MOVE_REVIVAL_BLESSING) == EFFECT_REVIVAL_BLESSING); PLAYER(SPECIES_GREEDENT) { Item(ITEM_ORAN_BERRY); } PLAYER(SPECIES_SKWOVET); OPPONENT(SPECIES_WOBBUFFET); @@ -99,8 +99,8 @@ SINGLE_BATTLE_TEST("Belch can still be used after fainting") SINGLE_BATTLE_TEST("Belch can still be used after restoring the consumed berry") { GIVEN { - ASSUME(gMovesInfo[MOVE_STUFF_CHEEKS].effect == EFFECT_STUFF_CHEEKS); - ASSUME(gMovesInfo[MOVE_RECYCLE].effect == EFFECT_RECYCLE); + ASSUME(GetMoveEffect(MOVE_STUFF_CHEEKS) == EFFECT_STUFF_CHEEKS); + ASSUME(GetMoveEffect(MOVE_RECYCLE) == EFFECT_RECYCLE); PLAYER(SPECIES_GREEDENT) { Item(ITEM_ORAN_BERRY); } PLAYER(SPECIES_SKWOVET); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/belly_drum.c b/test/battle/move_effect/belly_drum.c index bfc558a982db..e36689ac344e 100644 --- a/test/battle/move_effect/belly_drum.c +++ b/test/battle/move_effect/belly_drum.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_BELLY_DRUM].effect == EFFECT_BELLY_DRUM); + ASSUME(GetMoveEffect(MOVE_BELLY_DRUM) == EFFECT_BELLY_DRUM); } SINGLE_BATTLE_TEST("Belly Drum cuts the user's HP in half") @@ -25,7 +25,7 @@ SINGLE_BATTLE_TEST("Belly Drum maximizes the user's Attack stat", s16 damage) PARAMETRIZE { raiseAttack = FALSE; } PARAMETRIZE { raiseAttack = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -64,7 +64,7 @@ SINGLE_BATTLE_TEST("Belly Drum fails if user's current HP is half or less than h SINGLE_BATTLE_TEST("Belly Drum fails if the user's Attack is already at +6") { GIVEN { - ASSUME(gMovesInfo[MOVE_SWORDS_DANCE].effect == EFFECT_ATTACK_UP_2); + ASSUME(GetMoveEffect(MOVE_SWORDS_DANCE) == EFFECT_ATTACK_UP_2); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -111,7 +111,7 @@ SINGLE_BATTLE_TEST("Belly Drum minimizes the user's Attack stat with Contrary", PARAMETRIZE { raiseAttack = FALSE; } PARAMETRIZE { raiseAttack = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_CONTRARY); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/bide.c b/test/battle/move_effect/bide.c index f99829d57c92..177b139d088e 100644 --- a/test/battle/move_effect/bide.c +++ b/test/battle/move_effect/bide.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_BIDE].effect == EFFECT_BIDE); + ASSUME(GetMoveEffect(MOVE_BIDE) == EFFECT_BIDE); } SINGLE_BATTLE_TEST("Bide deals twice the taken damage over two turns") diff --git a/test/battle/move_effect/body_press.c b/test/battle/move_effect/body_press.c index 3a61c4d55dfc..d3aafa2d32b7 100644 --- a/test/battle/move_effect/body_press.c +++ b/test/battle/move_effect/body_press.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_BODY_PRESS].effect == EFFECT_BODY_PRESS); - ASSUME(gMovesInfo[MOVE_BODY_PRESS].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveEffect(MOVE_BODY_PRESS) == EFFECT_BODY_PRESS); + ASSUME(GetMoveCategory(MOVE_BODY_PRESS) == DAMAGE_CATEGORY_PHYSICAL); } SINGLE_BATTLE_TEST("Body Press uses physical defense stat of target", s16 damage) @@ -15,8 +15,8 @@ SINGLE_BATTLE_TEST("Body Press uses physical defense stat of target", s16 damage PARAMETRIZE { move = MOVE_BODY_PRESS; } GIVEN { - ASSUME(gMovesInfo[MOVE_DRILL_PECK].power == gMovesInfo[MOVE_BODY_PRESS].power); - ASSUME(gMovesInfo[MOVE_CHARM].effect == EFFECT_ATTACK_DOWN_2); + ASSUME(GetMovePower(MOVE_DRILL_PECK) == GetMovePower(MOVE_BODY_PRESS)); + ASSUME(GetMoveEffect(MOVE_CHARM) == EFFECT_ATTACK_DOWN_2); PLAYER(SPECIES_MEW); OPPONENT(SPECIES_SHELLDER); } WHEN { @@ -55,8 +55,8 @@ SINGLE_BATTLE_TEST("Body Press's damage depends on the user's Defense and not At PARAMETRIZE { move = MOVE_SWORDS_DANCE; } PARAMETRIZE { move = MOVE_CELEBRATE; } // Nothing, stats are default GIVEN { - ASSUME(gMovesInfo[MOVE_IRON_DEFENSE].effect == EFFECT_DEFENSE_UP_2); - ASSUME(gMovesInfo[MOVE_SWORDS_DANCE].effect == EFFECT_ATTACK_UP_2); + ASSUME(GetMoveEffect(MOVE_IRON_DEFENSE) == EFFECT_DEFENSE_UP_2); + ASSUME(GetMoveEffect(MOVE_SWORDS_DANCE) == EFFECT_ATTACK_UP_2); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Attack(150); Defense(150); } } WHEN { @@ -79,7 +79,7 @@ SINGLE_BATTLE_TEST("Body Press uses Defense Stat even in Wonder Room", s16 damag PARAMETRIZE { move = MOVE_WONDER_ROOM; } PARAMETRIZE { move = MOVE_CELEBRATE; } GIVEN { - ASSUME(gMovesInfo[MOVE_WONDER_ROOM].effect == EFFECT_WONDER_ROOM); + ASSUME(GetMoveEffect(MOVE_WONDER_ROOM) == EFFECT_WONDER_ROOM); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { SpDefense(50); Defense(150); } } WHEN { @@ -102,8 +102,8 @@ SINGLE_BATTLE_TEST("Body Press uses Special Defense stat Stages in Wonder Room", PARAMETRIZE { move = MOVE_AMNESIA; } PARAMETRIZE { move = MOVE_CELEBRATE; } // Nothing, stats are default GIVEN { - ASSUME(gMovesInfo[MOVE_IRON_DEFENSE].effect == EFFECT_DEFENSE_UP_2); - ASSUME(gMovesInfo[MOVE_AMNESIA].effect == EFFECT_SPECIAL_DEFENSE_UP_2); + ASSUME(GetMoveEffect(MOVE_IRON_DEFENSE) == EFFECT_DEFENSE_UP_2); + ASSUME(GetMoveEffect(MOVE_AMNESIA) == EFFECT_SPECIAL_DEFENSE_UP_2); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { SpDefense(150); Defense(150); } } WHEN { diff --git a/test/battle/move_effect/brick_break.c b/test/battle/move_effect/brick_break.c index 513369b5a1c5..a4aae1e68338 100644 --- a/test/battle/move_effect/brick_break.c +++ b/test/battle/move_effect/brick_break.c @@ -3,11 +3,11 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_BRICK_BREAK].effect == EFFECT_BRICK_BREAK); - ASSUME(gMovesInfo[MOVE_SNOWSCAPE].effect == EFFECT_SNOWSCAPE); - ASSUME(gMovesInfo[MOVE_LIGHT_SCREEN].effect == EFFECT_LIGHT_SCREEN); - ASSUME(gMovesInfo[MOVE_REFLECT].effect == EFFECT_REFLECT); - ASSUME(gMovesInfo[MOVE_AURORA_VEIL].effect == EFFECT_AURORA_VEIL); + ASSUME(GetMoveEffect(MOVE_BRICK_BREAK) == EFFECT_BRICK_BREAK); + ASSUME(GetMoveEffect(MOVE_SNOWSCAPE) == EFFECT_SNOWSCAPE); + ASSUME(GetMoveEffect(MOVE_LIGHT_SCREEN) == EFFECT_LIGHT_SCREEN); + ASSUME(GetMoveEffect(MOVE_REFLECT) == EFFECT_REFLECT); + ASSUME(GetMoveEffect(MOVE_AURORA_VEIL) == EFFECT_AURORA_VEIL); } SINGLE_BATTLE_TEST("Brick Break removes Light Screen, Reflect and Aurora Veil from the target's side of the field") diff --git a/test/battle/move_effect/change_type_on_item.c b/test/battle/move_effect/change_type_on_item.c index 2824438634e3..f5c8f92376c1 100644 --- a/test/battle/move_effect/change_type_on_item.c +++ b/test/battle/move_effect/change_type_on_item.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TECHNO_BLAST].effect == EFFECT_CHANGE_TYPE_ON_ITEM); - ASSUME(gMovesInfo[MOVE_TECHNO_BLAST].argument.holdEffect == HOLD_EFFECT_DRIVE); + ASSUME(GetMoveEffect(MOVE_TECHNO_BLAST) == EFFECT_CHANGE_TYPE_ON_ITEM); + ASSUME(GetMoveEffectArg_HoldEffect(MOVE_TECHNO_BLAST) == HOLD_EFFECT_DRIVE); } SINGLE_BATTLE_TEST("Techno Blast changes type depending on the drive the user holds") diff --git a/test/battle/move_effect/charge.c b/test/battle/move_effect/charge.c index b057fa4753ad..bd84a9b4e2c0 100644 --- a/test/battle/move_effect/charge.c +++ b/test/battle/move_effect/charge.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(!IS_MOVE_STATUS(MOVE_THUNDERBOLT)); - ASSUME(gMovesInfo[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); + ASSUME(!IsBattleMoveStatus(MOVE_THUNDERBOLT)); + ASSUME(GetMoveType(MOVE_THUNDERBOLT) == TYPE_ELECTRIC); } SINGLE_BATTLE_TEST("Charge doubles the damage of the next Electric move of the user") @@ -88,7 +88,7 @@ SINGLE_BATTLE_TEST("Charge's effect does not stack with Electromorphosis or Wind PARAMETRIZE { species = SPECIES_TADBULB; ability = ABILITY_ELECTROMORPHOSIS; } GIVEN { - ASSUME(gMovesInfo[MOVE_AIR_CUTTER].windMove == TRUE); + ASSUME(IsWindMove(MOVE_AIR_CUTTER)); PLAYER(species) { Ability(ability); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -114,8 +114,8 @@ SINGLE_BATTLE_TEST("Charge's effect is removed regardless if the next move is El s16 chargedUpDamage = 0; GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].type != TYPE_ELECTRIC); - ASSUME(!IS_MOVE_STATUS(MOVE_TACKLE)); + ASSUME(GetMoveType(MOVE_TACKLE) != TYPE_ELECTRIC); + ASSUME(!IsBattleMoveStatus(MOVE_TACKLE)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/chilly_reception.c b/test/battle/move_effect/chilly_reception.c index 7e821abe3d7e..9b464f0d03a9 100644 --- a/test/battle/move_effect/chilly_reception.c +++ b/test/battle/move_effect/chilly_reception.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_CHILLY_RECEPTION].effect == EFFECT_CHILLY_RECEPTION); + ASSUME(GetMoveEffect(MOVE_CHILLY_RECEPTION) == EFFECT_CHILLY_RECEPTION); } SINGLE_BATTLE_TEST("Chilly Reception sets up snow and switches the user out") diff --git a/test/battle/move_effect/coaching.c b/test/battle/move_effect/coaching.c index 451ac8049527..0cfc593d3529 100644 --- a/test/battle/move_effect/coaching.c +++ b/test/battle/move_effect/coaching.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_COACHING].effect == EFFECT_COACHING); + ASSUME(GetMoveEffect(MOVE_COACHING) == EFFECT_COACHING); } DOUBLE_BATTLE_TEST("Coaching raises Attack and Defense of ally by 1 stage each") @@ -25,7 +25,7 @@ DOUBLE_BATTLE_TEST("Coaching raises Attack and Defense of ally by 1 stage each") DOUBLE_BATTLE_TEST("Coaching bypasses Protect") { GIVEN { - ASSUME(gMovesInfo[MOVE_PROTECT].effect == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_PROTECT) == EFFECT_PROTECT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); @@ -42,7 +42,7 @@ DOUBLE_BATTLE_TEST("Coaching bypasses Protect") DOUBLE_BATTLE_TEST("Coaching bypasses Crafty Shield") { GIVEN { - ASSUME(gMovesInfo[MOVE_CRAFTY_SHIELD].effect == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_CRAFTY_SHIELD) == EFFECT_PROTECT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); @@ -60,7 +60,7 @@ DOUBLE_BATTLE_TEST("Coaching fails if all allies are is semi-invulnerable") { KNOWN_FAILING; // Coaching succeeds GIVEN { - ASSUME(gMovesInfo[MOVE_FLY].effect == EFFECT_SEMI_INVULNERABLE); + ASSUME(GetMoveEffect(MOVE_FLY) == EFFECT_SEMI_INVULNERABLE); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_HAWLUCHA); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/collision_course.c b/test/battle/move_effect/collision_course.c index 9eeeda5b1e76..9933df0dc72f 100644 --- a/test/battle/move_effect/collision_course.c +++ b/test/battle/move_effect/collision_course.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_COLLISION_COURSE].effect == EFFECT_COLLISION_COURSE); + ASSUME(GetMoveEffect(MOVE_COLLISION_COURSE) == EFFECT_COLLISION_COURSE); } SINGLE_BATTLE_TEST("Collision Course damage is increased by 33 Percent if super effective", s16 damage) diff --git a/test/battle/move_effect/confuse.c b/test/battle/move_effect/confuse.c index 05338219724b..425adfc889ba 100644 --- a/test/battle/move_effect/confuse.c +++ b/test/battle/move_effect/confuse.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TEETER_DANCE].effect == EFFECT_CONFUSE); + ASSUME(GetMoveEffect(MOVE_TEETER_DANCE) == EFFECT_CONFUSE); } SINGLE_BATTLE_TEST("Teeter Dance confuses target") diff --git a/test/battle/move_effect/corrosive_gas.c b/test/battle/move_effect/corrosive_gas.c index cc4110a7e38b..84b7c1c70bba 100644 --- a/test/battle/move_effect/corrosive_gas.c +++ b/test/battle/move_effect/corrosive_gas.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_CORROSIVE_GAS].effect == EFFECT_CORROSIVE_GAS); + ASSUME(GetMoveEffect(MOVE_CORROSIVE_GAS) == EFFECT_CORROSIVE_GAS); } SINGLE_BATTLE_TEST("Corrosive Gas destroys the target's item or fails if the target has no item") @@ -53,7 +53,7 @@ SINGLE_BATTLE_TEST("Corrosive Gas doesn't destroy the item of a Pokemon with the SINGLE_BATTLE_TEST("Items lost to Corrosive Gas cannot be restored by Recycle") { GIVEN { - ASSUME(gMovesInfo[MOVE_RECYCLE].effect == EFFECT_RECYCLE); + ASSUME(GetMoveEffect(MOVE_RECYCLE) == EFFECT_RECYCLE); PLAYER(SPECIES_WOBBUFFET) {Speed(15); } OPPONENT(SPECIES_WOBBUFFET) {Item(ITEM_ORAN_BERRY); Speed(10); } } WHEN { diff --git a/test/battle/move_effect/cosmic_power.c b/test/battle/move_effect/cosmic_power.c index 3b52fbe0464e..5c8fe30f6752 100644 --- a/test/battle/move_effect/cosmic_power.c +++ b/test/battle/move_effect/cosmic_power.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_COSMIC_POWER].effect == EFFECT_COSMIC_POWER); + ASSUME(GetMoveEffect(MOVE_COSMIC_POWER) == EFFECT_COSMIC_POWER); } SINGLE_BATTLE_TEST("Cosmic Power increases the user's Defense and Sp. Defense by 1 stage each") diff --git a/test/battle/move_effect/court_change.c b/test/battle/move_effect/court_change.c index f3775d0af65a..0727baff5eb6 100644 --- a/test/battle/move_effect/court_change.c +++ b/test/battle/move_effect/court_change.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_COURT_CHANGE].effect == EFFECT_COURT_CHANGE); + ASSUME(GetMoveEffect(MOVE_COURT_CHANGE) == EFFECT_COURT_CHANGE); } DOUBLE_BATTLE_TEST("Court Change swaps entry hazards used by the opponent") diff --git a/test/battle/move_effect/curse.c b/test/battle/move_effect/curse.c index 0269659b37ce..868608caa8c3 100644 --- a/test/battle/move_effect/curse.c +++ b/test/battle/move_effect/curse.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_CURSE].effect == EFFECT_CURSE); + ASSUME(GetMoveEffect(MOVE_CURSE) == EFFECT_CURSE); } SINGLE_BATTLE_TEST("Curse lowers Speed, raises Attack, and raises Defense when used by non-Ghost-types") diff --git a/test/battle/move_effect/dark_void.c b/test/battle/move_effect/dark_void.c index b7af9a58b235..a69d7d6930d1 100644 --- a/test/battle/move_effect/dark_void.c +++ b/test/battle/move_effect/dark_void.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_DARK_VOID].effect == EFFECT_DARK_VOID); + ASSUME(GetMoveEffect(MOVE_DARK_VOID) == EFFECT_DARK_VOID); } SINGLE_BATTLE_TEST("Dark Void inflicts 1-3 turns of sleep") diff --git a/test/battle/move_effect/defense_curl.c b/test/battle/move_effect/defense_curl.c index da9acbbedad3..c8beffe1717c 100644 --- a/test/battle/move_effect/defense_curl.c +++ b/test/battle/move_effect/defense_curl.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_DEFENSE_CURL].effect == EFFECT_DEFENSE_CURL); + ASSUME(GetMoveEffect(MOVE_DEFENSE_CURL) == EFFECT_DEFENSE_CURL); } SINGLE_BATTLE_TEST("Defense Curl raises Defense by 1 stage", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Defense Curl raises Defense by 1 stage", s16 damage) PARAMETRIZE { raiseDefense = FALSE; } PARAMETRIZE { raiseDefense = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/defense_down.c b/test/battle/move_effect/defense_down.c index bda3a128d799..9691b4a1c258 100644 --- a/test/battle/move_effect/defense_down.c +++ b/test/battle/move_effect/defense_down.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TAIL_WHIP].effect == EFFECT_DEFENSE_DOWN); + ASSUME(GetMoveEffect(MOVE_TAIL_WHIP) == EFFECT_DEFENSE_DOWN); } SINGLE_BATTLE_TEST("Tail Whip lowers Defense by 1 stage", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Tail Whip lowers Defense by 1 stage", s16 damage) PARAMETRIZE { lowerDefense = FALSE; } PARAMETRIZE { lowerDefense = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/defense_down_2.c b/test/battle/move_effect/defense_down_2.c index 121d6385360a..961e2de02ffc 100644 --- a/test/battle/move_effect/defense_down_2.c +++ b/test/battle/move_effect/defense_down_2.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SCREECH].effect == EFFECT_DEFENSE_DOWN_2); + ASSUME(GetMoveEffect(MOVE_SCREECH) == EFFECT_DEFENSE_DOWN_2); } SINGLE_BATTLE_TEST("Screech lowers Defense by 2 stages", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Screech lowers Defense by 2 stages", s16 damage) PARAMETRIZE { lowerDefense = FALSE; } PARAMETRIZE { lowerDefense = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/defense_up.c b/test/battle/move_effect/defense_up.c index 9840760254de..c83f2c01c5b7 100644 --- a/test/battle/move_effect/defense_up.c +++ b/test/battle/move_effect/defense_up.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_HARDEN].effect == EFFECT_DEFENSE_UP); + ASSUME(GetMoveEffect(MOVE_HARDEN) == EFFECT_DEFENSE_UP); } SINGLE_BATTLE_TEST("Harden raises Defense by 1 stage", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Harden raises Defense by 1 stage", s16 damage) PARAMETRIZE { raiseDefense = FALSE; } PARAMETRIZE { raiseDefense = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/defense_up_2.c b/test/battle/move_effect/defense_up_2.c index 18fbac53d695..59ca5c1af937 100644 --- a/test/battle/move_effect/defense_up_2.c +++ b/test/battle/move_effect/defense_up_2.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_IRON_DEFENSE].effect == EFFECT_DEFENSE_UP_2); + ASSUME(GetMoveEffect(MOVE_IRON_DEFENSE) == EFFECT_DEFENSE_UP_2); } SINGLE_BATTLE_TEST("Iron Defense raises Defense by 2 stages", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Iron Defense raises Defense by 2 stages", s16 damage) PARAMETRIZE { raiseDefense = FALSE; } PARAMETRIZE { raiseDefense = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/defense_up_3.c b/test/battle/move_effect/defense_up_3.c index 983bbb244695..040537c1d4f5 100644 --- a/test/battle/move_effect/defense_up_3.c +++ b/test/battle/move_effect/defense_up_3.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_COTTON_GUARD].effect == EFFECT_DEFENSE_UP_3); + ASSUME(GetMoveEffect(MOVE_COTTON_GUARD) == EFFECT_DEFENSE_UP_3); } SINGLE_BATTLE_TEST("Cotton Guard raises Defense by 3 stages", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Cotton Guard raises Defense by 3 stages", s16 damage) PARAMETRIZE { raiseDefense = FALSE; } PARAMETRIZE { raiseDefense = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/defog.c b/test/battle/move_effect/defog.c index a429da4511ea..3d0a46806ca5 100644 --- a/test/battle/move_effect/defog.c +++ b/test/battle/move_effect/defog.c @@ -3,20 +3,20 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_DEFOG].effect == EFFECT_DEFOG); - ASSUME(gMovesInfo[MOVE_REFLECT].effect == EFFECT_REFLECT); - ASSUME(gMovesInfo[MOVE_LIGHT_SCREEN].effect == EFFECT_LIGHT_SCREEN); - ASSUME(gMovesInfo[MOVE_MIST].effect == EFFECT_MIST); - ASSUME(gMovesInfo[MOVE_SAFEGUARD].effect == EFFECT_SAFEGUARD); - ASSUME(gMovesInfo[MOVE_AURORA_VEIL].effect == EFFECT_AURORA_VEIL); - ASSUME(gMovesInfo[MOVE_STEALTH_ROCK].effect == EFFECT_STEALTH_ROCK); - ASSUME(gMovesInfo[MOVE_SPIKES].effect == EFFECT_SPIKES); - ASSUME(gMovesInfo[MOVE_TOXIC_SPIKES].effect == EFFECT_TOXIC_SPIKES); - ASSUME(gMovesInfo[MOVE_STICKY_WEB].effect == EFFECT_STICKY_WEB); - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); - ASSUME(gMovesInfo[MOVE_SCREECH].effect == EFFECT_DEFENSE_DOWN_2); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveEffect(MOVE_DEFOG) == EFFECT_DEFOG); + ASSUME(GetMoveEffect(MOVE_REFLECT) == EFFECT_REFLECT); + ASSUME(GetMoveEffect(MOVE_LIGHT_SCREEN) == EFFECT_LIGHT_SCREEN); + ASSUME(GetMoveEffect(MOVE_MIST) == EFFECT_MIST); + ASSUME(GetMoveEffect(MOVE_SAFEGUARD) == EFFECT_SAFEGUARD); + ASSUME(GetMoveEffect(MOVE_AURORA_VEIL) == EFFECT_AURORA_VEIL); + ASSUME(GetMoveEffect(MOVE_STEALTH_ROCK) == EFFECT_STEALTH_ROCK); + ASSUME(GetMoveEffect(MOVE_SPIKES) == EFFECT_SPIKES); + ASSUME(GetMoveEffect(MOVE_TOXIC_SPIKES) == EFFECT_TOXIC_SPIKES); + ASSUME(GetMoveEffect(MOVE_STICKY_WEB) == EFFECT_STICKY_WEB); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_SCREECH) == EFFECT_DEFENSE_DOWN_2); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_GUST) == DAMAGE_CATEGORY_SPECIAL); } SINGLE_BATTLE_TEST("Defog lowers evasiveness by 1 stage") @@ -302,7 +302,7 @@ DOUBLE_BATTLE_TEST("Defog removes Aurora Veil from target's side", s16 damagePhy PARAMETRIZE { move = MOVE_DEFOG; } PARAMETRIZE { move = MOVE_CELEBRATE; } GIVEN { - ASSUME(gMovesInfo[MOVE_HAIL].effect == EFFECT_HAIL); + ASSUME(GetMoveEffect(MOVE_HAIL) == EFFECT_HAIL); ASSUME(gSpeciesInfo[SPECIES_GLALIE].types[0] == TYPE_ICE); PLAYER(SPECIES_GLALIE) { Speed(4); } PLAYER(SPECIES_GLALIE) { Speed(3); } @@ -334,7 +334,7 @@ DOUBLE_BATTLE_TEST("Defog removes Aurora Veil from target's side", s16 damagePhy DOUBLE_BATTLE_TEST("Defog removes everything it can") { GIVEN { - ASSUME(gMovesInfo[MOVE_HAIL].effect == EFFECT_HAIL); + ASSUME(GetMoveEffect(MOVE_HAIL) == EFFECT_HAIL); ASSUME(gSpeciesInfo[SPECIES_GLALIE].types[0] == TYPE_ICE); PLAYER(SPECIES_GLALIE) { Speed(4); } PLAYER(SPECIES_GLALIE) { Speed(3); } diff --git a/test/battle/move_effect/destiny_bond.c b/test/battle/move_effect/destiny_bond.c index a6db2291c7dc..ecb8b1d3ef2f 100644 --- a/test/battle/move_effect/destiny_bond.c +++ b/test/battle/move_effect/destiny_bond.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_DESTINY_BOND].effect == EFFECT_DESTINY_BOND); + ASSUME(GetMoveEffect(MOVE_DESTINY_BOND) == EFFECT_DESTINY_BOND); } SINGLE_BATTLE_TEST("Destiny Bond faints the opposing mon if it fainted from the attack") diff --git a/test/battle/move_effect/doodle.c b/test/battle/move_effect/doodle.c index a43a149dc82c..af144ecee593 100644 --- a/test/battle/move_effect/doodle.c +++ b/test/battle/move_effect/doodle.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_DOODLE].effect == EFFECT_DOODLE); + ASSUME(GetMoveEffect(MOVE_DOODLE) == EFFECT_DOODLE); } DOUBLE_BATTLE_TEST("Doodle gives the target's ability to user and ally") diff --git a/test/battle/move_effect/double_power_on_arg_status.c b/test/battle/move_effect/double_power_on_arg_status.c index 1d3563c42708..d733d04c4fed 100644 --- a/test/battle/move_effect/double_power_on_arg_status.c +++ b/test/battle/move_effect/double_power_on_arg_status.c @@ -12,8 +12,8 @@ SINGLE_BATTLE_TEST("Hex deals double damage to foes with a status", s16 damage) PARAMETRIZE { status1 = STATUS1_PARALYSIS; } PARAMETRIZE { status1 = STATUS1_TOXIC_POISON; } GIVEN { - ASSUME(gMovesInfo[MOVE_HEX].effect == EFFECT_DOUBLE_POWER_ON_ARG_STATUS); - ASSUME(gMovesInfo[MOVE_HEX].argument.status == STATUS1_ANY); + ASSUME(GetMoveEffect(MOVE_HEX) == EFFECT_DOUBLE_POWER_ON_ARG_STATUS); + ASSUME(GetMoveEffectArg_Status(MOVE_HEX) == STATUS1_ANY); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Status1(status1); } } WHEN { @@ -36,8 +36,8 @@ SINGLE_BATTLE_TEST("Venoshock's power doubles if the target is poisoned/badly po PARAMETRIZE { status1 = STATUS1_POISON; } PARAMETRIZE { status1 = STATUS1_TOXIC_POISON; } GIVEN { - ASSUME(gMovesInfo[MOVE_VENOSHOCK].effect == EFFECT_DOUBLE_POWER_ON_ARG_STATUS); - ASSUME(gMovesInfo[MOVE_VENOSHOCK].argument.status == STATUS1_PSN_ANY); + ASSUME(GetMoveEffect(MOVE_VENOSHOCK) == EFFECT_DOUBLE_POWER_ON_ARG_STATUS); + ASSUME(GetMoveEffectArg_Status(MOVE_VENOSHOCK) == STATUS1_PSN_ANY); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Status1(status1); } } WHEN { diff --git a/test/battle/move_effect/dragon_cheer.c b/test/battle/move_effect/dragon_cheer.c index e02dd84dd283..1e28c6d4b399 100644 --- a/test/battle/move_effect/dragon_cheer.c +++ b/test/battle/move_effect/dragon_cheer.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Dragon Cheer fails in a single battle") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_CHEER].effect == EFFECT_DRAGON_CHEER); + ASSUME(GetMoveEffect(MOVE_DRAGON_CHEER) == EFFECT_DRAGON_CHEER); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -19,8 +19,8 @@ DOUBLE_BATTLE_TEST("Dragon Cheer increases critical hit ratio by one on non-Drag PASSES_RANDOMLY(1, 8, RNG_CRITICAL_HIT); GIVEN { ASSUME(B_CRIT_CHANCE >= GEN_7); - ASSUME(gMovesInfo[MOVE_TACKLE].criticalHitStage == 0); - ASSUME(gMovesInfo[MOVE_DRAGON_CHEER].effect == EFFECT_DRAGON_CHEER); + ASSUME(GetMoveCriticalHitStage(MOVE_TACKLE) == 0); + ASSUME(GetMoveEffect(MOVE_DRAGON_CHEER) == EFFECT_DRAGON_CHEER); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); @@ -40,8 +40,8 @@ DOUBLE_BATTLE_TEST("Dragon Cheer increases critical hit ratio by two on Dragon t PASSES_RANDOMLY(1, 2, RNG_CRITICAL_HIT); GIVEN { ASSUME(B_CRIT_CHANCE >= GEN_7); - ASSUME(gMovesInfo[MOVE_TACKLE].criticalHitStage == 0); - ASSUME(gMovesInfo[MOVE_DRAGON_CHEER].effect == EFFECT_DRAGON_CHEER); + ASSUME(GetMoveCriticalHitStage(MOVE_TACKLE) == 0); + ASSUME(GetMoveEffect(MOVE_DRAGON_CHEER) == EFFECT_DRAGON_CHEER); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_DRATINI); OPPONENT(SPECIES_WOBBUFFET); @@ -59,9 +59,9 @@ DOUBLE_BATTLE_TEST("Dragon Cheer increases critical hit ratio by two on Dragon t DOUBLE_BATTLE_TEST("Dragon Cheer fails if critical hit stage was already increased by Focus Energy") { GIVEN { - ASSUME(gMovesInfo[MOVE_SLASH].criticalHitStage == 1); - ASSUME(gMovesInfo[MOVE_FOCUS_ENERGY].effect == EFFECT_FOCUS_ENERGY); - ASSUME(gMovesInfo[MOVE_DRAGON_CHEER].effect == EFFECT_DRAGON_CHEER); + ASSUME(GetMoveCriticalHitStage(MOVE_SLASH) == 1); + ASSUME(GetMoveEffect(MOVE_FOCUS_ENERGY) == EFFECT_FOCUS_ENERGY); + ASSUME(GetMoveEffect(MOVE_DRAGON_CHEER) == EFFECT_DRAGON_CHEER); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/dragon_darts.c b/test/battle/move_effect/dragon_darts.c index 336d9cd1a507..9e178f67c83f 100644 --- a/test/battle/move_effect/dragon_darts.c +++ b/test/battle/move_effect/dragon_darts.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_DRAGON_DARTS].effect == EFFECT_DRAGON_DARTS); + ASSUME(GetMoveEffect(MOVE_DRAGON_DARTS) == EFFECT_DRAGON_DARTS); ASSUME(gSpeciesInfo[SPECIES_CLEFAIRY].types[0] == TYPE_FAIRY || gSpeciesInfo[SPECIES_CLEFAIRY].types[1] == TYPE_FAIRY); } @@ -103,7 +103,7 @@ DOUBLE_BATTLE_TEST("Dragon Darts strikes an opponent twice if electrified and th PARAMETRIZE { chosenTarget = opponentLeft; finalTarget = opponentRight; abilityLeft = ABILITY_VOLT_ABSORB; abilityRight = ABILITY_WATER_ABSORB; } PARAMETRIZE { chosenTarget = opponentRight; finalTarget = opponentRight; abilityLeft = ABILITY_VOLT_ABSORB; abilityRight = ABILITY_WATER_ABSORB; } GIVEN { - ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + ASSUME(GetMoveEffect(MOVE_ELECTRIFY) == EFFECT_ELECTRIFY); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_LANTURN) { Ability(abilityLeft); }; @@ -129,7 +129,7 @@ DOUBLE_BATTLE_TEST("Dragon Darts strikes an opponent twice if electrified and th PARAMETRIZE { chosenTarget = opponentLeft; finalTarget = opponentRight; abilityLeft = ABILITY_MOTOR_DRIVE; abilityRight = ABILITY_VITAL_SPIRIT; } PARAMETRIZE { chosenTarget = opponentRight; finalTarget = opponentRight; abilityLeft = ABILITY_MOTOR_DRIVE; abilityRight = ABILITY_VITAL_SPIRIT; } GIVEN { - ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + ASSUME(GetMoveEffect(MOVE_ELECTRIFY) == EFFECT_ELECTRIFY); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_ELECTIVIRE) { Ability(abilityLeft); }; @@ -152,7 +152,7 @@ DOUBLE_BATTLE_TEST("Dragon Darts strikes an opponent twice if the other one is i PARAMETRIZE { chosenTarget = opponentLeft; finalTarget = opponentRight; } PARAMETRIZE { chosenTarget = opponentRight; finalTarget = opponentLeft; } GIVEN { - ASSUME(gMovesInfo[MOVE_FLY].effect == EFFECT_SEMI_INVULNERABLE); + ASSUME(GetMoveEffect(MOVE_FLY) == EFFECT_SEMI_INVULNERABLE); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/dream_eater.c b/test/battle/move_effect/dream_eater.c index 85bdb42ac97d..b840e9860ccf 100644 --- a/test/battle/move_effect/dream_eater.c +++ b/test/battle/move_effect/dream_eater.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_DREAM_EATER].effect == EFFECT_DREAM_EATER); + ASSUME(GetMoveEffect(MOVE_DREAM_EATER) == EFFECT_DREAM_EATER); } SINGLE_BATTLE_TEST("Dream Eater recovers 50% of the damage dealt") diff --git a/test/battle/move_effect/dynamax_double_dmg.c b/test/battle/move_effect/dynamax_double_dmg.c index 593f969862bc..c19ba5ecbc4b 100644 --- a/test/battle/move_effect/dynamax_double_dmg.c +++ b/test/battle/move_effect/dynamax_double_dmg.c @@ -7,7 +7,7 @@ SINGLE_BATTLE_TEST("Dynamax Cannon causes double damage to Dynamaxed Pokemon", s PARAMETRIZE { dynamax = GIMMICK_NONE; } PARAMETRIZE { dynamax = GIMMICK_DYNAMAX; } GIVEN { - ASSUME(gMovesInfo[MOVE_DYNAMAX_CANNON].effect == EFFECT_DYNAMAX_DOUBLE_DMG); + ASSUME(GetMoveEffect(MOVE_DYNAMAX_CANNON) == EFFECT_DYNAMAX_DOUBLE_DMG); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/earthquake.c b/test/battle/move_effect/earthquake.c index 93955e15b47a..2cbf3b32c56a 100644 --- a/test/battle/move_effect/earthquake.c +++ b/test/battle/move_effect/earthquake.c @@ -10,8 +10,8 @@ SINGLE_BATTLE_TEST("Earthquake's and Bulldoze's damage is halved when Grassy Ter PARAMETRIZE { terrain = FALSE; move = MOVE_BULLDOZE; } // 2 PARAMETRIZE { terrain = TRUE; move = MOVE_BULLDOZE; } // 3 GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].effect == EFFECT_EARTHQUAKE); - ASSUME(gMovesInfo[MOVE_BULLDOZE].effect == EFFECT_EARTHQUAKE); + ASSUME(GetMoveEffect(MOVE_EARTHQUAKE) == EFFECT_EARTHQUAKE); + ASSUME(GetMoveEffect(MOVE_BULLDOZE) == EFFECT_EARTHQUAKE); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/embargo.c b/test/battle/move_effect/embargo.c index 81939a6d567d..3e86b60b0b10 100644 --- a/test/battle/move_effect/embargo.c +++ b/test/battle/move_effect/embargo.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_EMBARGO].effect == EFFECT_EMBARGO); + ASSUME(GetMoveEffect(MOVE_EMBARGO) == EFFECT_EMBARGO); } SINGLE_BATTLE_TEST("Embargo blocks the effect of an affected Pokémon's held item") diff --git a/test/battle/move_effect/encore.c b/test/battle/move_effect/encore.c index ec68297ca0aa..8c6723a8c9d9 100644 --- a/test/battle/move_effect/encore.c +++ b/test/battle/move_effect/encore.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ENCORE].effect == EFFECT_ENCORE); + ASSUME(GetMoveEffect(MOVE_ENCORE) == EFFECT_ENCORE); } SINGLE_BATTLE_TEST("Encore forces consecutive move uses for 3 turns for player: Encore used before move") diff --git a/test/battle/move_effect/endeavor.c b/test/battle/move_effect/endeavor.c index 7080ee9c288f..65cb2839bcd4 100644 --- a/test/battle/move_effect/endeavor.c +++ b/test/battle/move_effect/endeavor.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ENDEAVOR].effect == EFFECT_ENDEAVOR); + ASSUME(GetMoveEffect(MOVE_ENDEAVOR) == EFFECT_ENDEAVOR); } SINGLE_BATTLE_TEST("Endeavor causes the target's HP to equal the user's current HP") diff --git a/test/battle/move_effect/evasion_up.c b/test/battle/move_effect/evasion_up.c index 7058694e9de4..c3fc98e0fdbd 100644 --- a/test/battle/move_effect/evasion_up.c +++ b/test/battle/move_effect/evasion_up.c @@ -3,14 +3,14 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_DOUBLE_TEAM].effect == EFFECT_EVASION_UP); + ASSUME(GetMoveEffect(MOVE_DOUBLE_TEAM) == EFFECT_EVASION_UP); } SINGLE_BATTLE_TEST("Double Team raises Evasion") { - PASSES_RANDOMLY(gMovesInfo[MOVE_SCRATCH].accuracy * 3 / 4, 100, RNG_ACCURACY); + PASSES_RANDOMLY(GetMoveAccuracy(MOVE_SCRATCH) * 3 / 4, 100, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_SCRATCH].accuracy == 100); + ASSUME(GetMoveAccuracy(MOVE_SCRATCH) == 100); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/explosion.c b/test/battle/move_effect/explosion.c index f383ecb1a262..52eec1a8e266 100644 --- a/test/battle/move_effect/explosion.c +++ b/test/battle/move_effect/explosion.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); } SINGLE_BATTLE_TEST("Explosion causes the user to faint") @@ -54,7 +54,7 @@ SINGLE_BATTLE_TEST("Explosion causes the user to faint even if it misses") SINGLE_BATTLE_TEST("Explosion causes the user to faint even if it has no effect") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_EXPLOSION) == TYPE_NORMAL); ASSUME(gSpeciesInfo[SPECIES_GASTLY].types[0] == TYPE_GHOST); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_GASTLY); diff --git a/test/battle/move_effect/fail_if_not_arg_type.c b/test/battle/move_effect/fail_if_not_arg_type.c index 4ded2d3a7f06..368c3410c0f8 100644 --- a/test/battle/move_effect/fail_if_not_arg_type.c +++ b/test/battle/move_effect/fail_if_not_arg_type.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Burn Up user loses its Fire-type") { GIVEN { - ASSUME(gMovesInfo[MOVE_BURN_UP].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE); + ASSUME(GetMoveEffect(MOVE_BURN_UP) == EFFECT_FAIL_IF_NOT_ARG_TYPE); ASSUME(IsMoveEffectRemoveSpeciesType(MOVE_BURN_UP, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) == TRUE); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_FIRE || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_FIRE); ASSUME(gSpeciesInfo[SPECIES_CYNDAQUIL].types[0] == TYPE_FIRE || gSpeciesInfo[SPECIES_CYNDAQUIL].types[1] == TYPE_FIRE); @@ -24,7 +24,7 @@ SINGLE_BATTLE_TEST("Burn Up user loses its Fire-type") SINGLE_BATTLE_TEST("Burn Up fails if the user isn't a Fire-type") { GIVEN { - ASSUME(gMovesInfo[MOVE_BURN_UP].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE); + ASSUME(GetMoveEffect(MOVE_BURN_UP) == EFFECT_FAIL_IF_NOT_ARG_TYPE); ASSUME(IsMoveEffectRemoveSpeciesType(MOVE_BURN_UP, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) == TRUE); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_FIRE || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_FIRE); PLAYER(SPECIES_WOBBUFFET); @@ -41,7 +41,7 @@ SINGLE_BATTLE_TEST("Burn Up fails if the user isn't a Fire-type") SINGLE_BATTLE_TEST("Burn Up user loses its Fire-type if enemy faints") { GIVEN { - ASSUME(gMovesInfo[MOVE_BURN_UP].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE); + ASSUME(GetMoveEffect(MOVE_BURN_UP) == EFFECT_FAIL_IF_NOT_ARG_TYPE); ASSUME(IsMoveEffectRemoveSpeciesType(MOVE_BURN_UP, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) == TRUE); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_FIRE || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_FIRE); ASSUME(gSpeciesInfo[SPECIES_CYNDAQUIL].types[0] == TYPE_FIRE || gSpeciesInfo[SPECIES_CYNDAQUIL].types[1] == TYPE_FIRE); @@ -59,7 +59,7 @@ SINGLE_BATTLE_TEST("Burn Up user loses its Fire-type if enemy faints") SINGLE_BATTLE_TEST("Double Shock user loses its Electric-type") { GIVEN { - ASSUME(gMovesInfo[MOVE_DOUBLE_SHOCK].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE); + ASSUME(GetMoveEffect(MOVE_DOUBLE_SHOCK) == EFFECT_FAIL_IF_NOT_ARG_TYPE); ASSUME(IsMoveEffectRemoveSpeciesType(MOVE_DOUBLE_SHOCK, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_ELECTRIC) == TRUE); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_ELECTRIC || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_ELECTRIC); ASSUME(gSpeciesInfo[SPECIES_PIKACHU].types[0] == TYPE_ELECTRIC || gSpeciesInfo[SPECIES_PIKACHU].types[1] == TYPE_ELECTRIC); @@ -79,7 +79,7 @@ SINGLE_BATTLE_TEST("Double Shock user loses its Electric-type") SINGLE_BATTLE_TEST("Double Shock fails if the user isn't an Electric-type") { GIVEN { - ASSUME(gMovesInfo[MOVE_DOUBLE_SHOCK].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE); + ASSUME(GetMoveEffect(MOVE_DOUBLE_SHOCK) == EFFECT_FAIL_IF_NOT_ARG_TYPE); ASSUME(IsMoveEffectRemoveSpeciesType(MOVE_DOUBLE_SHOCK, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_ELECTRIC) == TRUE); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_ELECTRIC || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_ELECTRIC); PLAYER(SPECIES_WOBBUFFET); @@ -96,7 +96,7 @@ SINGLE_BATTLE_TEST("Double Shock fails if the user isn't an Electric-type") SINGLE_BATTLE_TEST("Double Shock user loses its Electric-type if enemy faints") { GIVEN { - ASSUME(gMovesInfo[MOVE_DOUBLE_SHOCK].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE); + ASSUME(GetMoveEffect(MOVE_DOUBLE_SHOCK) == EFFECT_FAIL_IF_NOT_ARG_TYPE); ASSUME(IsMoveEffectRemoveSpeciesType(MOVE_DOUBLE_SHOCK, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_ELECTRIC) == TRUE); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_ELECTRIC || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_ELECTRIC); ASSUME(gSpeciesInfo[SPECIES_PIKACHU].types[0] == TYPE_ELECTRIC || gSpeciesInfo[SPECIES_PIKACHU].types[1] == TYPE_ELECTRIC); diff --git a/test/battle/move_effect/fickle_beam.c b/test/battle/move_effect/fickle_beam.c index ffbbe4d18dc5..0313823aa95c 100644 --- a/test/battle/move_effect/fickle_beam.c +++ b/test/battle/move_effect/fickle_beam.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_FICKLE_BEAM].effect == EFFECT_FICKLE_BEAM); + ASSUME(GetMoveEffect(MOVE_FICKLE_BEAM) == EFFECT_FICKLE_BEAM); } SINGLE_BATTLE_TEST("Fickle Beam deals double damage 30% of the time") @@ -12,8 +12,8 @@ SINGLE_BATTLE_TEST("Fickle Beam deals double damage 30% of the time") PASSES_RANDOMLY(30, 100, RNG_FICKLE_BEAM); GIVEN { - ASSUME(gMovesInfo[MOVE_POWER_GEM].power == 80); - ASSUME(gMovesInfo[MOVE_FICKLE_BEAM].power == 80); + ASSUME(GetMovePower(MOVE_POWER_GEM) == 80); + ASSUME(GetMovePower(MOVE_FICKLE_BEAM) == 80); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/fillet_away.c b/test/battle/move_effect/fillet_away.c index de203dbc5a5b..f9b679bfe5bf 100644 --- a/test/battle/move_effect/fillet_away.c +++ b/test/battle/move_effect/fillet_away.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_FILLET_AWAY].effect == EFFECT_FILLET_AWAY); + ASSUME(GetMoveEffect(MOVE_FILLET_AWAY) == EFFECT_FILLET_AWAY); } SINGLE_BATTLE_TEST("Fillet Away cuts the user's HP in half") diff --git a/test/battle/move_effect/fixed_damage_arg.c b/test/battle/move_effect/fixed_damage_arg.c index 1dae74e3f50c..8cb298707253 100644 --- a/test/battle/move_effect/fixed_damage_arg.c +++ b/test/battle/move_effect/fixed_damage_arg.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SONIC_BOOM].effect == EFFECT_FIXED_DAMAGE_ARG); + ASSUME(GetMoveEffect(MOVE_SONIC_BOOM) == EFFECT_FIXED_DAMAGE_ARG); } SINGLE_BATTLE_TEST("Sonic Boom deals fixed damage", s16 damage) @@ -13,7 +13,7 @@ SINGLE_BATTLE_TEST("Sonic Boom deals fixed damage", s16 damage) PARAMETRIZE { mon = SPECIES_ARON; } GIVEN { - ASSUME(gMovesInfo[MOVE_SONIC_BOOM].argument.fixedDamage == 20); + ASSUME(GetMoveFixedDamage(MOVE_SONIC_BOOM) == 20); PLAYER(SPECIES_WOBBUFFET); OPPONENT(mon); } WHEN { diff --git a/test/battle/move_effect/flame_burst.c b/test/battle/move_effect/flame_burst.c index 3597c8001450..df0199e11607 100644 --- a/test/battle/move_effect/flame_burst.c +++ b/test/battle/move_effect/flame_burst.c @@ -3,14 +3,14 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_FLAME_BURST].additionalEffects->moveEffect == MOVE_EFFECT_FLAME_BURST); + ASSUME(GetMoveAdditionalEffectById(MOVE_FLAME_BURST, 0)->moveEffect == MOVE_EFFECT_FLAME_BURST); } // Flame Burst AoE is supposed to hit through Substitute DOUBLE_BATTLE_TEST("Flame Burst Substitute") { GIVEN { - ASSUME(gMovesInfo[MOVE_SUBSTITUTE].effect == EFFECT_SUBSTITUTE); + ASSUME(GetMoveEffect(MOVE_SUBSTITUTE) == EFFECT_SUBSTITUTE); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WYNAUT); diff --git a/test/battle/move_effect/fling.c b/test/battle/move_effect/fling.c index 2bd1e824f1dd..b98020474b6d 100644 --- a/test/battle/move_effect/fling.c +++ b/test/battle/move_effect/fling.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_FLING].effect == EFFECT_FLING); + ASSUME(GetMoveEffect(MOVE_FLING) == EFFECT_FLING); } SINGLE_BATTLE_TEST("Fling fails if pokemon holds no item") @@ -38,8 +38,8 @@ SINGLE_BATTLE_TEST("Fling fails if pokemon is under the effects of Embargo or Ma PARAMETRIZE {move = MOVE_MAGIC_ROOM; } GIVEN { - ASSUME(gMovesInfo[MOVE_EMBARGO].effect == EFFECT_EMBARGO); - ASSUME(gMovesInfo[MOVE_MAGIC_ROOM].effect == EFFECT_MAGIC_ROOM); + ASSUME(GetMoveEffect(MOVE_EMBARGO) == EFFECT_EMBARGO); + ASSUME(GetMoveEffect(MOVE_MAGIC_ROOM) == EFFECT_MAGIC_ROOM); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RAZOR_CLAW); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -83,7 +83,7 @@ SINGLE_BATTLE_TEST("Fling fails for pokemon with Klutz ability") SINGLE_BATTLE_TEST("Fling's thrown item can be regained with Recycle") { GIVEN { - ASSUME(gMovesInfo[MOVE_RECYCLE].effect == EFFECT_RECYCLE); + ASSUME(GetMoveEffect(MOVE_RECYCLE) == EFFECT_RECYCLE); PLAYER(SPECIES_WOBBUFFET) {Item(ITEM_RAZOR_CLAW); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -106,7 +106,7 @@ SINGLE_BATTLE_TEST("Fling's thrown item can be regained with Recycle") SINGLE_BATTLE_TEST("Fling - Item is lost even when there is no target") { GIVEN { - ASSUME(gMovesInfo[MOVE_SELF_DESTRUCT].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_SELF_DESTRUCT) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET) {Item(ITEM_RAZOR_CLAW); Speed(2); } OPPONENT(SPECIES_WOBBUFFET) {Speed(5); } OPPONENT(SPECIES_WOBBUFFET) {Speed(5); } @@ -131,7 +131,7 @@ SINGLE_BATTLE_TEST("Fling - Item is lost even when there is no target") SINGLE_BATTLE_TEST("Fling - Item is lost when target protects itself") { GIVEN { - ASSUME(gMovesInfo[MOVE_PROTECT].effect == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_PROTECT) == EFFECT_PROTECT); PLAYER(SPECIES_WOBBUFFET) {Item(ITEM_RAZOR_CLAW); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -362,7 +362,7 @@ SINGLE_BATTLE_TEST("Fling - thrown berry's effect activates for the target even PARAMETRIZE { item = ITEM_SALAC_BERRY; effect = HOLD_EFFECT_SPEED_UP; statId = STAT_SPEED; } GIVEN { - ASSUME(gMovesInfo[MOVE_FLING].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_FLING) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET) { Item(item); Attack(1); } OPPONENT(SPECIES_WOBBUFFET) { Status1(status1); HP(399); MaxHP(400); MovesWithPP({MOVE_CELEBRATE, 35}); } } WHEN { @@ -441,7 +441,7 @@ SINGLE_BATTLE_TEST("Fling deals damage based on items fling power") s16 damage[2]; GIVEN { - ASSUME(gMovesInfo[MOVE_CRUNCH].power == 80); + ASSUME(GetMovePower(MOVE_CRUNCH) == 80); ASSUME(gItemsInfo[ITEM_VENUSAURITE].flingPower == 80); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_VENUSAURITE); } OPPONENT(SPECIES_REGIROCK); diff --git a/test/battle/move_effect/flower_shield.c b/test/battle/move_effect/flower_shield.c index e31fc9e5cd1a..784cce99f2c5 100644 --- a/test/battle/move_effect/flower_shield.c +++ b/test/battle/move_effect/flower_shield.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_FLOWER_SHIELD].effect == EFFECT_FLOWER_SHIELD); + ASSUME(GetMoveEffect(MOVE_FLOWER_SHIELD) == EFFECT_FLOWER_SHIELD); } DOUBLE_BATTLE_TEST("Flower Shield raises the defense of all grass type pokemon") diff --git a/test/battle/move_effect/focus_punch.c b/test/battle/move_effect/focus_punch.c index e8f36d4ff13a..55854ee80e11 100644 --- a/test/battle/move_effect/focus_punch.c +++ b/test/battle/move_effect/focus_punch.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_FOCUS_PUNCH].effect == EFFECT_FOCUS_PUNCH); + ASSUME(GetMoveEffect(MOVE_FOCUS_PUNCH) == EFFECT_FOCUS_PUNCH); } SINGLE_BATTLE_TEST("Focus Punch activates only if not damaged") diff --git a/test/battle/move_effect/foul_play.c b/test/battle/move_effect/foul_play.c index cc853b48de45..7df04201ef4e 100644 --- a/test/battle/move_effect/foul_play.c +++ b/test/battle/move_effect/foul_play.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_FOUL_PLAY].effect == EFFECT_FOUL_PLAY); + ASSUME(GetMoveEffect(MOVE_FOUL_PLAY) == EFFECT_FOUL_PLAY); } SINGLE_BATTLE_TEST("Foul Play uses physical attack stat of target", s16 damage) @@ -14,8 +14,8 @@ SINGLE_BATTLE_TEST("Foul Play uses physical attack stat of target", s16 damage) PARAMETRIZE { move = MOVE_FOUL_PLAY; } GIVEN { - ASSUME(gMovesInfo[MOVE_HIGH_HORSEPOWER].power == gMovesInfo[MOVE_FOUL_PLAY].power); - ASSUME(gMovesInfo[MOVE_SWORDS_DANCE].effect == EFFECT_ATTACK_UP_2); + ASSUME(GetMovePower(MOVE_HIGH_HORSEPOWER) == GetMovePower(MOVE_FOUL_PLAY)); + ASSUME(GetMoveEffect(MOVE_SWORDS_DANCE) == EFFECT_ATTACK_UP_2); PLAYER(SPECIES_SHELLDER); OPPONENT(SPECIES_SHELLDER); } WHEN { diff --git a/test/battle/move_effect/fury_cutter.c b/test/battle/move_effect/fury_cutter.c index b193882d3702..10d9d8a64ed0 100644 --- a/test/battle/move_effect/fury_cutter.c +++ b/test/battle/move_effect/fury_cutter.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_FURY_CUTTER].effect == EFFECT_FURY_CUTTER); + ASSUME(GetMoveEffect(MOVE_FURY_CUTTER) == EFFECT_FURY_CUTTER); } SINGLE_BATTLE_TEST("Fury Cutter power doubles with each use, up to 160 power") diff --git a/test/battle/move_effect/future_sight.c b/test/battle/move_effect/future_sight.c index e25fc750123e..3995e8479fb3 100644 --- a/test/battle/move_effect/future_sight.c +++ b/test/battle/move_effect/future_sight.c @@ -3,10 +3,10 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SEED_FLARE].power == gMovesInfo[MOVE_FUTURE_SIGHT].power); - ASSUME(gMovesInfo[MOVE_SEED_FLARE].category == gMovesInfo[MOVE_FUTURE_SIGHT].category); - ASSUME(gMovesInfo[MOVE_FUTURE_SIGHT].effect == EFFECT_FUTURE_SIGHT); - ASSUME(gMovesInfo[MOVE_FUTURE_SIGHT].power > 0); + ASSUME(GetMovePower(MOVE_SEED_FLARE) == GetMovePower(MOVE_FUTURE_SIGHT)); + ASSUME(GetMoveCategory(MOVE_SEED_FLARE) == GetMoveCategory(MOVE_FUTURE_SIGHT)); + ASSUME(GetMoveEffect(MOVE_FUTURE_SIGHT) == EFFECT_FUTURE_SIGHT); + ASSUME(GetMovePower(MOVE_FUTURE_SIGHT) > 0); } SINGLE_BATTLE_TEST("Future Sight uses Sp. Atk stat of the original user without modifiers") @@ -159,7 +159,7 @@ SINGLE_BATTLE_TEST("Future Sight will miss timing if target faints by residual d SINGLE_BATTLE_TEST("Future Sight breaks Focus Sash and doesn't make the holder endure another move") { GIVEN { - ASSUME(gMovesInfo[MOVE_PSYCHIC].power > 0); + ASSUME(GetMovePower(MOVE_PSYCHIC) > 0); ASSUME(gItemsInfo[ITEM_FOCUS_SASH].holdEffect == HOLD_EFFECT_FOCUS_SASH); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_PIDGEY) { Level(1); Item(ITEM_FOCUS_SASH); } diff --git a/test/battle/move_effect/gastro_acid.c b/test/battle/move_effect/gastro_acid.c index b3ce3787948d..8cb0a7d4af90 100644 --- a/test/battle/move_effect/gastro_acid.c +++ b/test/battle/move_effect/gastro_acid.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_GASTRO_ACID].effect == EFFECT_GASTRO_ACID); + ASSUME(GetMoveEffect(MOVE_GASTRO_ACID) == EFFECT_GASTRO_ACID); } SINGLE_BATTLE_TEST("Gastro Acid fails if target has a banned ability") diff --git a/test/battle/move_effect/glaive_rush.c b/test/battle/move_effect/glaive_rush.c index 639756da44a7..bb5bb7aaf6a9 100644 --- a/test/battle/move_effect/glaive_rush.c +++ b/test/battle/move_effect/glaive_rush.c @@ -3,14 +3,14 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_GLAIVE_RUSH].effect == EFFECT_GLAIVE_RUSH); + ASSUME(GetMoveEffect(MOVE_GLAIVE_RUSH) == EFFECT_GLAIVE_RUSH); } SINGLE_BATTLE_TEST("If Glaive Rush is successful moves targeted at the user do not check accuracy") { PASSES_RANDOMLY(100, 100, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_MEGA_PUNCH].accuracy == 85); + ASSUME(GetMoveAccuracy(MOVE_MEGA_PUNCH) == 85); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/gravity.c b/test/battle/move_effect/gravity.c index 4ccad08b5857..baac7a53eaf8 100644 --- a/test/battle/move_effect/gravity.c +++ b/test/battle/move_effect/gravity.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_GRAVITY].effect == EFFECT_GRAVITY); + ASSUME(GetMoveEffect(MOVE_GRAVITY) == EFFECT_GRAVITY); } DOUBLE_BATTLE_TEST("Gravity cancels fly and sky drop if they are in the air") diff --git a/test/battle/move_effect/guard_split.c b/test/battle/move_effect/guard_split.c index 3f012ab6e2e4..d7572c1431f8 100644 --- a/test/battle/move_effect/guard_split.c +++ b/test/battle/move_effect/guard_split.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_GUARD_SPLIT].effect == EFFECT_GUARD_SPLIT); + ASSUME(GetMoveEffect(MOVE_GUARD_SPLIT) == EFFECT_GUARD_SPLIT); } SINGLE_BATTLE_TEST("Guard Split averages users and targets Def and Sp. Def stats") diff --git a/test/battle/move_effect/haze.c b/test/battle/move_effect/haze.c index 0b28268ae929..3d0602bb73fe 100644 --- a/test/battle/move_effect/haze.c +++ b/test/battle/move_effect/haze.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_HAZE].effect == EFFECT_HAZE); + ASSUME(GetMoveEffect(MOVE_HAZE) == EFFECT_HAZE); } SINGLE_BATTLE_TEST("Haze resets stat changes", s16 damage) @@ -12,8 +12,8 @@ SINGLE_BATTLE_TEST("Haze resets stat changes", s16 damage) PARAMETRIZE { haze = FALSE; } PARAMETRIZE { haze = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_MEDITATE].effect == EFFECT_ATTACK_UP); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveEffect(MOVE_MEDITATE) == EFFECT_ATTACK_UP); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/heal_bell.c b/test/battle/move_effect/heal_bell.c index 9b62a36f9be2..5c87171056b4 100644 --- a/test/battle/move_effect/heal_bell.c +++ b/test/battle/move_effect/heal_bell.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_HEAL_BELL].effect == EFFECT_HEAL_BELL); - ASSUME(gMovesInfo[MOVE_AROMATHERAPY].effect == EFFECT_HEAL_BELL); + ASSUME(GetMoveEffect(MOVE_HEAL_BELL) == EFFECT_HEAL_BELL); + ASSUME(GetMoveEffect(MOVE_AROMATHERAPY) == EFFECT_HEAL_BELL); } DOUBLE_BATTLE_TEST("Heal Bell cures the entire party") diff --git a/test/battle/move_effect/heal_pulse.c b/test/battle/move_effect/heal_pulse.c index 95a2d75195ee..7c46cbf3448a 100644 --- a/test/battle/move_effect/heal_pulse.c +++ b/test/battle/move_effect/heal_pulse.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_HEAL_PULSE].effect == EFFECT_HEAL_PULSE); + ASSUME(GetMoveEffect(MOVE_HEAL_PULSE) == EFFECT_HEAL_PULSE); } SINGLE_BATTLE_TEST("Heal Pulse heals the target by 1/2 of it's maxHP") @@ -68,7 +68,7 @@ SINGLE_BATTLE_TEST("Heal Pulse ignores accurace checks") SINGLE_BATTLE_TEST("Heal Pulse is blocked by Substitute") { GIVEN { - ASSUME(gMovesInfo[MOVE_SUBSTITUTE].effect == EFFECT_SUBSTITUTE); + ASSUME(GetMoveEffect(MOVE_SUBSTITUTE) == EFFECT_SUBSTITUTE); PLAYER(SPECIES_WOBBUFFET) { MaxHP(100); HP(50); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -86,8 +86,8 @@ SINGLE_BATTLE_TEST("Heal Pulse is blocked by Substitute") SINGLE_BATTLE_TEST("Floral Healing heals the target by 2/3rd of it's maxHP if Grassy Terrain is on the field") { GIVEN { - ASSUME(gMovesInfo[MOVE_FLORAL_HEALING].argument.moveProperty == MOVE_EFFECT_FLORAL_HEALING); - ASSUME(gMovesInfo[MOVE_GRASSY_TERRAIN].effect == EFFECT_GRASSY_TERRAIN); + ASSUME(GetMoveEffectArg_MoveProperty(MOVE_FLORAL_HEALING) == MOVE_EFFECT_FLORAL_HEALING); + ASSUME(GetMoveEffect(MOVE_GRASSY_TERRAIN) == EFFECT_GRASSY_TERRAIN); PLAYER(SPECIES_WOBBUFFET) { MaxHP(100); HP(1); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/healing_wish.c b/test/battle/move_effect/healing_wish.c index a597d552ed5e..a29b04367cb1 100644 --- a/test/battle/move_effect/healing_wish.c +++ b/test/battle/move_effect/healing_wish.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_HEALING_WISH].effect == EFFECT_HEALING_WISH); - ASSUME(gMovesInfo[MOVE_LUNAR_DANCE].effect == EFFECT_HEALING_WISH); + ASSUME(GetMoveEffect(MOVE_HEALING_WISH) == EFFECT_HEALING_WISH); + ASSUME(GetMoveEffect(MOVE_LUNAR_DANCE) == EFFECT_HEALING_WISH); } SINGLE_BATTLE_TEST("Healing Wish causes the user to faint and fully heals the replacement") diff --git a/test/battle/move_effect/hit_escape.c b/test/battle/move_effect/hit_escape.c index 0a494cc667d4..bdfdbcae98ef 100644 --- a/test/battle/move_effect/hit_escape.c +++ b/test/battle/move_effect/hit_escape.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_U_TURN].effect == EFFECT_HIT_ESCAPE); + ASSUME(GetMoveEffect(MOVE_U_TURN) == EFFECT_HIT_ESCAPE); } SINGLE_BATTLE_TEST("U-turn switches the user out") @@ -98,7 +98,7 @@ SINGLE_BATTLE_TEST("U-turn switches the user out if Wimp Out fails to activate") SINGLE_BATTLE_TEST("U-turn switches the user out after Ice Face activates") { GIVEN { - ASSUME(gMovesInfo[MOVE_U_TURN].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_U_TURN) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_BEEDRILL); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_EISCUE) { Ability(ABILITY_ICE_FACE); } diff --git a/test/battle/move_effect/hit_set_remove_terrain.c b/test/battle/move_effect/hit_set_remove_terrain.c index a48d316d3f6a..e0564e074737 100644 --- a/test/battle/move_effect/hit_set_remove_terrain.c +++ b/test/battle/move_effect/hit_set_remove_terrain.c @@ -3,12 +3,12 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ELECTRIC_TERRAIN].effect == EFFECT_ELECTRIC_TERRAIN); - ASSUME(gMovesInfo[MOVE_PSYCHIC_TERRAIN].effect == EFFECT_PSYCHIC_TERRAIN); - ASSUME(gMovesInfo[MOVE_GRASSY_TERRAIN].effect == EFFECT_GRASSY_TERRAIN); - ASSUME(gMovesInfo[MOVE_MISTY_TERRAIN].effect == EFFECT_MISTY_TERRAIN); - ASSUME(gMovesInfo[MOVE_STEEL_ROLLER].effect == EFFECT_HIT_SET_REMOVE_TERRAIN); - ASSUME(gMovesInfo[MOVE_ICE_SPINNER].effect == EFFECT_HIT_SET_REMOVE_TERRAIN); + ASSUME(GetMoveEffect(MOVE_ELECTRIC_TERRAIN) == EFFECT_ELECTRIC_TERRAIN); + ASSUME(GetMoveEffect(MOVE_PSYCHIC_TERRAIN) == EFFECT_PSYCHIC_TERRAIN); + ASSUME(GetMoveEffect(MOVE_GRASSY_TERRAIN) == EFFECT_GRASSY_TERRAIN); + ASSUME(GetMoveEffect(MOVE_MISTY_TERRAIN) == EFFECT_MISTY_TERRAIN); + ASSUME(GetMoveEffect(MOVE_STEEL_ROLLER) == EFFECT_HIT_SET_REMOVE_TERRAIN); + ASSUME(GetMoveEffect(MOVE_ICE_SPINNER) == EFFECT_HIT_SET_REMOVE_TERRAIN); } SINGLE_BATTLE_TEST("Steel Roller and Ice Spinner can remove a terrain from the field") diff --git a/test/battle/move_effect/hit_switch_target.c b/test/battle/move_effect/hit_switch_target.c index a899ae0b33fe..5a6e480f9374 100644 --- a/test/battle/move_effect/hit_switch_target.c +++ b/test/battle/move_effect/hit_switch_target.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_DRAGON_TAIL].effect == EFFECT_HIT_SWITCH_TARGET); - ASSUME(gMovesInfo[MOVE_LOCK_ON].effect == EFFECT_LOCK_ON); + ASSUME(GetMoveEffect(MOVE_DRAGON_TAIL) == EFFECT_HIT_SWITCH_TARGET); + ASSUME(GetMoveEffect(MOVE_LOCK_ON) == EFFECT_LOCK_ON); } SINGLE_BATTLE_TEST("Dragon Tail switches the target with a random non-fainted replacement") diff --git a/test/battle/move_effect/hold_hands.c b/test/battle/move_effect/hold_hands.c index bcdb6a952af5..fb1c498bd3f1 100644 --- a/test/battle/move_effect/hold_hands.c +++ b/test/battle/move_effect/hold_hands.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_HOLD_HANDS].effect == EFFECT_HOLD_HANDS); + ASSUME(GetMoveEffect(MOVE_HOLD_HANDS) == EFFECT_HOLD_HANDS); } DOUBLE_BATTLE_TEST("Hold Hands is blocked by Crafty Shield") diff --git a/test/battle/move_effect/hydro_steam.c b/test/battle/move_effect/hydro_steam.c index a9c14c9acbba..cb19cc6ec128 100644 --- a/test/battle/move_effect/hydro_steam.c +++ b/test/battle/move_effect/hydro_steam.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_HYDRO_STEAM].effect == EFFECT_HYDRO_STEAM); + ASSUME(GetMoveEffect(MOVE_HYDRO_STEAM) == EFFECT_HYDRO_STEAM); } SINGLE_BATTLE_TEST("Hydro Steam deals 1.5x damage under both Sunlight and Rain", s16 damage) diff --git a/test/battle/move_effect/instruct.c b/test/battle/move_effect/instruct.c index 59772ea944a8..248370cd6a49 100644 --- a/test/battle/move_effect/instruct.c +++ b/test/battle/move_effect/instruct.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_INSTRUCT].effect == EFFECT_INSTRUCT); + ASSUME(GetMoveEffect(MOVE_INSTRUCT) == EFFECT_INSTRUCT); } DOUBLE_BATTLE_TEST("Instruct fails if target hasn't made a move") @@ -24,7 +24,7 @@ DOUBLE_BATTLE_TEST("Instruct fails if target hasn't made a move") DOUBLE_BATTLE_TEST("Instruct fails if move is banned by Instruct") { GIVEN { - ASSUME(gMovesInfo[MOVE_BIDE].instructBanned == TRUE); + ASSUME(IsMoveInstructBanned(MOVE_BIDE)); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_TACKLE, MOVE_POUND, MOVE_SCRATCH, MOVE_BIDE); } OPPONENT(SPECIES_WOBBUFFET); @@ -60,7 +60,7 @@ DOUBLE_BATTLE_TEST("Instruct-called move targets the target of the move picked o DOUBLE_BATTLE_TEST("Instruct doesn't bypass sleep") { GIVEN { - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_TACKLE, MOVE_POUND, MOVE_SCRATCH, MOVE_GROWL); } OPPONENT(SPECIES_WOBBUFFET); @@ -79,7 +79,7 @@ DOUBLE_BATTLE_TEST("Instruct doesn't bypass sleep") DOUBLE_BATTLE_TEST("Instruct fails if target doesn't know the last move it used") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); + ASSUME(IsDanceMove(MOVE_DRAGON_DANCE)); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_ORICORIO) { Moves(MOVE_TACKLE, MOVE_POUND, MOVE_SCRATCH, MOVE_CELEBRATE); } OPPONENT(SPECIES_WOBBUFFET); @@ -100,7 +100,7 @@ DOUBLE_BATTLE_TEST("Instruct fails if target doesn't know the last move it used" DOUBLE_BATTLE_TEST("Instruct-called move fails if it can only be used on the first turn but consumes PP") { GIVEN { - ASSUME(gMovesInfo[MOVE_FAKE_OUT].effect == EFFECT_FIRST_TURN_ONLY); + ASSUME(GetMoveEffect(MOVE_FAKE_OUT) == EFFECT_FIRST_TURN_ONLY); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_TACKLE, MOVE_POUND, MOVE_SCRATCH, MOVE_FAKE_OUT); } OPPONENT(SPECIES_WOBBUFFET); @@ -112,14 +112,14 @@ DOUBLE_BATTLE_TEST("Instruct-called move fails if it can only be used on the fir ANIMATION(ANIM_TYPE_MOVE, MOVE_INSTRUCT, playerLeft); NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_FAKE_OUT, playerRight); } THEN { - EXPECT_EQ(playerRight->pp[3], gMovesInfo[MOVE_FAKE_OUT].pp - 2); + EXPECT_EQ(playerRight->pp[3], GetMovePP(MOVE_FAKE_OUT) - 2); } } DOUBLE_BATTLE_TEST("Instruct-called move doesn't fail if tormented") { GIVEN { - ASSUME(gMovesInfo[MOVE_TORMENT].effect == EFFECT_TORMENT); + ASSUME(GetMoveEffect(MOVE_TORMENT) == EFFECT_TORMENT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_TACKLE, MOVE_POUND, MOVE_SCRATCH, MOVE_FAKE_OUT); } OPPONENT(SPECIES_WOBBUFFET); @@ -138,7 +138,7 @@ DOUBLE_BATTLE_TEST("Instruct-called status moves don't fail if holding Assault V { GIVEN { ASSUME(gItemsInfo[ITEM_ASSAULT_VEST].holdEffect == HOLD_EFFECT_ASSAULT_VEST); - ASSUME(gMovesInfo[MOVE_TRICK].effect == EFFECT_TRICK); + ASSUME(GetMoveEffect(MOVE_TRICK) == EFFECT_TRICK); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_TACKLE, MOVE_POUND, MOVE_SCRATCH, MOVE_TRICK); } OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_ASSAULT_VEST); } @@ -155,7 +155,7 @@ DOUBLE_BATTLE_TEST("Instruct-called status moves don't fail if holding Assault V DOUBLE_BATTLE_TEST("Instruct-called status move fails if taunted") { GIVEN { - ASSUME(gMovesInfo[MOVE_TAUNT].effect == EFFECT_TAUNT); + ASSUME(GetMoveEffect(MOVE_TAUNT) == EFFECT_TAUNT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_TACKLE, MOVE_POUND, MOVE_SCRATCH, MOVE_GROWL); } OPPONENT(SPECIES_WOBBUFFET); @@ -174,14 +174,14 @@ DOUBLE_BATTLE_TEST("Instruct-called status move fails if taunted") ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); } } THEN { - EXPECT_EQ(playerRight->pp[3], gMovesInfo[MOVE_GROWL].pp - 1); + EXPECT_EQ(playerRight->pp[3], GetMovePP(MOVE_GROWL) - 1); } } DOUBLE_BATTLE_TEST("Instruct-called moves fail if disabled") { GIVEN { - ASSUME(gMovesInfo[MOVE_DISABLE].effect == EFFECT_DISABLE); + ASSUME(GetMoveEffect(MOVE_DISABLE) == EFFECT_DISABLE); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_TACKLE, MOVE_POUND, MOVE_SCRATCH, MOVE_GROWL); } OPPONENT(SPECIES_WOBBUFFET); @@ -194,15 +194,15 @@ DOUBLE_BATTLE_TEST("Instruct-called moves fail if disabled") ANIMATION(ANIM_TYPE_MOVE, MOVE_INSTRUCT, playerLeft); NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerRight); } THEN { - EXPECT_EQ(playerRight->pp[0], gMovesInfo[MOVE_TACKLE].pp - 1); + EXPECT_EQ(playerRight->pp[0], GetMovePP(MOVE_TACKLE) - 1); } } DOUBLE_BATTLE_TEST("Instruct-called moves keep their priority") { GIVEN { - ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1); - ASSUME(gMovesInfo[MOVE_PSYCHIC_TERRAIN].effect == EFFECT_PSYCHIC_TERRAIN); + ASSUME(GetMovePriority(MOVE_QUICK_ATTACK) == 1); + ASSUME(GetMoveEffect(MOVE_PSYCHIC_TERRAIN) == EFFECT_PSYCHIC_TERRAIN); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_TACKLE, MOVE_POUND, MOVE_SCRATCH, MOVE_QUICK_ATTACK); } OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/ion_deluge.c b/test/battle/move_effect/ion_deluge.c index d0862ee8b441..8147048527d0 100644 --- a/test/battle/move_effect/ion_deluge.c +++ b/test/battle/move_effect/ion_deluge.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ION_DELUGE].effect == EFFECT_ION_DELUGE); + ASSUME(GetMoveEffect(MOVE_ION_DELUGE) == EFFECT_ION_DELUGE); } // For some reason SINGLE_BATTLE_TEST didn't catch these two issues. @@ -51,7 +51,7 @@ WILD_BATTLE_TEST("Ion Deluge works the same way as always when used by a mon wit SINGLE_BATTLE_TEST("Ion Deluge makes Normal type moves Electric type") { GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_TACKLE) == TYPE_NORMAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_GOLBAT); } WHEN { diff --git a/test/battle/move_effect/ivy_cudgel.c b/test/battle/move_effect/ivy_cudgel.c index 095f4d8eff11..88d002ae3500 100644 --- a/test/battle/move_effect/ivy_cudgel.c +++ b/test/battle/move_effect/ivy_cudgel.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_IVY_CUDGEL].effect == EFFECT_IVY_CUDGEL); + ASSUME(GetMoveEffect(MOVE_IVY_CUDGEL) == EFFECT_IVY_CUDGEL); } SINGLE_BATTLE_TEST("Ivy Cudgel changes the move type depending on the form of Ogerpon") diff --git a/test/battle/move_effect/knock_off.c b/test/battle/move_effect/knock_off.c index 61bb062a2540..4eb12697170a 100644 --- a/test/battle/move_effect/knock_off.c +++ b/test/battle/move_effect/knock_off.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_KNOCK_OFF].effect == EFFECT_KNOCK_OFF); + ASSUME(GetMoveEffect(MOVE_KNOCK_OFF) == EFFECT_KNOCK_OFF); } SINGLE_BATTLE_TEST("Knock Off knocks a healing berry before it has the chance to activate") diff --git a/test/battle/move_effect/last_resort.c b/test/battle/move_effect/last_resort.c index a9660f2c0e42..50a0a315127a 100644 --- a/test/battle/move_effect/last_resort.c +++ b/test/battle/move_effect/last_resort.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_LAST_RESORT].effect == EFFECT_LAST_RESORT); + ASSUME(GetMoveEffect(MOVE_LAST_RESORT) == EFFECT_LAST_RESORT); } SINGLE_BATTLE_TEST("Last Resort always fails if it's the only known move") @@ -95,7 +95,7 @@ SINGLE_BATTLE_TEST("Last Resort works only when all of the known moves have been SINGLE_BATTLE_TEST("Last Resort works with Sleep Talk") { GIVEN { - ASSUME(gMovesInfo[MOVE_SLEEP_TALK].effect == EFFECT_SLEEP_TALK); + ASSUME(GetMoveEffect(MOVE_SLEEP_TALK) == EFFECT_SLEEP_TALK); PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_LAST_RESORT, MOVE_SLEEP_TALK); Status1(STATUS1_SLEEP_TURN(3)); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/last_respects.c b/test/battle/move_effect/last_respects.c index 9b1f01f5fc9b..6ef4c73c2d81 100644 --- a/test/battle/move_effect/last_respects.c +++ b/test/battle/move_effect/last_respects.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_LAST_RESPECTS].effect == EFFECT_LAST_RESPECTS); + ASSUME(GetMoveEffect(MOVE_LAST_RESPECTS) == EFFECT_LAST_RESPECTS); } SINGLE_BATTLE_TEST("Last Respects power is multiplied by the amount of fainted mon in the user's side - Player", s16 damage) diff --git a/test/battle/move_effect/leech_seed.c b/test/battle/move_effect/leech_seed.c index 1ed050a2e0fe..d363e9800982 100644 --- a/test/battle/move_effect/leech_seed.c +++ b/test/battle/move_effect/leech_seed.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_LEECH_SEED].effect == EFFECT_LEECH_SEED); + ASSUME(GetMoveEffect(MOVE_LEECH_SEED) == EFFECT_LEECH_SEED); } SINGLE_BATTLE_TEST("Leech Seed doesn't affect Grass-type Pokémon") diff --git a/test/battle/move_effect/magic_coat.c b/test/battle/move_effect/magic_coat.c index 2e78967f3987..561d15a53230 100644 --- a/test/battle/move_effect/magic_coat.c +++ b/test/battle/move_effect/magic_coat.c @@ -3,13 +3,13 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_MAGIC_COAT].effect == EFFECT_MAGIC_COAT); + ASSUME(GetMoveEffect(MOVE_MAGIC_COAT) == EFFECT_MAGIC_COAT); } SINGLE_BATTLE_TEST("Magic Coat prints the correct message when bouncing back a move") { GIVEN { - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_WYNAUT); } WHEN { diff --git a/test/battle/move_effect/max_hp_50_recoil.c b/test/battle/move_effect/max_hp_50_recoil.c index b35043014b35..3e54e05532cc 100644 --- a/test/battle/move_effect/max_hp_50_recoil.c +++ b/test/battle/move_effect/max_hp_50_recoil.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_STEEL_BEAM].effect == EFFECT_MAX_HP_50_RECOIL); + ASSUME(GetMoveEffect(MOVE_STEEL_BEAM) == EFFECT_MAX_HP_50_RECOIL); } SINGLE_BATTLE_TEST("Steel Beam makes the user lose 1/2 of its Max HP") diff --git a/test/battle/move_effect/metronome.c b/test/battle/move_effect/metronome.c index 98e4bfd6187c..1a5d4aeb9d60 100644 --- a/test/battle/move_effect/metronome.c +++ b/test/battle/move_effect/metronome.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_METRONOME].effect == EFFECT_METRONOME); + ASSUME(GetMoveEffect(MOVE_METRONOME) == EFFECT_METRONOME); } SINGLE_BATTLE_TEST("Metronome picks a random move") @@ -25,9 +25,9 @@ SINGLE_BATTLE_TEST("Metronome picks a random move") SINGLE_BATTLE_TEST("Metronome's called powder move fails against Grass Types") { GIVEN { - ASSUME(gMovesInfo[MOVE_POISON_POWDER].powderMove); + ASSUME(IsPowderMove(MOVE_POISON_POWDER)); ASSUME(gSpeciesInfo[SPECIES_TANGELA].types[0] == TYPE_GRASS); - ASSUME(gMovesInfo[MOVE_POISON_POWDER].effect == EFFECT_POISON); + ASSUME(GetMoveEffect(MOVE_POISON_POWDER) == EFFECT_POISON); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_TANGELA); } WHEN { @@ -45,7 +45,7 @@ SINGLE_BATTLE_TEST("Metronome's called powder move fails against Grass Types") SINGLE_BATTLE_TEST("Metronome's called multi-hit move hits multiple times") { GIVEN { - ASSUME(gMovesInfo[MOVE_ROCK_BLAST].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_ROCK_BLAST) == EFFECT_MULTI_HIT); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/mind_blown.c b/test/battle/move_effect/mind_blown.c index 85e6a8fdbdd9..0a3419877773 100644 --- a/test/battle/move_effect/mind_blown.c +++ b/test/battle/move_effect/mind_blown.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_MIND_BLOWN].effect == EFFECT_MIND_BLOWN); + ASSUME(GetMoveEffect(MOVE_MIND_BLOWN) == EFFECT_MIND_BLOWN); } SINGLE_BATTLE_TEST("Mind Blown makes the user lose 1/2 of its Max HP") @@ -154,7 +154,7 @@ SINGLE_BATTLE_TEST("Mind Blown makes the user lose HP even if the opposing mon p SINGLE_BATTLE_TEST("Mind Blown makes the user lose HP even if it is absorbed by Flash Fire") { GIVEN { - ASSUME(gMovesInfo[MOVE_MIND_BLOWN].type == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_MIND_BLOWN) == TYPE_FIRE); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_CYNDAQUIL) { Ability(ABILITY_FLASH_FIRE); } } WHEN { diff --git a/test/battle/move_effect/mirror_move.c b/test/battle/move_effect/mirror_move.c index 65c600fb1878..cc148eb97cef 100644 --- a/test/battle/move_effect/mirror_move.c +++ b/test/battle/move_effect/mirror_move.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_MIRROR_MOVE].effect == EFFECT_MIRROR_MOVE); + ASSUME(GetMoveEffect(MOVE_MIRROR_MOVE) == EFFECT_MIRROR_MOVE); } SINGLE_BATTLE_TEST("Mirror Move copies the last used move by the target") @@ -41,9 +41,9 @@ SINGLE_BATTLE_TEST("Mirror Move fails if no move was used before") SINGLE_BATTLE_TEST("Mirror Move's called powder move fails against Grass Types") { GIVEN { - ASSUME(gMovesInfo[MOVE_STUN_SPORE].powderMove); + ASSUME(IsPowderMove(MOVE_STUN_SPORE)); ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS); - ASSUME(gMovesInfo[MOVE_STUN_SPORE].effect == EFFECT_PARALYZE); + ASSUME(GetMoveEffect(MOVE_STUN_SPORE) == EFFECT_PARALYZE); PLAYER(SPECIES_ODDISH); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -62,7 +62,7 @@ SINGLE_BATTLE_TEST("Mirror Move's called powder move fails against Grass Types") SINGLE_BATTLE_TEST("Mirror Move's called multi-hit move hits multiple times") { GIVEN { - ASSUME(gMovesInfo[MOVE_BULLET_SEED].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_BULLET_SEED) == EFFECT_MULTI_HIT); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/moonlight.c b/test/battle/move_effect/moonlight.c index 41359ea97cd4..34baa31b14e7 100644 --- a/test/battle/move_effect/moonlight.c +++ b/test/battle/move_effect/moonlight.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_MOONLIGHT].effect == EFFECT_MOONLIGHT); + ASSUME(GetMoveEffect(MOVE_MOONLIGHT) == EFFECT_MOONLIGHT); } SINGLE_BATTLE_TEST("Moonlight recovers 1/2 of the user's max HP") diff --git a/test/battle/move_effect/morning_sun.c b/test/battle/move_effect/morning_sun.c index 3b57f895006c..64fb1b044ba5 100644 --- a/test/battle/move_effect/morning_sun.c +++ b/test/battle/move_effect/morning_sun.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_MORNING_SUN].effect == EFFECT_MORNING_SUN); + ASSUME(GetMoveEffect(MOVE_MORNING_SUN) == EFFECT_MORNING_SUN); } SINGLE_BATTLE_TEST("Morning Sun recovers 1/2 of the user's max HP") diff --git a/test/battle/move_effect/multi_hit.c b/test/battle/move_effect/multi_hit.c index e2331efbf743..37334f2cb7df 100644 --- a/test/battle/move_effect/multi_hit.c +++ b/test/battle/move_effect/multi_hit.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_BULLET_SEED].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_BULLET_SEED) == EFFECT_MULTI_HIT); } SINGLE_BATTLE_TEST("Multi hit Moves hit the maximum amount with Skill Link") @@ -141,7 +141,7 @@ SINGLE_BATTLE_TEST("Multi hit Moves hit five times 50 Percent of the time with L SINGLE_BATTLE_TEST("Scale Shot decreases defense and increases speed after final hit") { GIVEN { - ASSUME(gMovesInfo[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_SCALE_SHOT) == EFFECT_MULTI_HIT); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -163,8 +163,8 @@ SINGLE_BATTLE_TEST("Scale Shot decreases defense and increases speed after final SINGLE_BATTLE_TEST("Scale Shot is immune to Fairy types and will end the move correctly") { GIVEN { - ASSUME(gMovesInfo[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT); - ASSUME(gMovesInfo[MOVE_SCALE_SHOT].type == TYPE_DRAGON); + ASSUME(GetMoveEffect(MOVE_SCALE_SHOT) == EFFECT_MULTI_HIT); + ASSUME(GetMoveType(MOVE_SCALE_SHOT) == TYPE_DRAGON); ASSUME(gSpeciesInfo[SPECIES_CLEFAIRY].types[0] == TYPE_FAIRY || gSpeciesInfo[SPECIES_CLEFAIRY].types[1] == TYPE_FAIRY); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_CLEFAIRY) { HP(1); } @@ -179,7 +179,7 @@ SINGLE_BATTLE_TEST("Scale Shot is immune to Fairy types and will end the move co DOUBLE_BATTLE_TEST("Scale Shot does not corrupt the next turn move used") { GIVEN { - ASSUME(gMovesInfo[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_SCALE_SHOT) == EFFECT_MULTI_HIT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); @@ -203,8 +203,8 @@ DOUBLE_BATTLE_TEST("Scale Shot does not corrupt the next turn move used") SINGLE_BATTLE_TEST("Endure does not prevent multiple hits and stat changes occur at the end of the turn") { GIVEN { - ASSUME(gMovesInfo[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT); - ASSUME(gMovesInfo[MOVE_ENDURE].effect == EFFECT_ENDURE); + ASSUME(GetMoveEffect(MOVE_SCALE_SHOT) == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_ENDURE) == EFFECT_ENDURE); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { HP(1); } } WHEN { @@ -228,7 +228,7 @@ SINGLE_BATTLE_TEST("Scale Shot decreases defense and increases speed after the 4 { PASSES_RANDOMLY(50, 100, RNG_LOADED_DICE); GIVEN { - ASSUME(gMovesInfo[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_SCALE_SHOT) == EFFECT_MULTI_HIT); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_LOADED_DICE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -253,7 +253,7 @@ SINGLE_BATTLE_TEST("Scale Shot decreases defense and increases speed after killi PARAMETRIZE { item = ITEM_LOADED_DICE; } GIVEN { - ASSUME(gMovesInfo[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_SCALE_SHOT) == EFFECT_MULTI_HIT); PLAYER(SPECIES_BAGON) { Item(item); } OPPONENT(SPECIES_SLUGMA) { Ability(ABILITY_WEAK_ARMOR); } OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/ohko.c b/test/battle/move_effect/ohko.c index 8a8015309b87..11dbb78f1f3a 100644 --- a/test/battle/move_effect/ohko.c +++ b/test/battle/move_effect/ohko.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SHEER_COLD].effect == EFFECT_OHKO); + ASSUME(GetMoveEffect(MOVE_SHEER_COLD) == EFFECT_OHKO); } SINGLE_BATTLE_TEST("Sheer Cold doesn't affect Ice-type Pokémon") @@ -24,7 +24,7 @@ SINGLE_BATTLE_TEST("Sheer Cold doesn't affect Ice-type Pokémon") SINGLE_BATTLE_TEST("OHKO moves can hit semi-invulnerable mons when the user has No-Guard") { GIVEN { - ASSUME(gMovesInfo[MOVE_SHEER_COLD].effect == EFFECT_OHKO); + ASSUME(GetMoveEffect(MOVE_SHEER_COLD) == EFFECT_OHKO); PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_NO_GUARD); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/photon_geyser.c b/test/battle/move_effect/photon_geyser.c index 986d3865aa5a..3f4bb10146ee 100644 --- a/test/battle/move_effect/photon_geyser.c +++ b/test/battle/move_effect/photon_geyser.c @@ -3,14 +3,14 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_PHOTON_GEYSER].effect == EFFECT_PHOTON_GEYSER); + ASSUME(GetMoveEffect(MOVE_PHOTON_GEYSER) == EFFECT_PHOTON_GEYSER); } SINGLE_BATTLE_TEST("Photon Geyser can be mirror coated if it is a special move") { GIVEN { // EFFECT_PHOTON_GEYSER requires the move data to be Special to work - ASSUME(gMovesInfo[MOVE_PHOTON_GEYSER].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_PHOTON_GEYSER) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET) { Attack(100); SpAttack(110); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/pledge.c b/test/battle/move_effect/pledge.c index 726adc81521f..5a659d7b966c 100644 --- a/test/battle/move_effect/pledge.c +++ b/test/battle/move_effect/pledge.c @@ -3,9 +3,9 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_WATER_PLEDGE].effect == EFFECT_PLEDGE); - ASSUME(gMovesInfo[MOVE_FIRE_PLEDGE].effect == EFFECT_PLEDGE); - ASSUME(gMovesInfo[MOVE_GRASS_PLEDGE].effect == EFFECT_PLEDGE); + ASSUME(GetMoveEffect(MOVE_WATER_PLEDGE) == EFFECT_PLEDGE); + ASSUME(GetMoveEffect(MOVE_FIRE_PLEDGE) == EFFECT_PLEDGE); + ASSUME(GetMoveEffect(MOVE_GRASS_PLEDGE) == EFFECT_PLEDGE); } DOUBLE_BATTLE_TEST("Water and Fire Pledge create a rainbow on the user's side of the field for four turns") @@ -189,7 +189,7 @@ DOUBLE_BATTLE_TEST("The base power of a combined pledge move effect is 150") s16 combinedPledgeDamage; GIVEN { - ASSUME(gMovesInfo[MOVE_HYPER_BEAM].power == 150); + ASSUME(GetMovePower(MOVE_HYPER_BEAM) == 150); PLAYER(SPECIES_WOBBUFFET) { Speed(4); } PLAYER(SPECIES_WYNAUT) { Speed(3); } OPPONENT(SPECIES_WOBBUFFET) { Speed(8); } @@ -313,7 +313,7 @@ DOUBLE_BATTLE_TEST("Damage calculation: Combined pledge move") PARAMETRIZE { expectedDamage = 136; } PARAMETRIZE { expectedDamage = 135; } GIVEN { - ASSUME(gMovesInfo[MOVE_GRASS_PLEDGE].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_GRASS_PLEDGE) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET) { Speed(4); } PLAYER(SPECIES_WOBBUFFET) { HP(521); SpDefense(152); Speed(3); } OPPONENT(SPECIES_CHARIZARD) { Speed(8); } @@ -344,7 +344,7 @@ DOUBLE_BATTLE_TEST("Pledge move combo interactions with Powder are correct") PARAMETRIZE { moveLeft = MOVE_GRASS_PLEDGE; moveRight = MOVE_FIRE_PLEDGE; speedLeft = 4; speedRight = 3; } PARAMETRIZE { moveLeft = MOVE_GRASS_PLEDGE; moveRight = MOVE_FIRE_PLEDGE; speedLeft = 3; speedRight = 4; } // FAIL 2 GIVEN { - ASSUME(gMovesInfo[MOVE_FIRE_PLEDGE].type == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_FIRE_PLEDGE) == TYPE_FIRE); PLAYER(SPECIES_WOBBUFFET) { Speed(speedLeft); } PLAYER(SPECIES_WYNAUT) { Speed(speedRight); } OPPONENT(SPECIES_WOBBUFFET) { Speed(8); } @@ -885,7 +885,7 @@ DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Electrify") { GIVEN { - ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + ASSUME(GetMoveEffect(MOVE_ELECTRIFY) == EFFECT_ELECTRIFY); PLAYER(SPECIES_MAROWAK) { Ability(ABILITY_LIGHTNING_ROD); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -1002,7 +1002,7 @@ DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Motor Drive") { GIVEN { - ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + ASSUME(GetMoveEffect(MOVE_ELECTRIFY) == EFFECT_ELECTRIFY); PLAYER(SPECIES_ELECTIVIRE) { Ability(ABILITY_MOTOR_DRIVE); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -1027,7 +1027,7 @@ DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Volt Absorb") { GIVEN { - ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + ASSUME(GetMoveEffect(MOVE_ELECTRIFY) == EFFECT_ELECTRIFY); PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/population_bomb.c b/test/battle/move_effect/population_bomb.c index b3e2e4768e9b..54da0726ae61 100644 --- a/test/battle/move_effect/population_bomb.c +++ b/test/battle/move_effect/population_bomb.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Population Bomb can hit ten times") { GIVEN { - ASSUME(gMovesInfo[MOVE_POPULATION_BOMB].strikeCount == 10); + ASSUME(GetMoveStrikeCount(MOVE_POPULATION_BOMB) == 10); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/powder.c b/test/battle/move_effect/powder.c index 7701f4d3a2ae..aa789fb05f3e 100644 --- a/test/battle/move_effect/powder.c +++ b/test/battle/move_effect/powder.c @@ -3,9 +3,9 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_POWDER].effect == EFFECT_POWDER); - ASSUME(gMovesInfo[MOVE_POWDER].powderMove == TRUE); - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(GetMoveEffect(MOVE_POWDER) == EFFECT_POWDER); + ASSUME(IsPowderMove(MOVE_POWDER)); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); } @@ -41,7 +41,7 @@ SINGLE_BATTLE_TEST("Powder blocks the target's Fire type moves and consumes PP") HP_BAR(opponent); } } THEN { - EXPECT_EQ(player->pp[0], gMovesInfo[MOVE_EMBER].pp - 1); + EXPECT_EQ(player->pp[0], GetMovePP(MOVE_EMBER) - 1); } } @@ -164,8 +164,8 @@ SINGLE_BATTLE_TEST("Powder fails if the target has Overcoat") DOUBLE_BATTLE_TEST("Powder still blocks the target's Fire type moves even if it was given Grass type") { GIVEN { - ASSUME(gMovesInfo[MOVE_FORESTS_CURSE].effect == EFFECT_THIRD_TYPE); - ASSUME(gMovesInfo[MOVE_FORESTS_CURSE].argument.type == TYPE_GRASS); + ASSUME(GetMoveEffect(MOVE_FORESTS_CURSE) == EFFECT_THIRD_TYPE); + ASSUME(GetMoveArgType(MOVE_FORESTS_CURSE) == TYPE_GRASS); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_TREVENANT); @@ -185,7 +185,7 @@ DOUBLE_BATTLE_TEST("Powder still blocks the target's Fire type moves even if it DOUBLE_BATTLE_TEST("Powder still blocks the target's Fire type moves even if it was given Overcoat") { GIVEN { - ASSUME(gMovesInfo[MOVE_DOODLE].effect == EFFECT_DOODLE); + ASSUME(GetMoveEffect(MOVE_DOODLE) == EFFECT_DOODLE); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_FORRETRESS) { Ability(ABILITY_OVERCOAT); } @@ -224,8 +224,8 @@ SINGLE_BATTLE_TEST("Powder prevents Protean from changing its user to Fire type" SINGLE_BATTLE_TEST("Powder doesn't prevent a Fire move from thawing its user out") { GIVEN { - ASSUME(gMovesInfo[MOVE_FLAME_WHEEL].thawsUser); - ASSUME(gMovesInfo[MOVE_FLAME_WHEEL].type == TYPE_FIRE); + ASSUME(MoveThawsUser(MOVE_FLAME_WHEEL)); + ASSUME(GetMoveType(MOVE_FLAME_WHEEL) == TYPE_FIRE); PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); } OPPONENT(SPECIES_VIVILLON); } WHEN { @@ -244,7 +244,7 @@ SINGLE_BATTLE_TEST("Powder doesn't prevent a Fire move from thawing its user out SINGLE_BATTLE_TEST("Powder doesn't consume Berry from Fire type Natural Gift but prevents using the move") { GIVEN { - ASSUME(gMovesInfo[MOVE_NATURAL_GIFT].effect == EFFECT_NATURAL_GIFT); + ASSUME(GetMoveEffect(MOVE_NATURAL_GIFT) == EFFECT_NATURAL_GIFT); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_CHERI_BERRY); } OPPONENT(SPECIES_VIVILLON); } WHEN { @@ -267,12 +267,12 @@ DOUBLE_BATTLE_TEST("Powder damages a target using Shell Trap even if it wasn't h PARAMETRIZE { move = MOVE_EMBER; } PARAMETRIZE { move = MOVE_TICKLE;} GIVEN { - ASSUME(gMovesInfo[MOVE_SHELL_TRAP].effect == EFFECT_SHELL_TRAP); - ASSUME(gMovesInfo[MOVE_SHELL_TRAP].type == TYPE_FIRE); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_EMBER].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_TICKLE].category == DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_TICKLE].effect == EFFECT_TICKLE); + ASSUME(GetMoveEffect(MOVE_SHELL_TRAP) == EFFECT_SHELL_TRAP); + ASSUME(GetMoveType(MOVE_SHELL_TRAP) == TYPE_FIRE); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_EMBER) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TICKLE) == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveEffect(MOVE_TICKLE) == EFFECT_TICKLE); PLAYER(SPECIES_TURTONATOR); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WYNAUT); diff --git a/test/battle/move_effect/power_based_on_target_hp.c b/test/battle/move_effect/power_based_on_target_hp.c index 2cecf3ff7f1e..030418cd87a0 100644 --- a/test/battle/move_effect/power_based_on_target_hp.c +++ b/test/battle/move_effect/power_based_on_target_hp.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_CRUSH_GRIP].effect == EFFECT_POWER_BASED_ON_TARGET_HP); + ASSUME(GetMoveEffect(MOVE_CRUSH_GRIP) == EFFECT_POWER_BASED_ON_TARGET_HP); } SINGLE_BATTLE_TEST("Crush Grip's damage is affected by the target's current HP", s16 damage) diff --git a/test/battle/move_effect/power_based_on_user_hp.c b/test/battle/move_effect/power_based_on_user_hp.c index 1dfa70ddf968..622b19552526 100644 --- a/test/battle/move_effect/power_based_on_user_hp.c +++ b/test/battle/move_effect/power_based_on_user_hp.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ERUPTION].effect == EFFECT_POWER_BASED_ON_USER_HP); + ASSUME(GetMoveEffect(MOVE_ERUPTION) == EFFECT_POWER_BASED_ON_USER_HP); } SINGLE_BATTLE_TEST("Eruption's damage is affected by the user's current HP", s16 damage) diff --git a/test/battle/move_effect/power_split.c b/test/battle/move_effect/power_split.c index 70d1bfd5ea06..84c64b1d8990 100644 --- a/test/battle/move_effect/power_split.c +++ b/test/battle/move_effect/power_split.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_POWER_SPLIT].effect == EFFECT_POWER_SPLIT); + ASSUME(GetMoveEffect(MOVE_POWER_SPLIT) == EFFECT_POWER_SPLIT); } SINGLE_BATTLE_TEST("Power Split averages user and targets Atk and Sp. Atk stats") diff --git a/test/battle/move_effect/protect.c b/test/battle/move_effect/protect.c index dff486cb001e..84862bbcd4c5 100644 --- a/test/battle/move_effect/protect.c +++ b/test/battle/move_effect/protect.c @@ -3,21 +3,21 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_PROTECT].effect == EFFECT_PROTECT); - ASSUME(gMovesInfo[MOVE_DETECT].effect == EFFECT_PROTECT); - ASSUME(gMovesInfo[MOVE_KINGS_SHIELD].effect == EFFECT_PROTECT); - ASSUME(gMovesInfo[MOVE_SILK_TRAP].effect == EFFECT_PROTECT); - ASSUME(gMovesInfo[MOVE_SPIKY_SHIELD].effect == EFFECT_PROTECT); - ASSUME(gMovesInfo[MOVE_WIDE_GUARD].effect == EFFECT_PROTECT); - ASSUME(gMovesInfo[MOVE_QUICK_GUARD].effect == EFFECT_PROTECT); - ASSUME(gMovesInfo[MOVE_CRAFTY_SHIELD].effect == EFFECT_PROTECT); - ASSUME(gMovesInfo[MOVE_BANEFUL_BUNKER].effect == EFFECT_PROTECT); - ASSUME(gMovesInfo[MOVE_BURNING_BULWARK].effect == EFFECT_PROTECT); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(gMovesInfo[MOVE_LEER].category == DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_WATER_GUN].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(!(gMovesInfo[MOVE_WATER_GUN].makesContact)); + ASSUME(GetMoveEffect(MOVE_PROTECT) == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_DETECT) == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_KINGS_SHIELD) == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_SILK_TRAP) == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_SPIKY_SHIELD) == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_WIDE_GUARD) == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_QUICK_GUARD) == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_CRAFTY_SHIELD) == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_BANEFUL_BUNKER) == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_BURNING_BULWARK) == EFFECT_PROTECT); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(GetMoveCategory(MOVE_LEER) == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveCategory(MOVE_WATER_GUN) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(!(MoveMakesContact(MOVE_WATER_GUN))); } SINGLE_BATTLE_TEST("Protect, Detect, Spiky Shield, Baneful Bunker and Burning Bulwark protect from all moves") @@ -244,10 +244,10 @@ SINGLE_BATTLE_TEST("Recoil damage is not applied if target was protected") GIVEN { - ASSUME(gMovesInfo[MOVE_VOLT_TACKLE].recoil > 0); - ASSUME(gMovesInfo[MOVE_HEAD_SMASH].recoil > 0); - ASSUME(gMovesInfo[MOVE_TAKE_DOWN].recoil > 0); - ASSUME(gMovesInfo[MOVE_DOUBLE_EDGE].recoil > 0); + ASSUME(GetMoveRecoil(MOVE_VOLT_TACKLE) > 0); + ASSUME(GetMoveRecoil(MOVE_HEAD_SMASH) > 0); + ASSUME(GetMoveRecoil(MOVE_TAKE_DOWN) > 0); + ASSUME(GetMoveRecoil(MOVE_DOUBLE_EDGE) > 0); PLAYER(SPECIES_RAPIDASH); OPPONENT(SPECIES_BEAUTIFLY); } WHEN { @@ -282,7 +282,7 @@ SINGLE_BATTLE_TEST("Multi-hit moves don't hit a protected target and fail only o PARAMETRIZE { move = MOVE_SPIKY_SHIELD; } GIVEN { - ASSUME(gMovesInfo[MOVE_ARM_THRUST].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_ARM_THRUST) == EFFECT_MULTI_HIT); PLAYER(SPECIES_RAPIDASH); OPPONENT(SPECIES_BEAUTIFLY); } WHEN { @@ -325,9 +325,9 @@ DOUBLE_BATTLE_TEST("Wide Guard protects self and ally from multi-target moves") PARAMETRIZE { move = MOVE_HYPER_VOICE; } // 2 foes GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].target == MOVE_TARGET_SELECTED); - ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); - ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_TACKLE) == MOVE_TARGET_SELECTED); + ASSUME(GetMoveTarget(MOVE_SURF) == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_HYPER_VOICE) == MOVE_TARGET_BOTH); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -364,7 +364,7 @@ DOUBLE_BATTLE_TEST("Wide Guard can not fail on consecutive turns") PASSES_RANDOMLY(2, 2); GIVEN { - ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_HYPER_VOICE) == MOVE_TARGET_BOTH); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -397,8 +397,8 @@ DOUBLE_BATTLE_TEST("Quick Guard protects self and ally from priority moves") PARAMETRIZE { move = MOVE_QUICK_ATTACK; targetOpponent = opponentRight; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].priority == 0); - ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1); + ASSUME(GetMovePriority(MOVE_TACKLE) == 0); + ASSUME(GetMovePriority(MOVE_QUICK_ATTACK) == 1); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -427,7 +427,7 @@ DOUBLE_BATTLE_TEST("Quick Guard can not fail on consecutive turns") PASSES_RANDOMLY(2, 2); GIVEN { - ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1); + ASSUME(GetMovePriority(MOVE_QUICK_ATTACK) == 1); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -457,9 +457,9 @@ DOUBLE_BATTLE_TEST("Crafty Shield protects self and ally from status moves") PARAMETRIZE { move = MOVE_TACKLE; targetOpponent = opponentRight; } GIVEN { - ASSUME(gMovesInfo[MOVE_LEER].target == MOVE_TARGET_BOTH); - ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH); - ASSUME(gMovesInfo[MOVE_HYPER_VOICE].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveTarget(MOVE_LEER) == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_HYPER_VOICE) == MOVE_TARGET_BOTH); + ASSUME(GetMoveCategory(MOVE_HYPER_VOICE) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -494,10 +494,10 @@ SINGLE_BATTLE_TEST("Protect does not block Confide or Decorate") PARAMETRIZE { move = MOVE_DECORATE; } GIVEN { - ASSUME(gMovesInfo[MOVE_CONFIDE].effect == EFFECT_SPECIAL_ATTACK_DOWN); - ASSUME(gMovesInfo[MOVE_CONFIDE].ignoresProtect == TRUE); - ASSUME(gMovesInfo[MOVE_DECORATE].effect == EFFECT_DECORATE); - ASSUME(gMovesInfo[MOVE_DECORATE].ignoresProtect == TRUE); + ASSUME(GetMoveEffect(MOVE_CONFIDE) == EFFECT_SPECIAL_ATTACK_DOWN); + ASSUME(MoveIgnoresProtect(MOVE_CONFIDE)); + ASSUME(GetMoveEffect(MOVE_DECORATE) == EFFECT_DECORATE); + ASSUME(MoveIgnoresProtect(MOVE_DECORATE)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -516,10 +516,10 @@ DOUBLE_BATTLE_TEST("Crafty Shield protects self and ally from Confide and Decora PARAMETRIZE { move = MOVE_DECORATE; } GIVEN { - ASSUME(gMovesInfo[MOVE_CONFIDE].effect == EFFECT_SPECIAL_ATTACK_DOWN); - ASSUME(gMovesInfo[MOVE_CONFIDE].ignoresProtect == TRUE); - ASSUME(gMovesInfo[MOVE_DECORATE].effect == EFFECT_DECORATE); - ASSUME(gMovesInfo[MOVE_DECORATE].ignoresProtect == TRUE); + ASSUME(GetMoveEffect(MOVE_CONFIDE) == EFFECT_SPECIAL_ATTACK_DOWN); + ASSUME(MoveIgnoresProtect(MOVE_CONFIDE)); + ASSUME(GetMoveEffect(MOVE_DECORATE) == EFFECT_DECORATE); + ASSUME(MoveIgnoresProtect(MOVE_DECORATE)); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/pursuit.c b/test/battle/move_effect/pursuit.c index a20b1ed1d129..ea64813e68bd 100644 --- a/test/battle/move_effect/pursuit.c +++ b/test/battle/move_effect/pursuit.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_PURSUIT].effect == EFFECT_PURSUIT); + ASSUME(GetMoveEffect(MOVE_PURSUIT) == EFFECT_PURSUIT); } SINGLE_BATTLE_TEST("Pursuit attacks a switching foe") @@ -29,9 +29,9 @@ SINGLE_BATTLE_TEST("Pursuit attacks a foe using Volt Switch / U-Turn / Parting S PARAMETRIZE { move = MOVE_U_TURN; } PARAMETRIZE { move = MOVE_PARTING_SHOT; } GIVEN { - ASSUME(gMovesInfo[MOVE_VOLT_SWITCH].effect == EFFECT_HIT_ESCAPE); - ASSUME(gMovesInfo[MOVE_U_TURN].effect == EFFECT_HIT_ESCAPE); - ASSUME(gMovesInfo[MOVE_PARTING_SHOT].effect == EFFECT_PARTING_SHOT); + ASSUME(GetMoveEffect(MOVE_VOLT_SWITCH) == EFFECT_HIT_ESCAPE); + ASSUME(GetMoveEffect(MOVE_U_TURN) == EFFECT_HIT_ESCAPE); + ASSUME(GetMoveEffect(MOVE_PARTING_SHOT) == EFFECT_PARTING_SHOT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_WYNAUT); @@ -51,9 +51,9 @@ DOUBLE_BATTLE_TEST("Pursuit doesn't attack a foe using Teleport / Baton Pass to PARAMETRIZE { move = MOVE_TELEPORT; } PARAMETRIZE { move = MOVE_BATON_PASS; } GIVEN { - ASSUME(gMovesInfo[MOVE_QUASH].effect == EFFECT_QUASH); - ASSUME(gMovesInfo[MOVE_TELEPORT].effect == EFFECT_TELEPORT); - ASSUME(gMovesInfo[MOVE_BATON_PASS].effect == EFFECT_BATON_PASS); + ASSUME(GetMoveEffect(MOVE_QUASH) == EFFECT_QUASH); + ASSUME(GetMoveEffect(MOVE_TELEPORT) == EFFECT_TELEPORT); + ASSUME(GetMoveEffect(MOVE_BATON_PASS) == EFFECT_BATON_PASS); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_NIDOKING); PLAYER(SPECIES_ZIGZAGOON); @@ -115,8 +115,8 @@ SINGLE_BATTLE_TEST("Pursuit ignores accuracy checks when attacking a switching t { PASSES_RANDOMLY(100, 100, RNG_ACCURACY); GIVEN { - ASSUME(gMovesInfo[MOVE_SAND_ATTACK].effect == EFFECT_ACCURACY_DOWN); - ASSUME(gMovesInfo[MOVE_HAIL].effect == EFFECT_HAIL); + ASSUME(GetMoveEffect(MOVE_SAND_ATTACK) == EFFECT_ACCURACY_DOWN); + ASSUME(GetMoveEffect(MOVE_HAIL) == EFFECT_HAIL); PLAYER(SPECIES_GLACEON) { Ability(ABILITY_SNOW_CLOAK); } PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_WOBBUFFET); @@ -340,7 +340,7 @@ SINGLE_BATTLE_TEST("Pursuit attacks a switching foe and takes Life Orb damage") DOUBLE_BATTLE_TEST("Pursuit attacks a switching foe but isn't affected by Follow Me") { GIVEN { - ASSUME(gMovesInfo[MOVE_FOLLOW_ME].effect == EFFECT_FOLLOW_ME); + ASSUME(GetMoveEffect(MOVE_FOLLOW_ME) == EFFECT_FOLLOW_ME); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_CLEFABLE); PLAYER(SPECIES_ZIGZAGOON); @@ -422,7 +422,7 @@ SINGLE_BATTLE_TEST("Pursuit user terastalizes before attacking a switching foe a DOUBLE_BATTLE_TEST("Pursuit affected by Electrify fails against immune target") { GIVEN { - ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + ASSUME(GetMoveEffect(MOVE_ELECTRIFY) == EFFECT_ELECTRIFY); PLAYER(SPECIES_DONPHAN); PLAYER(SPECIES_HELIOLISK); PLAYER(SPECIES_ZIGZAGOON); @@ -441,7 +441,7 @@ DOUBLE_BATTLE_TEST("Pursuit affected by Electrify fails against immune target") DOUBLE_BATTLE_TEST("Pursuit affected by Electrify fails against target with Volt Absorb") { GIVEN { - ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + ASSUME(GetMoveEffect(MOVE_ELECTRIFY) == EFFECT_ELECTRIFY); PLAYER(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); } PLAYER(SPECIES_HELIOLISK); PLAYER(SPECIES_ZIGZAGOON); diff --git a/test/battle/move_effect/quash.c b/test/battle/move_effect/quash.c index b342eafd74ae..1d2f89230c11 100644 --- a/test/battle/move_effect/quash.c +++ b/test/battle/move_effect/quash.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_QUASH].effect == EFFECT_QUASH); + ASSUME(GetMoveEffect(MOVE_QUASH) == EFFECT_QUASH); } DOUBLE_BATTLE_TEST("Quash-affected target will move last in the priority bracket") @@ -27,7 +27,7 @@ DOUBLE_BATTLE_TEST("Quash is not affected by dynamic speed") { GIVEN { ASSUME(B_RECALC_TURN_AFTER_ACTIONS >= GEN_8); - ASSUME(gMovesInfo[MOVE_TAILWIND].effect == EFFECT_TAILWIND); + ASSUME(GetMoveEffect(MOVE_TAILWIND) == EFFECT_TAILWIND); PLAYER(SPECIES_VOLBEAT) { Speed(10); Ability(ABILITY_PRANKSTER); } PLAYER(SPECIES_WOBBUFFET) { Speed(30); } OPPONENT(SPECIES_TORCHIC) { Speed(50); } @@ -113,8 +113,8 @@ DOUBLE_BATTLE_TEST("Quash-affected mon that acted early via After You is not aff { GIVEN { ASSUME(B_RECALC_TURN_AFTER_ACTIONS >= GEN_8); - ASSUME(gMovesInfo[MOVE_TAILWIND].effect == EFFECT_TAILWIND); - ASSUME(gMovesInfo[MOVE_AFTER_YOU].effect == EFFECT_AFTER_YOU); + ASSUME(GetMoveEffect(MOVE_TAILWIND) == EFFECT_TAILWIND); + ASSUME(GetMoveEffect(MOVE_AFTER_YOU) == EFFECT_AFTER_YOU); PLAYER(SPECIES_VOLBEAT) { Speed(20); Ability(ABILITY_PRANKSTER); } PLAYER(SPECIES_WOBBUFFET) { Speed(30); } OPPONENT(SPECIES_TORCHIC) { Speed(10); } diff --git a/test/battle/move_effect/rage_fist.c b/test/battle/move_effect/rage_fist.c index 7bc349cef03e..7a87f3e34d28 100644 --- a/test/battle/move_effect/rage_fist.c +++ b/test/battle/move_effect/rage_fist.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_RAGE_FIST].effect == EFFECT_RAGE_FIST); - ASSUME(gMovesInfo[MOVE_RAGE_FIST].power == 50); + ASSUME(GetMoveEffect(MOVE_RAGE_FIST) == EFFECT_RAGE_FIST); + ASSUME(GetMovePower(MOVE_RAGE_FIST) == 50); } SINGLE_BATTLE_TEST("Rage Fist base power is increased by 50 if the user takes damage") @@ -37,7 +37,7 @@ SINGLE_BATTLE_TEST("Rage Fist base power is increased by each multi hit") s16 timesGotHit[2]; GIVEN { - ASSUME(gMovesInfo[MOVE_BULLET_SEED].effect == EFFECT_MULTI_HIT); + ASSUME(GetMoveEffect(MOVE_BULLET_SEED) == EFFECT_MULTI_HIT); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_REGIROCK); } WHEN { @@ -130,7 +130,7 @@ SINGLE_BATTLE_TEST("Rage Fist base power is not increased if a substitute was hi s16 timesGotHit[2]; GIVEN { - ASSUME(gMovesInfo[MOVE_CRUNCH].category == DAMAGE_CATEGORY_PHYSICAL); // Substitute doesn't fade otherwise + ASSUME(GetMoveCategory(MOVE_CRUNCH) == DAMAGE_CATEGORY_PHYSICAL); // Substitute doesn't fade otherwise PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_REGIROCK); } WHEN { diff --git a/test/battle/move_effect/raging_bull.c b/test/battle/move_effect/raging_bull.c index 7e72ca82738a..c75c97749515 100644 --- a/test/battle/move_effect/raging_bull.c +++ b/test/battle/move_effect/raging_bull.c @@ -3,11 +3,11 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_RAGING_BULL].effect == EFFECT_RAGING_BULL); - ASSUME(gMovesInfo[MOVE_SNOWSCAPE].effect == EFFECT_SNOWSCAPE); - ASSUME(gMovesInfo[MOVE_LIGHT_SCREEN].effect == EFFECT_LIGHT_SCREEN); - ASSUME(gMovesInfo[MOVE_REFLECT].effect == EFFECT_REFLECT); - ASSUME(gMovesInfo[MOVE_AURORA_VEIL].effect == EFFECT_AURORA_VEIL); + ASSUME(GetMoveEffect(MOVE_RAGING_BULL) == EFFECT_RAGING_BULL); + ASSUME(GetMoveEffect(MOVE_SNOWSCAPE) == EFFECT_SNOWSCAPE); + ASSUME(GetMoveEffect(MOVE_LIGHT_SCREEN) == EFFECT_LIGHT_SCREEN); + ASSUME(GetMoveEffect(MOVE_REFLECT) == EFFECT_REFLECT); + ASSUME(GetMoveEffect(MOVE_AURORA_VEIL) == EFFECT_AURORA_VEIL); } SINGLE_BATTLE_TEST("Raging Bull removes Light Screen, Reflect and Aurora Veil from the target's side of the field") diff --git a/test/battle/move_effect/recoil_if_miss.c b/test/battle/move_effect/recoil_if_miss.c index a5f011109548..8695156dd032 100644 --- a/test/battle/move_effect/recoil_if_miss.c +++ b/test/battle/move_effect/recoil_if_miss.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_JUMP_KICK].effect == EFFECT_RECOIL_IF_MISS); + ASSUME(GetMoveEffect(MOVE_JUMP_KICK) == EFFECT_RECOIL_IF_MISS); } SINGLE_BATTLE_TEST("Jump Kick has 50% recoil on miss") @@ -25,7 +25,7 @@ SINGLE_BATTLE_TEST("Jump Kick has 50% recoil on miss") SINGLE_BATTLE_TEST("Jump Kick has 50% recoil on protect") { GIVEN { - ASSUME(!gMovesInfo[MOVE_JUMP_KICK].ignoresProtect); + ASSUME(!MoveIgnoresProtect(MOVE_JUMP_KICK)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -64,7 +64,7 @@ SINGLE_BATTLE_TEST("Jump Kick's recoil happens after Spiky Shield damage and Pok PARAMETRIZE { hp = maxHp / 8; faintOnSpiky = TRUE; } // Faints after Spiky Shield's recoil GIVEN { - ASSUME(gMovesInfo[MOVE_SPIKY_SHIELD].effect == EFFECT_PROTECT); + ASSUME(GetMoveEffect(MOVE_SPIKY_SHIELD) == EFFECT_PROTECT); PLAYER(SPECIES_WOBBUFFET) { HP(hp); MaxHP(maxHp); } PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/reflect.c b/test/battle/move_effect/reflect.c index 429dc6f6969e..83ac3b8503ef 100644 --- a/test/battle/move_effect/reflect.c +++ b/test/battle/move_effect/reflect.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_REFLECT].effect == EFFECT_REFLECT); + ASSUME(GetMoveEffect(MOVE_REFLECT) == EFFECT_REFLECT); } SINGLE_BATTLE_TEST("Reflect reduces physical damage", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Reflect reduces physical damage", s16 damage) PARAMETRIZE { move = MOVE_CELEBRATE; } PARAMETRIZE { move = MOVE_REFLECT; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -30,7 +30,7 @@ SINGLE_BATTLE_TEST("Reflect applies for 5 turns") { s16 damage[6]; GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/refresh.c b/test/battle/move_effect/refresh.c index 7cf319f3e6f8..7d0ba0273e52 100644 --- a/test/battle/move_effect/refresh.c +++ b/test/battle/move_effect/refresh.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_REFRESH].effect == EFFECT_REFRESH); + ASSUME(GetMoveEffect(MOVE_REFRESH) == EFFECT_REFRESH); } SINGLE_BATTLE_TEST("Refresh cures the user of burn, frostbite, poison, and paralysis") @@ -45,8 +45,8 @@ SINGLE_BATTLE_TEST("Refresh does not cure the user of Freeze") SINGLE_BATTLE_TEST("Refresh does not cure sleep when used by Sleep Talk") { GIVEN { - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_SLEEP_TALK].effect == EFFECT_SLEEP_TALK); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SLEEP_TALK) == EFFECT_SLEEP_TALK); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_SLEEP_TALK, MOVE_REFRESH); } } WHEN { diff --git a/test/battle/move_effect/relic_song.c b/test/battle/move_effect/relic_song.c index e7569c7e389e..f1e7fae92fdc 100644 --- a/test/battle/move_effect/relic_song.c +++ b/test/battle/move_effect/relic_song.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_RELIC_SONG].effect == EFFECT_RELIC_SONG); + ASSUME(GetMoveEffect(MOVE_RELIC_SONG) == EFFECT_RELIC_SONG); ASSUME(MoveHasAdditionalEffect(MOVE_RELIC_SONG, MOVE_EFFECT_SLEEP) == TRUE); } diff --git a/test/battle/move_effect/retaliate.c b/test/battle/move_effect/retaliate.c index 581793e8547a..39c26d196c43 100644 --- a/test/battle/move_effect/retaliate.c +++ b/test/battle/move_effect/retaliate.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_RETALIATE].effect == EFFECT_RETALIATE); + ASSUME(GetMoveEffect(MOVE_RETALIATE) == EFFECT_RETALIATE); } SINGLE_BATTLE_TEST("Retaliate doubles in base power the turn after an ally faints") @@ -63,17 +63,17 @@ DOUBLE_BATTLE_TEST("Retaliate works with passive damage") PARAMETRIZE { move = MOVE_FLAME_BURST; moveTarget = playerRight; } PARAMETRIZE { move = MOVE_FIRE_PLEDGE; moveTarget = playerRight; move2 = MOVE_GRASS_PLEDGE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); - ASSUME(gMovesInfo[MOVE_POISON_POWDER].effect == EFFECT_POISON); - ASSUME(gMovesInfo[MOVE_WILL_O_WISP].effect == EFFECT_WILL_O_WISP); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_POISON_POWDER) == EFFECT_POISON); + ASSUME(GetMoveEffect(MOVE_WILL_O_WISP) == EFFECT_WILL_O_WISP); #if B_USE_FROSTBITE == TRUE - ASSUME(gMovesInfo[MOVE_ICE_BEAM].additionalEffects[0].moveEffect == MOVE_EFFECT_FREEZE_OR_FROSTBITE); + ASSUME(GetMoveAdditionalEffectById(MOVE_ICE_BEAM, 0)->moveEffect == MOVE_EFFECT_FREEZE_OR_FROSTBITE); #endif - ASSUME(gMovesInfo[MOVE_SANDSTORM].effect == EFFECT_SANDSTORM); - ASSUME(gMovesInfo[MOVE_HAIL].effect == EFFECT_HAIL); - ASSUME(gMovesInfo[MOVE_LEECH_SEED].effect == EFFECT_LEECH_SEED); - ASSUME(gMovesInfo[MOVE_MAGMA_STORM].additionalEffects[0].moveEffect == MOVE_EFFECT_WRAP); - ASSUME(gMovesInfo[MOVE_FLAME_BURST].additionalEffects[0].moveEffect == MOVE_EFFECT_FLAME_BURST); + ASSUME(GetMoveEffect(MOVE_SANDSTORM) == EFFECT_SANDSTORM); + ASSUME(GetMoveEffect(MOVE_HAIL) == EFFECT_HAIL); + ASSUME(GetMoveEffect(MOVE_LEECH_SEED) == EFFECT_LEECH_SEED); + ASSUME(GetMoveAdditionalEffectById(MOVE_MAGMA_STORM, 0)->moveEffect == MOVE_EFFECT_WRAP); + ASSUME(GetMoveAdditionalEffectById(MOVE_FLAME_BURST, 0)->moveEffect == MOVE_EFFECT_FLAME_BURST); PLAYER(SPECIES_WYNAUT) { Ability(ABILITY_SHADOW_TAG); HP(18); } PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_SHADOW_TAG); } PLAYER(SPECIES_WOBBUFFET); @@ -97,7 +97,7 @@ SINGLE_BATTLE_TEST("Retaliate works with Perish Song") { s16 damage[2]; GIVEN { - ASSUME(gMovesInfo[MOVE_PERISH_SONG].effect == EFFECT_PERISH_SONG); + ASSUME(GetMoveEffect(MOVE_PERISH_SONG) == EFFECT_PERISH_SONG); PLAYER(SPECIES_WYNAUT); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_KOMMO_O) { Ability(ABILITY_SOUNDPROOF); } @@ -120,7 +120,7 @@ SINGLE_BATTLE_TEST("Retaliate works with self-inflicted fainting") { s16 damage[2]; GIVEN { - ASSUME(gMovesInfo[MOVE_HEALING_WISH].effect == EFFECT_HEALING_WISH); + ASSUME(GetMoveEffect(MOVE_HEALING_WISH) == EFFECT_HEALING_WISH); PLAYER(SPECIES_WYNAUT); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/revelation_dance.c b/test/battle/move_effect/revelation_dance.c index 0549abb7b77b..3730ecc0b2a5 100644 --- a/test/battle/move_effect/revelation_dance.c +++ b/test/battle/move_effect/revelation_dance.c @@ -3,12 +3,12 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_REVELATION_DANCE].effect == EFFECT_REVELATION_DANCE); - ASSUME(gMovesInfo[MOVE_REVELATION_DANCE].danceMove == TRUE); + ASSUME(GetMoveEffect(MOVE_REVELATION_DANCE) == EFFECT_REVELATION_DANCE); + ASSUME(IsDanceMove(MOVE_REVELATION_DANCE)); ASSUME(IsMoveEffectRemoveSpeciesType(MOVE_BURN_UP, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE)); - ASSUME(gMovesInfo[MOVE_FORESTS_CURSE].effect == EFFECT_THIRD_TYPE); - ASSUME(gMovesInfo[MOVE_FORESTS_CURSE].argument.type == TYPE_GRASS); - ASSUME(gMovesInfo[MOVE_ROOST].effect == EFFECT_ROOST); + ASSUME(GetMoveEffect(MOVE_FORESTS_CURSE) == EFFECT_THIRD_TYPE); + ASSUME(GetMoveArgType(MOVE_FORESTS_CURSE) == TYPE_GRASS); + ASSUME(GetMoveEffect(MOVE_ROOST) == EFFECT_ROOST); } SINGLE_BATTLE_TEST("Revelation Dance changes its type depending on the user's 1st Type") diff --git a/test/battle/move_effect/revival_blessing.c b/test/battle/move_effect/revival_blessing.c index dbeda39f9153..10198ce3527a 100644 --- a/test/battle/move_effect/revival_blessing.c +++ b/test/battle/move_effect/revival_blessing.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_REVIVAL_BLESSING].effect == EFFECT_REVIVAL_BLESSING); + ASSUME(GetMoveEffect(MOVE_REVIVAL_BLESSING) == EFFECT_REVIVAL_BLESSING); } SINGLE_BATTLE_TEST("Revival Blessing revives a chosen fainted party member for the player") diff --git a/test/battle/move_effect/roar.c b/test/battle/move_effect/roar.c index f67a24bba102..ef6439088f5e 100644 --- a/test/battle/move_effect/roar.c +++ b/test/battle/move_effect/roar.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ROAR].effect == EFFECT_ROAR); + ASSUME(GetMoveEffect(MOVE_ROAR) == EFFECT_ROAR); } SINGLE_BATTLE_TEST("Roar switches the target with a random non-fainted replacement") diff --git a/test/battle/move_effect/role_play.c b/test/battle/move_effect/role_play.c index ab0d801ee9b9..d2d937f7d121 100644 --- a/test/battle/move_effect/role_play.c +++ b/test/battle/move_effect/role_play.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ROLE_PLAY].effect == EFFECT_ROLE_PLAY); + ASSUME(GetMoveEffect(MOVE_ROLE_PLAY) == EFFECT_ROLE_PLAY); } SINGLE_BATTLE_TEST("Role Play copies target's ability") diff --git a/test/battle/move_effect/roost.c b/test/battle/move_effect/roost.c index 449119a89abc..51d9499bd19c 100644 --- a/test/battle/move_effect/roost.c +++ b/test/battle/move_effect/roost.c @@ -3,28 +3,28 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ROOST].effect == EFFECT_ROOST); + ASSUME(GetMoveEffect(MOVE_ROOST) == EFFECT_ROOST); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_FLYING); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_FLYING); // One attack of each type to verify typelessness - ASSUME(gMovesInfo[MOVE_POUND].type == TYPE_NORMAL); - ASSUME(gMovesInfo[MOVE_KARATE_CHOP].type == TYPE_FIGHTING); - ASSUME(gMovesInfo[MOVE_GUST].type == TYPE_FLYING); - ASSUME(gMovesInfo[MOVE_POISON_STING].type == TYPE_POISON); - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].type == TYPE_GROUND); - ASSUME(gMovesInfo[MOVE_ROCK_THROW].type == TYPE_ROCK); - ASSUME(gMovesInfo[MOVE_LEECH_LIFE].type == TYPE_BUG); - ASSUME(gMovesInfo[MOVE_LICK].type == TYPE_GHOST); - ASSUME(gMovesInfo[MOVE_STEEL_WING].type == TYPE_STEEL); - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); - ASSUME(gMovesInfo[MOVE_WATER_GUN].type == TYPE_WATER); - ASSUME(gMovesInfo[MOVE_VINE_WHIP].type == TYPE_GRASS); - ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC); - ASSUME(gMovesInfo[MOVE_CONFUSION].type == TYPE_PSYCHIC); - ASSUME(gMovesInfo[MOVE_ICE_BEAM].type == TYPE_ICE); - ASSUME(gMovesInfo[MOVE_DRAGON_BREATH].type == TYPE_DRAGON); - ASSUME(gMovesInfo[MOVE_BITE].type == TYPE_DARK); - ASSUME(gMovesInfo[MOVE_DISARMING_VOICE].type == TYPE_FAIRY); + ASSUME(GetMoveType(MOVE_POUND) == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_KARATE_CHOP) == TYPE_FIGHTING); + ASSUME(GetMoveType(MOVE_GUST) == TYPE_FLYING); + ASSUME(GetMoveType(MOVE_POISON_STING) == TYPE_POISON); + ASSUME(GetMoveType(MOVE_EARTHQUAKE) == TYPE_GROUND); + ASSUME(GetMoveType(MOVE_ROCK_THROW) == TYPE_ROCK); + ASSUME(GetMoveType(MOVE_LEECH_LIFE) == TYPE_BUG); + ASSUME(GetMoveType(MOVE_LICK) == TYPE_GHOST); + ASSUME(GetMoveType(MOVE_STEEL_WING) == TYPE_STEEL); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_WATER_GUN) == TYPE_WATER); + ASSUME(GetMoveType(MOVE_VINE_WHIP) == TYPE_GRASS); + ASSUME(GetMoveType(MOVE_THUNDER_SHOCK) == TYPE_ELECTRIC); + ASSUME(GetMoveType(MOVE_CONFUSION) == TYPE_PSYCHIC); + ASSUME(GetMoveType(MOVE_ICE_BEAM) == TYPE_ICE); + ASSUME(GetMoveType(MOVE_DRAGON_BREATH) == TYPE_DRAGON); + ASSUME(GetMoveType(MOVE_BITE) == TYPE_DARK); + ASSUME(GetMoveType(MOVE_DISARMING_VOICE) == TYPE_FAIRY); } SINGLE_BATTLE_TEST("Roost fails when user is at full HP") diff --git a/test/battle/move_effect/round.c b/test/battle/move_effect/round.c index 09209c79a2b6..0bac324b0fee 100644 --- a/test/battle/move_effect/round.c +++ b/test/battle/move_effect/round.c @@ -3,14 +3,14 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ROUND].effect == EFFECT_ROUND); + ASSUME(GetMoveEffect(MOVE_ROUND) == EFFECT_ROUND); } DOUBLE_BATTLE_TEST("Round allows other battlers which also selected the moves to immediately use the move, ignoring turn order") { GIVEN { ASSUME(gItemsInfo[ITEM_LAGGING_TAIL].holdEffect == HOLD_EFFECT_LAGGING_TAIL); - ASSUME(gMovesInfo[MOVE_IRON_HEAD].additionalEffects[0].moveEffect == MOVE_EFFECT_FLINCH); + ASSUME(GetMoveAdditionalEffectById(MOVE_IRON_HEAD, 0)->moveEffect == MOVE_EFFECT_FLINCH); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/semi_invulnerable.c b/test/battle/move_effect/semi_invulnerable.c index d5bf90948884..331413121c14 100644 --- a/test/battle/move_effect/semi_invulnerable.c +++ b/test/battle/move_effect/semi_invulnerable.c @@ -3,18 +3,18 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_FLY].effect == EFFECT_SEMI_INVULNERABLE); - ASSUME(UNCOMPRESS_BITS(gMovesInfo[MOVE_FLY].argument.twoTurnAttack.status) == STATUS3_ON_AIR); - ASSUME(gMovesInfo[MOVE_DIG].effect == EFFECT_SEMI_INVULNERABLE); - ASSUME(UNCOMPRESS_BITS(gMovesInfo[MOVE_DIG].argument.twoTurnAttack.status) == STATUS3_UNDERGROUND); - ASSUME(gMovesInfo[MOVE_BOUNCE].effect == EFFECT_SEMI_INVULNERABLE); - ASSUME(UNCOMPRESS_BITS(gMovesInfo[MOVE_BOUNCE].argument.twoTurnAttack.status) == STATUS3_ON_AIR); - ASSUME(gMovesInfo[MOVE_DIVE].effect == EFFECT_SEMI_INVULNERABLE); - ASSUME(UNCOMPRESS_BITS(gMovesInfo[MOVE_DIVE].argument.twoTurnAttack.status) == STATUS3_UNDERWATER); - ASSUME(gMovesInfo[MOVE_PHANTOM_FORCE].effect == EFFECT_SEMI_INVULNERABLE); - ASSUME(UNCOMPRESS_BITS(gMovesInfo[MOVE_PHANTOM_FORCE].argument.twoTurnAttack.status) == STATUS3_PHANTOM_FORCE); - ASSUME(gMovesInfo[MOVE_SHADOW_FORCE].effect == EFFECT_SEMI_INVULNERABLE); - ASSUME(UNCOMPRESS_BITS(gMovesInfo[MOVE_SHADOW_FORCE].argument.twoTurnAttack.status) == STATUS3_PHANTOM_FORCE); + ASSUME(GetMoveEffect(MOVE_FLY) == EFFECT_SEMI_INVULNERABLE); + ASSUME(GetMoveTwoTurnAttackStatus(MOVE_FLY) == STATUS3_ON_AIR); + ASSUME(GetMoveEffect(MOVE_DIG) == EFFECT_SEMI_INVULNERABLE); + ASSUME(GetMoveTwoTurnAttackStatus(MOVE_DIG) == STATUS3_UNDERGROUND); + ASSUME(GetMoveEffect(MOVE_BOUNCE) == EFFECT_SEMI_INVULNERABLE); + ASSUME(GetMoveTwoTurnAttackStatus(MOVE_BOUNCE) == STATUS3_ON_AIR); + ASSUME(GetMoveEffect(MOVE_DIVE) == EFFECT_SEMI_INVULNERABLE); + ASSUME(GetMoveTwoTurnAttackStatus(MOVE_DIVE) == STATUS3_UNDERWATER); + ASSUME(GetMoveEffect(MOVE_PHANTOM_FORCE) == EFFECT_SEMI_INVULNERABLE); + ASSUME(GetMoveTwoTurnAttackStatus(MOVE_PHANTOM_FORCE) == STATUS3_PHANTOM_FORCE); + ASSUME(GetMoveEffect(MOVE_SHADOW_FORCE) == EFFECT_SEMI_INVULNERABLE); + ASSUME(GetMoveTwoTurnAttackStatus(MOVE_SHADOW_FORCE) == STATUS3_PHANTOM_FORCE); } SINGLE_BATTLE_TEST("Semi-invulnerable moves make the user semi-invulnerable turn 1, then strike turn 2") diff --git a/test/battle/move_effect/shed_tail.c b/test/battle/move_effect/shed_tail.c index 1cdf74b0fd14..4667eab1ad20 100644 --- a/test/battle/move_effect/shed_tail.c +++ b/test/battle/move_effect/shed_tail.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SHED_TAIL].effect == EFFECT_SHED_TAIL); + ASSUME(GetMoveEffect(MOVE_SHED_TAIL) == EFFECT_SHED_TAIL); } SINGLE_BATTLE_TEST("Shed Tail creates a Substitute at the cost of 1/2 users maximum HP and switches the user out") @@ -110,8 +110,8 @@ SINGLE_BATTLE_TEST("Shed Tail creates a Substitute with 1/4 of user maximum heal PARAMETRIZE { hp = 164; } GIVEN { - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].argument.fixedDamage == 40); - ASSUME(gMovesInfo[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG); + ASSUME(GetMoveFixedDamage(MOVE_DRAGON_RAGE) == 40); + ASSUME(GetMoveEffect(MOVE_DRAGON_RAGE) == EFFECT_FIXED_DAMAGE_ARG); PLAYER(SPECIES_BULBASAUR) { MaxHP(hp); } PLAYER(SPECIES_BULBASAUR); OPPONENT(SPECIES_CHARMANDER); diff --git a/test/battle/move_effect/shell_trap.c b/test/battle/move_effect/shell_trap.c index d43893244a40..f121d1444d3d 100644 --- a/test/battle/move_effect/shell_trap.c +++ b/test/battle/move_effect/shell_trap.c @@ -3,10 +3,10 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SHELL_TRAP].effect == EFFECT_SHELL_TRAP); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_WATER_GUN].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_LEER].category == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMoveEffect(MOVE_SHELL_TRAP) == EFFECT_SHELL_TRAP); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_WATER_GUN) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_LEER) == DAMAGE_CATEGORY_STATUS); } SINGLE_BATTLE_TEST("Shell Trap activates only if hit by a physical move") @@ -98,7 +98,7 @@ SINGLE_BATTLE_TEST("Shell Trap does not activate if battler faints before being DOUBLE_BATTLE_TEST("Shell Trap activates immediately after being hit on turn 1 and attacks both opponents") { GIVEN { - ASSUME(gMovesInfo[MOVE_SHELL_TRAP].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_SHELL_TRAP) == MOVE_TARGET_BOTH); PLAYER(SPECIES_WOBBUFFET) { Speed(1); } PLAYER(SPECIES_WOBBUFFET) { Speed(2); } OPPONENT(SPECIES_WOBBUFFET) { Speed(5); } @@ -122,7 +122,7 @@ DOUBLE_BATTLE_TEST("Shell Trap activates immediately after being hit on turn 1 a DOUBLE_BATTLE_TEST("Shell Trap activates immediately after being hit on turn 2 and attacks both opponents") { GIVEN { - ASSUME(gMovesInfo[MOVE_SHELL_TRAP].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_SHELL_TRAP) == MOVE_TARGET_BOTH); PLAYER(SPECIES_WOBBUFFET) { Speed(1); } PLAYER(SPECIES_WOBBUFFET) { Speed(2); } OPPONENT(SPECIES_WOBBUFFET) { Speed(5); } @@ -146,7 +146,7 @@ DOUBLE_BATTLE_TEST("Shell Trap activates immediately after being hit on turn 2 a DOUBLE_BATTLE_TEST("Shell Trap activates immediately after being hit on turn 3 and attacks both opponents") { GIVEN { - ASSUME(gMovesInfo[MOVE_SHELL_TRAP].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_SHELL_TRAP) == MOVE_TARGET_BOTH); PLAYER(SPECIES_WOBBUFFET) { Speed(1); } PLAYER(SPECIES_WOBBUFFET) { Speed(7); } OPPONENT(SPECIES_WOBBUFFET) { Speed(5); } @@ -170,7 +170,7 @@ DOUBLE_BATTLE_TEST("Shell Trap activates immediately after being hit on turn 3 a DOUBLE_BATTLE_TEST("Shell Trap targets correctly if one of the opponents has fainted") { GIVEN { - ASSUME(gMovesInfo[MOVE_SHELL_TRAP].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_SHELL_TRAP) == MOVE_TARGET_BOTH); PLAYER(SPECIES_GRENINJA) { Speed(60); } PLAYER(SPECIES_TURTONATOR) { Speed(10); } OPPONENT(SPECIES_BLASTOISE) { Speed(120); } diff --git a/test/battle/move_effect/simple_beam.c b/test/battle/move_effect/simple_beam.c index e91bf0b8ce0d..4250c8ce45d6 100644 --- a/test/battle/move_effect/simple_beam.c +++ b/test/battle/move_effect/simple_beam.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SIMPLE_BEAM].effect == EFFECT_SIMPLE_BEAM); + ASSUME(GetMoveEffect(MOVE_SIMPLE_BEAM) == EFFECT_SIMPLE_BEAM); } SINGLE_BATTLE_TEST("Simple Beam replaces target's ability with Simple") diff --git a/test/battle/move_effect/skill_swap.c b/test/battle/move_effect/skill_swap.c index 9c31ae59a7c9..c3c2ca91f4f0 100644 --- a/test/battle/move_effect/skill_swap.c +++ b/test/battle/move_effect/skill_swap.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SKILL_SWAP].effect == EFFECT_SKILL_SWAP); + ASSUME(GetMoveEffect(MOVE_SKILL_SWAP) == EFFECT_SKILL_SWAP); } SINGLE_BATTLE_TEST("Skill Swap swaps user and target's abilities") diff --git a/test/battle/move_effect/sleep.c b/test/battle/move_effect/sleep.c index 834f6066724b..702044d331d2 100644 --- a/test/battle/move_effect/sleep.c +++ b/test/battle/move_effect/sleep.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_HYPNOSIS].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_HYPNOSIS) == EFFECT_SLEEP); } SINGLE_BATTLE_TEST("Hypnosis inflicts 1-3 turns of sleep") diff --git a/test/battle/move_effect/sleep_talk.c b/test/battle/move_effect/sleep_talk.c index 8ecd600f362d..4ac89e69d8ae 100644 --- a/test/battle/move_effect/sleep_talk.c +++ b/test/battle/move_effect/sleep_talk.c @@ -3,10 +3,10 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SLEEP_TALK].effect == EFFECT_SLEEP_TALK); - ASSUME(gMovesInfo[MOVE_RAZOR_WIND].sleepTalkBanned == TRUE); - ASSUME(gMovesInfo[MOVE_FLY].sleepTalkBanned == TRUE); - ASSUME(gMovesInfo[MOVE_DIG].sleepTalkBanned == TRUE); + ASSUME(GetMoveEffect(MOVE_SLEEP_TALK) == EFFECT_SLEEP_TALK); + ASSUME(IsMoveSleepTalkBanned(MOVE_RAZOR_WIND)); + ASSUME(IsMoveSleepTalkBanned(MOVE_FLY)); + ASSUME(IsMoveSleepTalkBanned(MOVE_DIG)); } SINGLE_BATTLE_TEST("Sleep Talk fails if not asleep") diff --git a/test/battle/move_effect/smelling_salts.c b/test/battle/move_effect/smelling_salts.c index 8d97ab8f0969..6b1d0b2d7ed6 100644 --- a/test/battle/move_effect/smelling_salts.c +++ b/test/battle/move_effect/smelling_salts.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(MoveHasAdditionalEffect(MOVE_SMELLING_SALTS, MOVE_EFFECT_REMOVE_STATUS) == TRUE); - ASSUME(gMovesInfo[MOVE_SMELLING_SALTS].argument.status == STATUS1_PARALYSIS); + ASSUME(GetMoveEffectArg_Status(MOVE_SMELLING_SALTS) == STATUS1_PARALYSIS); } SINGLE_BATTLE_TEST("Smelling Salts does not cure paralyzed pokemons behind substitutes or get increased power") diff --git a/test/battle/move_effect/solar_beam.c b/test/battle/move_effect/solar_beam.c index 6fca334deedf..309d950c5096 100644 --- a/test/battle/move_effect/solar_beam.c +++ b/test/battle/move_effect/solar_beam.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SOLAR_BEAM].effect == EFFECT_SOLAR_BEAM); - ASSUME(gMovesInfo[MOVE_SOLAR_BLADE].argument.twoTurnAttack.status == B_WEATHER_SUN); + ASSUME(GetMoveEffect(MOVE_SOLAR_BEAM) == EFFECT_SOLAR_BEAM); + ASSUME(GetMoveTwoTurnAttackWeather(MOVE_SOLAR_BLADE) == B_WEATHER_SUN); } SINGLE_BATTLE_TEST("Solar Beam does not need a charging turn if Sun is up") diff --git a/test/battle/move_effect/sparkling_aria.c b/test/battle/move_effect/sparkling_aria.c index 24ac3c84bb0f..86b906228b72 100644 --- a/test/battle/move_effect/sparkling_aria.c +++ b/test/battle/move_effect/sparkling_aria.c @@ -4,8 +4,8 @@ ASSUMPTIONS { ASSUME(MoveHasAdditionalEffect(MOVE_SPARKLING_ARIA, MOVE_EFFECT_REMOVE_STATUS) == TRUE); - ASSUME(gMovesInfo[MOVE_SPARKLING_ARIA].argument.status == STATUS1_BURN); - ASSUME(gMovesInfo[MOVE_SPARKLING_ARIA].soundMove == TRUE); + ASSUME(GetMoveEffectArg_Status(MOVE_SPARKLING_ARIA) == STATUS1_BURN); + ASSUME(IsSoundMove(MOVE_SPARKLING_ARIA)); } DOUBLE_BATTLE_TEST("Sparkling Aria cures burns from all Pokemon on the field and behind substitutes") diff --git a/test/battle/move_effect/special_attack_down.c b/test/battle/move_effect/special_attack_down.c index 60d015d1cddd..63ca071fc11e 100644 --- a/test/battle/move_effect/special_attack_down.c +++ b/test/battle/move_effect/special_attack_down.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_CONFIDE].effect == EFFECT_SPECIAL_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_CONFIDE) == EFFECT_SPECIAL_ATTACK_DOWN); } SINGLE_BATTLE_TEST("Confide lowers Special Attack", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Confide lowers Special Attack", s16 damage) PARAMETRIZE { lowerSpecialAttack = FALSE; } PARAMETRIZE { lowerSpecialAttack = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_GUST) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/special_attack_up_3.c b/test/battle/move_effect/special_attack_up_3.c index a701893f51f6..75f6c4b36dc6 100644 --- a/test/battle/move_effect/special_attack_up_3.c +++ b/test/battle/move_effect/special_attack_up_3.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TAIL_GLOW].effect == EFFECT_SPECIAL_ATTACK_UP_3); + ASSUME(GetMoveEffect(MOVE_TAIL_GLOW) == EFFECT_SPECIAL_ATTACK_UP_3); } SINGLE_BATTLE_TEST("Tail Glow drastically raises Special Attack", s16 damage) @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Tail Glow drastically raises Special Attack", s16 damage) PARAMETRIZE { raiseSpecialAttack = FALSE; } PARAMETRIZE { raiseSpecialAttack = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_GUST) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/spicy_extract.c b/test/battle/move_effect/spicy_extract.c index c9ddb3c30db0..b5fe1da0f10f 100644 --- a/test/battle/move_effect/spicy_extract.c +++ b/test/battle/move_effect/spicy_extract.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SPICY_EXTRACT].effect == EFFECT_SPICY_EXTRACT); + ASSUME(GetMoveEffect(MOVE_SPICY_EXTRACT) == EFFECT_SPICY_EXTRACT); } SINGLE_BATTLE_TEST("Spicy Extract raises target's Attack by 2 stages and lowers target's Defense by 2 stages") @@ -33,7 +33,7 @@ SINGLE_BATTLE_TEST("Spicy Extract is prevented by target's ability if it's Attac PARAMETRIZE { ability = ABILITY_LIGHT_METAL; } GIVEN { - ASSUME(gMovesInfo[MOVE_SWORDS_DANCE].effect == EFFECT_ATTACK_UP_2); + ASSUME(GetMoveEffect(MOVE_SWORDS_DANCE) == EFFECT_ATTACK_UP_2); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_BELDUM) { Ability(ability); } } WHEN { diff --git a/test/battle/move_effect/spikes.c b/test/battle/move_effect/spikes.c index 339a9f9a4bf1..187b9ce7acf3 100644 --- a/test/battle/move_effect/spikes.c +++ b/test/battle/move_effect/spikes.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SPIKES].effect == EFFECT_SPIKES); + ASSUME(GetMoveEffect(MOVE_SPIKES) == EFFECT_SPIKES); } SINGLE_BATTLE_TEST("Spikes damage on switch in") diff --git a/test/battle/move_effect/stealth_rock.c b/test/battle/move_effect/stealth_rock.c index 9a38f17a5ee5..d4399a2d0f0b 100644 --- a/test/battle/move_effect/stealth_rock.c +++ b/test/battle/move_effect/stealth_rock.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_STEALTH_ROCK].effect == EFFECT_STEALTH_ROCK); + ASSUME(GetMoveEffect(MOVE_STEALTH_ROCK) == EFFECT_STEALTH_ROCK); } SINGLE_BATTLE_TEST("Stealth Rock damage on switch in based on typing") diff --git a/test/battle/move_effect/sticky_web.c b/test/battle/move_effect/sticky_web.c index e99368aa7d8d..ed0f6e5d93cc 100644 --- a/test/battle/move_effect/sticky_web.c +++ b/test/battle/move_effect/sticky_web.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_STICKY_WEB].effect == EFFECT_STICKY_WEB); + ASSUME(GetMoveEffect(MOVE_STICKY_WEB) == EFFECT_STICKY_WEB); } SINGLE_BATTLE_TEST("Sticky Web lowers Speed by 1 on switch-in") @@ -49,7 +49,7 @@ SINGLE_BATTLE_TEST("Sticky Web can only be set up 1 time") DOUBLE_BATTLE_TEST("Sticky Web lowers Speed by 1 in a double battle after Explosion fainting both mons") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(GetMoveEffect(MOVE_EXPLOSION) == EFFECT_EXPLOSION); PLAYER(SPECIES_WOBBUFFET) {Speed(5);} PLAYER(SPECIES_WOBBUFFET) {HP(1500); Speed(10);} PLAYER(SPECIES_WOBBUFFET) {Speed(10);} @@ -197,7 +197,7 @@ DOUBLE_BATTLE_TEST("Sticky Web has correct interactions with Mirror Armor - no o PARAMETRIZE {hasReplacement = FALSE;} GIVEN { - ASSUME(gMovesInfo[MOVE_MEMENTO].effect == EFFECT_MEMENTO); + ASSUME(GetMoveEffect(MOVE_MEMENTO) == EFFECT_MEMENTO); PLAYER(SPECIES_SQUIRTLE) {Speed(5); } PLAYER(SPECIES_CHARMANDER) {Speed(5); } PLAYER(SPECIES_CORVIKNIGHT) {Ability(ABILITY_MIRROR_ARMOR); Item(ITEM_IRON_BALL); Speed(5); } // Iron Ball, so that flying type Corviknight is affected by Sticky Web. diff --git a/test/battle/move_effect/stockpile.c b/test/battle/move_effect/stockpile.c index f6c3f02a462d..f045fa68238c 100644 --- a/test/battle/move_effect/stockpile.c +++ b/test/battle/move_effect/stockpile.c @@ -4,9 +4,9 @@ // These tests cover all 3 effects: Stockpile, Spit up and Swallow. ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_STOCKPILE].effect == EFFECT_STOCKPILE); - ASSUME(gMovesInfo[MOVE_SWALLOW].effect == EFFECT_SWALLOW); - ASSUME(gMovesInfo[MOVE_SPIT_UP].effect == EFFECT_SPIT_UP); + ASSUME(GetMoveEffect(MOVE_STOCKPILE) == EFFECT_STOCKPILE); + ASSUME(GetMoveEffect(MOVE_SWALLOW) == EFFECT_SWALLOW); + ASSUME(GetMoveEffect(MOVE_SPIT_UP) == EFFECT_SPIT_UP); } SINGLE_BATTLE_TEST("Stockpile's count can go up only to 3") @@ -148,8 +148,8 @@ SINGLE_BATTLE_TEST("Stockpile temporarily raises Def and Sp. Def", s16 dmgPyhsic PARAMETRIZE { move = MOVE_CELEBRATE; } GIVEN { ASSUME(B_STOCKPILE_RAISES_DEFS >= GEN_4); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_GUST) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET) { Speed(2); } OPPONENT(SPECIES_WOBBUFFET) { Speed(1); } } WHEN { @@ -184,8 +184,8 @@ DOUBLE_BATTLE_TEST("Stockpile's Def and Sp. Def boost is lost after using Spit U PARAMETRIZE { count = 3; move = MOVE_SPIT_UP; } GIVEN { ASSUME(B_STOCKPILE_RAISES_DEFS >= GEN_4); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_GUST].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_GUST) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET) { Speed(4); HP(399); MaxHP(400); } PLAYER(SPECIES_WOBBUFFET) { Speed(3); } OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } diff --git a/test/battle/move_effect/stomping_tantrum.c b/test/battle/move_effect/stomping_tantrum.c index 32747282e420..c759de38b17d 100644 --- a/test/battle/move_effect/stomping_tantrum.c +++ b/test/battle/move_effect/stomping_tantrum.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_STOMPING_TANTRUM].effect == EFFECT_STOMPING_TANTRUM); + ASSUME(GetMoveEffect(MOVE_STOMPING_TANTRUM) == EFFECT_STOMPING_TANTRUM); } SINGLE_BATTLE_TEST("Stomping Tatrum will deal double damage if user flinched on the previous turn") diff --git a/test/battle/move_effect/strength_sap.c b/test/battle/move_effect/strength_sap.c index 813b2abfb218..c38048ba8f2c 100644 --- a/test/battle/move_effect/strength_sap.c +++ b/test/battle/move_effect/strength_sap.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_STRENGTH_SAP].effect == EFFECT_STRENGTH_SAP); + ASSUME(GetMoveEffect(MOVE_STRENGTH_SAP) == EFFECT_STRENGTH_SAP); } SINGLE_BATTLE_TEST("Strength Sap lowers Attack by 1 and restores HP based on target's Attack Stat", s16 hp) @@ -69,8 +69,8 @@ SINGLE_BATTLE_TEST("Strength Sap lowers Attack by 1 and restores HP based on tar } GIVEN { - ASSUME(gMovesInfo[MOVE_WORK_UP].effect == EFFECT_ATTACK_SPATK_UP); - ASSUME(gMovesInfo[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); + ASSUME(GetMoveEffect(MOVE_WORK_UP) == EFFECT_ATTACK_SPATK_UP); + ASSUME(GetMoveEffect(MOVE_GROWL) == EFFECT_ATTACK_DOWN); PLAYER(SPECIES_WOBBUFFET) { HP(50); } OPPONENT(SPECIES_WOBBUFFET) { Attack(60); } } WHEN { @@ -117,7 +117,7 @@ SINGLE_BATTLE_TEST("Strength Sap lowers Attack by 1 and restores HP based on tar SINGLE_BATTLE_TEST("Strength Sap fails if target is at -6 Atk") { GIVEN { - ASSUME(gMovesInfo[MOVE_CHARM].effect == EFFECT_ATTACK_DOWN_2); + ASSUME(GetMoveEffect(MOVE_CHARM) == EFFECT_ATTACK_DOWN_2); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/stuff_cheeks.c b/test/battle/move_effect/stuff_cheeks.c index 3bb3f229254f..9e6a34c3068d 100644 --- a/test/battle/move_effect/stuff_cheeks.c +++ b/test/battle/move_effect/stuff_cheeks.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_STUFF_CHEEKS].effect == EFFECT_STUFF_CHEEKS); + ASSUME(GetMoveEffect(MOVE_STUFF_CHEEKS) == EFFECT_STUFF_CHEEKS); ASSUME(gItemsInfo[ITEM_LIECHI_BERRY].pocket == POCKET_BERRIES); ASSUME(gItemsInfo[ITEM_LIECHI_BERRY].holdEffect == HOLD_EFFECT_ATTACK_UP); } @@ -92,7 +92,7 @@ SINGLE_BATTLE_TEST("Stuff Cheeks can be used even if Magic Room is active") SINGLE_BATTLE_TEST("Stuff Cheeks fails if the user's berry is removed before they use the move") { GIVEN { - ASSUME(gMovesInfo[MOVE_KNOCK_OFF].effect == EFFECT_KNOCK_OFF); + ASSUME(GetMoveEffect(MOVE_KNOCK_OFF) == EFFECT_KNOCK_OFF); PLAYER(SPECIES_SKWOVET) { Item(ITEM_LIECHI_BERRY); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/substitute.c b/test/battle/move_effect/substitute.c index 92e894fa073f..e94767b6605f 100644 --- a/test/battle/move_effect/substitute.c +++ b/test/battle/move_effect/substitute.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SUBSTITUTE].effect == EFFECT_SUBSTITUTE); + ASSUME(GetMoveEffect(MOVE_SUBSTITUTE) == EFFECT_SUBSTITUTE); } SINGLE_BATTLE_TEST("Substitute creates a Substitute at the cost of 1/4 users maximum HP") diff --git a/test/battle/move_effect/super_effective_on_arg.c b/test/battle/move_effect/super_effective_on_arg.c index d10b8a2231aa..2569ccb109ce 100644 --- a/test/battle/move_effect/super_effective_on_arg.c +++ b/test/battle/move_effect/super_effective_on_arg.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_FREEZE_DRY].effect == EFFECT_SUPER_EFFECTIVE_ON_ARG); + ASSUME(GetMoveEffect(MOVE_FREEZE_DRY) == EFFECT_SUPER_EFFECTIVE_ON_ARG); } SINGLE_BATTLE_TEST("Freeze Dry is super effective on water types") diff --git a/test/battle/move_effect/synthesis.c b/test/battle/move_effect/synthesis.c index e4a2b77869c6..6799bd28705a 100644 --- a/test/battle/move_effect/synthesis.c +++ b/test/battle/move_effect/synthesis.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SYNTHESIS].effect == EFFECT_SYNTHESIS); + ASSUME(GetMoveEffect(MOVE_SYNTHESIS) == EFFECT_SYNTHESIS); } SINGLE_BATTLE_TEST("Synthesis recovers 1/2 of the user's max HP") diff --git a/test/battle/move_effect/tailwind.c b/test/battle/move_effect/tailwind.c index 5fa53564512e..f105c9612ab6 100644 --- a/test/battle/move_effect/tailwind.c +++ b/test/battle/move_effect/tailwind.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TAILWIND].effect == EFFECT_TAILWIND); + ASSUME(GetMoveEffect(MOVE_TAILWIND) == EFFECT_TAILWIND); } SINGLE_BATTLE_TEST("Tailwind applies for 4 turns") diff --git a/test/battle/move_effect/take_heart.c b/test/battle/move_effect/take_heart.c index 2961725b220b..e0294391034c 100644 --- a/test/battle/move_effect/take_heart.c +++ b/test/battle/move_effect/take_heart.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TAKE_HEART].effect == EFFECT_TAKE_HEART); + ASSUME(GetMoveEffect(MOVE_TAKE_HEART) == EFFECT_TAKE_HEART); } SINGLE_BATTLE_TEST("Take Heart increases Sp. Atk and Sp. Def by one stage") @@ -50,8 +50,8 @@ SINGLE_BATTLE_TEST("Take Heart cures the user of all status conditions") SINGLE_BATTLE_TEST("Take Heart cures sleep when used by Sleep Talk") { GIVEN { - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_SLEEP_TALK].effect == EFFECT_SLEEP_TALK); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SLEEP_TALK) == EFFECT_SLEEP_TALK); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_SLEEP_TALK, MOVE_TAKE_HEART); } } WHEN { diff --git a/test/battle/move_effect/tar_shot.c b/test/battle/move_effect/tar_shot.c index 2b780577ecc0..f2aac4e55221 100644 --- a/test/battle/move_effect/tar_shot.c +++ b/test/battle/move_effect/tar_shot.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TAR_SHOT].effect == EFFECT_TAR_SHOT); + ASSUME(GetMoveEffect(MOVE_TAR_SHOT) == EFFECT_TAR_SHOT); } SINGLE_BATTLE_TEST("Tar Shot doubles the effectiveness of Fire-type moves used on the target") @@ -18,7 +18,7 @@ SINGLE_BATTLE_TEST("Tar Shot doubles the effectiveness of Fire-type moves used o ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[1] == TYPE_PSYCHIC); ASSUME(gSpeciesInfo[SPECIES_OMASTAR].types[0] == TYPE_ROCK); ASSUME(gSpeciesInfo[SPECIES_OMASTAR].types[1] == TYPE_WATER); - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); GIVEN { PLAYER(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/teatime.c b/test/battle/move_effect/teatime.c index dfdc70c80122..fc4ad2219872 100644 --- a/test/battle/move_effect/teatime.c +++ b/test/battle/move_effect/teatime.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TEATIME].effect == EFFECT_TEATIME); + ASSUME(GetMoveEffect(MOVE_TEATIME) == EFFECT_TEATIME); ASSUME(gItemsInfo[ITEM_LIECHI_BERRY].holdEffect == HOLD_EFFECT_ATTACK_UP); } diff --git a/test/battle/move_effect/telekinesis.c b/test/battle/move_effect/telekinesis.c index 746c42d053eb..31390d973359 100644 --- a/test/battle/move_effect/telekinesis.c +++ b/test/battle/move_effect/telekinesis.c @@ -3,14 +3,14 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TELEKINESIS].effect == EFFECT_TELEKINESIS); + ASSUME(GetMoveEffect(MOVE_TELEKINESIS) == EFFECT_TELEKINESIS); } SINGLE_BATTLE_TEST("Telekinesis makes the target unable to avoid any attacks made against it") { GIVEN { - ASSUME(gMovesInfo[MOVE_MINIMIZE].effect == EFFECT_MINIMIZE); // Raises evs by 2 - ASSUME(gMovesInfo[MOVE_SCREECH].accuracy < 100); + ASSUME(GetMoveEffect(MOVE_MINIMIZE) == EFFECT_MINIMIZE); // Raises evs by 2 + ASSUME(GetMoveAccuracy(MOVE_SCREECH) < 100); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WYNAUT); } WHEN { @@ -47,7 +47,7 @@ SINGLE_BATTLE_TEST("Telekinesis ends after 3 turns") SINGLE_BATTLE_TEST("Telekinesis makes the target immune to Ground-type attacks") { GIVEN { - ASSUME(gMovesInfo[MOVE_BULLDOZE].type == TYPE_GROUND); + ASSUME(GetMoveType(MOVE_BULLDOZE) == TYPE_GROUND); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WYNAUT); } WHEN { diff --git a/test/battle/move_effect/teleport.c b/test/battle/move_effect/teleport.c index 3c79cb54ffb5..f77dffc658fe 100644 --- a/test/battle/move_effect/teleport.c +++ b/test/battle/move_effect/teleport.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TELEPORT].effect == EFFECT_TELEPORT); + ASSUME(GetMoveEffect(MOVE_TELEPORT) == EFFECT_TELEPORT); } SINGLE_BATTLE_TEST("Teleport fails when there is no pokemon to switch in") diff --git a/test/battle/move_effect/tera_blast.c b/test/battle/move_effect/tera_blast.c index 80e960a1affc..63e7a776b9a1 100644 --- a/test/battle/move_effect/tera_blast.c +++ b/test/battle/move_effect/tera_blast.c @@ -3,13 +3,13 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TERA_BLAST].effect == EFFECT_TERA_BLAST); + ASSUME(GetMoveEffect(MOVE_TERA_BLAST) == EFFECT_TERA_BLAST); } SINGLE_BATTLE_TEST("Tera Blast changes from Normal-type to the user's Tera Type") { GIVEN { - ASSUME(gMovesInfo[MOVE_TERA_BLAST].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_TERA_BLAST) == TYPE_NORMAL); PLAYER(SPECIES_WOBBUFFET) { TeraType(TYPE_DARK); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect/tera_starstorm.c b/test/battle/move_effect/tera_starstorm.c index b6b457164424..3077b38df913 100644 --- a/test/battle/move_effect/tera_starstorm.c +++ b/test/battle/move_effect/tera_starstorm.c @@ -3,13 +3,13 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TERA_STARSTORM].effect == EFFECT_TERA_STARSTORM); + ASSUME(GetMoveEffect(MOVE_TERA_STARSTORM) == EFFECT_TERA_STARSTORM); } SINGLE_BATTLE_TEST("Tera Starstorm changes from Normal-type to Stellar-type if used by Terapagos-Stellar") { GIVEN { - ASSUME(gMovesInfo[MOVE_TERA_STARSTORM].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_TERA_STARSTORM) == TYPE_NORMAL); PLAYER(SPECIES_TERAPAGOS_STELLAR); OPPONENT(SPECIES_MISDREAVUS); } WHEN { @@ -25,7 +25,7 @@ SINGLE_BATTLE_TEST("Tera Starstorm changes from Normal-type to Stellar-type if u DOUBLE_BATTLE_TEST("Tera Starstorm targets both opponents in a double battle if used by Terapagos-Stellar") { GIVEN { - ASSUME(gMovesInfo[MOVE_TERA_STARSTORM].target == MOVE_TARGET_SELECTED); + ASSUME(GetMoveTarget(MOVE_TERA_STARSTORM) == MOVE_TARGET_SELECTED); PLAYER(SPECIES_TERAPAGOS_STELLAR); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); @@ -46,7 +46,7 @@ SINGLE_BATTLE_TEST("Tera Starstorm becomes a physical move if the user is Terapa PARAMETRIZE { tera = GIMMICK_NONE; } PARAMETRIZE { tera = GIMMICK_TERA; } GIVEN { - ASSUME(gMovesInfo[MOVE_TERA_STARSTORM].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_TERA_STARSTORM) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_TERAPAGOS_STELLAR) { Attack(100); SpAttack(50); } OPPONENT(SPECIES_WOBBUFFET) { Defense(200); SpDefense(200); } } WHEN { @@ -63,7 +63,7 @@ SINGLE_BATTLE_TEST("Tera Starstorm becomes a physical move if the user is Terapa SINGLE_BATTLE_TEST("Tera Starstorm remains Normal-type if used by Pokemon other than Terapagos") { GIVEN { - ASSUME(gMovesInfo[MOVE_TERA_STARSTORM].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_TERA_STARSTORM) == TYPE_NORMAL); ASSUME(gSpeciesInfo[SPECIES_MISDREAVUS].types[0] == TYPE_GHOST); PLAYER(SPECIES_WOBBUFFET) { TeraType(TYPE_STELLAR); } OPPONENT(SPECIES_MISDREAVUS); diff --git a/test/battle/move_effect/thousand_arrows.c b/test/battle/move_effect/thousand_arrows.c index 09e726fa2093..c62e71001d16 100644 --- a/test/battle/move_effect/thousand_arrows.c +++ b/test/battle/move_effect/thousand_arrows.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(MoveHasAdditionalEffect(MOVE_THOUSAND_ARROWS, MOVE_EFFECT_SMACK_DOWN) == TRUE); - ASSUME(gMovesInfo[MOVE_THOUSAND_ARROWS].ignoreTypeIfFlyingAndUngrounded == TRUE); + ASSUME(MoveHasAdditionalEffect(MOVE_THOUSAND_ARROWS, MOVE_EFFECT_SMACK_DOWN)); + ASSUME(MoveIgnoresTypeIfFlyingAndUngrounded(MOVE_THOUSAND_ARROWS) == TRUE); } SINGLE_BATTLE_TEST("Thousand Arrows does not ground mons behind substitutes") diff --git a/test/battle/move_effect/thunder.c b/test/battle/move_effect/thunder.c index 98a4979e7966..81ebd416ca7e 100644 --- a/test/battle/move_effect/thunder.c +++ b/test/battle/move_effect/thunder.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_THUNDER].effect == EFFECT_THUNDER); - ASSUME(gMovesInfo[MOVE_THUNDER].accuracy == 70); + ASSUME(GetMoveEffect(MOVE_THUNDER) == EFFECT_THUNDER); + ASSUME(GetMoveAccuracy(MOVE_THUNDER) == 70); } SINGLE_BATTLE_TEST("Thunder's accuracy is lowered to 50% in Sunlight") diff --git a/test/battle/move_effect/tidy_up.c b/test/battle/move_effect/tidy_up.c index fcb78ba962c3..9c934ab213fc 100644 --- a/test/battle/move_effect/tidy_up.c +++ b/test/battle/move_effect/tidy_up.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TIDY_UP].effect == EFFECT_TIDY_UP); + ASSUME(GetMoveEffect(MOVE_TIDY_UP) == EFFECT_TIDY_UP); } SINGLE_BATTLE_TEST("Tidy Up raises Attack and Speed by one") diff --git a/test/battle/move_effect/torment.c b/test/battle/move_effect/torment.c index dc911691b0f8..446d168de276 100644 --- a/test/battle/move_effect/torment.c +++ b/test/battle/move_effect/torment.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TORMENT].effect == EFFECT_TORMENT); + ASSUME(GetMoveEffect(MOVE_TORMENT) == EFFECT_TORMENT); } SINGLE_BATTLE_TEST("Torment prevents consecutive move uses") diff --git a/test/battle/move_effect/toxic.c b/test/battle/move_effect/toxic.c index 804ed56b8f75..7b8274a4417a 100644 --- a/test/battle/move_effect/toxic.c +++ b/test/battle/move_effect/toxic.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(GetMoveEffect(MOVE_TOXIC) == EFFECT_TOXIC); } SINGLE_BATTLE_TEST("Toxic inflicts bad poison") diff --git a/test/battle/move_effect/toxic_spikes.c b/test/battle/move_effect/toxic_spikes.c index fd18f57b97a4..70053b4a4449 100644 --- a/test/battle/move_effect/toxic_spikes.c +++ b/test/battle/move_effect/toxic_spikes.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TOXIC_SPIKES].effect == EFFECT_TOXIC_SPIKES); + ASSUME(GetMoveEffect(MOVE_TOXIC_SPIKES) == EFFECT_TOXIC_SPIKES); } SINGLE_BATTLE_TEST("Toxic Spikes inflicts poison on switch in") @@ -212,7 +212,7 @@ SINGLE_BATTLE_TEST("Toxic Spikes are removed by Poison-type Pokémon affected by SINGLE_BATTLE_TEST("Toxic Spikes inflicts poison on switch in after Primal Reversed mon fainted") // Oddly specific, but encountered during testing { GIVEN { - ASSUME(gMovesInfo[MOVE_MEMENTO].effect == EFFECT_MEMENTO); // Faints the user. + ASSUME(GetMoveEffect(MOVE_MEMENTO) == EFFECT_MEMENTO); // Faints the user. PLAYER(SPECIES_WOBBUFFET) {Speed(5); } PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); Speed(1); } PLAYER(SPECIES_WYNAUT) {Speed(5); } diff --git a/test/battle/move_effect/triple_kick.c b/test/battle/move_effect/triple_kick.c index 9fe0ec60225e..5aeb1ea44249 100644 --- a/test/battle/move_effect/triple_kick.c +++ b/test/battle/move_effect/triple_kick.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_TRIPLE_KICK].effect == EFFECT_TRIPLE_KICK); + ASSUME(GetMoveEffect(MOVE_TRIPLE_KICK) == EFFECT_TRIPLE_KICK); } SINGLE_BATTLE_TEST("Triple Kick damage is increased by its base damage for each hit") diff --git a/test/battle/move_effect/two_turns_attack.c b/test/battle/move_effect/two_turns_attack.c index 8010d143569c..200fc72d1874 100644 --- a/test/battle/move_effect/two_turns_attack.c +++ b/test/battle/move_effect/two_turns_attack.c @@ -3,14 +3,14 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_RAZOR_WIND].effect == EFFECT_TWO_TURNS_ATTACK); - ASSUME(gMovesInfo[MOVE_SKULL_BASH].effect == EFFECT_TWO_TURNS_ATTACK); + ASSUME(GetMoveEffect(MOVE_RAZOR_WIND) == EFFECT_TWO_TURNS_ATTACK); + ASSUME(GetMoveEffect(MOVE_SKULL_BASH) == EFFECT_TWO_TURNS_ATTACK); ASSUME(MoveHasAdditionalEffectSelf(MOVE_SKULL_BASH, MOVE_EFFECT_DEF_PLUS_1) == TRUE); - ASSUME(gMovesInfo[MOVE_SKY_ATTACK].effect == EFFECT_TWO_TURNS_ATTACK); + ASSUME(GetMoveEffect(MOVE_SKY_ATTACK) == EFFECT_TWO_TURNS_ATTACK); // Electro shot - check for rain - ASSUME(gMovesInfo[MOVE_ELECTRO_SHOT].argument.twoTurnAttack.status == B_WEATHER_RAIN); - ASSUME(gMovesInfo[MOVE_ELECTRO_SHOT].effect == EFFECT_TWO_TURNS_ATTACK); + ASSUME(GetMoveTwoTurnAttackWeather(MOVE_ELECTRO_SHOT) == B_WEATHER_RAIN); + ASSUME(GetMoveEffect(MOVE_ELECTRO_SHOT) == EFFECT_TWO_TURNS_ATTACK); ASSUME(MoveHasAdditionalEffectSelf(MOVE_ELECTRO_SHOT, MOVE_EFFECT_SP_ATK_PLUS_1) == TRUE); } diff --git a/test/battle/move_effect/upper_hand.c b/test/battle/move_effect/upper_hand.c index 69b2b75ef958..72a80a05426f 100644 --- a/test/battle/move_effect/upper_hand.c +++ b/test/battle/move_effect/upper_hand.c @@ -3,16 +3,16 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_UPPER_HAND].effect == EFFECT_UPPER_HAND); - ASSUME(gMovesInfo[MOVE_UPPER_HAND].priority == 3); + ASSUME(GetMoveEffect(MOVE_UPPER_HAND) == EFFECT_UPPER_HAND); + ASSUME(GetMovePriority(MOVE_UPPER_HAND) == 3); ASSUME(MoveHasAdditionalEffect(MOVE_UPPER_HAND, MOVE_EFFECT_FLINCH) == TRUE); } SINGLE_BATTLE_TEST("Upper Hand succeeds if the target is using a priority attacking move and causes it to flinch") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXTREME_SPEED].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_EXTREME_SPEED].priority == 2); + ASSUME(GetMoveCategory(MOVE_EXTREME_SPEED) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMovePriority(MOVE_EXTREME_SPEED) == 2); PLAYER(SPECIES_MIENSHAO); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -28,8 +28,8 @@ SINGLE_BATTLE_TEST("Upper Hand succeeds if the target is using a priority attack SINGLE_BATTLE_TEST("Upper Hand fails if the target is using a status move") { GIVEN { - ASSUME(gMovesInfo[MOVE_BABY_DOLL_EYES].category == DAMAGE_CATEGORY_STATUS); - ASSUME(gMovesInfo[MOVE_BABY_DOLL_EYES].priority == 1); + ASSUME(GetMoveCategory(MOVE_BABY_DOLL_EYES) == DAMAGE_CATEGORY_STATUS); + ASSUME(GetMovePriority(MOVE_BABY_DOLL_EYES) == 1); PLAYER(SPECIES_MIENSHAO); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -47,8 +47,8 @@ SINGLE_BATTLE_TEST("Upper Hand fails if the target is using a status move") SINGLE_BATTLE_TEST("Upper Hand fails if the target is not using a priority move") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAINING_KISS].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_DRAINING_KISS].priority == 0); + ASSUME(GetMoveCategory(MOVE_DRAINING_KISS) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMovePriority(MOVE_DRAINING_KISS) == 0); PLAYER(SPECIES_MIENSHAO); OPPONENT(SPECIES_COMFEY) { Ability(ABILITY_FLOWER_VEIL); } } WHEN { @@ -66,8 +66,8 @@ SINGLE_BATTLE_TEST("Upper Hand fails if the target is not using a priority move" SINGLE_BATTLE_TEST("Upper Hand succeeds if the target's move is boosted in priority by an Ability") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAINING_KISS].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_DRAINING_KISS].priority == 0); + ASSUME(GetMoveCategory(MOVE_DRAINING_KISS) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMovePriority(MOVE_DRAINING_KISS) == 0); PLAYER(SPECIES_MIENSHAO) { Speed(10); } OPPONENT(SPECIES_COMFEY) { Speed(5); Ability(ABILITY_TRIAGE); } } WHEN { @@ -83,8 +83,8 @@ SINGLE_BATTLE_TEST("Upper Hand succeeds if the target's move is boosted in prior SINGLE_BATTLE_TEST("Upper Hand fails if the target moves first") { GIVEN { - ASSUME(gMovesInfo[MOVE_DRAINING_KISS].category == DAMAGE_CATEGORY_SPECIAL); - ASSUME(gMovesInfo[MOVE_DRAINING_KISS].priority == 0); + ASSUME(GetMoveCategory(MOVE_DRAINING_KISS) == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMovePriority(MOVE_DRAINING_KISS) == 0); PLAYER(SPECIES_MIENSHAO) { Speed(5); } OPPONENT(SPECIES_COMFEY) { Speed(10); Ability(ABILITY_TRIAGE); } } WHEN { @@ -102,8 +102,8 @@ SINGLE_BATTLE_TEST("Upper Hand fails if the target moves first") SINGLE_BATTLE_TEST("Upper Hand is boosted by Sheer Force") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXTREME_SPEED].category == DAMAGE_CATEGORY_PHYSICAL); - ASSUME(gMovesInfo[MOVE_EXTREME_SPEED].priority == 2); + ASSUME(GetMoveCategory(MOVE_EXTREME_SPEED) == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMovePriority(MOVE_EXTREME_SPEED) == 2); ASSUME(MoveIsAffectedBySheerForce(MOVE_UPPER_HAND) == TRUE); PLAYER(SPECIES_HARIYAMA) { Ability(ABILITY_SHEER_FORCE); } OPPONENT(SPECIES_WOBBUFFET); @@ -124,7 +124,7 @@ AI_SINGLE_BATTLE_TEST("AI won't use Upper Hand unless it has seen a priority mov PARAMETRIZE { move = MOVE_QUICK_ATTACK; } GIVEN { AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); - ASSUME(gMovesInfo[MOVE_QUICK_ATTACK].priority == 1); + ASSUME(GetMovePriority(MOVE_QUICK_ATTACK) == 1); PLAYER(SPECIES_WOBBUFFET) {Moves(move); } OPPONENT(SPECIES_WOBBUFFET) { Moves(MOVE_UPPER_HAND, MOVE_KARATE_CHOP); } } WHEN { diff --git a/test/battle/move_effect/uproar.c b/test/battle/move_effect/uproar.c index a97422390f65..cbe17ce066c3 100644 --- a/test/battle/move_effect/uproar.c +++ b/test/battle/move_effect/uproar.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_UPROAR].effect == EFFECT_UPROAR); + ASSUME(GetMoveEffect(MOVE_UPROAR) == EFFECT_UPROAR); } DOUBLE_BATTLE_TEST("Uproar status causes sleeping pokemon to wake up during an attack") diff --git a/test/battle/move_effect/wake_up_slap.c b/test/battle/move_effect/wake_up_slap.c index e4d7c2e6166c..0e172bf053d8 100644 --- a/test/battle/move_effect/wake_up_slap.c +++ b/test/battle/move_effect/wake_up_slap.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(MoveHasAdditionalEffect(MOVE_WAKE_UP_SLAP, MOVE_EFFECT_REMOVE_STATUS) == TRUE); - ASSUME(gMovesInfo[MOVE_WAKE_UP_SLAP].argument.status == STATUS1_SLEEP); + ASSUME(GetMoveEffectArg_Status(MOVE_WAKE_UP_SLAP) == STATUS1_SLEEP); } SINGLE_BATTLE_TEST("Wake-Up Slap does not cure paralyzed pokemons behind substitutes or get increased power") diff --git a/test/battle/move_effect/weather_ball.c b/test/battle/move_effect/weather_ball.c index 432e5f79f737..047438348352 100644 --- a/test/battle/move_effect/weather_ball.c +++ b/test/battle/move_effect/weather_ball.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_WEATHER_BALL].effect == EFFECT_WEATHER_BALL); + ASSUME(GetMoveEffect(MOVE_WEATHER_BALL) == EFFECT_WEATHER_BALL); } SINGLE_BATTLE_TEST("Weather Ball doubles its power and turns to a Fire-type move in Sunlight", s16 damage) diff --git a/test/battle/move_effect/worry_seed.c b/test/battle/move_effect/worry_seed.c index 3e74c883e738..c4b18b7cabd2 100644 --- a/test/battle/move_effect/worry_seed.c +++ b/test/battle/move_effect/worry_seed.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_WORRY_SEED].effect == EFFECT_WORRY_SEED); + ASSUME(GetMoveEffect(MOVE_WORRY_SEED) == EFFECT_WORRY_SEED); } SINGLE_BATTLE_TEST("Worry Seed replaces target's ability with Insomnia") diff --git a/test/battle/move_effect_secondary/bug_bite.c b/test/battle/move_effect_secondary/bug_bite.c index fdf9b05cf40a..e086941a5e30 100644 --- a/test/battle/move_effect_secondary/bug_bite.c +++ b/test/battle/move_effect_secondary/bug_bite.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(MoveHasAdditionalEffect(MOVE_BUG_BITE, MOVE_EFFECT_BUG_BITE)); - ASSUME(gMovesInfo[MOVE_BUG_BITE].pp == 20); + ASSUME(GetMovePP(MOVE_BUG_BITE) == 20); } // Pretty much copy/paste of the Berry Fling Test. diff --git a/test/battle/move_effect_secondary/burn.c b/test/battle/move_effect_secondary/burn.c index 9801ad1f2571..0bc979f08ec7 100644 --- a/test/battle/move_effect_secondary/burn.c +++ b/test/battle/move_effect_secondary/burn.c @@ -43,7 +43,7 @@ DOUBLE_BATTLE_TEST("Lava Plume inflicts burn to all adjacent battlers") { GIVEN { ASSUME(MoveHasAdditionalEffect(MOVE_LAVA_PLUME, MOVE_EFFECT_BURN) == TRUE); - ASSUME(gMovesInfo[MOVE_LAVA_PLUME].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_LAVA_PLUME) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -111,7 +111,7 @@ SINGLE_BATTLE_TEST("Scald shouldn't burn a Water-type Pokémon") GIVEN { ASSUME(gSpeciesInfo[SPECIES_SQUIRTLE].types[0] == TYPE_WATER); ASSUME(MoveHasAdditionalEffect(MOVE_SCALD, MOVE_EFFECT_BURN) == TRUE); - ASSUME(gMovesInfo[MOVE_SCALD].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_SCALD) == TYPE_WATER); PLAYER(SPECIES_SQUIRTLE); OPPONENT(SPECIES_SQUIRTLE); } WHEN { diff --git a/test/battle/move_effect_secondary/freeze.c b/test/battle/move_effect_secondary/freeze.c index 45005cf5d7da..bfaadcebe1b0 100644 --- a/test/battle/move_effect_secondary/freeze.c +++ b/test/battle/move_effect_secondary/freeze.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(MoveHasAdditionalEffect(MOVE_POWDER_SNOW, MOVE_EFFECT_FREEZE_OR_FROSTBITE) == TRUE); - ASSUME(gMovesInfo[MOVE_BLIZZARD].accuracy == 70); + ASSUME(GetMoveAccuracy(MOVE_BLIZZARD) == 70); } #if B_USE_FROSTBITE == TRUE @@ -92,7 +92,7 @@ SINGLE_BATTLE_TEST("Freezing Glare shouldn't freeze Psychic-types") GIVEN { ASSUME(gSpeciesInfo[SPECIES_ARTICUNO_GALAR].types[0] == TYPE_PSYCHIC); ASSUME(MoveHasAdditionalEffect(MOVE_FREEZING_GLARE, MOVE_EFFECT_FREEZE_OR_FROSTBITE) == TRUE); - ASSUME(gMovesInfo[MOVE_FREEZING_GLARE].type == TYPE_PSYCHIC); + ASSUME(GetMoveType(MOVE_FREEZING_GLARE) == TYPE_PSYCHIC); PLAYER(SPECIES_ARTICUNO_GALAR); OPPONENT(SPECIES_ARTICUNO_GALAR); } WHEN { diff --git a/test/battle/move_effect_secondary/ion_deluge.c b/test/battle/move_effect_secondary/ion_deluge.c index efc66903bc5f..e5bf7c08101a 100644 --- a/test/battle/move_effect_secondary/ion_deluge.c +++ b/test/battle/move_effect_secondary/ion_deluge.c @@ -9,7 +9,7 @@ ASSUMPTIONS SINGLE_BATTLE_TEST("Ion Duldge turns normal moves into electric for the remainder of the current turn") { GIVEN { - ASSUME(gMovesInfo[MOVE_ION_DELUGE].effect == EFFECT_ION_DELUGE); + ASSUME(GetMoveEffect(MOVE_ION_DELUGE) == EFFECT_ION_DELUGE); PLAYER(SPECIES_KRABBY); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effect_secondary/order_up.c b/test/battle/move_effect_secondary/order_up.c index 8d286850a28b..ec6f1c51b533 100644 --- a/test/battle/move_effect_secondary/order_up.c +++ b/test/battle/move_effect_secondary/order_up.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_ORDER_UP].additionalEffects[0].moveEffect == MOVE_EFFECT_ORDER_UP); + ASSUME(GetMoveAdditionalEffectById(MOVE_ORDER_UP, 0)->moveEffect == MOVE_EFFECT_ORDER_UP); } DOUBLE_BATTLE_TEST("Order Up increases a stat based on Tatsugiri's form") @@ -123,7 +123,7 @@ DOUBLE_BATTLE_TEST("Order up does not boosts any stats if Dondozo is not affecte DOUBLE_BATTLE_TEST("Order Up is boosted by Sheer Force without removing the stat boosting effect") { GIVEN { - ASSUME(gMovesInfo[MOVE_ENTRAINMENT].effect == EFFECT_ENTRAINMENT); + ASSUME(GetMoveEffect(MOVE_ENTRAINMENT) == EFFECT_ENTRAINMENT); PLAYER(SPECIES_DONDOZO) { Speed(10); } PLAYER(SPECIES_TATSUGIRI_CURLY) { Speed(9); } OPPONENT(SPECIES_WOBBUFFET) { Speed(8); } @@ -146,8 +146,8 @@ DOUBLE_BATTLE_TEST("Order Up is always boosted by Sheer Force", s16 damage) PARAMETRIZE(move = MOVE_ENTRAINMENT, ability = ABILITY_COMMANDER); GIVEN { - ASSUME(gMovesInfo[MOVE_HAZE].effect == EFFECT_HAZE); - ASSUME(gMovesInfo[MOVE_ENTRAINMENT].effect == EFFECT_ENTRAINMENT); + ASSUME(GetMoveEffect(MOVE_HAZE) == EFFECT_HAZE); + ASSUME(GetMoveEffect(MOVE_ENTRAINMENT) == EFFECT_ENTRAINMENT); PLAYER(SPECIES_DONDOZO) { Speed(10); } PLAYER(SPECIES_TATSUGIRI_CURLY) { Speed(9); Ability(ability); } OPPONENT(SPECIES_TAUROS) { Speed(21); Ability(ABILITY_SHEER_FORCE); } diff --git a/test/battle/move_effect_secondary/paralysis.c b/test/battle/move_effect_secondary/paralysis.c index 0e9d9589a862..711ca11ee8ac 100644 --- a/test/battle/move_effect_secondary/paralysis.c +++ b/test/battle/move_effect_secondary/paralysis.c @@ -49,7 +49,7 @@ SINGLE_BATTLE_TEST("Body Slam shouldn't paralyze Normal-types") GIVEN { ASSUME(gSpeciesInfo[SPECIES_TAUROS].types[0] == TYPE_NORMAL); ASSUME(MoveHasAdditionalEffect(MOVE_BODY_SLAM, MOVE_EFFECT_PARALYSIS) == TRUE); - ASSUME(gMovesInfo[MOVE_BODY_SLAM].type == TYPE_NORMAL); + ASSUME(GetMoveType(MOVE_BODY_SLAM) == TYPE_NORMAL); PLAYER(SPECIES_TAUROS); OPPONENT(SPECIES_TAUROS); } WHEN { diff --git a/test/battle/move_effect_secondary/psychic_noise.c b/test/battle/move_effect_secondary/psychic_noise.c index e44ae75abe44..8e5eae4efb4a 100644 --- a/test/battle/move_effect_secondary/psychic_noise.c +++ b/test/battle/move_effect_secondary/psychic_noise.c @@ -4,7 +4,7 @@ ASSUMPTIONS { ASSUME(MoveHasAdditionalEffect(MOVE_PSYCHIC_NOISE, MOVE_EFFECT_PSYCHIC_NOISE)); - ASSUME(gMovesInfo[MOVE_RECOVER].effect == EFFECT_RESTORE_HP); + ASSUME(GetMoveEffect(MOVE_RECOVER) == EFFECT_RESTORE_HP); } SINGLE_BATTLE_TEST("Psychic Noise blocks healing moves for 2 turns") diff --git a/test/battle/move_effects_combined/axe_kick.c b/test/battle/move_effects_combined/axe_kick.c index 94ab9377ad3d..5cc5b9b90c68 100644 --- a/test/battle/move_effects_combined/axe_kick.c +++ b/test/battle/move_effects_combined/axe_kick.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_AXE_KICK].effect == EFFECT_RECOIL_IF_MISS); + ASSUME(GetMoveEffect(MOVE_AXE_KICK) == EFFECT_RECOIL_IF_MISS); ASSUME(MoveHasAdditionalEffect(MOVE_AXE_KICK, MOVE_EFFECT_CONFUSION) == TRUE); } diff --git a/test/battle/move_effects_combined/barb_barrage.c b/test/battle/move_effects_combined/barb_barrage.c index cedb671b8604..62f78cd4cf8f 100644 --- a/test/battle/move_effects_combined/barb_barrage.c +++ b/test/battle/move_effects_combined/barb_barrage.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_BARB_BARRAGE].effect == EFFECT_DOUBLE_POWER_ON_ARG_STATUS); - ASSUME(gMovesInfo[MOVE_BARB_BARRAGE].argument.status == STATUS1_PSN_ANY); + ASSUME(GetMoveEffect(MOVE_BARB_BARRAGE) == EFFECT_DOUBLE_POWER_ON_ARG_STATUS); + ASSUME(GetMoveEffectArg_Status(MOVE_BARB_BARRAGE) == STATUS1_PSN_ANY); ASSUME(MoveHasAdditionalEffect(MOVE_BARB_BARRAGE, MOVE_EFFECT_POISON) == TRUE); } diff --git a/test/battle/move_effects_combined/hurricane.c b/test/battle/move_effects_combined/hurricane.c index 6e9228ddaf64..02620f4d0596 100644 --- a/test/battle/move_effects_combined/hurricane.c +++ b/test/battle/move_effects_combined/hurricane.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_HURRICANE].effect == EFFECT_THUNDER); - ASSUME(gMovesInfo[MOVE_HURRICANE].accuracy == 70); + ASSUME(GetMoveEffect(MOVE_HURRICANE) == EFFECT_THUNDER); + ASSUME(GetMoveAccuracy(MOVE_HURRICANE) == 70); } SINGLE_BATTLE_TEST("Hurricane's accuracy is lowered to 50% in Sunlight") @@ -39,10 +39,10 @@ SINGLE_BATTLE_TEST("Hurricane can hit airborne targets (Fly, Bounce)") PARAMETRIZE { move = MOVE_FLY; } PARAMETRIZE { move = MOVE_BOUNCE; } GIVEN { - ASSUME(gMovesInfo[MOVE_FLY].effect == EFFECT_SEMI_INVULNERABLE); - ASSUME(UNCOMPRESS_BITS(gMovesInfo[MOVE_FLY].argument.twoTurnAttack.status) == STATUS3_ON_AIR); - ASSUME(gMovesInfo[MOVE_BOUNCE].effect == EFFECT_SEMI_INVULNERABLE); - ASSUME(UNCOMPRESS_BITS(gMovesInfo[MOVE_BOUNCE].argument.twoTurnAttack.status) == STATUS3_ON_AIR); + ASSUME(GetMoveEffect(MOVE_FLY) == EFFECT_SEMI_INVULNERABLE); + ASSUME(GetMoveTwoTurnAttackStatus(MOVE_FLY) == STATUS3_ON_AIR); + ASSUME(GetMoveEffect(MOVE_BOUNCE) == EFFECT_SEMI_INVULNERABLE); + ASSUME(GetMoveTwoTurnAttackStatus(MOVE_BOUNCE) == STATUS3_ON_AIR); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Moves(move); } } WHEN { @@ -57,8 +57,8 @@ SINGLE_BATTLE_TEST("Hurricane can hit airborne targets (Fly, Bounce)") DOUBLE_BATTLE_TEST("Hurricane can hit airborne targets (Sky Drop)") { GIVEN { - ASSUME(gMovesInfo[MOVE_SKY_DROP].effect == EFFECT_SKY_DROP); - ASSUME(UNCOMPRESS_BITS(gMovesInfo[MOVE_SKY_DROP].argument.twoTurnAttack.status) == STATUS3_ON_AIR); + ASSUME(GetMoveEffect(MOVE_SKY_DROP) == EFFECT_SKY_DROP); + ASSUME(GetMoveTwoTurnAttackStatus(MOVE_SKY_DROP) == STATUS3_ON_AIR); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effects_combined/infernal_parade.c b/test/battle/move_effects_combined/infernal_parade.c index 890f8f9dc5e5..266718d2e986 100644 --- a/test/battle/move_effects_combined/infernal_parade.c +++ b/test/battle/move_effects_combined/infernal_parade.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_INFERNAL_PARADE].effect == EFFECT_DOUBLE_POWER_ON_ARG_STATUS); - ASSUME(gMovesInfo[MOVE_INFERNAL_PARADE].argument.status == STATUS1_ANY); + ASSUME(GetMoveEffect(MOVE_INFERNAL_PARADE) == EFFECT_DOUBLE_POWER_ON_ARG_STATUS); + ASSUME(GetMoveEffectArg_Status(MOVE_INFERNAL_PARADE) == STATUS1_ANY); ASSUME(MoveHasAdditionalEffect(MOVE_INFERNAL_PARADE, MOVE_EFFECT_BURN) == TRUE); } diff --git a/test/battle/move_effects_combined/make_it_rain.c b/test/battle/move_effects_combined/make_it_rain.c index 5469eac8a5d4..e9c8b153ce5e 100644 --- a/test/battle/move_effects_combined/make_it_rain.c +++ b/test/battle/move_effects_combined/make_it_rain.c @@ -12,7 +12,7 @@ SINGLE_BATTLE_TEST("Make It Rain lowers special attack by one stage") s16 damage[2]; GIVEN { - ASSUME(gMovesInfo[MOVE_MAKE_IT_RAIN].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_MAKE_IT_RAIN) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_effects_combined/triple_arrows.c b/test/battle/move_effects_combined/triple_arrows.c index ad7878fdc93e..4fd040e32a17 100644 --- a/test/battle/move_effects_combined/triple_arrows.c +++ b/test/battle/move_effects_combined/triple_arrows.c @@ -49,7 +49,7 @@ SINGLE_BATTLE_TEST("Triple Arrows lands a critical hit") PASSES_RANDOMLY(1, 8, RNG_CRITICAL_HIT); GIVEN { ASSUME(B_CRIT_CHANCE >= GEN_7); - ASSUME(gMovesInfo[MOVE_TRIPLE_ARROWS].criticalHitStage == 1); + ASSUME(GetMoveCriticalHitStage(MOVE_TRIPLE_ARROWS) == 1); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_flags/cant_use_twice.c b/test/battle/move_flags/cant_use_twice.c index 99bd681acb2e..cba5596d267d 100644 --- a/test/battle/move_flags/cant_use_twice.c +++ b/test/battle/move_flags/cant_use_twice.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_GIGATON_HAMMER].cantUseTwice == TRUE); - ASSUME(gMovesInfo[MOVE_BLOOD_MOON].cantUseTwice == TRUE); + ASSUME(MoveCantBeUsedTwice(MOVE_GIGATON_HAMMER) == TRUE); + ASSUME(MoveCantBeUsedTwice(MOVE_BLOOD_MOON) == TRUE); } SINGLE_BATTLE_TEST("Struggle will be used if slow Encore is used on moves with the cantUseTwice flag") @@ -13,7 +13,7 @@ SINGLE_BATTLE_TEST("Struggle will be used if slow Encore is used on moves with t PARAMETRIZE { move = MOVE_GIGATON_HAMMER; } PARAMETRIZE { move = MOVE_BLOOD_MOON; } GIVEN { - ASSUME(gMovesInfo[MOVE_ENCORE].effect == EFFECT_ENCORE); + ASSUME(GetMoveEffect(MOVE_ENCORE) == EFFECT_ENCORE); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -32,7 +32,7 @@ SINGLE_BATTLE_TEST("Moves with the cantUseTwice flag strike again if fast encore PARAMETRIZE { move = MOVE_GIGATON_HAMMER; } PARAMETRIZE { move = MOVE_BLOOD_MOON; } GIVEN { - ASSUME(gMovesInfo[MOVE_ENCORE].effect == EFFECT_ENCORE); + ASSUME(GetMoveEffect(MOVE_ENCORE) == EFFECT_ENCORE); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/move_flags/damages_airborne_double_damage.c b/test/battle/move_flags/damages_airborne_double_damage.c index dcdb801ff655..adeac7d3a218 100644 --- a/test/battle/move_flags/damages_airborne_double_damage.c +++ b/test/battle/move_flags/damages_airborne_double_damage.c @@ -7,7 +7,7 @@ SINGLE_BATTLE_TEST("Being airborne causes the target to take double damage from PARAMETRIZE { useDive = FALSE; } PARAMETRIZE { useDive = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TWISTER].damagesAirborneDoubleDamage); + ASSUME(MoveDamagesAirborneDoubleDamage(MOVE_TWISTER)); PLAYER(SPECIES_WOBBUFFET) { Speed(1); } OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } } WHEN { diff --git a/test/battle/move_flags/damages_underground.c b/test/battle/move_flags/damages_underground.c index 97b792b4dd1e..7d4b8cd9464b 100644 --- a/test/battle/move_flags/damages_underground.c +++ b/test/battle/move_flags/damages_underground.c @@ -7,7 +7,7 @@ SINGLE_BATTLE_TEST("Being underground causes the target to take double damage fr PARAMETRIZE { useDig = FALSE; } PARAMETRIZE { useDig = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].damagesUnderground); + ASSUME(MoveDamagesUnderground(MOVE_EARTHQUAKE)); PLAYER(SPECIES_WOBBUFFET) { Speed(1); } OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } } WHEN { diff --git a/test/battle/move_flags/damages_underwater.c b/test/battle/move_flags/damages_underwater.c index a7269a016263..b313d044c280 100644 --- a/test/battle/move_flags/damages_underwater.c +++ b/test/battle/move_flags/damages_underwater.c @@ -7,7 +7,7 @@ SINGLE_BATTLE_TEST("Being underwater causes the target to take double damage fro PARAMETRIZE { useDive = FALSE; } PARAMETRIZE { useDive = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_SURF].damagesUnderwater); + ASSUME(MoveDamagesUnderWater(MOVE_SURF)); PLAYER(SPECIES_WOBBUFFET) { Speed(1); } OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } } WHEN { diff --git a/test/battle/move_flags/ignores_target_ability.c b/test/battle/move_flags/ignores_target_ability.c index 2836f4838ec0..f4f9ff30a724 100644 --- a/test/battle/move_flags/ignores_target_ability.c +++ b/test/battle/move_flags/ignores_target_ability.c @@ -3,9 +3,9 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SUNSTEEL_STRIKE].ignoresTargetAbility); - ASSUME(gMovesInfo[MOVE_MOONGEIST_BEAM].ignoresTargetAbility); - ASSUME(gMovesInfo[MOVE_PHOTON_GEYSER].ignoresTargetAbility); + ASSUME(MoveIgnoresTargetAbility(MOVE_SUNSTEEL_STRIKE)); + ASSUME(MoveIgnoresTargetAbility(MOVE_MOONGEIST_BEAM)); + ASSUME(MoveIgnoresTargetAbility(MOVE_PHOTON_GEYSER)); } SINGLE_BATTLE_TEST("ignoresTargetAbility moves do not ignore the attacker's own ability", s16 damage) @@ -20,19 +20,19 @@ SINGLE_BATTLE_TEST("ignoresTargetAbility moves do not ignore the attacker's own PARAMETRIZE { move = MOVE_PHOTON_GEYSER; ability = ABILITY_UNAWARE; } ASSUME(gAbilitiesInfo[ABILITY_UNAWARE].breakable); - ASSUME(gMovesInfo[MOVE_IRON_DEFENSE].effect == EFFECT_DEFENSE_UP_2); - ASSUME(gMovesInfo[MOVE_AMNESIA].effect == EFFECT_SPECIAL_DEFENSE_UP_2); + ASSUME(GetMoveEffect(MOVE_IRON_DEFENSE) == EFFECT_DEFENSE_UP_2); + ASSUME(GetMoveEffect(MOVE_AMNESIA) == EFFECT_SPECIAL_DEFENSE_UP_2); GIVEN { PLAYER(SPECIES_CLEFABLE) { Speed(1); Ability(ability); } OPPONENT(SPECIES_ARON) { Speed(2); } } WHEN { - if (gMovesInfo[move].category == DAMAGE_CATEGORY_PHYSICAL) + if (GetMoveCategory(move) == DAMAGE_CATEGORY_PHYSICAL) TURN { MOVE(opponent, MOVE_IRON_DEFENSE); MOVE(player, move); } else TURN { MOVE(opponent, MOVE_AMNESIA); MOVE(player, move); } } SCENE { - if (gMovesInfo[move].category == DAMAGE_CATEGORY_PHYSICAL) + if (GetMoveCategory(move) == DAMAGE_CATEGORY_PHYSICAL) ANIMATION(ANIM_TYPE_MOVE, MOVE_IRON_DEFENSE, opponent); else ANIMATION(ANIM_TYPE_MOVE, MOVE_AMNESIA, opponent); diff --git a/test/battle/move_flags/minimize_double_damage.c b/test/battle/move_flags/minimize_double_damage.c index f3cdd7657f06..fd44077c4fa0 100644 --- a/test/battle/move_flags/minimize_double_damage.c +++ b/test/battle/move_flags/minimize_double_damage.c @@ -7,8 +7,8 @@ SINGLE_BATTLE_TEST("MinimizeDoubleDamage flag makes moves cause double damage to PARAMETRIZE { useMinimize = FALSE; } PARAMETRIZE { useMinimize = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_MINIMIZE].effect == EFFECT_MINIMIZE); - ASSUME(gMovesInfo[MOVE_STEAMROLLER].minimizeDoubleDamage); + ASSUME(GetMoveEffect(MOVE_MINIMIZE) == EFFECT_MINIMIZE); + ASSUME(MoveIncreasesPowerToMinimizedTargets(MOVE_STEAMROLLER)); PLAYER(SPECIES_WOBBUFFET) { Speed(1); } OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } } WHEN { diff --git a/test/battle/move_flags/powder.c b/test/battle/move_flags/powder.c index 35a6e1012b28..04920f79f303 100644 --- a/test/battle/move_flags/powder.c +++ b/test/battle/move_flags/powder.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Powder moves are blocked by Grass-type Pokémon") { GIVEN { - ASSUME(gMovesInfo[MOVE_STUN_SPORE].powderMove); + ASSUME(IsPowderMove(MOVE_STUN_SPORE)); ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_ODDISH); diff --git a/test/battle/move_flags/recoil.c b/test/battle/move_flags/recoil.c index bdada8a11479..dede6289da06 100644 --- a/test/battle/move_flags/recoil.c +++ b/test/battle/move_flags/recoil.c @@ -7,7 +7,7 @@ SINGLE_BATTLE_TEST("Take Down deals 25% of recoil damage to the user") s16 recoilDamage; GIVEN { - ASSUME(gMovesInfo[MOVE_TAKE_DOWN].recoil == 25); + ASSUME(GetMoveRecoil(MOVE_TAKE_DOWN) == 25); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -27,7 +27,7 @@ SINGLE_BATTLE_TEST("Double Edge deals 33% of recoil damage to the user") s16 recoilDamage; GIVEN { - ASSUME(gMovesInfo[MOVE_DOUBLE_EDGE].recoil == 33); + ASSUME(GetMoveRecoil(MOVE_DOUBLE_EDGE) == 33); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -47,7 +47,7 @@ SINGLE_BATTLE_TEST("Head Smash deals 50% of recoil damage to the user") s16 recoilDamage; GIVEN { - ASSUME(gMovesInfo[MOVE_HEAD_SMASH].recoil == 50); + ASSUME(GetMoveRecoil(MOVE_HEAD_SMASH) == 50); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -67,7 +67,7 @@ SINGLE_BATTLE_TEST("Flare Blitz deals 33% of recoil damage to the user and can b s16 recoilDamage; GIVEN { - ASSUME(gMovesInfo[MOVE_FLARE_BLITZ].recoil == 33); + ASSUME(GetMoveRecoil(MOVE_FLARE_BLITZ) == 33); ASSUME(MoveHasAdditionalEffect(MOVE_FLARE_BLITZ, MOVE_EFFECT_BURN)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_flags/strike_count.c b/test/battle/move_flags/strike_count.c index ba71e35c263d..80a6f2435908 100644 --- a/test/battle/move_flags/strike_count.c +++ b/test/battle/move_flags/strike_count.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Two strike count turns a move into a 2-hit move") { GIVEN { - ASSUME(gMovesInfo[MOVE_DOUBLE_KICK].strikeCount == 2); + ASSUME(GetMoveStrikeCount(MOVE_DOUBLE_KICK) == 2); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -23,7 +23,7 @@ SINGLE_BATTLE_TEST("Three strike count turns a move into a 3-hit move") s16 thirdHit; GIVEN { - ASSUME(gMovesInfo[MOVE_TRIPLE_DIVE].strikeCount == 3); + ASSUME(GetMoveStrikeCount(MOVE_TRIPLE_DIVE) == 3); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -49,8 +49,8 @@ SINGLE_BATTLE_TEST("Surging Strikes hits 3 times with each hit being a critical s16 thirdHit; GIVEN { - ASSUME(gMovesInfo[MOVE_SURGING_STRIKES].strikeCount == 3); - ASSUME(gMovesInfo[MOVE_SURGING_STRIKES].alwaysCriticalHit == TRUE); + ASSUME(GetMoveStrikeCount(MOVE_SURGING_STRIKES) == 3); + ASSUME(MoveAlwaysCrits(MOVE_SURGING_STRIKES)); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/sleep_clause.c b/test/battle/sleep_clause.c index f0f8f2906d37..a5f28f4f22f0 100644 --- a/test/battle/sleep_clause.c +++ b/test/battle/sleep_clause.c @@ -5,7 +5,7 @@ AI_SINGLE_BATTLE_TEST("Sleep Clause: AI will not use sleep moves while sleep cla { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); @@ -21,7 +21,7 @@ AI_DOUBLE_BATTLE_TEST("Sleep Clause: AI will not use sleep moves while sleep cla { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); @@ -39,7 +39,7 @@ AI_DOUBLE_BATTLE_TEST("Sleep Clause: AI will not use sleep move if partner is al { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); @@ -55,7 +55,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep moves fail when sleep clause is active") { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -82,7 +82,7 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Sleep moves fail when sleep clause is active ( { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { HP(1); MaxHP(100); } @@ -108,8 +108,8 @@ SINGLE_BATTLE_TEST("Sleep Clause: Rest does not activate sleep clause") { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_REST].effect == EFFECT_REST); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_REST) == EFFECT_REST); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -128,8 +128,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Rest does not activate sleep clause (Doubles)" { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_REST].effect == EFFECT_REST); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_REST) == EFFECT_REST); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { HP(1); MaxHP(100); } @@ -150,8 +150,8 @@ SINGLE_BATTLE_TEST("Sleep Clause: Rest can still be used when sleep clause is ac { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_REST].effect == EFFECT_REST); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_REST) == EFFECT_REST); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -174,8 +174,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Rest can still be used when sleep clause is ac { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_REST].effect == EFFECT_REST); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_REST) == EFFECT_REST); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { HP(1); MaxHP(100); } @@ -196,9 +196,9 @@ SINGLE_BATTLE_TEST("Sleep Clause: Psycho Shift'ing sleep will fail if sleep clau { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_SLEEP_TALK].effect == EFFECT_SLEEP_TALK); - ASSUME(gMovesInfo[MOVE_PSYCHO_SHIFT].effect == EFFECT_PSYCHO_SHIFT); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SLEEP_TALK) == EFFECT_SLEEP_TALK); + ASSUME(GetMoveEffect(MOVE_PSYCHO_SHIFT) == EFFECT_PSYCHO_SHIFT); PLAYER(SPECIES_WOBBUFFET) PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_SLEEP_TALK, MOVE_PSYCHO_SHIFT); } OPPONENT(SPECIES_WOBBUFFET); @@ -222,9 +222,9 @@ SINGLE_BATTLE_TEST("Sleep Clause: Psycho Shift'ing sleep will activate sleep cla { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_SLEEP_TALK].effect == EFFECT_SLEEP_TALK); - ASSUME(gMovesInfo[MOVE_PSYCHO_SHIFT].effect == EFFECT_PSYCHO_SHIFT); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SLEEP_TALK) == EFFECT_SLEEP_TALK); + ASSUME(GetMoveEffect(MOVE_PSYCHO_SHIFT) == EFFECT_PSYCHO_SHIFT); PLAYER(SPECIES_ZIGZAGOON) PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_SLEEP_TALK, MOVE_PSYCHO_SHIFT); } @@ -252,7 +252,7 @@ AI_SINGLE_BATTLE_TEST("Sleep Clause: AI will not use Yawn while sleep clause is { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); @@ -269,7 +269,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Yawn will fail when sleep clause is active") { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -297,8 +297,8 @@ SINGLE_BATTLE_TEST("Sleep Clause: Effect Spore causes sleep 11% of the time with GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); } @@ -321,8 +321,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Effect Spore causes sleep 11% of the time with GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); } @@ -348,8 +348,8 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep from Effect Spore will not activate slee GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); } @@ -375,8 +375,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Sleep from Effect Spore will not activate slee GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(MoveMakesContact(MOVE_TACKLE)); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); } @@ -401,7 +401,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Moves with sleep effect chance will activate s GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); ASSUME(MoveHasAdditionalEffect(MOVE_RELIC_SONG, MOVE_EFFECT_SLEEP)); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -429,7 +429,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Moves with sleep effect chance will still do d GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); ASSUME(MoveHasAdditionalEffect(MOVE_RELIC_SONG, MOVE_EFFECT_SLEEP)); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -456,7 +456,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Dire Claw cannot sleep a mon when sleep clause GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); ASSUME(MoveHasAdditionalEffect(MOVE_DIRE_CLAW, MOVE_EFFECT_DIRE_CLAW)); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -482,7 +482,7 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Dark Void can only sleep one opposing mon if s // Source: https://bulbapedia.bulbagarden.net/wiki/Dark_Void_(move) GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_DARK_VOID].effect == EFFECT_DARK_VOID); + ASSUME(GetMoveEffect(MOVE_DARK_VOID) == EFFECT_DARK_VOID); PLAYER(SPECIES_DARKRAI); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -507,7 +507,7 @@ DOUBLE_BATTLE_TEST("Sleep Clause: G-Max Befuddle can only sleep one opposing mon { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_G_MAX_BEFUDDLE].argument.maxEffect == MAX_EFFECT_EFFECT_SPORE_FOES); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_BEFUDDLE) == MAX_EFFECT_EFFECT_SPORE_FOES); PLAYER(SPECIES_BUTTERFREE) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_CATERPIE); OPPONENT(SPECIES_WOBBUFFET); @@ -532,7 +532,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); ASSUME(B_SLEEP_TURNS >= GEN_5); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -564,10 +564,10 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo PARAMETRIZE { move = MOVE_SPARKLY_SWIRL; healingSlot = opponentLeft; sporedSlot = opponentRight; switchIndex = 1; } GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_AROMATHERAPY].effect == EFFECT_HEAL_BELL); - ASSUME(gMovesInfo[MOVE_HEAL_BELL].effect == EFFECT_HEAL_BELL); - ASSUME(gMovesInfo[MOVE_SPARKLY_SWIRL].effect == EFFECT_SPARKLY_SWIRL); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_AROMATHERAPY) == EFFECT_HEAL_BELL); + ASSUME(GetMoveEffect(MOVE_HEAL_BELL) == EFFECT_HEAL_BELL); + ASSUME(GetMoveEffect(MOVE_SPARKLY_SWIRL) == EFFECT_SPARKLY_SWIRL); ASSUME(B_SLEEP_TURNS >= GEN_5); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); @@ -622,7 +622,7 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); ASSUME(MoveHasAdditionalEffect(MOVE_WAKE_UP_SLAP, MOVE_EFFECT_REMOVE_STATUS)); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); @@ -664,8 +664,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_UPROAR].effect == EFFECT_UPROAR); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_UPROAR) == EFFECT_UPROAR); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); @@ -705,14 +705,14 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo PARAMETRIZE { move = MOVE_AROMATHERAPY; } GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_SLEEP_TALK].effect == EFFECT_SLEEP_TALK); - ASSUME(gMovesInfo[MOVE_PSYCHO_SHIFT].effect == EFFECT_PSYCHO_SHIFT); - ASSUME(gMovesInfo[MOVE_JUNGLE_HEALING].effect == EFFECT_JUNGLE_HEALING); - ASSUME(gMovesInfo[MOVE_LUNAR_BLESSING].effect == EFFECT_JUNGLE_HEALING); - ASSUME(gMovesInfo[MOVE_PURIFY].effect == EFFECT_PURIFY); - ASSUME(gMovesInfo[MOVE_TAKE_HEART].effect == EFFECT_TAKE_HEART); - ASSUME(gMovesInfo[MOVE_AROMATHERAPY].effect == EFFECT_HEAL_BELL); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SLEEP_TALK) == EFFECT_SLEEP_TALK); + ASSUME(GetMoveEffect(MOVE_PSYCHO_SHIFT) == EFFECT_PSYCHO_SHIFT); + ASSUME(GetMoveEffect(MOVE_JUNGLE_HEALING) == EFFECT_JUNGLE_HEALING); + ASSUME(GetMoveEffect(MOVE_LUNAR_BLESSING) == EFFECT_JUNGLE_HEALING); + ASSUME(GetMoveEffect(MOVE_PURIFY) == EFFECT_PURIFY); + ASSUME(GetMoveEffect(MOVE_TAKE_HEART) == EFFECT_TAKE_HEART); + ASSUME(GetMoveEffect(MOVE_AROMATHERAPY) == EFFECT_HEAL_BELL); ASSUME(gItemsInfo[ITEM_CHESTO_BERRY].holdEffect == HOLD_EFFECT_CURE_SLP); PLAYER(SPECIES_ZIGZAGOON) { Item(ITEM_CHESTO_BERRY); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_SLEEP_TALK, move); } @@ -761,7 +761,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_PELIPPER) { Ability(ABILITY_DRIZZLE); } OPPONENT(SPECIES_LUVDISC) { Ability(ABILITY_HYDRATION); } } WHEN { @@ -785,7 +785,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_SWABLU) { Ability(ABILITY_NATURAL_CURE); } OPPONENT(SPECIES_ZIGZAGOON); @@ -815,7 +815,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo PASSES_RANDOMLY(33, 100, RNG_SHED_SKIN); GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_DRATINI) { Ability(ABILITY_SHED_SKIN); } } WHEN { @@ -839,7 +839,7 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo PASSES_RANDOMLY(30, 100, RNG_HEALER); GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_ZIGZAGOON); @@ -867,7 +867,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo PARAMETRIZE { heldItem = ITEM_LUM_BERRY; } GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); ASSUME(gItemsInfo[ITEM_CHESTO_BERRY].holdEffect == HOLD_EFFECT_CURE_SLP); ASSUME(gItemsInfo[ITEM_LUM_BERRY].holdEffect == HOLD_EFFECT_CURE_STATUS); PLAYER(SPECIES_ZIGZAGOON); @@ -898,8 +898,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo PARAMETRIZE { heldItem = ITEM_LUM_BERRY; } GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_FLING].effect == EFFECT_FLING); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_FLING) == EFFECT_FLING); ASSUME(gItemsInfo[ITEM_CHESTO_BERRY].holdEffect == HOLD_EFFECT_CURE_SLP); ASSUME(gItemsInfo[ITEM_LUM_BERRY].holdEffect == HOLD_EFFECT_CURE_STATUS); PLAYER(SPECIES_ZIGZAGOON); @@ -931,7 +931,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); ASSUME(gItemsInfo[ITEM_AWAKENING].battleUsage == EFFECT_ITEM_CURE_STATUS); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_ZIGZAGOON); @@ -955,7 +955,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_ZIGZAGOON) { Level(5); } OPPONENT(SPECIES_ZIGZAGOON); @@ -980,7 +980,7 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_ZIGZAGOON) { Level(5); } @@ -1008,7 +1008,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo PARAMETRIZE { ability = ABILITY_INSOMNIA; } GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_DELIBIRD) { Ability(ability); } OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_SLEEP_TALK, MOVE_SKILL_SWAP); } } WHEN { @@ -1044,7 +1044,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo PARAMETRIZE { ability = ABILITY_INSOMNIA; } GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ZIGZAGOON) PLAYER(SPECIES_DELIBIRD) { Ability(ability); } OPPONENT(SPECIES_RALTS) { Ability(ABILITY_TRACE); } @@ -1081,7 +1081,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo KNOWN_FAILING; // Sleep Clause parts work, but Imposter seems broken with battle messages / targeting. Issue #5565 https://github.com/rh-hideout/pokeemerald-expansion/issues/5565 GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); ASSUME(gItemsInfo[ITEM_LAGGING_TAIL].holdEffect == HOLD_EFFECT_LAGGING_TAIL); PLAYER(SPECIES_ZIGZAGOON) PLAYER(SPECIES_DELIBIRD) { Ability(ability); } @@ -1116,7 +1116,7 @@ AI_SINGLE_BATTLE_TEST("Sleep Clause: AI will use sleep moves again when sleep cl { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); ASSUME(gItemsInfo[ITEM_CHESTO_BERRY].holdEffect == HOLD_EFFECT_CURE_SLP); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_CHESTO_BERRY); } @@ -1131,8 +1131,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Sleep clause is deactivated when a sleeping mo { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_G_MAX_SWEETNESS].argument.maxEffect == MAX_EFFECT_AROMATHERAPY); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveMaxEffect(MOVE_G_MAX_SWEETNESS) == MAX_EFFECT_AROMATHERAPY); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_APPLETUN) { GigantamaxFactor(TRUE); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); @@ -1159,7 +1159,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Pre-existing sleep condition doesn't activate { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_ZIGZAGOON) { Status1(STATUS1_SLEEP); } OPPONENT(SPECIES_ZIGZAGOON); @@ -1179,9 +1179,9 @@ SINGLE_BATTLE_TEST("Sleep Clause: Sleep caused by Effect Spore does not prevent GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_AROMATHERAPY].effect == EFFECT_HEAL_BELL); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_AROMATHERAPY) == EFFECT_HEAL_BELL); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); @@ -1215,8 +1215,8 @@ SINGLE_BATTLE_TEST("Sleep Clause: Waking up after Effect Spore doesn't deactivat GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); } @@ -1252,9 +1252,9 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Waking up after Effect Spore doesn't deactivat GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_AROMATHERAPY].effect == EFFECT_HEAL_BELL); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_AROMATHERAPY) == EFFECT_HEAL_BELL); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); @@ -1292,8 +1292,8 @@ SINGLE_BATTLE_TEST("Sleep Clause: Waking up after Rest doesn't deactivate sleep { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_REST].effect == EFFECT_REST); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_REST) == EFFECT_REST); PLAYER(SPECIES_ZIGZAGOON) { HP(1); MaxHP(100); } PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_ZIGZAGOON); @@ -1328,8 +1328,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Waking up after Rest doesn't deactivate sleep { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_REST].effect == EFFECT_REST); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_REST) == EFFECT_REST); PLAYER(SPECIES_ZIGZAGOON) { HP(1); MaxHP(100); } PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); @@ -1366,7 +1366,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Suppressing and then sleeping Vital Spirit / I PARAMETRIZE { ability = ABILITY_INSOMNIA; } GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_DELIBIRD) { Ability(ability); } OPPONENT(SPECIES_ZIGZAGOON); @@ -1397,7 +1397,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Mold Breaker Pokémon sleeping Vital Spirit / PARAMETRIZE { ability = ABILITY_INSOMNIA; } GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_PANCHAM) { Ability(ABILITY_MOLD_BREAKER); } OPPONENT(SPECIES_DELIBIRD) { Ability(ability); } OPPONENT(SPECIES_ZIGZAGOON); @@ -1424,9 +1424,9 @@ SINGLE_BATTLE_TEST("Sleep Clause: Yawn'd Pokémon slept due to Effect Spore befo PASSES_RANDOMLY(11, 100, RNG_EFFECT_SPORE); GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); - ASSUME(gMovesInfo[MOVE_TACKLE].makesContact); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); + ASSUME(MoveMakesContact(MOVE_TACKLE)); PLAYER(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); } OPPONENT(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_ZIGZAGOON); @@ -1451,8 +1451,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Yawn'd Pokémon who's partner is slept before { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_ZIGZAGOON); @@ -1478,8 +1478,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: If both Pokémon on one side are Yawn'd at the { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); PLAYER(SPECIES_ZIGZAGOON) { Speed(5); } PLAYER(SPECIES_ZIGZAGOON) { Speed(4); } OPPONENT(SPECIES_ZIGZAGOON) { Speed(3); } @@ -1503,8 +1503,8 @@ SINGLE_BATTLE_TEST("Sleep Clause: Reflection moves (ie. Magic Coat) fail if slee { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_MAGIC_COAT].effect == EFFECT_MAGIC_COAT); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_MAGIC_COAT) == EFFECT_MAGIC_COAT); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_ZIGZAGOON); @@ -1528,8 +1528,8 @@ SINGLE_BATTLE_TEST("Sleep Clause: Reflection moves (ie. Magic Coat) that reflect { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_MAGIC_COAT].effect == EFFECT_MAGIC_COAT); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_MAGIC_COAT) == EFFECT_MAGIC_COAT); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_ZIGZAGOON); @@ -1558,8 +1558,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Reflection moves (ie. Magic Coat) that reflect // Source: https://bulbapedia.bulbagarden.net/wiki/Dark_Void_(move) GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_MAGIC_COAT].effect == EFFECT_MAGIC_COAT); - ASSUME(gMovesInfo[MOVE_DARK_VOID].effect == EFFECT_DARK_VOID); + ASSUME(GetMoveEffect(MOVE_MAGIC_COAT) == EFFECT_MAGIC_COAT); + ASSUME(GetMoveEffect(MOVE_DARK_VOID) == EFFECT_DARK_VOID); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_DARKRAI); @@ -1583,7 +1583,7 @@ SINGLE_BATTLE_TEST("Sleep Clause: Magic Bounce'ing a sleep move activates sleep { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE); } PLAYER(SPECIES_ZIGZAGOON); OPPONENT(SPECIES_ZIGZAGOON); @@ -1612,7 +1612,7 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Magic Bounce reflecting Dark Void only sleeps // Source: https://bulbapedia.bulbagarden.net/wiki/Dark_Void_(move) GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_DARK_VOID].effect == EFFECT_DARK_VOID); + ASSUME(GetMoveEffect(MOVE_DARK_VOID) == EFFECT_DARK_VOID); PLAYER(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE); } PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_DARKRAI); @@ -1636,7 +1636,7 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Sleep Clause does not prevent sleeping your pa { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); @@ -1679,7 +1679,7 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Sleep Clause does not prevent sleeping your pa { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); @@ -1722,7 +1722,7 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Sleep moves used after being Encore'd are prev { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); @@ -1751,8 +1751,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Spore'ing opponent after Yawn'ing partner does { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); @@ -1788,8 +1788,8 @@ DOUBLE_BATTLE_TEST("Sleep Clause: Opponent Spore'ing player's partner after part { GIVEN { FLAG_SET(B_FLAG_SLEEP_CLAUSE); - ASSUME(gMovesInfo[MOVE_SPORE].effect == EFFECT_SLEEP); - ASSUME(gMovesInfo[MOVE_YAWN].effect == EFFECT_YAWN); + ASSUME(GetMoveEffect(MOVE_SPORE) == EFFECT_SLEEP); + ASSUME(GetMoveEffect(MOVE_YAWN) == EFFECT_YAWN); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); PLAYER(SPECIES_ZIGZAGOON); diff --git a/test/battle/spread_moves.c b/test/battle/spread_moves.c index 5228e3041f04..2791ca0ea5e9 100644 --- a/test/battle/spread_moves.c +++ b/test/battle/spread_moves.c @@ -36,8 +36,8 @@ DOUBLE_BATTLE_TEST("Spread Moves: No damage will be dealt to a mon in an invulne PARAMETRIZE { attackingMove = MOVE_HYPER_VOICE; invulMove = MOVE_DIVE; } PARAMETRIZE { attackingMove = MOVE_LAVA_PLUME; invulMove = MOVE_DIVE; } GIVEN { - ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH); - ASSUME(gMovesInfo[MOVE_LAVA_PLUME].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_HYPER_VOICE) == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_LAVA_PLUME) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_ZAPDOS); @@ -172,8 +172,8 @@ DOUBLE_BATTLE_TEST("Spread Moves: A spread move attack will be weakened by stron DOUBLE_BATTLE_TEST("Spread Moves: AOE move vs Disguise, Volt Absorb (right) and Lightning Rod (left)") { GIVEN { - ASSUME(gMovesInfo[MOVE_DISCHARGE].target == MOVE_TARGET_FOES_AND_ALLY); - ASSUME(gMovesInfo[MOVE_DISCHARGE].type == TYPE_ELECTRIC); + ASSUME(GetMoveTarget(MOVE_DISCHARGE) == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveType(MOVE_DISCHARGE) == TYPE_ELECTRIC); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_MIMIKYU); OPPONENT(SPECIES_RAICHU) { Ability(ABILITY_LIGHTNING_ROD); } @@ -191,8 +191,8 @@ DOUBLE_BATTLE_TEST("Spread Moves: AOE move vs Disguise, Volt Absorb (right) and DOUBLE_BATTLE_TEST("Spread Moves: AOE move vs Disguise, Volt Absorb (left) and Lightning Rod (reft)") { GIVEN { - ASSUME(gMovesInfo[MOVE_DISCHARGE].target == MOVE_TARGET_FOES_AND_ALLY); - ASSUME(gMovesInfo[MOVE_DISCHARGE].type == TYPE_ELECTRIC); + ASSUME(GetMoveTarget(MOVE_DISCHARGE) == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveType(MOVE_DISCHARGE) == TYPE_ELECTRIC); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_MIMIKYU); OPPONENT(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); HP(1); } @@ -210,8 +210,8 @@ DOUBLE_BATTLE_TEST("Spread Moves: AOE move vs Disguise, Volt Absorb (left) and L DOUBLE_BATTLE_TEST("Spread Moves: AOE move vs Eiscue and Mimikyu (Based on vanilla games)") { GIVEN { - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); - ASSUME(gMovesInfo[MOVE_EARTHQUAKE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveTarget(MOVE_EARTHQUAKE) == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveCategory(MOVE_EARTHQUAKE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_EISCUE); OPPONENT(SPECIES_MIMIKYU); @@ -229,7 +229,7 @@ DOUBLE_BATTLE_TEST("Spread Moves: AOE move vs Eiscue and Mimikyu (Based on vanil DOUBLE_BATTLE_TEST("Spread Moves: Spread move, Gem Boosted, vs Resist Berries") { GIVEN { - ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_HYPER_VOICE) == MOVE_TARGET_BOTH); PLAYER(SPECIES_WOBBUFFET) { Speed(40); Item(ITEM_NORMAL_GEM); } PLAYER(SPECIES_WYNAUT) { Speed(30); } OPPONENT(SPECIES_WOBBUFFET) { Speed(20); Item(ITEM_CHILAN_BERRY); } @@ -249,7 +249,7 @@ DOUBLE_BATTLE_TEST("Spread Moves: Spread move, Gem Boosted, vs Resist Berries") DOUBLE_BATTLE_TEST("Spread Moves: Explosion, Gem Boosted, vs Resist Berries") { GIVEN { - ASSUME(gMovesInfo[MOVE_EXPLOSION].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(GetMoveTarget(MOVE_EXPLOSION) == MOVE_TARGET_FOES_AND_ALLY); PLAYER(SPECIES_WOBBUFFET) { Speed(40); Item(ITEM_NORMAL_GEM); } PLAYER(SPECIES_MISDREAVUS) { Speed(30); } OPPONENT(SPECIES_WOBBUFFET) { Speed(20); Item(ITEM_CHILAN_BERRY); } @@ -270,8 +270,8 @@ DOUBLE_BATTLE_TEST("Spread Moves: Explosion, Gem Boosted, vs Resist Berries") DOUBLE_BATTLE_TEST("Spread Moves: Spread move vs Eiscue and Mimikyu with 1 Eject Button") { GIVEN { - ASSUME(gMovesInfo[MOVE_RAZOR_LEAF].target == MOVE_TARGET_BOTH); - ASSUME(gMovesInfo[MOVE_RAZOR_LEAF].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveTarget(MOVE_RAZOR_LEAF) == MOVE_TARGET_BOTH); + ASSUME(GetMoveCategory(MOVE_RAZOR_LEAF) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET) { Speed(40); } PLAYER(SPECIES_WYNAUT) { Speed(30); } OPPONENT(SPECIES_MIMIKYU) { Speed(20); Item(ITEM_EJECT_BUTTON); } @@ -290,7 +290,7 @@ DOUBLE_BATTLE_TEST("Spread Moves: Spread move vs Eiscue and Mimikyu with 1 Eject DOUBLE_BATTLE_TEST("Spread Moves: Spread move vs Wide Guard") { GIVEN { - ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_HYPER_VOICE) == MOVE_TARGET_BOTH); PLAYER(SPECIES_WOBBUFFET) { Speed(40); } PLAYER(SPECIES_WYNAUT) { Speed(20); } OPPONENT(SPECIES_WOBBUFFET) { Speed(30); } @@ -310,7 +310,7 @@ DOUBLE_BATTLE_TEST("Spread Moves: Spread move vs Wide Guard") DOUBLE_BATTLE_TEST("Spread Moves: Spread move vs one protecting mon") { GIVEN { - ASSUME(gMovesInfo[MOVE_HYPER_VOICE].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_HYPER_VOICE) == MOVE_TARGET_BOTH); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_WOBBUFFET); @@ -327,7 +327,7 @@ DOUBLE_BATTLE_TEST("Spread Moves: Spread move vs one protecting mon") DOUBLE_BATTLE_TEST("Spread Moves: Super Effective Message on both opposing mons") { GIVEN { - ASSUME(gMovesInfo[MOVE_PRECIPICE_BLADES].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_PRECIPICE_BLADES) == MOVE_TARGET_BOTH); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_GOLEM); @@ -345,7 +345,7 @@ DOUBLE_BATTLE_TEST("Spread Moves: Super Effective Message on both opposing mons" DOUBLE_BATTLE_TEST("Spread Moves: Super Effective Message on both player mons") { GIVEN { - ASSUME(gMovesInfo[MOVE_PRECIPICE_BLADES].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_PRECIPICE_BLADES) == MOVE_TARGET_BOTH); PLAYER(SPECIES_GOLEM); PLAYER(SPECIES_ONIX); OPPONENT(SPECIES_WOBBUFFET); @@ -363,7 +363,7 @@ DOUBLE_BATTLE_TEST("Spread Moves: Super Effective Message on both player mons") DOUBLE_BATTLE_TEST("Spread Moves: Not very effective Message on both opposing mons") { GIVEN { - ASSUME(gMovesInfo[MOVE_PRECIPICE_BLADES].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_PRECIPICE_BLADES) == MOVE_TARGET_BOTH); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_CHIKORITA); @@ -381,7 +381,7 @@ DOUBLE_BATTLE_TEST("Spread Moves: Not very effective Message on both opposing mo DOUBLE_BATTLE_TEST("Spread Moves: Not very effective message on both player mons") { GIVEN { - ASSUME(gMovesInfo[MOVE_PRECIPICE_BLADES].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_PRECIPICE_BLADES) == MOVE_TARGET_BOTH); PLAYER(SPECIES_CHIKORITA); PLAYER(SPECIES_TREECKO); OPPONENT(SPECIES_WOBBUFFET); @@ -399,7 +399,7 @@ DOUBLE_BATTLE_TEST("Spread Moves: Not very effective message on both player mons DOUBLE_BATTLE_TEST("Spread Moves: Doesn't affect message on both opposing mons") { GIVEN { - ASSUME(gMovesInfo[MOVE_PRECIPICE_BLADES].target == MOVE_TARGET_BOTH); + ASSUME(GetMoveTarget(MOVE_PRECIPICE_BLADES) == MOVE_TARGET_BOTH); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_PIDGEY); diff --git a/test/battle/status1/burn.c b/test/battle/status1/burn.c index 63d6506fb626..c37768cedf09 100644 --- a/test/battle/status1/burn.c +++ b/test/battle/status1/burn.c @@ -23,7 +23,7 @@ SINGLE_BATTLE_TEST("Burn reduces Attack by 50%", s16 damage) PARAMETRIZE { burned = FALSE; } PARAMETRIZE { burned = TRUE; } GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); PLAYER(SPECIES_WOBBUFFET) { if (burned) Status1(STATUS1_BURN); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/status1/freeze.c b/test/battle/status1/freeze.c index f218430909e1..ed8367545731 100644 --- a/test/battle/status1/freeze.c +++ b/test/battle/status1/freeze.c @@ -17,7 +17,7 @@ SINGLE_BATTLE_TEST("Freeze has a 20% chance of being thawed") SINGLE_BATTLE_TEST("Freeze is thawed by opponent's Fire-type attacks") { GIVEN { - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -32,7 +32,7 @@ SINGLE_BATTLE_TEST("Freeze is thawed by opponent's Fire-type attacks") SINGLE_BATTLE_TEST("Freeze is thawed by user's Flame Wheel") { GIVEN { - ASSUME(gMovesInfo[MOVE_FLAME_WHEEL].thawsUser); + ASSUME(MoveThawsUser(MOVE_FLAME_WHEEL)); PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/battle/status1/frostbite.c b/test/battle/status1/frostbite.c index a7776e5e2e1a..f45508f800b9 100644 --- a/test/battle/status1/frostbite.c +++ b/test/battle/status1/frostbite.c @@ -7,7 +7,7 @@ SINGLE_BATTLE_TEST("Frostbite reduces the special attack by 50 percent") s16 normaleDamage; GIVEN { - ASSUME(gMovesInfo[MOVE_SWIFT].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_SWIFT) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET) { Status1(STATUS1_FROSTBITE); } } WHEN { diff --git a/test/battle/status2/confusion.c b/test/battle/status2/confusion.c index 4115123b3c11..c2ee92dd09cb 100644 --- a/test/battle/status2/confusion.c +++ b/test/battle/status2/confusion.c @@ -5,7 +5,7 @@ SINGLE_BATTLE_TEST("Confusion adds a 50/33% chance to hit self with 40 power") { s16 damage[2]; - ASSUME(gMovesInfo[MOVE_TACKLE].power == 40); + ASSUME(GetMovePower(MOVE_TACKLE) == 40); PASSES_RANDOMLY(B_CONFUSION_SELF_DMG_CHANCE >= GEN_7 ? 33 : 50, 100, RNG_CONFUSION); GIVEN { diff --git a/test/battle/weather/rain.c b/test/battle/weather/rain.c index 3359d25a818d..0620aae1009e 100644 --- a/test/battle/weather/rain.c +++ b/test/battle/weather/rain.c @@ -4,8 +4,8 @@ // Please add Rain interactions with move, item and ability effects on their respective files. ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); - ASSUME(gMovesInfo[MOVE_WATER_GUN].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_WATER_GUN) == TYPE_WATER); } SINGLE_BATTLE_TEST("Rain multiplies the power of Fire-type moves by 0.5x", s16 damage) diff --git a/test/battle/weather/sandstorm.c b/test/battle/weather/sandstorm.c index 38502cbbc79c..dcac3f71c33b 100644 --- a/test/battle/weather/sandstorm.c +++ b/test/battle/weather/sandstorm.c @@ -23,7 +23,7 @@ SINGLE_BATTLE_TEST("Sandstorm multiplies the special defense of Rock-types by 1. PARAMETRIZE { move = MOVE_SANDSTORM; } PARAMETRIZE { move = MOVE_CELEBRATE; } GIVEN { - ASSUME(gMovesInfo[MOVE_SWIFT].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(GetMoveCategory(MOVE_SWIFT) == DAMAGE_CATEGORY_SPECIAL); PLAYER(SPECIES_WOBBUFFET) ; OPPONENT(SPECIES_NOSEPASS); } WHEN { diff --git a/test/battle/weather/snow.c b/test/battle/weather/snow.c index 6c084f6b7a05..7b4e4cb2ffef 100644 --- a/test/battle/weather/snow.c +++ b/test/battle/weather/snow.c @@ -4,10 +4,10 @@ // Please add Snow interactions with move, item and ability effects on their respective files. ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SNOWSCAPE].effect == EFFECT_SNOWSCAPE); + ASSUME(GetMoveEffect(MOVE_SNOWSCAPE) == EFFECT_SNOWSCAPE); ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_ICE && gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_ICE); ASSUME(gSpeciesInfo[SPECIES_GLALIE].types[0] == TYPE_ICE || gSpeciesInfo[SPECIES_GLALIE].types[1] == TYPE_ICE); - ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(GetMoveCategory(MOVE_TACKLE) == DAMAGE_CATEGORY_PHYSICAL); } SINGLE_BATTLE_TEST("Snow multiplies the defense of Ice-types by 1.5x", s16 damage) diff --git a/test/battle/weather/sunlight.c b/test/battle/weather/sunlight.c index 6cf6348987b6..796ad3c3af24 100644 --- a/test/battle/weather/sunlight.c +++ b/test/battle/weather/sunlight.c @@ -4,8 +4,8 @@ // Please add Sunlight interactions with move, item and ability effects on their respective files. ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); - ASSUME(gMovesInfo[MOVE_WATER_GUN].type == TYPE_WATER); + ASSUME(GetMoveType(MOVE_EMBER) == TYPE_FIRE); + ASSUME(GetMoveType(MOVE_WATER_GUN) == TYPE_WATER); } SINGLE_BATTLE_TEST("Sunlight multiplies the power of Fire-type moves by 1.5x", s16 damage) diff --git a/test/test_runner_battle.c b/test/test_runner_battle.c index a3130ec6a6bf..eda9c1eda552 100644 --- a/test/test_runner_battle.c +++ b/test/test_runner_battle.c @@ -1774,7 +1774,8 @@ void Moves_(u32 sourceLine, u16 moves[MAX_MON_MOVES]) break; INVALID_IF(moves[i] >= MOVES_COUNT, "Illegal move: %d", moves[i]); SetMonData(DATA.currentMon, MON_DATA_MOVE1 + i, &moves[i]); - SetMonData(DATA.currentMon, MON_DATA_PP1 + i, &gMovesInfo[moves[i]].pp); + u32 pp = GetMovePP(moves[i]); + SetMonData(DATA.currentMon, MON_DATA_PP1 + i, &pp); } DATA.explicitMoves[DATA.currentSide] |= 1 << DATA.currentPartyIndex; } @@ -2092,7 +2093,8 @@ void MoveGetIdAndSlot(s32 battlerId, struct MoveContext *ctx, u32 *moveId, u32 * { INVALID_IF(DATA.explicitMoves[battlerId & BIT_SIDE] & (1 << DATA.currentMonIndexes[battlerId]), "Missing explicit %S", GetMoveName(ctx->move)); SetMonData(mon, MON_DATA_MOVE1 + i, &ctx->move); - SetMonData(DATA.currentMon, MON_DATA_PP1 + i, &gMovesInfo[ctx->move].pp); + u32 pp = GetMovePP(ctx->move); + SetMonData(DATA.currentMon, MON_DATA_PP1 + i, &pp); *moveSlot = i; *moveId = ctx->move; break; @@ -2121,7 +2123,7 @@ void MoveGetIdAndSlot(s32 battlerId, struct MoveContext *ctx, u32 *moveId, u32 * // Check invalid item usage. INVALID_IF(ctx->gimmick == GIMMICK_MEGA && holdEffect != HOLD_EFFECT_MEGA_STONE && species != SPECIES_RAYQUAZA, "Cannot Mega Evolve without a Mega Stone"); INVALID_IF(ctx->gimmick == GIMMICK_Z_MOVE && holdEffect != HOLD_EFFECT_Z_CRYSTAL, "Cannot use a Z-Move without a Z-Crystal"); - INVALID_IF(ctx->gimmick == GIMMICK_Z_MOVE && ItemId_GetSecondaryId(item) != gMovesInfo[*moveId].type + INVALID_IF(ctx->gimmick == GIMMICK_Z_MOVE && ItemId_GetSecondaryId(item) != GetMoveType(*moveId) && GetSignatureZMove(*moveId, species, item) == MOVE_NONE && *moveId != MOVE_PHOTON_GEYSER, // exception because test won't recognize Ultra Necrozma pre-Burst "Cannot turn %S into a Z-Move with %S", GetMoveName(ctx->move), ItemId_GetName(item)); @@ -2183,7 +2185,7 @@ void Move(u32 sourceLine, struct BattlePokemon *battler, struct MoveContext ctx) MoveGetIdAndSlot(battlerId, &ctx, &moveId, &moveSlot, sourceLine); target = MoveGetTarget(battlerId, moveId, &ctx, sourceLine); - if (gMovesInfo[moveId].effect == EFFECT_REVIVAL_BLESSING) + if (GetMoveEffect(moveId) == EFFECT_REVIVAL_BLESSING) requirePartyIndex = MoveGetFirstFainted(battlerId) != PARTY_SIZE; // Check party menu moves. diff --git a/test/text.c b/test/text.c index ed343d103981..781aaaed3ec6 100644 --- a/test/text.c +++ b/test/text.c @@ -23,10 +23,10 @@ TEST("Move names fit on Pokemon Summary Screen") u32 move = MOVE_NONE; for (i = 1; i < MOVES_COUNT; i++) { - PARAMETRIZE_LABEL("%S", gMovesInfo[i].name) { move = i; } + PARAMETRIZE_LABEL("%S", GetMoveName(i)) { move = i; } } - //DebugPrintf("Move %d: %S", GetStringWidth(fontId, gMovesInfo[move].name, 0), gMovesInfo[move].name); - EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx); + //DebugPrintf("Move %d: %S", GetStringWidth(fontId, GetMoveName(move), 0), GetMoveName(move)); + EXPECT_LE(GetStringWidth(fontId, GetMoveName(move), 0), widthPx); } TEST("Move names fit on Battle Screen") @@ -36,9 +36,9 @@ TEST("Move names fit on Battle Screen") u32 move = MOVE_NONE; for (i = 1; i < MOVES_COUNT; i++) { - PARAMETRIZE_LABEL("%S", gMovesInfo[i].name) { move = i; } + PARAMETRIZE_LABEL("%S", GetMoveName(i)) { move = i; } } - EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx); + EXPECT_LE(GetStringWidth(fontId, GetMoveName(move), 0), widthPx); } TEST("Move names fit on Contest Screen") @@ -48,7 +48,7 @@ TEST("Move names fit on Contest Screen") u32 move = MOVE_NONE; for (i = 1; i < MOVES_COUNT; i++) { - PARAMETRIZE_LABEL("%S", gMovesInfo[i].name) { move = i; } + PARAMETRIZE_LABEL("%S", GetMoveName(i)) { move = i; } } // All moves explicitly listed here are too big to fit. switch (move) @@ -56,10 +56,10 @@ TEST("Move names fit on Contest Screen") case MOVE_STOMPING_TANTRUM: case MOVE_NATURES_MADNESS: case MOVE_DOUBLE_IRON_BASH: - EXPECT_GT(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx); + EXPECT_GT(GetStringWidth(fontId, GetMoveName(move), 0), widthPx); break; default: - EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx); + EXPECT_LE(GetStringWidth(fontId, GetMoveName(move), 0), widthPx); break; } } @@ -71,9 +71,9 @@ TEST("Move names fit on TMs & HMs Bag Screen") u32 move = MOVE_NONE; for (i = 1; i < MOVES_COUNT; i++) { - PARAMETRIZE_LABEL("%S", gMovesInfo[i].name) { move = i; } + PARAMETRIZE_LABEL("%S", GetMoveName(i)) { move = i; } } - EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx); + EXPECT_LE(GetStringWidth(fontId, GetMoveName(move), 0), widthPx); } TEST("Move names fit on Move Relearner Screen") @@ -83,9 +83,9 @@ TEST("Move names fit on Move Relearner Screen") u32 move = MOVE_NONE; for (i = 1; i < MOVES_COUNT; i++) { - PARAMETRIZE_LABEL("%S", gMovesInfo[i].name) { move = i; } + PARAMETRIZE_LABEL("%S", GetMoveName(i)) { move = i; } } - EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx); + EXPECT_LE(GetStringWidth(fontId, GetMoveName(move), 0), widthPx); } TEST("Move descriptions fit on Pokemon Summary Screen") @@ -95,9 +95,9 @@ TEST("Move descriptions fit on Pokemon Summary Screen") u32 move = MOVE_NONE; for (i = 1; i < MOVES_COUNT; i++) { - PARAMETRIZE_LABEL("%S", gMovesInfo[i].description) { move = i; } + PARAMETRIZE_LABEL("%S", GetMoveDescription(i)) { move = i; } } - EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].description, 0), widthPx); + EXPECT_LE(GetStringWidth(fontId, GetMoveDescription(move), 0), widthPx); } TEST("Item names fit on Bag Screen (list)")