From 348d70b309c6ff89812ec7dd0f8e05e1c7312657 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 26 Nov 2020 15:56:18 -0500 Subject: [PATCH 001/208] z move indicator and some data --- graphics/battle_interface/z_move_trigger.pal | 19 + graphics/battle_interface/z_move_trigger.png | Bin 0 -> 272 bytes include/battle.h | 13 + include/battle_controllers.h | 2 + include/battle_interface.h | 9 +- include/battle_message.h | 1 + include/battle_util.h | 1 + include/battle_z_move.h | 22 + include/constants/battle_config.h | 35 + include/constants/hold_effects.h | 1 + include/constants/items.h | 42 +- include/constants/moves.h | 46 +- include/constants/z_move_effects.h | 38 + include/data.h | 1 + include/pokemon.h | 4 +- ld_script.txt | 2 + src/battle_anim_new.c | 98 + src/battle_controller_player.c | 64 +- src/battle_interface.c | 7 + src/battle_main.c | 1 + src/battle_message.c | 3 +- src/battle_util.c | 2 +- src/battle_z_move.c | 525 +++ src/data/battle_moves.h | 3749 ++++++++---------- src/data/text/move_names.h | 75 + src/graphics.c | 4 +- src/pokemon.c | 1 + 27 files changed, 2597 insertions(+), 2168 deletions(-) create mode 100644 graphics/battle_interface/z_move_trigger.pal create mode 100644 graphics/battle_interface/z_move_trigger.png create mode 100644 include/battle_z_move.h create mode 100644 include/constants/z_move_effects.h create mode 100644 src/battle_z_move.c diff --git a/graphics/battle_interface/z_move_trigger.pal b/graphics/battle_interface/z_move_trigger.pal new file mode 100644 index 000000000..2672d1f10 --- /dev/null +++ b/graphics/battle_interface/z_move_trigger.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +185 207 163 +77 105 97 +199 159 199 +221 177 207 +57 151 117 +139 221 253 +247 161 133 +255 255 255 +153 87 67 +233 233 125 +129 255 223 +149 147 247 +195 207 201 +123 151 135 +0 0 0 +0 0 0 diff --git a/graphics/battle_interface/z_move_trigger.png b/graphics/battle_interface/z_move_trigger.png new file mode 100644 index 0000000000000000000000000000000000000000..9a9c5d937abc948679d39a39bf302822a9f1ff45 GIT binary patch literal 272 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvg8-ip*PZ7V`(`E{pMU)B#`Bib zOS|v>{l2jE|Ns9p!<}EgtZn>%f9mA#htHp^p56}B0R&|!RxLn^v%n*=n1Mk|6@(c* zgH%2M1=~Db978lFCMPs7#5uBw9ME3TacqB1hf+b{4YAPH1sfMU+}+N^AzSpmfx)xk zz3i+5yUYDq8#xpU0z=H+&COAWX$TK6dvf=3_r`+8?xv>q_c|-q3N>g8OsU?U)p^I7 zF@;q@p4L?9Rc!Aa}$p-(z~|W{`6| MUHx3vIVCg!02ZTWLjV8( literal 0 HcmV?d00001 diff --git a/include/battle.h b/include/battle.h index 13fe13171..0e484746e 100644 --- a/include/battle.h +++ b/include/battle.h @@ -427,6 +427,18 @@ struct Illusion struct Pokemon *mon; }; +struct ZMoveData +{ + /*0x00*/ u8 battlerId; + /*0x01*/ u8 viable:1; // current move can become a z move + u8 viewingZMove:1; //if player is viewing the z move name instead of regular moves + u8 split:2; + u8 zUnused:4; + /*0x02*/ u16 currZMove; //z move of cursor / selected z move + /*0x04*/ u16 baseMove; //move turned into z move + /*0x06*/ u8 triggerSpriteId; +}; /* size = 8 */ + struct BattleStruct { u8 turnEffectsTracker; @@ -522,6 +534,7 @@ struct BattleStruct u8 activeAbilityPopUps; // as bits for each battler bool8 throwingPokeBall; struct MegaEvolutionData mega; + struct ZMoveData zmove; const u8 *trainerSlideMsg; bool8 trainerSlideLowHpMsgDone; u8 introState; diff --git a/include/battle_controllers.h b/include/battle_controllers.h index bbaa40ca8..e0eeca6be 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -259,6 +259,8 @@ void c3_0802FDF4(u8 taskId); void ActionSelectionCreateCursorAt(u8 cursorPos, u8 unused); void ActionSelectionDestroyCursorAt(u8 cursorPos); void InitMoveSelectionsVarsAndStrings(void); +void MoveSelectionCreateCursorAt(u8 cursorPos, u8 arg1); +void MoveSelectionDestroyCursorAt(u8 cursorPosition); // recorded player controller void SetControllerToRecordedPlayer(void); diff --git a/include/battle_interface.h b/include/battle_interface.h index 32c679285..2d69af586 100644 --- a/include/battle_interface.h +++ b/include/battle_interface.h @@ -39,16 +39,18 @@ enum #define TAG_STATUS_SUMMARY_BAR_TILE 0xD70C #define TAG_STATUS_SUMMARY_BALLS_TILE 0xD714 -#define TAG_MEGA_TRIGGER_TILE 0xD777 +#define TAG_MEGA_TRIGGER_TILE 0xD777 #define TAG_MEGA_INDICATOR_TILE 0xD778 +#define TAG_ZMOVE_TRIGGER_TILE 0xD779 #define TAG_HEALTHBOX_PAL 0xD6FF #define TAG_HEALTHBAR_PAL 0xD704 #define TAG_STATUS_SUMMARY_BAR_PAL 0xD710 #define TAG_STATUS_SUMMARY_BALLS_PAL 0xD712 -#define TAG_MEGA_TRIGGER_PAL 0xD777 -#define TAG_MEGA_INDICATOR_PAL 0xD778 +#define TAG_MEGA_TRIGGER_PAL 0xD777 +#define TAG_MEGA_INDICATOR_PAL 0xD778 +#define TAG_ZMOVE_TRIGGER_PAL 0xD779 enum { @@ -92,5 +94,6 @@ s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 arg3); u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale); u8 GetHPBarLevel(s16 hp, s16 maxhp); void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle); +void HideTriggerSprites(void); #endif // GUARD_BATTLE_INTERFACE_H diff --git a/include/battle_message.h b/include/battle_message.h index 51d06b779..2ebb3b837 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -233,6 +233,7 @@ void BattlePutTextOnWindow(const u8* text, u8 windowId); void SetPpNumbersPaletteInMoveSelection(void); u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp); bool32 ShouldDoTrainerSlide(u32 battlerId, u32 trainerId, u32 which); +void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst); extern struct BattleMsgData *gBattleMsgDataPtr; diff --git a/include/battle_util.h b/include/battle_util.h index 422aa7300..31e410f17 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -130,5 +130,6 @@ void ClearIllusionMon(u32 battlerId); bool32 SetIllusionMon(struct Pokemon *mon, u32 battlerId); bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 battlerId); u8 GetBattleMoveSplit(u32 moveId); +bool32 IsPartnerMonFromSameTrainer(u8 battlerId); #endif // GUARD_BATTLE_UTIL_H diff --git a/include/battle_z_move.h b/include/battle_z_move.h new file mode 100644 index 000000000..ab3f4ad1f --- /dev/null +++ b/include/battle_z_move.h @@ -0,0 +1,22 @@ +#ifndef GUARD_BATTLE_Z_MOVE_H +#define GUARD_BATTLE_Z_MOVE_H + +#include "constants/z_move_effects.h" + +struct SignatureZMove +{ + u16 species; + u16 item; + u16 move; + u16 zmove; +}; + +bool32 IsViableZMove(u8 battlerId, u16 move); +bool32 TryChangeZIndicator(u8 battlerId, u16 move); +void CreateZMoveTriggerSprite(u8, bool8); +void HideZMoveTriggerSprite(void); +bool32 IsZMoveTriggerSpriteActive(void); +void DestroyZMoveTriggerSprite(void); +bool32 MoveSelectionDisplayZMove(u16 zmove); + +#endif // GUARD_BATTLE_Z_MOVE_H \ No newline at end of file diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index d7f178570..a5c14023f 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -64,6 +64,41 @@ #define ITEM_RINDO_BERRY 207 #define ITEM_YACHE_BERRY 208 #define ITEM_GRISEOUS_ORB 369 + // z crystals + #define ITEM_NORMALIUM_Z 568 + #define ITEM_FIGHTINIUM_Z 569 + #define ITEM_FLYINIUM_Z 570 + #define ITEM_POISONIUM_Z 571 + #define ITEM_GROUNDIUM_Z 572 + #define ITEM_ROCKIUM_Z 573 + #define ITEM_BUGINIUM_Z 574 + #define ITEM_GHOSTIUM_Z 575 + #define ITEM_STEELIUM_Z 576 + #define ITEM_FIRIUM_Z 577 + #define ITEM_WATERIUM_Z 578 + #define ITEM_GRASSIUM_Z 579 + #define ITEM_ELECTRIUM_Z 580 + #define ITEM_PSYCHIUM_Z 581 + #define ITEM_ICIUM_Z 582 + #define ITEM_DRAGONIUM_Z 583 + #define ITEM_DARKINIUM_Z 584 + #define ITEM_FAIRIUM_Z 585 + #define ITEM_ALORAICHIUM_Z 586 + #define ITEM_DECIDIUM_Z 587 + #define ITEM_EEVIUM_Z 588 + #define ITEM_INCINIUM_Z 589 + #define ITEM_KOMMONIUM_Z 590 + #define ITEM_LUNALIUM_Z 591 + #define ITEM_LYCANIUM_Z 592 + #define ITEM_MARSHADIUM_Z 593 + #define ITEM_MEWNIUM_Z 594 + #define ITEM_MIMIKIUM_Z 595 + #define ITEM_PIKANIUM_Z 596 + #define ITEM_PIKASHUNIUM_Z 597 + #define ITEM_PRIMARIUM_Z 598 + #define ITEM_SNORLIUM_Z 599 + #define ITEM_SOLGANIUM_Z 600 + #define ITEM_TAPUNIUM_Z 601 #endif #ifndef GEN_3 diff --git a/include/constants/hold_effects.h b/include/constants/hold_effects.h index 85017cb40..54c1d004a 100644 --- a/include/constants/hold_effects.h +++ b/include/constants/hold_effects.h @@ -135,6 +135,7 @@ #define HOLD_EFFECT_ADRENALINE_ORB 152 #define HOLD_EFFECT_MEMORY 153 #define HOLD_EFFECT_PLATE 154 +#define HOLD_EFFECT_Z_CRYSTAL 155 #define HOLD_EFFECT_CHOICE(holdEffect)((holdEffect == HOLD_EFFECT_CHOICE_BAND || holdEffect == HOLD_EFFECT_CHOICE_SCARF || holdEffect == HOLD_EFFECT_CHOICE_SPECS)) diff --git a/include/constants/items.h b/include/constants/items.h index 95c6aacfe..72a5bc71c 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -464,7 +464,47 @@ #define ITEM_MAGMA_EMBLEM 375 #define ITEM_OLD_SEA_MAP 376 -#define ITEMS_COUNT 377 + + +#define ITEM_NORMALIUM_Z 568 +#define ITEM_FIGHTINIUM_Z 569 +#define ITEM_FLYINIUM_Z 570 +#define ITEM_POISONIUM_Z 571 +#define ITEM_GROUNDIUM_Z 572 +#define ITEM_ROCKIUM_Z 573 +#define ITEM_BUGINIUM_Z 574 +#define ITEM_GHOSTIUM_Z 575 +#define ITEM_STEELIUM_Z 576 +#define ITEM_FIRIUM_Z 577 +#define ITEM_WATERIUM_Z 578 +#define ITEM_GRASSIUM_Z 579 +#define ITEM_ELECTRIUM_Z 580 +#define ITEM_PSYCHIUM_Z 581 +#define ITEM_ICIUM_Z 582 +#define ITEM_DRAGONIUM_Z 583 +#define ITEM_DARKINIUM_Z 584 +#define ITEM_FAIRIUM_Z 585 +#define ITEM_ALORAICHIUM_Z 586 +#define ITEM_DECIDIUM_Z 587 +#define ITEM_EEVIUM_Z 588 +#define ITEM_INCINIUM_Z 589 +#define ITEM_KOMMONIUM_Z 590 +#define ITEM_LUNALIUM_Z 591 +#define ITEM_LYCANIUM_Z 592 +#define ITEM_MARSHADIUM_Z 593 +#define ITEM_MEWNIUM_Z 594 +#define ITEM_MIMIKIUM_Z 595 +#define ITEM_PIKANIUM_Z 596 +#define ITEM_PIKASHUNIUM_Z 597 +#define ITEM_PRIMARIUM_Z 598 +#define ITEM_SNORLIUM_Z 599 +#define ITEM_SOLGANIUM_Z 600 +#define ITEM_TAPUNIUM_Z 601 + + + + +#define ITEMS_COUNT 602 #define ITEM_FIELD_ARROW ITEMS_COUNT #define FIRST_BERRY_INDEX ITEM_CHERI_BERRY diff --git a/include/constants/moves.h b/include/constants/moves.h index 711aa3023..167a2936a 100644 --- a/include/constants/moves.h +++ b/include/constants/moves.h @@ -775,6 +775,50 @@ #define MOVES_COUNT_GEN8 747 -#define MOVES_COUNT MOVES_COUNT_GEN8 +// Z Moves +#define MOVE_BREAKNECK_BLITZ 747 +#define MOVE_ALL_OUT_PUMMELING 748 +#define MOVE_SUPERSONIC_SKYSTRIKE 749 +#define MOVE_ACID_DOWNPOUR 750 +#define MOVE_TECTONIC_RAGE 751 +#define MOVE_CONTINENTAL_CRUSH 752 +#define MOVE_SAVAGE_SPIN_OUT 753 +#define MOVE_NEVER_ENDING_NIGHTMARE 754 +#define MOVE_CORKSCREW_CRASH 755 +#define MOVE_INFERNO_OVERDRIVE 756 +#define MOVE_HYDRO_VORTEX 757 +#define MOVE_BLOOM_DOOM 758 +#define MOVE_GIGAVOLT_HAVOC 759 +#define MOVE_SHATTERED_PSYCHE 760 +#define MOVE_SUBZERO_SLAMMER 761 +#define MOVE_DEVASTATING_DRAKE 762 +#define MOVE_BLACK_HOLE_ECLIPSE 763 +#define MOVE_TWINKLE_TACKLE 764 +//signature z moves +#define MOVE_CATASTROPIKA 765 +#define MOVE_10000000_VOLT_THUNDERBOLT 766 +#define MOVE_STOKED_SPARKSURFER 767 +#define MOVE_EXTREME_EVOBOOST 768 +#define MOVE_PULVERIZING_PANCAKE 769 +#define MOVE_GENESIS_SUPERNOVA 770 +#define MOVE_SINISTER_ARROW_RAID 771 +#define MOVE_MALICIOUS_MOONSAULT 772 +#define MOVE_OCEANIC_OPERETTA 773 +#define MOVE_SPLINTERED_STORMSHARDS 774 +#define MOVE_LETS_SNUGGLE_FOREVER 775 +#define MOVE_CLANGOROUS_SOULBLAZE 776 +#define MOVE_GUARDIAN_OF_ALOLA 777 +#define MOVE_SEARING_SUNRAZE_SMASH 778 +#define MOVE_MENACING_MOONRAZE_MAELSTROM 7979 +#define MOVE_LIGHT_THAT_BURNS_THE_SKY 780 +#define MOVE_SOUL_STEALING_7_STAR_STRIKE 781 + +#define FIRST_Z_MOVE MOVE_BREAKNECK_BLITZ +#define LAST_Z_MOVE MOVE_SOUL_STEALING_7_STAR_STRIKE + +#define MOVES_COUNT MOVES_COUNT_GEN8 +#define MOVES_COUNT_Z (MOVE_SOUL_STEALING_7_STAR_STRIKE + 1) + +#define MOVE_Z_SIGNATURE 0xFFFF //signature z move #endif // GUARD_CONSTANTS_MOVES_H diff --git a/include/constants/z_move_effects.h b/include/constants/z_move_effects.h new file mode 100644 index 000000000..8b77596ef --- /dev/null +++ b/include/constants/z_move_effects.h @@ -0,0 +1,38 @@ +#ifndef GUARD_Z_MOVE_EFFECTS_H +#define GUARD_Z_MOVE_EFFECTS_H + +#define Z_EFFECT_NONE 0 +#define Z_EFFECT_RESET_STATS 1 +#define Z_EFFECT_ALL_STATS_UP_1 2 +#define Z_EFFECT_BOOST_CRITS 3 +#define Z_EFFECT_FOLLOW_ME 4 +#define Z_EFFECT_CURSE 5 +#define Z_EFFECT_RECOVER_HP 6 +#define Z_EFFECT_RESTORE_REPLACEMENT_HP 7 + +#define Z_EFFECT_ATK_UP_1 8 +#define Z_EFFECT_DEF_UP_1 9 +#define Z_EFFECT_SPD_UP_1 10 +#define Z_EFFECT_SPATK_UP_1 11 +#define Z_EFFECT_SPDEF_UP_1 12 +#define Z_EFFECT_ACC_UP_1 13 +#define Z_EFFECT_EVSN_UP_1 14 + +#define Z_EFFECT_ATK_UP_2 15 +#define Z_EFFECT_DEF_UP_2 16 +#define Z_EFFECT_SPD_UP_2 17 +#define Z_EFFECT_SPATK_UP_2 18 +#define Z_EFFECT_SPDEF_UP_2 19 +#define Z_EFFECT_ACC_UP_2 20 +#define Z_EFFECT_EVSN_UP_2 21 + +#define Z_EFFECT_ATK_UP_3 22 +#define Z_EFFECT_DEF_UP_3 23 +#define Z_EFFECT_SPD_UP_3 24 +#define Z_EFFECT_SPATK_UP_3 25 +#define Z_EFFECT_SPDEF_UP_3 26 +#define Z_EFFECT_ACC_UP_3 27 +#define Z_EFFECT_EVSN_UP_3 28 + + +#endif // GUARD_Z_MOVE_EFFECTS_H \ No newline at end of file diff --git a/include/data.h b/include/data.h index 260c18152..d0782a3e1 100644 --- a/include/data.h +++ b/include/data.h @@ -114,5 +114,6 @@ extern const struct Trainer gTrainers[]; extern const u8 gTrainerClassNames[][13]; extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1]; extern const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1]; +extern const u8 *const gZMoveNames[]; #endif // GUARD_DATA_H diff --git a/include/pokemon.h b/include/pokemon.h index b6277b9e2..629635255 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -208,7 +208,7 @@ struct BaseStats struct BattleMove { u16 effect; - u8 power; + u16 power; //higher than 255 for z moves u8 type; u8 accuracy; u8 pp; @@ -218,6 +218,8 @@ struct BattleMove u32 flags; u8 split; u8 argument; + u8 zMovePower; + u8 zMoveEffect; }; struct SpindaSpot diff --git a/ld_script.txt b/ld_script.txt index 091b6e693..a7a7075fb 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -87,6 +87,7 @@ SECTIONS { src/battle_bg.o(.text); src/battle_main.o(.text); src/battle_util.o(.text); + src/battle_z_move.o(.text); src/battle_script_commands.o(.text); src/battle_util2.o(.text); src/battle_controller_player.o(.text); @@ -474,6 +475,7 @@ SECTIONS { src/battle_bg.o(.rodata); src/battle_main.o(.rodata); src/battle_util.o(.rodata); + src/battle_z_move.o(.rodata); src/battle_script_commands.o(.rodata); src/battle_controller_player.o(.rodata); src/battle_anim_smokescreen.o(.rodata); diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 0b54b4c40..9d1b48453 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -4049,6 +4049,104 @@ const struct SpriteTemplate gSteelBeamSpikeShardTemplate = .callback = AnimDirtScatter }; +//// Z MOVES +/* +// breakneck blitz +const struct SpriteTemplate gBreakneckBlitzDanceSpriteTemplate = +{ + .tileTag = ANIM_TAG_HOLLOW_ORB, + .paletteTag = ANIM_TAG_FLAT_ROCK, + .oam = OAM_OFF_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = 0x80B7449 +}; +const struct SpriteTemplate gBreakneckBlitzSuperpowerSpriteTemplate = +{ + .tileTag = ANIM_TAG_METEOR, + .paletteTag = ANIM_TAG_METEOR, + .oam = sGrowingSuperpowerOAM, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gSpriteAffineAnimTable_GrowingSuperpower, + .callback = SpriteCB_GrowingSuperpower +}; +const struct SpriteTemplate gBreakneckBlitzHitSpriteTemplate = +{ + .tileTag = ANIM_TAG_IMPACT, + .paletteTag = ANIM_TAG_FLAT_ROCK, + .oam = OAM_NORMAL_BLEND_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = 0x83E7BF8, + .callback = 0x80BA561 +}; +// all out pummelling +const struct SpriteTemplate gAllOutPummelingOnslaughtSpriteTemplate = +{ + .tileTag = ANIM_TAG_HANDS_AND_FEET, + .paletteTag = ANIM_TAG_IMPACT, + .oam = OAM_OFF_32x32, + .anims = 0x83E66CC, + .images = 0x0, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = 0x80B0929 +}; +// supersonic skystrike +static const union AffineAnimCmd sSupersonicSkystrikeAffinePlayerSide = { + .hword 0,0,0x01b9,0,0x7fff,0,0,0 +}; +static const union AffineAnimCmd sSupersonicSkystrikeAffineOpponentSide = { + .hword 0,0,0x0150,0,0x7fff,0,0,0 +}; +static const union AffineAnimCmd* const sSupersonicSkystrikeAffineAnimTable[] = { + sSupersonicSkystrikeAffinePlayerSide, + sSupersonicSkystrikeAffineOpponentSide, +}; +const struct SpriteTemplate gSupersonicSkystrikeFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_BIRD, + .paletteTag = ANIM_TAG_BIRD, + .oam = OAM_NORMAL_64x64, + .anims = gDummySpriteAnimTable, + .images = 0x0, + .affineAnims = sSupersonicSkystrikeAffineAnimTable, + .callback = 0x80B1C3D +}; +//acid downpour +const struct SpriteTemplate gAcidDownpourReversalSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = OAM_NORMAL_16x16, + .anims = gDummySpriteAnimTable, + .images = 0x0, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = 0x80E0E95 +}; +const struct SpriteTemplate gAcidDownpourAuraSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = OAM_NORMAL_16x16, + .anims = gDummySpriteAnimTable, + .images = 0x0, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = 0x80B477D +}; +//tectonic rage +const struct SpriteTemplate gTectonicRageBlastBurnSpriteTemplate = +{ +TEC_RAGE_BLAST_BURN: objtemplate ANIM_TAG_FIRE_PLUME ANIM_TAG_FIRE_PLUME OAM_OFF_32x32 0x83E5C50 0x0 gDummySpriteAffineAnimTable BLASTBURN_TARGET_ASM+1 +}; +const struct SpriteTemplate gTectonicRageExplosionSpriteTemplate = +{ +TECTONIC_EXPLODE: objtemplate ANIM_TAG_UNUSED_EXPLOSION_2 ANIM_TAG_UNUSED_EXPLOSION_2 OAM_OFF_32x32 0x83E3F90 0x0 gDummySpriteAffineAnimTable SpriteCB_AnimSpriteOnMonPos +};*/ + + + //// functions //general static u8 LoadBattleAnimTarget(u8 arg) diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 2ad113638..fb1f844a7 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -8,6 +8,7 @@ #include "battle_message.h" #include "battle_setup.h" #include "battle_tv.h" +#include "battle_z_move.h" #include "bg.h" #include "data.h" #include "item.h" @@ -101,8 +102,6 @@ static void PlayerCmdEnd(void); static void PlayerBufferRunCommand(void); static void HandleInputChooseTarget(void); static void HandleInputChooseMove(void); -static void MoveSelectionCreateCursorAt(u8 cursorPos, u8 arg1); -static void MoveSelectionDestroyCursorAt(u8 cursorPos); static void MoveSelectionDisplayPpNumber(void); static void MoveSelectionDisplayPpString(void); static void MoveSelectionDisplayMoveType(void); @@ -125,6 +124,8 @@ static void PlayerDoMoveAnimation(void); static void task05_08033660(u8 taskId); static void sub_805CE38(void); +static void ReloadMoveNames(void); + static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { PlayerHandleGetMonData, @@ -372,7 +373,7 @@ static void HandleInputChooseTarget(void) else BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX); - HideMegaTriggerSprite(); + HideTriggerSprites(); PlayerBufferExecCompleted(); } else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59) @@ -513,7 +514,7 @@ static void HandleInputShowTargets(void) BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | RET_MEGA_EVOLUTION | (gMultiUsePlayerCursor << 8)); else BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); - HideMegaTriggerSprite(); + HideTriggerSprites(); PlayerBufferExecCompleted(); } else if (gMain.newKeys & B_BUTTON || gPlayerDpadHoldFrames > 59) @@ -605,7 +606,7 @@ static void HandleInputChooseMove(void) BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | RET_MEGA_EVOLUTION | (gMultiUsePlayerCursor << 8)); else BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); - HideMegaTriggerSprite(); + HideTriggerSprites(); PlayerBufferExecCompleted(); } else if (canSelectTarget == 1) @@ -629,10 +630,18 @@ static void HandleInputChooseMove(void) else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59) { PlaySE(SE_SELECT); - gBattleStruct->mega.playerSelect = FALSE; - BtlController_EmitTwoReturnValues(1, 10, 0xFFFF); - HideMegaTriggerSprite(); - PlayerBufferExecCompleted(); + if (gBattleStruct->zmove.viewingZMove) + { + ReloadMoveNames(); + } + else + { + gBattleStruct->mega.playerSelect = FALSE; + gBattleStruct->zmove.viable = FALSE; + BtlController_EmitTwoReturnValues(1, 10, 0xFFFF); + HideTriggerSprites(); + PlayerBufferExecCompleted(); + } } else if (JOY_NEW(DPAD_LEFT)) { @@ -644,6 +653,7 @@ static void HandleInputChooseMove(void) MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); + TryChangeZIndicator(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); } } else if (JOY_NEW(DPAD_RIGHT)) @@ -657,6 +667,7 @@ static void HandleInputChooseMove(void) MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); + TryChangeZIndicator(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); } } else if (JOY_NEW(DPAD_UP)) @@ -669,6 +680,7 @@ static void HandleInputChooseMove(void) MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); + TryChangeZIndicator(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); } } else if (JOY_NEW(DPAD_DOWN)) @@ -682,6 +694,7 @@ static void HandleInputChooseMove(void) MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); + TryChangeZIndicator(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); } } else if (JOY_NEW(SELECT_BUTTON)) @@ -708,9 +721,32 @@ static void HandleInputChooseMove(void) ChangeMegaTriggerSprite(gBattleStruct->mega.triggerSpriteId, gBattleStruct->mega.playerSelect); PlaySE(SE_SELECT); } + else if (gBattleStruct->zmove.currZMove != MOVE_NONE) + { + // show z move name / info + //TODO: brighten z move symbol + //ChangeMegaTriggerSprite(gBattleStruct->zmove.triggerSpriteId, gBattleStruct->zmove.viable); + PlaySE(SE_SELECT); + + if (!gBattleStruct->zmove.viewingZMove) + MoveSelectionDisplayZMove(gBattleStruct->zmove.currZMove); + else + ReloadMoveNames(); + } } } +static void ReloadMoveNames(void) +{ + gBattleStruct->mega.playerSelect = FALSE; + gBattleStruct->zmove.viewingZMove = FALSE; + MoveSelectionDestroyCursorAt(0); + MoveSelectionDisplayMoveNames(); + MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); + MoveSelectionDisplayPpNumber(); + MoveSelectionDisplayMoveType(); +} + u32 sub_8057FBC(void) // unused { u32 var = 0; @@ -1587,7 +1623,7 @@ static void MoveSelectionDisplayMoveType(void) BattlePutTextOnWindow(gDisplayedStringBattle, 10); } -static void MoveSelectionCreateCursorAt(u8 cursorPosition, u8 arg1) +void MoveSelectionCreateCursorAt(u8 cursorPosition, u8 arg1) { u16 src[2]; src[0] = arg1 + 1; @@ -1597,7 +1633,7 @@ static void MoveSelectionCreateCursorAt(u8 cursorPosition, u8 arg1) CopyBgTilemapBufferToVram(0); } -static void MoveSelectionDestroyCursorAt(u8 cursorPosition) +void MoveSelectionDestroyCursorAt(u8 cursorPosition) { u16 src[2]; src[0] = 0x1016; @@ -2712,12 +2748,18 @@ static void PlayerHandleChooseMove(void) } else { + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]); + InitMoveSelectionsVarsAndStrings(); gBattleStruct->mega.playerSelect = FALSE; if (!IsMegaTriggerSpriteActive()) gBattleStruct->mega.triggerSpriteId = 0xFF; if (CanMegaEvolve(gActiveBattler)) CreateMegaTriggerSprite(gActiveBattler, 0); + if (!IsZMoveTriggerSpriteActive()) + gBattleStruct->zmove.triggerSpriteId = 0xFF; + gBattleStruct->zmove.viable = IsViableZMove(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); //is current move a z move + CreateZMoveTriggerSprite(gActiveBattler, gBattleStruct->zmove.viable); gBattlerControllerFuncs[gActiveBattler] = HandleChooseMoveAfterDma3; } } diff --git a/src/battle_interface.c b/src/battle_interface.c index d302cd646..d2fbd2729 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -4,6 +4,7 @@ #include "pokemon.h" #include "battle_controllers.h" #include "battle_interface.h" +#include "battle_z_move.h" #include "graphics.h" #include "sprite.h" #include "window.h" @@ -1520,6 +1521,12 @@ void HideMegaTriggerSprite(void) gSprites[gBattleStruct->mega.triggerSpriteId].tHide = TRUE; } +void HideTriggerSprites(void) +{ + HideMegaTriggerSprite(); + HideZMoveTriggerSprite(); +} + void DestroyMegaTriggerSprite(void) { FreeSpritePaletteByTag(TAG_MEGA_TRIGGER_PAL); diff --git a/src/battle_main.c b/src/battle_main.c index 793a37022..e5ba05bbc 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5049,3 +5049,4 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) gSpecialStatuses[battlerAtk].gemBoost = 1; } } + diff --git a/src/battle_message.c b/src/battle_message.c index 9e86d2774..04a939ad6 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -50,7 +50,6 @@ extern const u16 gUnknown_08D85620[]; // this file's functions static void ChooseMoveUsedParticle(u8 *textPtr); static void ChooseTypeOfMoveUsedString(u8 *dst); -static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst); // EWRAM vars static EWRAM_DATA u8 sBattlerAbilities[MAX_BATTLERS_COUNT] = {0}; @@ -3315,7 +3314,7 @@ static void IllusionNickHack(u32 battlerId, u32 partyId, u8 *dst) GetMonData(mon, MON_DATA_NICKNAME, dst); } -static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) +void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) { u32 srcID = 1; u32 value = 0; diff --git a/src/battle_util.c b/src/battle_util.c index 697c7799d..c1ec01ef0 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7504,7 +7504,7 @@ s32 GetStealthHazardDamage(u8 hazardType, u8 battlerId) return dmg; } -static bool32 IsPartnerMonFromSameTrainer(u8 battlerId) +bool32 IsPartnerMonFromSameTrainer(u8 battlerId) { if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT && gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) return FALSE; diff --git a/src/battle_z_move.c b/src/battle_z_move.c new file mode 100644 index 000000000..446a1d790 --- /dev/null +++ b/src/battle_z_move.c @@ -0,0 +1,525 @@ +#include "global.h" +#include "malloc.h" +#include "battle.h" +#include "pokemon.h" +#include "battle_controllers.h" +#include "battle_interface.h" +#include "battle_message.h" +#include "battle_z_move.h" +#include "graphics.h" +#include "sprite.h" +#include "window.h" +#include "string_util.h" +#include "text.h" +#include "item.h" +#include "strings.h" +#include "sound.h" +#include "constants/songs.h" +#include "decompress.h" +#include "task.h" +#include "util.h" +#include "gpu_regs.h" +#include "battle_message.h" +#include "pokedex.h" +#include "palette.h" +#include "international_string_util.h" +#include "safari_zone.h" +#include "battle_anim.h" +#include "constants/battle_anim.h" +#include "constants/rgb.h" +#include "battle_debug.h" +#include "constants/battle_config.h" +#include "data.h" +#include "pokemon_summary_screen.h" +#include "constants/songs.h" +#include "constants/items.h" +#include "constants/species.h" +#include "constants/hold_effects.h" + +// Function Declarations +static void SpriteCB_ZMoveTrigger(struct Sprite *sprite); +static u16 GetSignatureZMove(u16 move, u16 species, u16 item); +static u16 GetTypeBasedZMove(u16 move, u8 battler); +static void ZMoveSelectionDisplayPpNumber(void); +static void ZMoveSelectionDisplayPower(u16 move, u16 zMove); +static const u8* GetZMoveName(u16 move); +static void ShowZMoveTriggerSprite(void); + +// Const Data +static const struct SignatureZMove sSignatureZMoves[] = +{ + #ifdef POKEMON_EXPANSION + {SPECIES_RAICHU_A, ITEM_ALORAICHIUM_Z, MOVE_THUNDERBOLT, MOVE_STOKED_SPARKSURFER}, + {SPECIES_DECIDUEYE, ITEM_DECIDIUM_Z, MOVE_SPIRIT_SHACKLE, MOVE_SINISTER_ARROW_RAID}, + {SPECIES_INCINEROAR, ITEM_INCINIUM_Z, MOVE_DARKEST_LARIAT, MOVE_MALICIOUS_MOONSAULT}, + {SPECIES_KOMMO_O, ITEM_KOMMONIUM_Z, MOVE_CLANGING_SCALES, MOVE_CLANGOROUS_SOULBLAZE}, + {SPECIES_LUNALA, ITEM_LUNALIUM_Z, MOVE_MOONGEIST_BEAM, MOVE_MENACING_MOONRAZE_MAELSTROM}, + {SPECIES_NECROZMA_DAWN_WINGS, ITEM_LUNALIUM_Z, MOVE_MOONGEIST_BEAM, MOVE_MENACING_MOONRAZE_MAELSTROM}, + {SPECIES_LYCANROC, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS}, + {SPECIES_LYCANROC_N, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS}, + {SPECIES_LYCANROC_DUSK, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS}, + {SPECIES_MARSHADOW, ITEM_MARSHADIUM_Z, MOVE_SPECTRAL_THIEF, MOVE_SOUL_STEALING_7_STAR_STRIKE}, + {SPECIES_MIMIKYU, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER}, + {SPECIES_MIMIKYU_BUSTED, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER}, + {SPECIES_PIKACHU_CAP_ORIGINAL, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_CAP_HOENN, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_CAP_SINNOH, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_CAP_UNOVA, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_CAP_KALOS, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_CAP_ALOLA, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_CAP_PARTNER, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PRIMARINA, ITEM_PRIMARIUM_Z, MOVE_SPARKLING_ARIA, MOVE_OCEANIC_OPERETTA}, + {SPECIES_SOLGALEO, ITEM_SOLGANIUM_Z, MOVE_SUNSTEEL_STRIKE, MOVE_SEARING_SUNRAZE_SMASH}, + {SPECIES_NECROZMA_DUSK_MANE, ITEM_SOLGANIUM_Z, MOVE_SUNSTEEL_STRIKE, MOVE_SEARING_SUNRAZE_SMASH}, + {SPECIES_TAPU_KOKO, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA}, + {SPECIES_TAPU_BULU, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA}, + {SPECIES_TAPU_LELE, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA}, + {SPECIES_TAPU_FINI, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA}, + {SPECIES_NECROZMA_ULTRA, ITEM_ULTRANECROZIUM_Z, MOVE_PHOTON_GEYSER, MOVE_LIGHT_THAT_BURNS_THE_SKY}, + #endif + {SPECIES_MEW, ITEM_MEWNIUM_Z, MOVE_PSYCHIC, MOVE_GENESIS_SUPERNOVA}, + {SPECIES_PIKACHU, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_EEVEE, ITEM_EEVIUM_Z, MOVE_LAST_RESORT, MOVE_EXTREME_EVOBOOST}, + {SPECIES_SNORLAX, ITEM_SNORLIUM_Z, MOVE_GIGA_IMPACT, MOVE_PULVERIZING_PANCAKE}, +}; + +static const u8 sText_ResetStats[] = _("Reset Lowered Stats"); +static const u8 sText_StatsPlus[] = _("+ All Stats"); +static const u8 sText_CritHitsPlus[] = _("+ Critical Hit Chance"); +static const u8 sText_FollowMe[] = _("Follow Me"); +static const u8 sText_RecoverHP[] = _("Recover HP"); +static const u8 sText_HealAllyHP[] = _("Heal Replacement HP"); +static const u8 sText_PowerColon[] = _("Power: "); + +static const u32 sZMoveTriggerGfx[] = INCBIN_U32("graphics/battle_interface/z_move_trigger.4bpp.lz"); +static const u16 sZMoveTriggerPal[] = INCBIN_U16("graphics/battle_interface/z_move_trigger.gbapal"); + +static const struct CompressedSpriteSheet sSpriteSheet_ZMoveTrigger = { + sZMoveTriggerGfx, (32 * 32) / 2, TAG_ZMOVE_TRIGGER_TILE +}; + +static const struct SpritePalette sSpritePalette_ZMoveTrigger = { + sZMoveTriggerPal, TAG_ZMOVE_TRIGGER_PAL +}; + +static const struct OamData sOamData_ZMoveTrigger = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = SPRITE_SHAPE(32x32), + .size = SPRITE_SIZE(32x32), + .priority = 1, +}; + +static const struct SpriteTemplate sSpriteTemplate_ZMoveTrigger = +{ + .tileTag = TAG_ZMOVE_TRIGGER_TILE, + .paletteTag = TAG_ZMOVE_TRIGGER_PAL, + .oam = &sOamData_ZMoveTrigger, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_ZMoveTrigger +}; + +// Functions +bool8 IsZMove(u16 move) +{ + return move >= FIRST_Z_MOVE && move <= LAST_Z_MOVE; +} + +bool32 IsViableZMove(u8 battlerId, u16 move) +{ + struct Pokemon *mon; + struct MegaEvolutionData *mega = &(((struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]))->mega); + u8 battlerPosition = GetBattlerPosition(battlerId); + u8 partnerPosition = GetBattlerPosition(BATTLE_PARTNER(battlerId)); + u32 item; + u16 holdEffect; + u16 species; + + gBattleStruct->zmove.currZMove = MOVE_NONE; //init + + // Gets mon data. + if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT) + mon = &gEnemyParty[gBattlerPartyIndexes[battlerId]]; + else + mon = &gPlayerParty[gBattlerPartyIndexes[battlerId]]; + + species = GetMonData(mon, MON_DATA_SPECIES); + item = GetMonData(mon, MON_DATA_HELD_ITEM); + + if (gBattleTypeFlags & (BATTLE_TYPE_SAFARI | BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_FRONTIER)) + return FALSE; + + #ifdef ITEM_Z_RING + if (!CheckBagHasItem(ITEM_Z_RING, 1)) + return FALSE; + #endif + + if (mega->alreadyEvolved[battlerPosition]) + return FALSE; // trainer has mega evolved + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + if (IsPartnerMonFromSameTrainer(battlerId) + && (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)]))) + return FALSE; //partner has mega evolved or is about to mega evolve + } + + if (USE_BATTLE_DEBUG && gBattleStruct->debugHoldEffects[battlerId]) + holdEffect = gBattleStruct->debugHoldEffects[battlerId]; + else if (item == ITEM_ENIGMA_BERRY) + return FALSE; //holdEffect = gEnigmaBerries[battlerId].holdEffect; + else + holdEffect = ItemId_GetHoldEffect(item); + + #ifdef ITEM_ULTRANECROZIUM_Z + if (holdEffect == HOLD_EFFECT_Z_CRYSTAL || item == ITEM_ULTRANECROZIUM_Z) + #else + if (holdEffect == HOLD_EFFECT_Z_CRYSTAL) + #endif + { + //TODO: status z moves + u16 zMove = GetSignatureZMove(move, gBattleMons[battlerId].species, item); + if (zMove != MOVE_NONE) + { + gBattleStruct->zmove.currZMove = MOVE_Z_SIGNATURE; //signature z move exists + return TRUE; + } + + if (move != MOVE_NONE && zMove != MOVE_Z_SIGNATURE && gBattleMoves[move].type == ItemId_GetHoldEffectParam(item)) + { + if (gBattleMoves[move].split == SPLIT_STATUS) + gBattleStruct->zmove.currZMove = MOVE_Z_SIGNATURE; + else + gBattleStruct->zmove.currZMove = GetTypeBasedZMove(move, battlerId); + + return TRUE; + } + } + + return FALSE; +} + +bool32 TryChangeZIndicator(u8 battlerId, u16 move) +{ + bool32 viableZMove = IsViableZMove(battlerId, move); + + if (gBattleStruct->zmove.viable && !viableZMove) + HideZMoveTriggerSprite(); //was a viable z move, now is not -> slide out + else if (!gBattleStruct->zmove.viable && viableZMove) + ShowZMoveTriggerSprite(); //was not a viable z move, now is -> slide back in +} + +#define SINGLES_Z_TRIGGER_POS_X_OPTIMAL (30) +#define SINGLES_Z_TRIGGER_POS_X_PRIORITY (31) +#define SINGLES_Z_TRIGGER_POS_X_SLIDE (15) +#define SINGLES_Z_TRIGGER_POS_Y_DIFF (-11) + +#define DOUBLES_Z_TRIGGER_POS_X_OPTIMAL (30) +#define DOUBLES_Z_TRIGGER_POS_X_PRIORITY (31) +#define DOUBLES_Z_TRIGGER_POS_X_SLIDE (15) +#define DOUBLES_Z_TRIGGER_POS_Y_DIFF (-4) + +#define tBattler data[0] +#define tHide data[1] + +void CreateZMoveTriggerSprite(u8 battlerId, bool8 viable) +{ + s16 x, y; + + // TODO: test mega trigger and z trigger together + LoadSpritePalette(&sSpritePalette_ZMoveTrigger); + if (GetSpriteTileStartByTag(TAG_ZMOVE_TRIGGER_TILE) == 0xFFFF) + LoadCompressedSpriteSheetUsingHeap(&sSpriteSheet_ZMoveTrigger); + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + x = gSprites[gHealthboxSpriteIds[battlerId]].pos1.x - DOUBLES_Z_TRIGGER_POS_X_SLIDE; + y = gSprites[gHealthboxSpriteIds[battlerId]].pos1.y - DOUBLES_Z_TRIGGER_POS_Y_DIFF; + } + else + { + x = gSprites[gHealthboxSpriteIds[battlerId]].pos1.x - SINGLES_Z_TRIGGER_POS_X_SLIDE; + y = gSprites[gHealthboxSpriteIds[battlerId]].pos1.y - SINGLES_Z_TRIGGER_POS_Y_DIFF, 0; + } + + if (gBattleStruct->zmove.triggerSpriteId == 0xFF) + gBattleStruct->zmove.triggerSpriteId = CreateSprite(&sSpriteTemplate_ZMoveTrigger, x, y, 0); + + gSprites[gBattleStruct->zmove.triggerSpriteId].tBattler = battlerId; + gSprites[gBattleStruct->zmove.triggerSpriteId].tHide = (viable == TRUE) ? FALSE : TRUE; + ChangeMegaTriggerSprite(gBattleStruct->zmove.triggerSpriteId, 0); +} + +static void SpriteCB_ZMoveTrigger(struct Sprite *sprite) +{ + s32 xSlide, xPriority, xOptimal; + s32 yDiff; + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + xSlide = DOUBLES_Z_TRIGGER_POS_X_SLIDE; + xPriority = DOUBLES_Z_TRIGGER_POS_X_PRIORITY; + xOptimal = DOUBLES_Z_TRIGGER_POS_X_OPTIMAL; + yDiff = DOUBLES_Z_TRIGGER_POS_Y_DIFF; + } + else + { + xSlide = SINGLES_Z_TRIGGER_POS_X_SLIDE; + xPriority = SINGLES_Z_TRIGGER_POS_X_PRIORITY; + xOptimal = SINGLES_Z_TRIGGER_POS_X_OPTIMAL; + yDiff = SINGLES_Z_TRIGGER_POS_Y_DIFF; + } + + if (sprite->tHide) + { + if (sprite->pos1.x != gSprites[gHealthboxSpriteIds[sprite->tBattler]].pos1.x - xSlide) + sprite->pos1.x++; + + if (sprite->pos1.x >= gSprites[gHealthboxSpriteIds[sprite->tBattler]].pos1.x - xPriority) + sprite->oam.priority = 2; + else + sprite->oam.priority = 1; + + sprite->pos1.y = gSprites[gHealthboxSpriteIds[sprite->tBattler]].pos1.y - yDiff; + sprite->pos2.y = gSprites[gHealthboxSpriteIds[sprite->tBattler]].pos2.y - yDiff; + if (sprite->pos1.x == gSprites[gHealthboxSpriteIds[sprite->tBattler]].pos1.x - xSlide) + DestroyZMoveTriggerSprite(); + } + else + { + if (sprite->pos1.x != gSprites[gHealthboxSpriteIds[sprite->tBattler]].pos1.x - xOptimal) + sprite->pos1.x--; + + if (sprite->pos1.x >= gSprites[gHealthboxSpriteIds[sprite->tBattler]].pos1.x - xPriority) + sprite->oam.priority = 2; + else + sprite->oam.priority = 1; + + sprite->pos1.y = gSprites[gHealthboxSpriteIds[sprite->tBattler]].pos1.y - yDiff; + sprite->pos2.y = gSprites[gHealthboxSpriteIds[sprite->tBattler]].pos2.y - yDiff; + } +} + +bool32 IsZMoveTriggerSpriteActive(void) +{ + if (GetSpriteTileStartByTag(TAG_ZMOVE_TRIGGER_TILE) == 0xFFFF) + return FALSE; + else if (IndexOfSpritePaletteTag(TAG_ZMOVE_TRIGGER_PAL) != 0xFF) + return TRUE; + else + return FALSE; +} + +void HideZMoveTriggerSprite(void) +{ + struct Sprite *sprite = &gSprites[gBattleStruct->zmove.triggerSpriteId]; + ChangeMegaTriggerSprite(gBattleStruct->zmove.triggerSpriteId, 0); + sprite->tHide = TRUE; + gBattleStruct->zmove.viable = FALSE; +} + +static void ShowZMoveTriggerSprite(void) +{ + struct Sprite *sprite = &gSprites[gBattleStruct->zmove.triggerSpriteId]; + gBattleStruct->zmove.viable = TRUE; + CreateZMoveTriggerSprite(sprite->tBattler, TRUE); +} + +void DestroyZMoveTriggerSprite(void) +{ + FreeSpritePaletteByTag(TAG_ZMOVE_TRIGGER_PAL); + FreeSpriteTilesByTag(TAG_ZMOVE_TRIGGER_TILE); + if (gBattleStruct->zmove.triggerSpriteId != 0xFF) + DestroySprite(&gSprites[gBattleStruct->zmove.triggerSpriteId]); + gBattleStruct->zmove.triggerSpriteId = 0xFF; +} + +static u16 GetSignatureZMove(u16 move, u16 species, u16 item) +{ + u32 i; + + // check signature z move + for (i = 0; i < ARRAY_COUNT(sSignatureZMoves); ++i) + { + if (sSignatureZMoves[i].item == item && sSignatureZMoves[i].species == species && sSignatureZMoves[i].move == move) + return sSignatureZMoves[i].zmove; + } + + return MOVE_NONE; +} + +static u16 GetTypeBasedZMove(u16 move, u8 battler) +{ + u8 moveType; + //handle dynamic move types + SetTypeBeforeUsingMove(battler, move); + GET_MOVE_TYPE(move, moveType); + + // get z move from split + // TODO: light that burns the sky gets split from relative stats + if (moveType < TYPE_FIRE) + return MOVE_BREAKNECK_BLITZ + moveType; + else if (moveType >= TYPE_FAIRY) + return MOVE_TWINKLE_TACKLE + (moveType - TYPE_FAIRY); + else + return MOVE_BREAKNECK_BLITZ + (moveType - 1); +} + +bool32 MoveSelectionDisplayZMove(u16 zmove) +{ + u32 i; + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]); + u16 move = moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]; + + PlaySE(SE_SELECT); + gBattleStruct->zmove.viewingZMove = TRUE; + if (zmove != MOVE_NONE) + { + // clear move slots + for (i = 0; i < MAX_MON_MOVES; ++i) + { + MoveSelectionDestroyCursorAt(i); + StringCopy(gDisplayedStringBattle, gText_EmptyString2); + BattlePutTextOnWindow(gDisplayedStringBattle, i + 3); + } + + if (zmove == MOVE_Z_SIGNATURE) + { + u8 zEffect = gBattleMoves[move].zMoveEffect; + + if (zEffect == Z_EFFECT_CURSE) + { + if (moveInfo->monType1 == TYPE_GHOST || moveInfo->monType2 == TYPE_GHOST || moveInfo->monType3 == TYPE_GHOST) + zEffect = Z_EFFECT_RECOVER_HP; + else + zEffect = Z_EFFECT_ATK_UP_1; + } + + gDisplayedStringBattle[0] = EOS; + switch (zEffect) + { + case Z_EFFECT_RESET_STATS: + StringCopy(gDisplayedStringBattle, sText_ResetStats); + break; + case Z_EFFECT_ALL_STATS_UP_1: + StringCopy(gDisplayedStringBattle, sText_StatsPlus); + break; + case Z_EFFECT_BOOST_CRITS: + StringCopy(gDisplayedStringBattle, sText_CritHitsPlus); + break; + case Z_EFFECT_FOLLOW_ME: + StringCopy(gDisplayedStringBattle, sText_FollowMe); + break; + case Z_EFFECT_RECOVER_HP: + StringCopy(gDisplayedStringBattle, sText_RecoverHP); + break; + case Z_EFFECT_RESTORE_REPLACEMENT_HP: + StringCopy(gDisplayedStringBattle, sText_HealAllyHP); + break; + case Z_EFFECT_ATK_UP_1: + case Z_EFFECT_DEF_UP_1: + case Z_EFFECT_SPD_UP_1: + case Z_EFFECT_SPATK_UP_1: + case Z_EFFECT_SPDEF_UP_1: + case Z_EFFECT_ACC_UP_1: + case Z_EFFECT_EVSN_UP_1: + gDisplayedStringBattle[0] = CHAR_PLUS; + gDisplayedStringBattle[1] = 0; + gDisplayedStringBattle[2] = EOS; + PREPARE_STAT_BUFFER(gBattleTextBuff1, zEffect - Z_EFFECT_ATK_UP_1 + 1); + ExpandBattleTextBuffPlaceholders(gBattleTextBuff1, gDisplayedStringBattle + 2); + break; + case Z_EFFECT_ATK_UP_2: + case Z_EFFECT_DEF_UP_2: + case Z_EFFECT_SPD_UP_2: + case Z_EFFECT_SPATK_UP_2: + case Z_EFFECT_SPDEF_UP_2: + case Z_EFFECT_ACC_UP_2: + case Z_EFFECT_EVSN_UP_2: + gDisplayedStringBattle[0] = CHAR_PLUS; + gDisplayedStringBattle[1] = CHAR_PLUS; + gDisplayedStringBattle[2] = 0; + gDisplayedStringBattle[3] = EOS; + PREPARE_STAT_BUFFER(gBattleTextBuff1, zEffect - Z_EFFECT_ATK_UP_2 + 1); + ExpandBattleTextBuffPlaceholders(gBattleTextBuff1, gDisplayedStringBattle + 3); + break; + case Z_EFFECT_ATK_UP_3: + case Z_EFFECT_DEF_UP_3: + case Z_EFFECT_SPD_UP_3: + case Z_EFFECT_SPATK_UP_3: + case Z_EFFECT_SPDEF_UP_3: + case Z_EFFECT_ACC_UP_3: + case Z_EFFECT_EVSN_UP_3: + gDisplayedStringBattle[0] = CHAR_PLUS; + gDisplayedStringBattle[1] = CHAR_PLUS; + gDisplayedStringBattle[2] = CHAR_PLUS; + gDisplayedStringBattle[3] = 0; + gDisplayedStringBattle[4] = EOS; + PREPARE_STAT_BUFFER(gBattleTextBuff1, zEffect - Z_EFFECT_ATK_UP_3 + 1); + ExpandBattleTextBuffPlaceholders(gBattleTextBuff1, gDisplayedStringBattle + 4); + break; + } + + BattlePutTextOnWindow(gDisplayedStringBattle, 5); //Slot of Move 3 + gDisplayedStringBattle[0] = CHAR_Z; + gDisplayedStringBattle[1] = CHAR_HYPHEN; + StringCopy(gDisplayedStringBattle + 2, gMoveNames[move]); + } + else + { + ZMoveSelectionDisplayPower(move, zmove); + StringCopy(gDisplayedStringBattle, GetZMoveName(zmove)); + } + BattlePutTextOnWindow(gDisplayedStringBattle, 3); //first move slot + + ZMoveSelectionDisplayPpNumber(); + MoveSelectionCreateCursorAt(0, 0); + return TRUE; + } + + return FALSE; +} + +static void ZMoveSelectionDisplayPower(u16 move, u16 zMove) +{ + u8 *txtPtr; + u16 power = gBattleMoves[move].zMovePower; + + if (zMove >= MOVE_CATASTROPIKA) + power = gBattleMoves[zMove].power; + + if (gBattleMoves[move].split != SPLIT_STATUS) + { + txtPtr = StringCopy(gDisplayedStringBattle, sText_PowerColon); + ConvertIntToDecimalStringN(txtPtr, power, STR_CONV_MODE_LEFT_ALIGN, 3); + BattlePutTextOnWindow(gDisplayedStringBattle, 5); //bottom left + } +} + +static void ZMoveSelectionDisplayPpNumber(void) +{ + u8 *txtPtr; + struct ChooseMoveStruct *moveInfo; + + if (gBattleResources->bufferA[gActiveBattler][2] == TRUE) // check if we didn't want to display pp number + return; + + SetPpNumbersPaletteInMoveSelection(); + moveInfo = (struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]); + txtPtr = ConvertIntToDecimalStringN(gDisplayedStringBattle, 1, STR_CONV_MODE_RIGHT_ALIGN, 2); + *(txtPtr)++ = CHAR_SLASH; + ConvertIntToDecimalStringN(txtPtr, 1, STR_CONV_MODE_RIGHT_ALIGN, 2); + BattlePutTextOnWindow(gDisplayedStringBattle, 9); +} + +static const u8* GetZMoveName(u16 move) +{ + if (IsZMove(move)) + return gZMoveNames[move - MOVE_BREAKNECK_BLITZ]; + else + return gZMoveNames[0]; //failsafe +} + diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 0b0c0b553..279e7b328 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -26,6 +26,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_KARATE_CHOP] = @@ -40,6 +42,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOUBLE_SLAP] = @@ -54,6 +58,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COMET_PUNCH] = @@ -68,6 +74,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MEGA_PUNCH] = @@ -82,6 +90,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PAY_DAY] = @@ -96,6 +106,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIRE_PUNCH] = @@ -110,6 +122,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICE_PUNCH] = @@ -124,6 +138,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THUNDER_PUNCH] = @@ -138,6 +154,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SCRATCH] = @@ -152,6 +170,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VICE_GRIP] = @@ -166,6 +186,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GUILLOTINE] = @@ -180,15 +202,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RAZOR_WIND] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif .effect = EFFECT_TWO_TURNS_ATTACK, .power = 80, .type = TYPE_NORMAL, @@ -197,25 +216,26 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_BOTH, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWORDS_DANCE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 20, - #else - .pp = 30, - #endif .effect = EFFECT_ATTACK_UP_2, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, + .pp = 30, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, .flags = FLAG_SNATCH_AFFECTED | FLAG_DANCE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_CUT] = @@ -230,6 +250,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GUST] = @@ -244,6 +266,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_IN_AIR, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WING_ATTACK] = @@ -258,38 +282,30 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WHIRLWIND] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .accuracy = 0, - .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #elif B_UPDATED_MOVE_DATA >= GEN_5 - .accuracy = 100, - .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .accuracy = 100, - .flags = FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_ROAR, .power = 0, .type = TYPE_NORMAL, + .accuracy = 100, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = -6, + .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_FLY] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .power = 90, - #else - .power = 70, - #endif .effect = EFFECT_SEMI_INVULNERABLE, + .power = 90, .type = TYPE_FLYING, .accuracy = 95, .pp = 15, @@ -298,24 +314,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BIND] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .accuracy = 85, - #else - .accuracy = 75, - #endif .effect = EFFECT_TRAP, .power = 15, .type = TYPE_NORMAL, + .accuracy = 85, .pp = 20, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SLAM] = @@ -330,28 +346,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VINE_WHIP] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 45, - .pp = 25, - #elif B_UPDATED_MOVE_DATA >= GEN_4 - .power = 35, - .pp = 15, - #else - .power = 35, - .pp = 10, - #endif .effect = EFFECT_HIT, + .power = 45, .type = TYPE_GRASS, .accuracy = 100, + .pp = 25, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STOMP] = @@ -366,6 +378,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOUBLE_KICK] = @@ -380,6 +394,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MEGA_KICK] = @@ -394,28 +410,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_JUMP_KICK] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 100, - .pp = 10, - #elif B_UPDATED_MOVE_DATA == GEN_4 - .power = 85, - .pp = 25, - #else - .power = 70, - .pp = 25, - #endif .effect = EFFECT_RECOIL_IF_MISS, + .power = 100, .type = TYPE_FIGHTING, .accuracy = 95, + .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROLLING_KICK] = @@ -430,6 +442,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SAND_ATTACK] = @@ -444,6 +458,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_HEADBUTT] = @@ -458,6 +474,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HORN_ATTACK] = @@ -472,6 +490,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FURY_ATTACK] = @@ -486,6 +506,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HORN_DRILL] = @@ -500,28 +522,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TACKLE] = { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .power = 40, - .accuracy = 100, - #elif B_UPDATED_MOVE_DATA >= GEN_5 - .power = 50, - .accuracy = 100, - #else - .power = 35, - .accuracy = 95, - #endif .effect = EFFECT_HIT, + .power = 40, .type = TYPE_NORMAL, + .accuracy = 100, .pp = 35, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BODY_SLAM] = @@ -536,24 +554,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WRAP] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .accuracy = 90, - #else - .accuracy = 85, - #endif .effect = EFFECT_TRAP, .power = 15, .type = TYPE_NORMAL, + .accuracy = 85, .pp = 20, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TAKE_DOWN] = @@ -568,25 +586,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THRASH] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 120, - .pp = 10, - #else - .power = 90, - .pp = 20, - #endif .effect = EFFECT_RAMPAGE, + .power = 120, .type = TYPE_NORMAL, .accuracy = 100, + .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_RANDOM, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOUBLE_EDGE] = @@ -601,6 +618,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TAIL_WHIP] = @@ -615,6 +634,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_POISON_STING] = @@ -629,6 +650,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TWINEEDLE] = @@ -643,25 +666,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PIN_MISSILE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 25, - .accuracy = 95, - #else - .power = 14, - .accuracy = 85, - #endif .effect = EFFECT_MULTI_HIT, + .power = 25, .type = TYPE_BUG, + .accuracy = 95, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LEER] = @@ -676,6 +698,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_BITE] = @@ -690,6 +714,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GROWL] = @@ -704,28 +730,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_ROAR] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .accuracy = 0, - .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_MAGICCOAT_AFFECTED, - #elif B_UPDATED_MOVE_DATA >= GEN_5 - .accuracy = 100, - .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_MAGICCOAT_AFFECTED, - #else - .accuracy = 100, - .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, - #endif .effect = EFFECT_ROAR, .power = 0, .type = TYPE_NORMAL, + .accuracy = 100, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = -6, + .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_SING] = @@ -740,6 +762,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SUPERSONIC] = @@ -754,6 +778,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SONIC_BOOM] = @@ -768,37 +794,29 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DISABLE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .accuracy = 100, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, - #elif B_UPDATED_MOVE_DATA == GEN_4 - .accuracy = 80, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .accuracy = 55, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_DISABLE, .power = 0, .type = TYPE_NORMAL, + .accuracy = 100, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_ACID] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, - #else - .effect = EFFECT_DEFENSE_DOWN_HIT, - #endif + .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, .power = 40, .type = TYPE_POISON, .accuracy = 100, @@ -808,6 +826,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EMBER] = @@ -822,16 +842,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLAMETHROWER] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 90, - #else - .power = 95, - #endif .effect = EFFECT_BURN_HIT, + .power = 90, .type = TYPE_FIRE, .accuracy = 100, .pp = 15, @@ -840,6 +858,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIST] = @@ -854,6 +874,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_WATER_GUN] = @@ -868,16 +890,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYDRO_PUMP] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 110, - #else - .power = 120, - #endif .effect = EFFECT_HIT, + .power = 110, .type = TYPE_WATER, .accuracy = 80, .pp = 5, @@ -886,38 +906,30 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SURF] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 90, - .target = MOVE_TARGET_FOES_AND_ALLY, - #elif B_UPDATED_MOVE_DATA >= GEN_4 - .power = 95, - .target = MOVE_TARGET_FOES_AND_ALLY, - #else - .power = 95, - .target = MOVE_TARGET_BOTH, - #endif .effect = EFFECT_HIT, + .power = 90, .type = TYPE_WATER, .accuracy = 100, .pp = 15, .secondaryEffectChance = 0, + .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_UNDERWATER, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICE_BEAM] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 90, - #else - .power = 95, - #endif .effect = EFFECT_FREEZE_HIT, + .power = 90, .type = TYPE_ICE, .accuracy = 100, .pp = 10, @@ -926,16 +938,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BLIZZARD] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 110, - #else - .power = 120, - #endif .effect = EFFECT_FREEZE_HIT, + .power = 110, .type = TYPE_ICE, .accuracy = 70, .pp = 5, @@ -944,6 +954,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYBEAM] = @@ -958,6 +970,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BUBBLE_BEAM] = @@ -972,6 +986,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AURORA_BEAM] = @@ -986,6 +1002,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYPER_BEAM] = @@ -1000,6 +1018,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PECK] = @@ -1014,6 +1034,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRILL_PECK] = @@ -1028,24 +1050,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SUBMISSION] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 20, - #else - .pp = 25, - #endif .effect = EFFECT_RECOIL_25, .power = 80, .type = TYPE_FIGHTING, .accuracy = 80, + .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LOW_KICK] = @@ -1060,15 +1082,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COUNTER] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED, - #else - .flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_COUNTER, .power = 1, .type = TYPE_FIGHTING, @@ -1077,7 +1096,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_DEPENDS, .priority = -5, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SEISMIC_TOSS] = @@ -1092,6 +1114,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STRENGTH] = @@ -1106,42 +1130,40 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ABSORB] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .pp = 25, - #else - .pp = 20, - #endif .effect = EFFECT_ABSORB, .power = 20, .type = TYPE_GRASS, .accuracy = 100, + .pp = 25, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MEGA_DRAIN] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .pp = 15, - #else - .pp = 10, - #endif .effect = EFFECT_ABSORB, .power = 40, .type = TYPE_GRASS, .accuracy = 100, + .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LEECH_SEED] = @@ -1156,24 +1178,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_GROWTH] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 20, - #else - .pp = 40, - #endif .effect = EFFECT_GROWTH, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, + .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_RAZOR_LEAF] = @@ -1188,6 +1210,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SOLAR_BEAM] = @@ -1202,6 +1226,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POISON_POWDER] = @@ -1216,6 +1242,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_STUN_SPORE] = @@ -1230,6 +1258,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_SLEEP_POWDER] = @@ -1244,28 +1274,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_PETAL_DANCE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 120, - .pp = 10, - #elif B_UPDATED_MOVE_DATA == GEN_4 - .power = 90, - .pp = 20, - #else - .power = 70, - .pp = 20, - #endif .effect = EFFECT_RAMPAGE, + .power = 120, .type = TYPE_GRASS, .accuracy = 100, + .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_RANDOM, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DANCE, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STRING_SHOT] = @@ -1280,6 +1306,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_DRAGON_RAGE] = @@ -1294,25 +1322,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIRE_SPIN] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 35, - .accuracy = 85, - #else - .power = 15, - .accuracy = 70, - #endif .effect = EFFECT_TRAP, + .power = 35, .type = TYPE_FIRE, + .accuracy = 85, .pp = 15, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THUNDER_SHOCK] = @@ -1327,16 +1354,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THUNDERBOLT] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 90, - #else - .power = 95, - #endif .effect = EFFECT_PARALYZE_HIT, + .power = 90, .type = TYPE_ELECTRIC, .accuracy = 100, .pp = 15, @@ -1345,34 +1370,30 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THUNDER_WAVE] = { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .accuracy = 90, - #else - .accuracy = 100, - #endif .effect = EFFECT_PARALYZE, .power = 0, .type = TYPE_ELECTRIC, + .accuracy = 90, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_THUNDER] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 110, - #else - .power = 120, - #endif .effect = EFFECT_THUNDER, + .power = 110, .type = TYPE_ELECTRIC, .accuracy = 70, .pp = 10, @@ -1381,6 +1402,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_HIT_IN_AIR, .split = SPLIT_SPECIAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROCK_THROW] = @@ -1395,6 +1418,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EARTHQUAKE] = @@ -1409,6 +1434,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_UNDERGROUND, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FISSURE] = @@ -1423,16 +1450,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_UNDERGROUND, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DIG] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .power = 80, - #else - .power = 60, - #endif .effect = EFFECT_SEMI_INVULNERABLE, + .power = 80, .type = TYPE_GROUND, .accuracy = 100, .pp = 10, @@ -1441,24 +1466,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TOXIC] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .accuracy = 90, - #else - .accuracy = 85, - #endif .effect = EFFECT_TOXIC, .power = 0, .type = TYPE_POISON, + .accuracy = 90, .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_CONFUSION] = @@ -1473,6 +1498,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCHIC] = @@ -1487,6 +1514,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYPNOSIS] = @@ -1501,6 +1530,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_MEDITATE] = @@ -1515,6 +1546,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_AGILITY] = @@ -1529,6 +1562,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_QUICK_ATTACK] = @@ -1543,6 +1578,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RAGE] = @@ -1557,6 +1594,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TELEPORT] = @@ -1568,9 +1607,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = -6, + .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_NIGHT_SHADE] = @@ -1585,6 +1626,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIMIC] = @@ -1592,13 +1635,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .effect = EFFECT_MIMIC, .power = 0, .type = TYPE_NORMAL, - .accuracy = 0, + .accuracy = 100, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_SCREECH] = @@ -1613,6 +1658,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_DOUBLE_TEAM] = @@ -1627,24 +1674,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_RECOVER] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .pp = 10, - #else - .pp = 20, - #endif .effect = EFFECT_RESTORE_HP, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, + .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HARDEN] = @@ -1659,24 +1706,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_MINIMIZE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 10, - #else - .pp = 20, - #endif .effect = EFFECT_MINIMIZE, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, + .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_SMOKESCREEN] = @@ -1691,6 +1738,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_CONFUSE_RAY] = @@ -1705,6 +1754,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_WITHDRAW] = @@ -1719,6 +1770,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_DEFENSE_CURL] = @@ -1733,24 +1786,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_BARRIER] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 20, - #else - .pp = 30, - #endif .effect = EFFECT_DEFENSE_UP_2, .power = 0, .type = TYPE_PSYCHIC, .accuracy = 0, + .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_LIGHT_SCREEN] = @@ -1765,6 +1818,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_HAZE] = @@ -1779,6 +1834,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_REFLECT] = @@ -1793,6 +1850,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_FOCUS_ENERGY] = @@ -1807,25 +1866,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_BIDE] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .accuracy = 0, - .priority = 1, - #else - .accuracy = 100, - .priority = 0, - #endif .effect = EFFECT_BIDE, .power = 1, .type = TYPE_NORMAL, + .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, + .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_METRONOME] = @@ -1840,6 +1898,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIRROR_MOVE] = @@ -1854,6 +1914,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_2, }, [MOVE_SELF_DESTRUCT] = @@ -1868,6 +1930,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EGG_BOMB] = @@ -1882,16 +1946,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LICK] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 30, - #else - .power = 20, - #endif .effect = EFFECT_PARALYZE_HIT, + .power = 30, .type = TYPE_GHOST, .accuracy = 100, .pp = 30, @@ -1900,24 +1962,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SMOG] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 30, - #else - .power = 20, - #endif .effect = EFFECT_POISON_HIT, + .power = 20, .type = TYPE_POISON, .accuracy = 70, - .pp = 20, + .pp = 30, .secondaryEffectChance = 40, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SLUDGE] = @@ -1932,6 +1994,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BONE_CLUB] = @@ -1946,16 +2010,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIRE_BLAST] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 120, - #else - .power = 110, - #endif .effect = EFFECT_BURN_HIT, + .power = 110, .type = TYPE_FIRE, .accuracy = 85, .pp = 5, @@ -1964,15 +2026,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WATERFALL] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .effect = EFFECT_FLINCH_HIT, - #else - .effect = EFFECT_HIT, - #endif + .effect = EFFECT_FLINCH_HIT, .power = 80, .type = TYPE_WATER, .accuracy = 100, @@ -1982,25 +2042,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CLAMP] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .accuracy = 85, - .pp = 15, - #else - .accuracy = 75, - .pp = 10, - #endif .effect = EFFECT_TRAP, .power = 35, .type = TYPE_WATER, + .accuracy = 85, + .pp = 15, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWIFT] = @@ -2015,25 +2074,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SKULL_BASH] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 130, - .pp = 10, - #else - .power = 100, - .pp = 15, - #endif .effect = EFFECT_SKULL_BASH, + .power = 130, .type = TYPE_NORMAL, .accuracy = 100, + .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPIKE_CANNON] = @@ -2048,6 +2106,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CONSTRICT] = @@ -2062,6 +2122,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AMNESIA] = @@ -2076,15 +2138,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_KINESIS] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_ACCURACY_DOWN, .power = 0, .type = TYPE_PSYCHIC, @@ -2093,7 +2152,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_SOFT_BOILED] = @@ -2108,48 +2170,40 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HI_JUMP_KICK] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 130, - .pp = 10, - #elif B_UPDATED_MOVE_DATA == GEN_4 - .power = 100, - .pp = 20, - #else - .power = 85, - .pp = 20, - #endif .effect = EFFECT_RECOIL_IF_MISS, + .power = 130, .type = TYPE_FIGHTING, .accuracy = 90, + .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GLARE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .accuracy = 100, - #elif B_UPDATED_MOVE_DATA == GEN_5 - .accuracy = 90, - #else - .accuracy = 75, - #endif .effect = EFFECT_PARALYZE, .power = 0, .type = TYPE_NORMAL, + .accuracy = 100, .pp = 30, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_DREAM_EATER] = @@ -2164,28 +2218,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POISON_GAS] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .accuracy = 90, - .target = MOVE_TARGET_FOES_AND_ALLY, - #elif B_UPDATED_MOVE_DATA == GEN_5 - .accuracy = 80, - .target = MOVE_TARGET_FOES_AND_ALLY, - #else - .accuracy = 55, - .target = MOVE_TARGET_BOTH, - #endif .effect = EFFECT_POISON, .power = 0, .type = TYPE_POISON, + .accuracy = 90, .pp = 40, .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_BARRAGE] = @@ -2200,25 +2250,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LEECH_LIFE] = { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .power = 80, - .pp = 10, - #else - .power = 20, - .pp = 15, - #endif .effect = EFFECT_ABSORB, + .power = 80, .type = TYPE_BUG, .accuracy = 100, + .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LOVELY_KISS] = @@ -2233,6 +2282,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SKY_ATTACK] = @@ -2248,6 +2299,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, .argument = MOVE_EFFECT_FLINCH, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TRANSFORM] = @@ -2262,16 +2315,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_BUBBLE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 40, - #else - .power = 20, - #endif .effect = EFFECT_SPEED_DOWN_HIT, + .power = 40, .type = TYPE_WATER, .accuracy = 100, .pp = 30, @@ -2280,6 +2331,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DIZZY_PUNCH] = @@ -2294,6 +2347,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPORE] = @@ -2308,42 +2363,40 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_FLASH] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .accuracy = 100, - #else - .accuracy = 70, - #endif .effect = EFFECT_ACCURACY_DOWN, .power = 0, .type = TYPE_NORMAL, + .accuracy = 100, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_PSYWAVE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .accuracy = 100, - #else - .accuracy = 80, - #endif .effect = EFFECT_PSYWAVE, .power = 1, .type = TYPE_PSYCHIC, + .accuracy = 100, .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPLASH] = @@ -2358,46 +2411,40 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_3, }, [MOVE_ACID_ARMOR] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 20, - #else - .pp = 40, - #endif .effect = EFFECT_DEFENSE_UP_2, .power = 0, .type = TYPE_POISON, .accuracy = 0, + .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_CRABHAMMER] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 100, - .accuracy = 90, - #elif B_UPDATED_MOVE_DATA == GEN_5 - .power = 90, - .accuracy = 90, - #else - .power = 90, - .accuracy = 85, - #endif .effect = EFFECT_HIT, + .power = 100, .type = TYPE_WATER, + .accuracy = 90, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EXPLOSION] = @@ -2412,6 +2459,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FURY_SWIPES] = @@ -2426,6 +2475,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BONEMERANG] = @@ -2440,6 +2491,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_REST] = @@ -2454,6 +2507,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_ROCK_SLIDE] = @@ -2468,6 +2523,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYPER_FANG] = @@ -2482,6 +2539,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_STRONG_JAW_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHARPEN] = @@ -2496,15 +2555,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_CONVERSION] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_SNATCH_AFFECTED, - #else - .flags = 0, - #endif .effect = EFFECT_CONVERSION, .power = 0, .type = TYPE_NORMAL, @@ -2513,7 +2569,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, + .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_TRI_ATTACK] = @@ -2528,6 +2587,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SUPER_FANG] = @@ -2542,6 +2603,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SLASH] = @@ -2556,6 +2619,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SUBSTITUTE] = @@ -2570,25 +2635,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_STRUGGLE] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .accuracy = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .accuracy = 100, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif .effect = EFFECT_RECOIL_25, .power = 50, .type = TYPE_NORMAL, + .accuracy = 0, .pp = 1, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SKETCH] = @@ -2603,6 +2667,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_TRIPLE_KICK] = @@ -2617,79 +2683,72 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THIEF] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 60, - .pp = 25, - #else - .power = 40, - .pp = 10, - #endif .effect = EFFECT_THIEF, + .power = 60, .type = TYPE_DARK, .accuracy = 100, + .pp = 25, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPIDER_WEB] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_MEAN_LOOK, .power = 0, .type = TYPE_BUG, - .accuracy = 0, + .accuracy = 100, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_MIND_READER] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .accuracy = 0, - #else - .accuracy = 100, - #endif .effect = EFFECT_LOCK_ON, .power = 0, .type = TYPE_NORMAL, + .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_NIGHTMARE] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .accuracy = 100, - #else - .accuracy = 0, - #endif .effect = EFFECT_NIGHTMARE, .power = 0, .type = TYPE_GHOST, + .accuracy = 100, .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_FLAME_WHEEL] = @@ -2704,16 +2763,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SNORE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 50, - #else - .power = 40, - #endif .effect = EFFECT_SNORE, + .power = 50, .type = TYPE_NORMAL, .accuracy = 100, .pp = 15, @@ -2722,17 +2779,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CURSE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .type = TYPE_GHOST, - #else - .type = TYPE_MYSTERY, - #endif .effect = EFFECT_CURSE, .power = 0, + .type = TYPE_GHOST, .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, @@ -2740,6 +2795,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_CURSE, }, [MOVE_FLAIL] = @@ -2754,24 +2811,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CONVERSION_2] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .target = MOVE_TARGET_USER, - #else - .target = MOVE_TARGET_FOES_AND_ALLY, - #endif .effect = EFFECT_CONVERSION_2, .power = 0, .type = TYPE_NORMAL, .accuracy = 100, .pp = 30, .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_AEROBLAST] = @@ -2786,28 +2843,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COTTON_SPORE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .accuracy = 100, - .target = MOVE_TARGET_BOTH, - #elif B_UPDATED_MOVE_DATA == GEN_5 - .accuracy = 100, - .target = MOVE_TARGET_FOES_AND_ALLY, - #else - .accuracy = 85, - .target = MOVE_TARGET_FOES_AND_ALLY, - #endif .effect = EFFECT_SPEED_DOWN_2, .power = 0, .type = TYPE_GRASS, + .accuracy = 100, .pp = 40, .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_REVERSAL] = @@ -2822,15 +2875,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPITE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_SPITE, .power = 0, .type = TYPE_GHOST, @@ -2839,7 +2889,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_POWDER_SNOW] = @@ -2854,6 +2907,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PROTECT] = @@ -2865,9 +2920,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 4, + .priority = 3, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_MACH_PUNCH] = @@ -2882,33 +2939,28 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SCARY_FACE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .accuracy = 100, - #else - .accuracy = 90, - #endif .effect = EFFECT_SPEED_DOWN_2, .power = 0, .type = TYPE_NORMAL, + .accuracy = 100, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_FAINT_ATTACK] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif .effect = EFFECT_HIT, .power = 60, .type = TYPE_DARK, @@ -2917,18 +2969,17 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWEET_KISS] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .type = TYPE_FAIRY, - #else - .type = TYPE_NORMAL, - #endif .effect = EFFECT_CONFUSE, .power = 0, + .type = TYPE_FAIRY, .accuracy = 75, .pp = 10, .secondaryEffectChance = 0, @@ -2936,6 +2987,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_BELLY_DRUM] = @@ -2950,6 +3003,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_SLUDGE_BOMB] = @@ -2964,6 +3019,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MUD_SLAP] = @@ -2978,6 +3035,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OCTAZOOKA] = @@ -2992,15 +3051,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPIKES] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_MAGICCOAT_AFFECTED, - #else - .flags = 0, - #endif .effect = EFFECT_SPIKES, .power = 0, .type = TYPE_GROUND, @@ -3009,17 +3065,16 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_OPPONENTS_FIELD, .priority = 0, + .flags = FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_ZAP_CANNON] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .power = 120, - #else - .power = 100, - #endif .effect = EFFECT_PARALYZE_HIT, + .power = 120, .type = TYPE_ELECTRIC, .accuracy = 50, .pp = 5, @@ -3028,28 +3083,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FORESIGHT] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .accuracy = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, - #elif B_UPDATED_MOVE_DATA >= GEN_4 - .accuracy = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .accuracy = 100, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_FORESIGHT, .power = 0, .type = TYPE_NORMAL, + .accuracy = 0, .pp = 40, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_BOOST_CRITS, }, [MOVE_DESTINY_BOND] = @@ -3064,6 +3115,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_FOLLOW_ME, }, [MOVE_PERISH_SONG] = @@ -3078,6 +3131,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_ICY_WIND] = @@ -3092,6 +3147,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DETECT] = @@ -3103,67 +3160,59 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 4, + .priority = 3, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_BONE_RUSH] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .accuracy = 90, - #else - .accuracy = 80, - #endif .effect = EFFECT_MULTI_HIT, .power = 25, .type = TYPE_GROUND, + .accuracy = 90, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LOCK_ON] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .accuracy = 100, - #else - .accuracy = 0, - #endif .effect = EFFECT_LOCK_ON, .power = 0, .type = TYPE_NORMAL, + .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_OUTRAGE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 120, - .pp = 10, - #elif B_UPDATED_MOVE_DATA == GEN_4 - .power = 120, - .pp = 15, - #else - .power = 90, - .pp = 15, - #endif .effect = EFFECT_RAMPAGE, + .power = 120, .type = TYPE_DRAGON, .accuracy = 100, + .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_RANDOM, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SANDSTORM] = @@ -3178,28 +3227,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_GIGA_DRAIN] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 75, - .pp = 10, - #elif B_UPDATED_MOVE_DATA == GEN_4 - .power = 60, - .pp = 10, - #else - .power = 60, - .pp = 5, - #endif .effect = EFFECT_ABSORB, + .power = 75, .type = TYPE_GRASS, .accuracy = 100, + .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ENDURE] = @@ -3211,20 +3256,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 4, + .priority = 3, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_CHARM] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .type = TYPE_FAIRY, - #else - .type = TYPE_NORMAL, - #endif .effect = EFFECT_ATTACK_DOWN_2, .power = 0, + .type = TYPE_FAIRY, .accuracy = 100, .pp = 20, .secondaryEffectChance = 0, @@ -3232,6 +3275,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_ROLLOUT] = @@ -3246,6 +3291,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FALSE_SWIPE] = @@ -3260,24 +3307,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWAGGER] = { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .accuracy = 85, - #else - .accuracy = 90, - #endif .effect = EFFECT_SWAGGER, .power = 0, .type = TYPE_NORMAL, + .accuracy = 85, .pp = 15, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_MILK_DRINK] = @@ -3292,6 +3339,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_SPARK] = @@ -3306,18 +3355,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FURY_CUTTER] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 40, - #elif B_UPDATED_MOVE_DATA == GEN_5 - .power = 20, - #else - .power = 10, - #endif .effect = EFFECT_FURY_CUTTER, + .power = 40, .type = TYPE_BUG, .accuracy = 95, .pp = 20, @@ -3326,6 +3371,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STEEL_WING] = @@ -3340,24 +3387,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MEAN_LOOK] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_MEAN_LOOK, .power = 0, .type = TYPE_NORMAL, - .accuracy = 0, + .accuracy = 100, .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_ATTRACT] = @@ -3372,6 +3419,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_SLEEP_TALK] = @@ -3386,6 +3435,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_BOOST_CRITS, }, [MOVE_HEAL_BELL] = @@ -3400,6 +3451,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_RETURN] = @@ -3414,6 +3467,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PRESENT] = @@ -3428,6 +3483,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FRUSTRATION] = @@ -3442,6 +3499,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SAFEGUARD] = @@ -3456,6 +3515,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_PAIN_SPLIT] = @@ -3470,6 +3531,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_SACRED_FIRE] = @@ -3483,7 +3546,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, - .split = SPLIT_PHYSICAL, + .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAGNITUDE] = @@ -3498,6 +3563,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_UNDERGROUND, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DYNAMIC_PUNCH] = @@ -3512,6 +3579,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MEGAHORN] = @@ -3526,6 +3595,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_BREATH] = @@ -3540,6 +3611,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BATON_PASS] = @@ -3554,15 +3627,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_ENCORE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_ENCORE, .power = 0, .type = TYPE_NORMAL, @@ -3571,7 +3641,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_PURSUIT] = @@ -3586,16 +3659,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RAPID_SPIN] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .power = 50, - #else - .power = 20, - #endif .effect = EFFECT_RAPID_SPIN, + .power = 20, .type = TYPE_NORMAL, .accuracy = 100, .pp = 40, @@ -3604,6 +3675,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWEET_SCENT] = @@ -3618,6 +3691,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_IRON_TAIL] = @@ -3632,6 +3707,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_METAL_CLAW] = @@ -3646,6 +3723,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VITAL_THROW] = @@ -3653,13 +3732,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .effect = EFFECT_VITAL_THROW, .power = 70, .type = TYPE_FIGHTING, - .accuracy = 0, + .accuracy = 100, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = -1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MORNING_SUN] = @@ -3674,6 +3755,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_SYNTHESIS] = @@ -3688,17 +3771,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_MOONLIGHT] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .type = TYPE_FAIRY, - #else - .type = TYPE_NORMAL, - #endif .effect = EFFECT_MOONLIGHT, .power = 0, + .type = TYPE_FAIRY, .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, @@ -3706,6 +3787,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HIDDEN_POWER] = @@ -3720,6 +3803,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CROSS_CHOP] = @@ -3734,6 +3819,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TWISTER] = @@ -3748,6 +3835,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_IN_AIR, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RAIN_DANCE] = @@ -3760,8 +3849,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = 0, + .flags = FLAG_DANCE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SUNNY_DAY] = @@ -3776,15 +3867,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_CRUNCH] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .effect = EFFECT_DEFENSE_DOWN_HIT, - #else - .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, - #endif + .effect = EFFECT_DEFENSE_DOWN_HIT, .power = 80, .type = TYPE_DARK, .accuracy = 100, @@ -3794,15 +3883,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIRROR_COAT] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .flags = FLAG_PROTECT_AFFECTED, - #else - .flags = FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_MIRROR_COAT, .power = 1, .type = TYPE_PSYCHIC, @@ -3811,16 +3897,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_DEPENDS, .priority = -5, + .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCH_UP] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_SNATCH_AFFECTED, - #else - .flags = 0, - #endif .effect = EFFECT_PSYCH_UP, .power = 0, .type = TYPE_NORMAL, @@ -3829,16 +3913,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_EXTREME_SPEED] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .priority = 2, - #else - .priority = 1, - #endif .effect = EFFECT_HIT, .power = 80, .type = TYPE_NORMAL, @@ -3846,17 +3928,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, + .priority = 2, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ANCIENT_POWER] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, - #else - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, - #endif .effect = EFFECT_ALL_STATS_UP_HIT, .power = 60, .type = TYPE_ROCK, @@ -3865,7 +3945,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHADOW_BALL] = @@ -3880,40 +3963,30 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FUTURE_SIGHT] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 120, - .accuracy = 100, - .pp = 10, - #elif B_UPDATED_MOVE_DATA == GEN_5 - .power = 100, - .accuracy = 100, - .pp = 10, - #else - .power = 80, - .accuracy = 90, - .pp = 15, - #endif .effect = EFFECT_FUTURE_SIGHT, + .power = 120, .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = 0, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROCK_SMASH] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .power = 40, - #else - .power = 20, - #endif .effect = EFFECT_DEFENSE_DOWN_HIT, + .power = 40, .type = TYPE_FIGHTING, .accuracy = 100, .pp = 15, @@ -3922,35 +3995,30 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WHIRLPOOL] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 35, - .accuracy = 85, - #else - .power = 15, - .accuracy = 70, - #endif .effect = EFFECT_TRAP, + .power = 35, .type = TYPE_WATER, + .accuracy = 85, .pp = 15, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_UNDERWATER, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BEAT_UP] = { .effect = EFFECT_BEAT_UP, - #if B_BEAT_UP_DMG >= GEN_5 - .power = 1, - #else - .power = 10, - #endif + .power = 10, .type = TYPE_DARK, .accuracy = 100, .pp = 10, @@ -3959,15 +4027,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FAKE_OUT] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, - #endif .effect = EFFECT_FAKE_OUT, .power = 40, .type = TYPE_NORMAL, @@ -3975,18 +4040,17 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, - .priority = 3, + .priority = 1, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_UPROAR] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 90, - #else - .power = 50, - #endif .effect = EFFECT_UPROAR, + .power = 90, .type = TYPE_NORMAL, .accuracy = 100, .pp = 10, @@ -3995,34 +4059,30 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STOCKPILE] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .pp = 20, - #else - .pp = 10, - #endif .effect = EFFECT_STOCKPILE, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, + .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_SPIT_UP] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .power = 1, - #else - .power = 100, - #endif .effect = EFFECT_SPIT_UP, + .power = 100, .type = TYPE_NORMAL, .accuracy = 100, .pp = 10, @@ -4031,6 +4091,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWALLOW] = @@ -4045,16 +4107,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HEAT_WAVE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 95, - #else - .power = 100, - #endif .effect = EFFECT_BURN_HIT, + .power = 95, .type = TYPE_FIRE, .accuracy = 90, .pp = 10, @@ -4063,6 +4123,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HAIL] = @@ -4077,15 +4139,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_TORMENT] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_TORMENT, .power = 0, .type = TYPE_DARK, @@ -4094,7 +4153,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_FLATTER] = @@ -4109,24 +4171,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_WILL_O_WISP] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .accuracy = 85, - #else - .accuracy = 75, - #endif .effect = EFFECT_WILL_O_WISP, .power = 0, .type = TYPE_FIRE, + .accuracy = 85, .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_MEMENTO] = @@ -4141,6 +4203,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESTORE_REPLACEMENT_HP, }, [MOVE_FACADE] = @@ -4155,6 +4219,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FOCUS_PUNCH] = @@ -4169,16 +4235,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -3, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SMELLING_SALT] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 70, - #else - .power = 60, - #endif .effect = EFFECT_SMELLINGSALT, + .power = 70, .type = TYPE_NORMAL, .accuracy = 100, .pp = 10, @@ -4188,6 +4252,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, .argument = STATUS1_PARALYSIS, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FOLLOW_ME] = @@ -4199,9 +4265,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 2, + .priority = 3, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_NATURE_POWER] = @@ -4216,6 +4284,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CHARGE] = @@ -4230,15 +4300,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_TAUNT] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED, - #endif .effect = EFFECT_TAUNT, .power = 0, .type = TYPE_DARK, @@ -4247,25 +4314,26 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_HELPING_HAND] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .target = MOVE_TARGET_ALLY, - #else - .target = MOVE_TARGET_USER, - #endif .effect = EFFECT_HELPING_HAND, .power = 0, .type = TYPE_NORMAL, .accuracy = 100, .pp = 20, .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, .priority = 5, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_TRICK] = @@ -4280,6 +4348,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_ROLE_PLAY] = @@ -4287,22 +4357,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .effect = EFFECT_ROLE_PLAY, .power = 0, .type = TYPE_PSYCHIC, - .accuracy = 0, + .accuracy = 100, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_WISH] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_SNATCH_AFFECTED, - #else - .flags = 0, - #endif .effect = EFFECT_WISH, .power = 0, .type = TYPE_NORMAL, @@ -4311,7 +4378,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_ASSIST] = @@ -4326,6 +4396,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_INGRAIN] = @@ -4340,6 +4412,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_SUPERPOWER] = @@ -4354,6 +4428,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAGIC_COAT] = @@ -4368,15 +4444,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 4, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_2, }, [MOVE_RECYCLE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_SNATCH_AFFECTED, - #else - .flags = 0, - #endif .effect = EFFECT_RECYCLE, .power = 0, .type = TYPE_NORMAL, @@ -4385,7 +4458,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, + .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_REVENGE] = @@ -4400,6 +4476,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -4, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BRICK_BREAK] = @@ -4414,6 +4492,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_YAWN] = @@ -4421,23 +4501,21 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .effect = EFFECT_YAWN, .power = 0, .type = TYPE_NORMAL, - .accuracy = 0, + .accuracy = 100, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_KNOCK_OFF] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 65, - #else - .power = 20, - #endif .effect = EFFECT_KNOCK_OFF, + .power = 65, .type = TYPE_DARK, .accuracy = 100, .pp = 20, @@ -4446,6 +4524,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ENDEAVOR] = @@ -4460,6 +4540,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ERUPTION] = @@ -4474,6 +4556,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SKILL_SWAP] = @@ -4481,22 +4565,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .effect = EFFECT_SKILL_SWAP, .power = 0, .type = TYPE_PSYCHIC, - .accuracy = 0, + .accuracy = 100, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_IMPRISON] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_PROTECT_AFFECTED | FLAG_SNATCH_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED, - #endif .effect = EFFECT_IMPRISON, .power = 0, .type = TYPE_PSYCHIC, @@ -4505,7 +4586,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_2, }, [MOVE_REFRESH] = @@ -4520,6 +4604,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_GRUDGE] = @@ -4534,6 +4620,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_FOLLOW_ME, }, [MOVE_SNATCH] = @@ -4548,6 +4636,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 4, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_SECRET_POWER] = @@ -4562,16 +4652,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DIVE] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .power = 80, - #else - .power = 60, - #endif .effect = EFFECT_SEMI_INVULNERABLE, + .power = 80, .type = TYPE_WATER, .accuracy = 100, .pp = 10, @@ -4580,6 +4668,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ARM_THRUST] = @@ -4594,6 +4684,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CAMOUFLAGE] = @@ -4608,6 +4700,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_TAIL_GLOW] = @@ -4622,6 +4716,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_LUSTER_PURGE] = @@ -4636,6 +4732,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIST_BALL] = @@ -4650,6 +4748,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FEATHER_DANCE] = @@ -4664,15 +4764,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DANCE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_TEETER_DANCE] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DANCE, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_DANCE, - #endif .effect = EFFECT_TEETER_DANCE, .power = 0, .type = TYPE_NORMAL, @@ -4681,7 +4778,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_DANCE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_BLAZE_KICK] = @@ -4696,6 +4796,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_HIGH_CRIT | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MUD_SPORT] = @@ -4710,6 +4812,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_ICE_BALL] = @@ -4724,6 +4828,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_NEEDLE_ARM] = @@ -4738,6 +4844,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SLACK_OFF] = @@ -4752,6 +4860,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HYPER_VOICE] = @@ -4766,24 +4876,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POISON_FANG] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .secondaryEffectChance = 50, - #else - .secondaryEffectChance = 30, - #endif .effect = EFFECT_POISON_FANG, .power = 50, .type = TYPE_POISON, .accuracy = 100, .pp = 15, + .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CRUSH_CLAW] = @@ -4798,6 +4908,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BLAST_BURN] = @@ -4812,6 +4924,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYDRO_CANNON] = @@ -4826,25 +4940,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_METEOR_MASH] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 90, - .accuracy = 90, - #else - .power = 100, - .accuracy = 85, - #endif .effect = EFFECT_ATTACK_UP_HIT, + .power = 90, .type = TYPE_STEEL, + .accuracy = 90, .pp = 10, .secondaryEffectChance = 20, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ASTONISH] = @@ -4859,6 +4972,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WEATHER_BALL] = @@ -4873,6 +4988,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AROMATHERAPY] = @@ -4887,6 +5004,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_FAKE_TEARS] = @@ -4901,16 +5020,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_AIR_CUTTER] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 60, - #else - .power = 55, - #endif .effect = EFFECT_HIT, + .power = 60, .type = TYPE_FLYING, .accuracy = 95, .pp = 25, @@ -4919,67 +5036,56 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OVERHEAT] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 130, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #elif B_UPDATED_MOVE_DATA >= GEN_4 - .power = 130, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .power = 140, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif .effect = EFFECT_OVERHEAT, + .power = 130, .type = TYPE_FIRE, .accuracy = 90, .pp = 5, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ODOR_SLEUTH] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .accuracy = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, - #else - .accuracy = 100, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_FORESIGHT, .power = 0, .type = TYPE_NORMAL, + .accuracy = 0, .pp = 40, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_ROCK_TOMB] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 60, - .accuracy = 95, - .pp = 15, - #else - .power = 50, - .accuracy = 80, - .pp = 10, - #endif .effect = EFFECT_SPEED_DOWN_HIT, + .power = 60, .type = TYPE_ROCK, + .accuracy = 95, + .pp = 15, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SILVER_WIND] = @@ -4994,6 +5100,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_METAL_SOUND] = @@ -5008,6 +5116,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_GRASS_WHISTLE] = @@ -5022,6 +5132,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_TICKLE] = @@ -5036,6 +5148,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_COSMIC_POWER] = @@ -5050,6 +5164,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_WATER_SPOUT] = @@ -5064,6 +5180,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SIGNAL_BEAM] = @@ -5078,6 +5196,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHADOW_PUNCH] = @@ -5092,24 +5212,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EXTRASENSORY] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 20, - #else - .pp = 30, - #endif .effect = EFFECT_FLINCH_MINIMIZE_HIT, .power = 80, .type = TYPE_PSYCHIC, .accuracy = 100, + .pp = 20, .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SKY_UPPERCUT] = @@ -5124,25 +5244,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_HIT_IN_AIR, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SAND_TOMB] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 35, - .accuracy = 85, - #else - .power = 15, - .accuracy = 70, - #endif .effect = EFFECT_TRAP, + .power = 35, .type = TYPE_GROUND, + .accuracy = 85, .pp = 15, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHEER_COLD] = @@ -5157,16 +5276,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MUDDY_WATER] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 90, - #else - .power = 95, - #endif .effect = EFFECT_ACCURACY_DOWN_HIT, + .power = 90, .type = TYPE_WATER, .accuracy = 85, .pp = 10, @@ -5175,16 +5292,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BULLET_SEED] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 25, - #else - .power = 10, - #endif .effect = EFFECT_MULTI_HIT, + .power = 25, .type = TYPE_GRASS, .accuracy = 100, .pp = 30, @@ -5193,6 +5308,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AERIAL_ACE] = @@ -5207,16 +5324,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICICLE_SPEAR] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 25, - #else - .power = 10, - #endif .effect = EFFECT_MULTI_HIT, + .power = 25, .type = TYPE_ICE, .accuracy = 100, .pp = 30, @@ -5225,6 +5340,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_IRON_DEFENSE] = @@ -5239,24 +5356,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_BLOCK] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_MEAN_LOOK, .power = 0, .type = TYPE_NORMAL, - .accuracy = 0, + .accuracy = 100, .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_HOWL] = @@ -5269,8 +5386,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_SNATCH_AFFECTED | FLAG_SOUND, + .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_DRAGON_CLAW] = @@ -5285,6 +5404,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FRENZY_PLANT] = @@ -5299,6 +5420,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BULK_UP] = @@ -5313,6 +5436,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_BOUNCE] = @@ -5328,6 +5453,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, .argument = MOVE_EFFECT_PARALYSIS, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MUD_SHOT] = @@ -5342,6 +5469,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POISON_TAIL] = @@ -5356,44 +5485,29 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COVET] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 60, - .pp = 25, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #elif B_UPDATED_MOVE_DATA == GEN_5 - .power = 60, - .pp = 40, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #elif B_UPDATED_MOVE_DATA == GEN_4 - .power = 40, - .pp = 40, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .power = 40, - .pp = 40, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_THIEF, + .power = 60, .type = TYPE_NORMAL, .accuracy = 100, + .pp = 25, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VOLT_TACKLE] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .effect = EFFECT_RECOIL_33_STATUS, - .argument = STATUS1_PARALYSIS, - #else - .effect = EFFECT_RECOIL_33, - #endif + .effect = EFFECT_RECOIL_33_STATUS, .power = 120, .type = TYPE_ELECTRIC, .accuracy = 100, @@ -5403,6 +5517,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .argument = STATUS1_PARALYSIS, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAGICAL_LEAF] = @@ -5417,6 +5534,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WATER_SPORT] = @@ -5431,6 +5550,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_CALM_MIND] = @@ -5445,16 +5566,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_LEAF_BLADE] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .power = 90, - #else - .power = 70, - #endif .effect = EFFECT_HIT, + .power = 90, .type = TYPE_GRASS, .accuracy = 100, .pp = 15, @@ -5463,6 +5582,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_DANCE] = @@ -5477,24 +5598,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED | FLAG_DANCE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_ROCK_BLAST] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .accuracy = 90, - #else - .accuracy = 80, - #endif .effect = EFFECT_MULTI_HIT, .power = 25, .type = TYPE_ROCK, + .accuracy = 90, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHOCK_WAVE] = @@ -5509,6 +5630,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WATER_PULSE] = @@ -5523,25 +5646,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_MEGA_LAUNCHER_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOOM_DESIRE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 140, - .accuracy = 100, - #else - .power = 120, - .accuracy = 85, - #endif .effect = EFFECT_FUTURE_SIGHT, + .power = 140, .type = TYPE_STEEL, + .accuracy = 100, .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = 0, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCHO_BOOST] = @@ -5556,6 +5678,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROOST] = @@ -5570,6 +5694,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_GRAVITY] = @@ -5584,15 +5710,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_MIRACLE_EYE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_MIRACLE_EYE, .power = 0, .type = TYPE_PSYCHIC, @@ -5601,17 +5724,16 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_WAKE_UP_SLAP] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 70, - #else - .power = 60, - #endif .effect = EFFECT_WAKE_UP_SLAP, + .power = 70, .type = TYPE_FIGHTING, .accuracy = 100, .pp = 10, @@ -5621,6 +5743,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, .argument = STATUS1_SLEEP, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HAMMER_ARM] = @@ -5635,6 +5759,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GYRO_BALL] = @@ -5649,15 +5775,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HEALING_WISH] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_SNATCH_AFFECTED, - #else - .flags = 0, - #endif .effect = EFFECT_HEALING_WISH, .power = 0, .type = TYPE_PSYCHIC, @@ -5666,7 +5789,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, + .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BRINE] = @@ -5681,6 +5807,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_NATURAL_GIFT] = @@ -5695,28 +5823,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FEINT] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 30, - .flags = FLAG_MIRROR_MOVE_AFFECTED, - #elif B_UPDATED_MOVE_DATA >= GEN_5 - .power = 30, - .flags = 0, - #else - .power = 50, - .flags = 0, - #endif .effect = EFFECT_FEINT, + .power = 30, .type = TYPE_NORMAL, .accuracy = 100, .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 2, + .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PLUCK] = @@ -5731,33 +5855,28 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TAILWIND] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 15, - #else - .pp = 30, - #endif .effect = EFFECT_TAILWIND, .power = 0, .type = TYPE_FLYING, .accuracy = 0, + .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_BOOST_CRITS, }, [MOVE_ACUPRESSURE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = 0, - #else - .flags = FLAG_SNATCH_AFFECTED, - #endif .effect = EFFECT_ACUPRESSURE, .power = 0, .type = TYPE_NORMAL, @@ -5766,16 +5885,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER | MOVE_TARGET_ALLY, .priority = 0, + .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_BOOST_CRITS, }, [MOVE_METAL_BURST] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .flags = FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_METAL_BURST, .power = 0, .type = TYPE_STEEL, @@ -5784,6 +5901,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_DEPENDS, .priority = 0, + .flags = 0, .split = SPLIT_PHYSICAL, }, @@ -5799,6 +5917,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CLOSE_COMBAT] = @@ -5813,6 +5933,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PAYBACK] = @@ -5827,16 +5949,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ASSURANCE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 60, - #else - .power = 50, - #endif .effect = EFFECT_ASSURANCE, + .power = 60, .type = TYPE_DARK, .accuracy = 100, .pp = 10, @@ -5845,15 +5965,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EMBARGO] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_EMBARGO, .power = 0, .type = TYPE_DARK, @@ -5862,7 +5979,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_FLING] = @@ -5877,24 +5997,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCHO_SHIFT] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .accuracy = 100, - #else - .accuracy = 90, - #endif .effect = EFFECT_PSYCHO_SHIFT, .power = 0, .type = TYPE_PSYCHIC, + .accuracy = 100, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_2, }, [MOVE_TRUMP_CARD] = @@ -5913,11 +6033,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_HEAL_BLOCK] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_HEAL_BLOCK, .power = 0, .type = TYPE_PSYCHIC, @@ -5926,7 +6041,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_2, }, [MOVE_WRING_OUT] = @@ -5945,11 +6063,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_POWER_TRICK] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_SNATCH_AFFECTED, - #else - .flags = 0, - #endif .effect = EFFECT_POWER_TRICK, .power = 0, .type = TYPE_PSYCHIC, @@ -5958,7 +6071,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, + .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_GASTRO_ACID] = @@ -5973,15 +6089,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_LUCKY_CHANT] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_SNATCH_AFFECTED, - #else - .flags = 0, - #endif .effect = EFFECT_LUCKY_CHANT, .power = 0, .type = TYPE_NORMAL, @@ -5990,7 +6103,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, + .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_ME_FIRST] = @@ -6005,6 +6121,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_COPYCAT] = @@ -6019,6 +6137,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_POWER_SWAP] = @@ -6033,6 +6153,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_GUARD_SWAP] = @@ -6047,6 +6169,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_PUNISHMENT] = @@ -6061,16 +6185,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LAST_RESORT] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 140, - #else - .power = 130, - #endif .effect = EFFECT_LAST_RESORT, + .power = 140, .type = TYPE_NORMAL, .accuracy = 100, .pp = 5, @@ -6079,6 +6201,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WORRY_SEED] = @@ -6093,16 +6217,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SUCKER_PUNCH] = { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .power = 70, - #else - .power = 80, - #endif .effect = EFFECT_SUCKER_PUNCH, + .power = 70, .type = TYPE_DARK, .accuracy = 100, .pp = 5, @@ -6111,15 +6233,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TOXIC_SPIKES] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_MAGICCOAT_AFFECTED, - #else - .flags = 0, - #endif .effect = EFFECT_TOXIC_SPIKES, .power = 0, .type = TYPE_POISON, @@ -6128,7 +6247,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_OPPONENTS_FIELD, .priority = 0, + .flags = FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_HEART_SWAP] = @@ -6143,15 +6265,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_BOOST_CRITS, }, [MOVE_AQUA_RING] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_SNATCH_AFFECTED, - #else - .flags = 0, - #endif .effect = EFFECT_AQUA_RING, .power = 0, .type = TYPE_WATER, @@ -6160,16 +6279,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, + .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_MAGNET_RISE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_SNATCH_AFFECTED, - #else - .flags = 0, - #endif .effect = EFFECT_MAGNET_RISE, .power = 0, .type = TYPE_ELECTRIC, @@ -6178,7 +6295,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, + .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_FLARE_BLITZ] = @@ -6194,6 +6314,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, .argument = STATUS1_BURN, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FORCE_PALM] = @@ -6208,16 +6330,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AURA_SPHERE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 80, - #else - .power = 90, - #endif .effect = EFFECT_HIT, + .power = 80, .type = TYPE_FIGHTING, .accuracy = 0, .pp = 20, @@ -6226,6 +6346,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROCK_POLISH] = @@ -6240,6 +6362,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_POISON_JAB] = @@ -6254,6 +6378,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DARK_PULSE] = @@ -6268,6 +6394,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_MEGA_LAUNCHER_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_NIGHT_SLASH] = @@ -6282,6 +6410,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AQUA_TAIL] = @@ -6296,6 +6426,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SEED_BOMB] = @@ -6308,26 +6440,26 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AIR_SLASH] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 15, - #else - .pp = 20, - #endif .effect = EFFECT_FLINCH_HIT, .power = 75, .type = TYPE_FLYING, .accuracy = 95, + .pp = 15, .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_X_SCISSOR] = @@ -6342,6 +6474,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BUG_BUZZ] = @@ -6356,16 +6490,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_PULSE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 85, - #else - .power = 90, - #endif .effect = EFFECT_HIT, + .power = 85, .type = TYPE_DRAGON, .accuracy = 100, .pp = 10, @@ -6374,6 +6506,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_RUSH] = @@ -6388,16 +6522,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POWER_GEM] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 80, - #else - .power = 70, - #endif .effect = EFFECT_HIT, + .power = 80, .type = TYPE_ROCK, .accuracy = 100, .pp = 20, @@ -6406,25 +6538,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAIN_PUNCH] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .power = 75, - .pp = 10, - #else - .power = 60, - .pp = 5, - #endif .effect = EFFECT_ABSORB, + .power = 75, .type = TYPE_FIGHTING, .accuracy = 100, + .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VACUUM_WAVE] = @@ -6439,6 +6570,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FOCUS_BLAST] = @@ -6453,16 +6586,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ENERGY_BALL] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 90, - #else - .power = 80, - #endif .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, + .power = 90, .type = TYPE_GRASS, .accuracy = 100, .pp = 10, @@ -6471,6 +6602,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BRAVE_BIRD] = @@ -6485,6 +6618,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EARTH_POWER] = @@ -6499,6 +6634,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWITCHEROO] = @@ -6513,6 +6650,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_GIGA_IMPACT] = @@ -6527,6 +6666,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_NASTY_PLOT] = @@ -6541,6 +6682,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_BULLET_PUNCH] = @@ -6555,6 +6698,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AVALANCHE] = @@ -6569,6 +6714,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -4, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICE_SHARD] = @@ -6583,6 +6730,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHADOW_CLAW] = @@ -6597,6 +6746,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THUNDER_FANG] = @@ -6612,6 +6763,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, .argument = STATUS1_PARALYSIS, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICE_FANG] = @@ -6627,6 +6780,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, .argument = STATUS1_FREEZE, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIRE_FANG] = @@ -6642,6 +6797,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, .argument = STATUS1_BURN, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHADOW_SNEAK] = @@ -6656,6 +6813,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MUD_BOMB] = @@ -6670,6 +6829,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCHO_CUT] = @@ -6684,6 +6845,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ZEN_HEADBUTT] = @@ -6698,6 +6861,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIRROR_SHOT] = @@ -6712,6 +6877,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLASH_CANNON] = @@ -6726,6 +6893,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROCK_CLIMB] = @@ -6740,15 +6909,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DEFOG] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_DEFOG, .power = 0, .type = TYPE_FLYING, @@ -6757,7 +6923,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_TRICK_ROOM] = @@ -6772,16 +6941,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -7, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_DRACO_METEOR] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 130, - #else - .power = 140, - #endif .effect = EFFECT_OVERHEAT, + .power = 130, .type = TYPE_DRAGON, .accuracy = 90, .pp = 5, @@ -6790,6 +6957,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DISCHARGE] = @@ -6804,6 +6973,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LAVA_PLUME] = @@ -6818,16 +6989,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LEAF_STORM] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 130, - #else - .power = 140, - #endif .effect = EFFECT_OVERHEAT, + .power = 130, .type = TYPE_GRASS, .accuracy = 90, .pp = 5, @@ -6836,6 +7005,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POWER_WHIP] = @@ -6850,6 +7021,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROCK_WRECKER] = @@ -6864,6 +7037,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CROSS_POISON] = @@ -6878,24 +7053,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GUNK_SHOT] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .accuracy = 80, - #else - .accuracy = 70, - #endif .effect = EFFECT_POISON_HIT, .power = 120, .type = TYPE_POISON, + .accuracy = 80, .pp = 5, .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_IRON_HEAD] = @@ -6910,6 +7085,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAGNET_BOMB] = @@ -6924,6 +7101,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STONE_EDGE] = @@ -6938,6 +7117,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CAPTIVATE] = @@ -6952,15 +7133,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_2, }, [MOVE_STEALTH_ROCK] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_MAGICCOAT_AFFECTED, - #else - .flags = 0, - #endif .effect = EFFECT_STEALTH_ROCK, .power = 0, .type = TYPE_ROCK, @@ -6969,7 +7147,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_OPPONENTS_FIELD, .priority = 0, + .flags = FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_GRASS_KNOT] = @@ -6984,16 +7165,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CHATTER] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 65, - #else - .power = 60, - #endif .effect = EFFECT_CONFUSE_HIT, + .power = 65, .type = TYPE_FLYING, .accuracy = 100, .pp = 20, @@ -7002,11 +7181,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_JUDGMENT] = { - .effect = EFFECT_CHANGE_TYPE_ON_ITEM, + .effect = EFFECT_HIT, .power = 100, .type = TYPE_NORMAL, .accuracy = 100, @@ -7016,7 +7197,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, - .argument = HOLD_EFFECT_PLATE, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BUG_BITE] = @@ -7031,6 +7213,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CHARGE_BEAM] = @@ -7045,6 +7229,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WOOD_HAMMER] = @@ -7059,6 +7245,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AQUA_JET] = @@ -7073,6 +7261,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ATTACK_ORDER] = @@ -7087,6 +7277,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DEFEND_ORDER] = @@ -7101,6 +7293,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_HEAL_ORDER] = @@ -7115,6 +7309,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HEAD_SMASH] = @@ -7129,6 +7325,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOUBLE_HIT] = @@ -7143,6 +7341,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROAR_OF_TIME] = @@ -7157,6 +7357,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPACIAL_REND] = @@ -7171,15 +7373,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LUNAR_DANCE] = { - #if B_UPDATED_MOVE_DATA >= GEN_5 - .flags = FLAG_DANCE | FLAG_SNATCH_AFFECTED, - #else - .flags = FLAG_DANCE, - #endif .effect = EFFECT_HEALING_WISH, .power = 0, .type = TYPE_PSYCHIC, @@ -7188,7 +7387,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, + .flags = FLAG_DANCE | FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CRUSH_GRIP] = @@ -7203,46 +7405,40 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAGMA_STORM] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 100, - .accuracy = 75, - #elif B_UPDATED_MOVE_DATA == GEN_5 - .power = 120, - .accuracy = 75, - #else - .power = 120, - .accuracy = 70, - #endif .effect = EFFECT_TRAP, + .power = 100, .type = TYPE_FIRE, + .accuracy = 75, .pp = 5, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DARK_VOID] = { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .accuracy = 50, - #else - .accuracy = 80, - #endif .effect = EFFECT_SLEEP, .power = 0, .type = TYPE_DARK, + .accuracy = 50, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_BOTH, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_SEED_FLARE] = @@ -7257,6 +7453,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OMINOUS_WIND] = @@ -7271,6 +7469,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHADOW_FORCE] = @@ -7283,8 +7483,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_MINIMIZE, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HONE_CLAWS] = @@ -7299,6 +7501,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_WIDE_GUARD] = @@ -7314,6 +7518,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECTION_MOVE | FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .argument = TRUE, // Protects the whole side. + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_GUARD_SPLIT] = @@ -7328,6 +7534,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_POWER_SPLIT] = @@ -7342,15 +7550,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_WONDER_ROOM] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .priority = 0, - #else - .priority = -7, - #endif .effect = EFFECT_WONDER_ROOM, .power = 0, .type = TYPE_PSYCHIC, @@ -7358,8 +7563,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, + .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_PSYSHOCK] = @@ -7374,6 +7582,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VENOSHOCK] = @@ -7388,11 +7598,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AUTOTOMIZE] = { - .effect = EFFECT_AUTOTOMIZE, + .effect = EFFECT_HIT, .power = 0, .type = TYPE_STEEL, .accuracy = 0, @@ -7402,15 +7614,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_RAGE_POWDER] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .priority = 2, - #else - .priority = 3, - #endif .effect = EFFECT_FOLLOW_ME, .power = 0, .type = TYPE_BUG, @@ -7418,8 +7627,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, + .priority = 2, .flags = FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_TELEKINESIS] = @@ -7434,15 +7646,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_MAGIC_ROOM] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .priority = 0, - #else - .priority = -7, - #endif .effect = EFFECT_MAGIC_ROOM, .power = 0, .type = TYPE_PSYCHIC, @@ -7450,8 +7659,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, + .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_SMACK_DOWN] = @@ -7466,16 +7678,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIT_IN_AIR, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STORM_THROW] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 60, - #else - .power = 40, - #endif .effect = EFFECT_ALWAYS_CRIT, + .power = 60, .type = TYPE_FIGHTING, .accuracy = 100, .pp = 10, @@ -7484,6 +7694,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLAME_BURST] = @@ -7498,6 +7710,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SLUDGE_WAVE] = @@ -7512,6 +7726,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_QUIVER_DANCE] = @@ -7526,6 +7742,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED | FLAG_DANCE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HEAVY_SLAM] = @@ -7538,27 +7756,26 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_MINIMIZE, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SYNCHRONOISE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 120, - .pp = 10, - #else - .power = 70, - .pp = 15, - #endif .effect = EFFECT_SYNCHRONOISE, + .power = 120, .type = TYPE_PSYCHIC, .accuracy = 100, + .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ELECTRO_BALL] = @@ -7573,6 +7790,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SOAK] = @@ -7587,6 +7806,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_FLAME_CHARGE] = @@ -7601,6 +7822,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COIL] = @@ -7615,16 +7838,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_LOW_SWEEP] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 65, - #else - .power = 60, - #endif .effect = EFFECT_SPEED_DOWN_HIT, + .power = 65, .type = TYPE_FIGHTING, .accuracy = 100, .pp = 20, @@ -7633,6 +7854,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ACID_SPRAY] = @@ -7647,6 +7870,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FOUL_PLAY] = @@ -7661,6 +7886,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SIMPLE_BEAM] = @@ -7675,6 +7902,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_ENTRAINMENT] = @@ -7689,6 +7918,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_AFTER_YOU] = @@ -7703,6 +7934,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_ROUND] = @@ -7717,6 +7950,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ECHOED_VOICE] = @@ -7731,6 +7966,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CHIP_AWAY] = @@ -7745,6 +7982,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_STAT_STAGES_IGNORED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CLEAR_SMOG] = @@ -7759,6 +7998,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STORED_POWER] = @@ -7773,6 +8014,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_QUICK_GUARD] = @@ -7788,15 +8031,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECTION_MOVE | FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .argument = TRUE, // Protects the whole side. + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_ALLY_SWITCH] = { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .priority = 2, - #else - .priority = 1, - #endif .effect = EFFECT_ALLY_SWITCH, .power = 0, .type = TYPE_PSYCHIC, @@ -7804,8 +8044,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, + .priority = 1, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_SCALD] = @@ -7820,6 +8063,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHELL_SMASH] = @@ -7834,6 +8079,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HEAL_PULSE] = @@ -7848,16 +8095,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HEX] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 65, - #else - .power = 50, - #endif .effect = EFFECT_HEX, + .power = 65, .type = TYPE_GHOST, .accuracy = 100, .pp = 10, @@ -7866,6 +8111,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SKY_DROP] = @@ -7880,6 +8127,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHIFT_GEAR] = @@ -7894,6 +8143,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_CIRCLE_THROW] = @@ -7908,16 +8159,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -6, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_INCINERATE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 60, - #else - .power = 30, - #endif .effect = EFFECT_INCINERATE, + .power = 60, .type = TYPE_FIRE, .accuracy = 100, .pp = 15, @@ -7926,6 +8175,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_QUASH] = @@ -7940,6 +8191,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_ACROBATICS] = @@ -7954,6 +8207,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_REFLECT_TYPE] = @@ -7968,6 +8223,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_RETALIATE] = @@ -7982,6 +8239,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FINAL_GAMBIT] = @@ -7996,15 +8255,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BESTOW] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .flags = FLAG_MIRROR_MOVE_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #endif .effect = EFFECT_BESTOW, .power = 0, .type = TYPE_NORMAL, @@ -8013,7 +8269,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_INFERNO] = @@ -8028,16 +8287,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WATER_PLEDGE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 80, - #else - .power = 50, - #endif .effect = EFFECT_PLEDGE, + .power = 80, .type = TYPE_WATER, .accuracy = 100, .pp = 10, @@ -8046,16 +8303,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIRE_PLEDGE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 80, - #else - .power = 50, - #endif .effect = EFFECT_PLEDGE, + .power = 80, .type = TYPE_FIRE, .accuracy = 100, .pp = 10, @@ -8064,16 +8319,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GRASS_PLEDGE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 80, - #else - .power = 50, - #endif .effect = EFFECT_PLEDGE, + .power = 80, .type = TYPE_GRASS, .accuracy = 100, .pp = 10, @@ -8082,6 +8335,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VOLT_SWITCH] = @@ -8096,16 +8351,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STRUGGLE_BUG] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 50, - #else - .power = 30, - #endif .effect = EFFECT_SPECIAL_ATTACK_DOWN_HIT, + .power = 50, .type = TYPE_BUG, .accuracy = 100, .pp = 20, @@ -8114,6 +8367,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BULLDOZE] = @@ -8128,16 +8383,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FROST_BREATH] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 60, - #else - .power = 40, - #endif .effect = EFFECT_ALWAYS_CRIT, + .power = 60, .type = TYPE_ICE, .accuracy = 90, .pp = 10, @@ -8146,6 +8399,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_TAIL] = @@ -8160,6 +8415,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -6, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WORK_UP] = @@ -8174,6 +8431,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_ELECTROWEB] = @@ -8188,6 +8447,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WILD_CHARGE] = @@ -8202,6 +8463,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRILL_RUN] = @@ -8216,6 +8479,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DUAL_CHOP] = @@ -8230,6 +8495,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HEART_STAMP] = @@ -8244,6 +8511,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HORN_LEECH] = @@ -8258,24 +8527,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SACRED_SWORD] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .pp = 15, - #else - .pp = 20, - #endif .effect = EFFECT_HIT, .power = 90, .type = TYPE_FIGHTING, .accuracy = 100, + .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_STAT_STAGES_IGNORED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RAZOR_SHELL] = @@ -8290,6 +8559,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HEAT_CRASH] = @@ -8304,6 +8575,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_MINIMIZE, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LEAF_TORNADO] = @@ -8318,6 +8591,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STEAMROLLER] = @@ -8332,6 +8607,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COTTON_GUARD] = @@ -8346,6 +8623,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_NIGHT_DAZE] = @@ -8360,6 +8639,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYSTRIKE] = @@ -8374,6 +8655,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TAIL_SLAP] = @@ -8388,16 +8671,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HURRICANE] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 110, - #else - .power = 120, - #endif .effect = EFFECT_HURRICANE, + .power = 110, .type = TYPE_FLYING, .accuracy = 70, .pp = 10, @@ -8406,6 +8687,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_HIT_IN_AIR, .split = SPLIT_SPECIAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HEAD_CHARGE] = @@ -8420,6 +8703,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GEAR_GRIND] = @@ -8434,6 +8719,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SEARING_SHOT] = @@ -8448,16 +8735,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TECHNO_BLAST] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 - .power = 120, - #else - .power = 85, - #endif - .effect = EFFECT_CHANGE_TYPE_ON_ITEM, + .effect = EFFECT_HIT, + .power = 120, .type = TYPE_NORMAL, .accuracy = 100, .pp = 5, @@ -8466,7 +8751,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, - .argument = HOLD_EFFECT_DRIVE + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RELIC_SONG] = @@ -8481,6 +8767,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SECRET_SWORD] = @@ -8495,6 +8783,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GLACIATE] = @@ -8509,6 +8799,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BOLT_STRIKE] = @@ -8523,6 +8815,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BLUE_FLARE] = @@ -8537,6 +8831,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIERY_DANCE] = @@ -8551,6 +8847,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DANCE | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FREEZE_SHOCK] = @@ -8566,6 +8864,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, .argument = MOVE_EFFECT_PARALYSIS, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICE_BURN] = @@ -8581,6 +8881,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, .argument = MOVE_EFFECT_BURN, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SNARL] = @@ -8595,6 +8897,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICICLE_CRASH] = @@ -8609,6 +8913,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_V_CREATE] = @@ -8623,6 +8929,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 220, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FUSION_FLARE] = @@ -8637,6 +8945,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FUSION_BOLT] = @@ -8651,16 +8961,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLYING_PRESS] = { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .power = 100, - #else - .power = 80, - #endif .effect = EFFECT_TWO_TYPED_MOVE, + .power = 100, .type = TYPE_FIGHTING, .accuracy = 95, .pp = 10, @@ -8670,6 +8978,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_MINIMIZE, .split = SPLIT_PHYSICAL, .argument = TYPE_FLYING, + .zMovePower = 170, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAT_BLOCK] = @@ -8685,6 +8995,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .argument = TRUE, // Protects the whole side. + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_BELCH] = @@ -8699,6 +9011,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROTOTILLER] = @@ -8713,6 +9027,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_STICKY_WEB] = @@ -8727,16 +9043,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_FELL_STINGER] = { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .power = 50, - #else - .power = 30, - #endif .effect = EFFECT_FELL_STINGER, + .power = 50, .type = TYPE_BUG, .accuracy = 100, .pp = 25, @@ -8745,6 +9059,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PHANTOM_FORCE] = @@ -8757,9 +9073,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_MINIMIZE, .split = SPLIT_PHYSICAL, .argument = MOVE_EFFECT_FEINT, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TRICK_OR_TREAT] = @@ -8775,6 +9093,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .argument = TYPE_GHOST, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_NOBLE_ROAR] = @@ -8789,6 +9109,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_ION_DELUGE] = @@ -8803,16 +9125,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_PARABOLIC_CHARGE] = { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .power = 65, - #else - .power = 50, - #endif .effect = EFFECT_ABSORB, + .power = 65, .type = TYPE_ELECTRIC, .accuracy = 100, .pp = 20, @@ -8821,6 +9141,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FORESTS_CURSE] = @@ -8836,6 +9158,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .argument = TYPE_GRASS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_PETAL_BLIZZARD] = @@ -8850,6 +9174,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FREEZE_DRY] = @@ -8864,6 +9190,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DISARMING_VOICE] = @@ -8878,6 +9206,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PARTING_SHOT] = @@ -8892,24 +9222,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESTORE_REPLACEMENT_HP, }, [MOVE_TOPSY_TURVY] = { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .accuracy = 0, - #else - .accuracy = 100, - #endif .effect = EFFECT_TOPSY_TURVY, .power = 0, .type = TYPE_DARK, + .accuracy = 0, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_DRAINING_KISS] = @@ -8923,8 +9253,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - .argument = 75, // restores 75% HP instead of 50% HP + .split = SPLIT_SPECIAL, // restores 75% HP instead of 50% HP + .argument = 75, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CRAFTY_SHIELD] = @@ -8940,6 +9272,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = 0, .split = SPLIT_STATUS, .argument = TRUE, // Protects the whole side. + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_FLOWER_SHIELD] = @@ -8954,6 +9288,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_GRASSY_TERRAIN] = @@ -8968,6 +9304,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_MISTY_TERRAIN] = @@ -8982,6 +9320,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_ELECTRIFY] = @@ -8996,6 +9336,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_PLAY_ROUGH] = @@ -9010,6 +9352,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FAIRY_WIND] = @@ -9024,6 +9368,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MOONBLAST] = @@ -9038,6 +9384,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BOOMBURST] = @@ -9052,6 +9400,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FAIRY_LOCK] = @@ -9066,6 +9416,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_KINGS_SHIELD] = @@ -9080,6 +9432,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 4, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_PLAY_NICE] = @@ -9094,6 +9448,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_CONFIDE] = @@ -9108,15 +9464,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_DIAMOND_STORM] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .effect = EFFECT_DEFENSE_UP2_HIT, - #else - .effect = EFFECT_DEFENSE_UP_HIT, - #endif + .effect = EFFECT_DEFENSE_UP2_HIT, .power = 100, .type = TYPE_ROCK, .accuracy = 95, @@ -9126,6 +9480,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STEAM_ERUPTION] = @@ -9140,6 +9496,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYPERSPACE_HOLE] = @@ -9154,15 +9512,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WATER_SHURIKEN] = { - #if B_WATER_SHURIKEN_SPLIT >= GEN_7 - .split = SPLIT_SPECIAL, - #else - .split = SPLIT_PHYSICAL, - #endif .effect = EFFECT_MULTI_HIT, .power = 15, .type = TYPE_WATER, @@ -9172,16 +9527,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 1, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MYSTICAL_FIRE] = { - #if B_UPDATED_MOVE_DATA >= GEN_7 - .power = 75, - #else - .power = 65, - #endif .effect = EFFECT_SPECIAL_ATTACK_DOWN_HIT, + .power = 75, .type = TYPE_FIRE, .accuracy = 100, .pp = 10, @@ -9190,6 +9544,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPIKY_SHIELD] = @@ -9204,6 +9560,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 4, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_AROMATIC_MIST] = @@ -9218,6 +9576,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_2, }, [MOVE_EERIE_IMPULSE] = @@ -9232,6 +9592,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_VENOM_DRENCH] = @@ -9246,6 +9608,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_POWDER] = @@ -9260,6 +9624,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_2, }, [MOVE_GEOMANCY] = @@ -9274,6 +9640,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_MAGNETIC_FLUX] = @@ -9288,6 +9656,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_HAPPY_HOUR] = @@ -9302,6 +9672,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_ELECTRIC_TERRAIN] = @@ -9316,6 +9688,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_DAZZLING_GLEAM] = @@ -9330,6 +9704,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CELEBRATE] = @@ -9344,6 +9720,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_HOLD_HANDS] = @@ -9358,6 +9736,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_BABY_DOLL_EYES] = @@ -9372,6 +9752,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_NUZZLE] = @@ -9386,6 +9768,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HOLD_BACK] = @@ -9400,6 +9784,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_INFESTATION] = @@ -9414,6 +9800,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POWER_UP_PUNCH] = @@ -9428,6 +9816,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OBLIVION_WING] = @@ -9443,6 +9833,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, .argument = 75, // restores 75% HP instead of 50% HP + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THOUSAND_ARROWS] = @@ -9457,6 +9849,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIT_IN_AIR, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THOUSAND_WAVES] = @@ -9471,6 +9865,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LANDS_WRATH] = @@ -9485,6 +9881,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LIGHT_OF_RUIN] = @@ -9499,6 +9897,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ORIGIN_PULSE] = @@ -9513,6 +9913,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PRECIPICE_BLADES] = @@ -9527,6 +9929,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_ASCENT] = @@ -9541,13 +9945,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYPERSPACE_FURY] = { .effect = EFFECT_PLACEHOLDER, .power = 0, - .type = TYPE_DARK, + .type = TYPE_MYSTERY, .accuracy = 0, .pp = 0, .secondaryEffectChance = 0, @@ -9569,6 +9975,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_FIRST_IMPRESSION] = @@ -9583,6 +9991,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 2, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BANEFUL_BUNKER] = @@ -9597,6 +10007,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 4, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_SPIRIT_SHACKLE] = @@ -9611,6 +10023,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DARKEST_LARIAT] = @@ -9625,6 +10039,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_STAT_STAGES_IGNORED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPARKLING_ARIA] = @@ -9640,6 +10056,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, .argument = STATUS1_BURN, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICE_HAMMER] = @@ -9652,8 +10070,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLORAL_HEALING] = @@ -9668,6 +10088,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HIGH_HORSEPOWER] = @@ -9682,6 +10104,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STRENGTH_SAP] = @@ -9696,6 +10120,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_SOLAR_BLADE] = @@ -9710,6 +10136,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LEAFAGE] = @@ -9724,6 +10152,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPOTLIGHT] = @@ -9738,12 +10168,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 3, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_TOXIC_THREAD] = { .effect = EFFECT_TOXIC_THREAD, - .power = 0, + .power = 20, .type = TYPE_POISON, .accuracy = 100, .pp = 0, @@ -9752,6 +10184,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_LASER_FOCUS] = @@ -9766,6 +10200,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_GEAR_UP] = @@ -9780,6 +10216,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_THROAT_CHOP] = @@ -9792,8 +10230,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POLLEN_PUFF] = @@ -9806,8 +10246,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ANCHOR_SHOT] = @@ -9822,6 +10264,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCHIC_TERRAIN] = @@ -9836,6 +10280,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_LUNGE] = @@ -9850,6 +10296,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIRE_LASH] = @@ -9864,6 +10312,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POWER_TRIP] = @@ -9878,6 +10328,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BURN_UP] = @@ -9892,6 +10344,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPEED_SWAP] = @@ -9906,6 +10360,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SMART_STRIKE] = @@ -9920,6 +10376,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PURIFY] = @@ -9934,6 +10392,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_REVELATION_DANCE] = @@ -9948,6 +10408,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DANCE, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CORE_ENFORCER] = @@ -9962,6 +10424,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TROP_KICK] = @@ -9976,6 +10440,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_INSTRUCT] = @@ -9990,6 +10456,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_BEAK_BLAST] = @@ -10002,8 +10470,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = -3, - .flags = FLAG_PROTECT_AFFECTED | FLAG_BALLISTIC, + .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CLANGING_SCALES] = @@ -10018,6 +10488,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_HAMMER] = @@ -10032,6 +10504,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BRUTAL_SWING] = @@ -10046,6 +10520,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AURORA_VEIL] = @@ -10060,6 +10536,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SHELL_TRAP] = @@ -10074,6 +10552,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -3, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLEUR_CANNON] = @@ -10088,6 +10568,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCHIC_FANGS] = @@ -10100,8 +10582,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_STRONG_JAW_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STOMPING_TANTRUM] = @@ -10116,6 +10600,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHADOW_BONE] = @@ -10130,6 +10616,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ACCELEROCK] = @@ -10144,6 +10632,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LIQUIDATION] = @@ -10158,6 +10648,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PRISMATIC_LASER] = @@ -10172,6 +10664,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPECTRAL_THIEF] = @@ -10186,6 +10680,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SUNSTEEL_STRIKE] = @@ -10200,6 +10696,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_TARGET_ABILITY_IGNORED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MOONGEIST_BEAM] = @@ -10214,6 +10712,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_TARGET_ABILITY_IGNORED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TEARFUL_LOOK] = @@ -10228,6 +10728,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_ZING_ZAP] = @@ -10242,6 +10744,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_NATURES_MADNESS] = @@ -10256,16 +10760,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MULTI_ATTACK] = { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 120, - #else - .power = 90, - #endif - .effect = EFFECT_CHANGE_TYPE_ON_ITEM, + .effect = EFFECT_PLACEHOLDER, + .power = 90, .type = TYPE_NORMAL, .accuracy = 100, .pp = 10, @@ -10274,7 +10776,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, - .argument = HOLD_EFFECT_MEMORY, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIND_BLOWN] = @@ -10289,6 +10792,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PLASMA_FISTS] = @@ -10301,8 +10806,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PHOTON_GEYSER] = @@ -10317,1073 +10824,23 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, - }, - - [MOVE_ZIPPY_ZAP] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 80, - .pp = 10, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .power = 50, - .pp = 15, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif - .effect = EFFECT_ALWAYS_CRIT, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 2, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_SPLISHY_SPLASH] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif - .effect = EFFECT_PARALYZE_HIT, - .power = 90, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .split = SPLIT_SPECIAL, - }, - - [MOVE_FLOATY_FALL] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - #else - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED, - #endif - .effect = EFFECT_FLINCH_HIT, - .power = 90, - .type = TYPE_FLYING, - .accuracy = 95, - .pp = 15, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_PIKA_PAPOW] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif - .effect = EFFECT_RETURN, - .power = 1, - .type = TYPE_ELECTRIC, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .split = SPLIT_SPECIAL, - }, - - [MOVE_BOUNCY_BUBBLE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 60, - .pp = 20, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .argument = 100, // restores 100% HP instead of 50% HP - #else - .power = 90, - .pp = 15, - .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif - .effect = EFFECT_ABSORB, - .type = TYPE_WATER, - .accuracy = 100, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .split = SPLIT_SPECIAL, - }, - - [MOVE_BUZZY_BUZZ] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 60, - .pp = 20, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .power = 90, - .pp = 15, - .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif - .effect = EFFECT_PARALYZE_HIT, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .split = SPLIT_SPECIAL, - }, - - [MOVE_SIZZLY_SLIDE] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 60, - .pp = 20, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .power = 90, - .pp = 15, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif - .effect = EFFECT_BURN_HIT, - .type = TYPE_FIRE, - .accuracy = 100, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_GLITZY_GLOW] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 80, - .accuracy = 95, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .power = 90, - .accuracy = 100, - .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif - .effect = EFFECT_PLACEHOLDER, //TODO (Light Screen + Hit) - .type = TYPE_PSYCHIC, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .split = SPLIT_SPECIAL, - }, - - [MOVE_BADDY_BAD] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 80, - .accuracy = 95, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .power = 90, - .accuracy = 100, - .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif - .effect = EFFECT_PLACEHOLDER, //TODO (Reflect + Hit) - .type = TYPE_DARK, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .split = SPLIT_SPECIAL, - }, - - [MOVE_SAPPY_SEED] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 100, - .accuracy = 90, - .pp = 10, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .power = 90, - .accuracy = 100, - .pp = 15, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif - .effect = EFFECT_PLACEHOLDER, //TODO (Leech Seed + Hit) - .type = TYPE_GRASS, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_FREEZY_FROST] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 100, - .accuracy = 90, - .pp = 10, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .power = 90, - .accuracy = 100, - .pp = 15, - .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif - .effect = EFFECT_PLACEHOLDER, //TODO (Haze + Hit) - .type = TYPE_ICE, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .split = SPLIT_SPECIAL, - }, - - [MOVE_SPARKLY_SWIRL] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .power = 120, - .accuracy = 85, - .pp = 5, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .power = 90, - .accuracy = 100, - .pp = 15, - .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif - .effect = EFFECT_PLACEHOLDER, //TODO (Heal Bell + Hit) - .type = TYPE_FAIRY, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .split = SPLIT_SPECIAL, - }, - - [MOVE_VEEVEE_VOLLEY] = - { - #if B_UPDATED_MOVE_DATA >= GEN_8 - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #else - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - #endif - .effect = EFFECT_RETURN, - .power = 1, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOUBLE_IRON_BASH] = { - .effect = EFFECT_PLACEHOLDER, //TODO (EFFECT_FLINCH_HIT + EFFECT_DOUBLE_HIT) + .effect = EFFECT_FLINCH_HIT, .power = 60, .type = TYPE_STEEL, .accuracy = 100, .pp = 5, .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_DYNAMAX_CANNON] = - { - .effect = EFFECT_HIT, - .power = 100, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_SNIPE_SHOT] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 80, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_JAW_LOCK] = - { - .effect = EFFECT_MEAN_LOOK, - .power = 80, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_STRONG_JAW_BOOST, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_STUFF_CHEEKS] = - { - .effect = EFFECT_DEFENSE_UP_2, - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - .split = SPLIT_STATUS, - }, - - [MOVE_NO_RETREAT] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 0, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - .split = SPLIT_STATUS, - }, - - [MOVE_TAR_SHOT] = - { - .effect = EFFECT_SPEED_DOWN, - .power = 0, - .type = TYPE_ROCK, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - .split = SPLIT_STATUS, - }, - - [MOVE_MAGIC_POWDER] = - { - .effect = EFFECT_THIRD_TYPE, - .power = 0, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, - .split = SPLIT_STATUS, - .argument = TYPE_PSYCHIC, - }, - - [MOVE_DRAGON_DARTS] = - { - .effect = EFFECT_MULTI_HIT, //TODO - .power = 50, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_TEATIME] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = 0, - .split = SPLIT_STATUS, - }, - - [MOVE_OCTOLOCK] = - { - .effect = EFFECT_MEAN_LOOK, - .power = 0, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - .split = SPLIT_STATUS, - }, - - [MOVE_BOLT_BEAK] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 85, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_FISHIOUS_REND] = - { - .effect = EFFECT_PLACEHOLDER, //TODO. same as bolt beak - .power = 85, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_STRONG_JAW_BOOST, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_COURT_CHANGE] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 0, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_MIRROR_MOVE_AFFECTED, - .split = SPLIT_STATUS, - }, - - [MOVE_CLANGOROUS_SOUL] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 0, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED | FLAG_SOUND, - .split = SPLIT_STATUS, - }, - - [MOVE_BODY_PRESS] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 80, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_DECORATE] = - { - .effect = EFFECT_PLACEHOLDER, // TODO .. EFFECT_DECORATE - .power = 0, - .type = TYPE_FAIRY, - .accuracy = 0, - .pp = 15, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = 0, - .split = SPLIT_STATUS, - }, - - [MOVE_DRUM_BEATING] = - { - .effect = EFFECT_SPEED_DOWN_HIT, - .power = 80, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_SNAP_TRAP] = - { - .effect = EFFECT_TRAP, //TODO: add case/effect - .power = 35, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_PYRO_BALL] = - { - .effect = EFFECT_BURN_HIT, - .power = 120, - .type = TYPE_FIRE, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 10, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_BEHEMOTH_BLADE] = - { - .effect = EFFECT_HIT, //TODO: 2x damage if dynamaxed? meh... - .power = 100, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_BEHEMOTH_BASH] = - { - .effect = EFFECT_HIT, //TODO: 2x damage if dynamaxed? meh... - .power = 100, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_AURA_WHEEL] = - { - .effect = EFFECT_SPEED_UP_HIT, - .power = 110, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_BREAKING_SWIPE] = - { - .effect = EFFECT_ATTACK_DOWN_HIT, - .power = 60, - .type = TYPE_DRAGON, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_BRANCH_POKE] = - { - .effect = EFFECT_HIT, - .power = 40, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_OVERDRIVE] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND, - .split = SPLIT_SPECIAL, - }, - - [MOVE_APPLE_ACID] = - { - .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, - .power = 80, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_GRAV_APPLE] = - { - .effect = EFFECT_DEFENSE_DOWN_HIT, - .power = 80, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_SPIRIT_BREAK] = - { - .effect = EFFECT_SPECIAL_ATTACK_DOWN_HIT, - .power = 75, - .type = TYPE_FAIRY, - .accuracy = 100, - .pp = 15, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_STRANGE_STEAM] = - { - .effect = EFFECT_CONFUSE_HIT, - .power = 90, - .type = TYPE_FAIRY, - .accuracy = 95, - .pp = 10, - .secondaryEffectChance = 20, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_LIFE_DEW] = - { - .effect = EFFECT_RESTORE_HP, - .power = 0, - .type = TYPE_WATER, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, - .split = SPLIT_STATUS, - }, - - [MOVE_OBSTRUCT] = - { - .effect = EFFECT_PLACEHOLDER, //TODO. EFFECT_PROTECT? - .power = 0, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 4, - .flags = 0, - .split = SPLIT_STATUS, - }, - - [MOVE_FALSE_SURRENDER] = - { - .effect = EFFECT_HIT, - .power = 80, - .type = TYPE_DARK, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_METEOR_ASSAULT] = - { - .effect = EFFECT_RECHARGE, - .power = 150, - .type = TYPE_FIGHTING, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_ETERNABEAM] = - { - .effect = EFFECT_RECHARGE, - .power = 160, - .type = TYPE_DRAGON, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_STEEL_BEAM] = - { - .effect = EFFECT_RECOIL_50, - .power = 140, - .type = TYPE_STEEL, - .accuracy = 95, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_EXPANDING_FORCE] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 80, - .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_STEEL_ROLLER] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 130, - .type = TYPE_STEEL, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_SCALE_SHOT] = - { - .effect = EFFECT_PLACEHOLDER, //TODO (EFFECT_MULTI_HIT + ABILITY_WEAK_ARMOR, - .power = 25, - .type = TYPE_DRAGON, - .accuracy = 90, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_METEOR_BEAM] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 120, - .type = TYPE_ROCK, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_SHELL_SIDE_ARM] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 90, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_MISTY_EXPLOSION] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 100, - .type = TYPE_FAIRY, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_GRASSY_GLIDE] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 70, - .type = TYPE_GRASS, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_RISING_VOLTAGE] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 70, - .type = TYPE_ELECTRIC, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_TERRAIN_PULSE] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 50, - .type = TYPE_NORMAL, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST, - .split = SPLIT_SPECIAL, - }, - - [MOVE_SKITTER_SMACK] = - { - .effect = EFFECT_SPECIAL_ATTACK_DOWN_HIT, - .power = 70, - .type = TYPE_BUG, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 100, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_BURNING_JEALOUSY] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 70, - .type = TYPE_FIRE, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_BOTH, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_LASH_OUT] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 75, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_POLTERGEIST] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 110, - .type = TYPE_GHOST, - .accuracy = 90, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_CORROSIVE_GAS] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 0, - .type = TYPE_POISON, - .accuracy = 100, - .pp = 40, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_FOES_AND_ALLY, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, - .split = SPLIT_STATUS, - }, - - [MOVE_COACHING] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 0, - .type = TYPE_FIGHTING, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_ALLY, - .priority = 0, - .flags = 0, - .split = SPLIT_STATUS, - }, - - [MOVE_FLIP_TURN] = - { - .effect = EFFECT_HIT_ESCAPE, - .power = 60, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 20, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_TRIPLE_AXEL] = - { - .effect = EFFECT_TRIPLE_KICK, //TODO: Increase damage by 20 instead of 10 - .power = 20, - .type = TYPE_ICE, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_DUAL_WINGBEAT] = - { - .effect = EFFECT_DOUBLE_HIT, - .power = 40, - .type = TYPE_FLYING, - .accuracy = 90, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_SCORCHING_SANDS] = - { - .effect = EFFECT_SCALD, - .power = 70, - .type = TYPE_GROUND, - .accuracy = 100, - .pp = 10, - .secondaryEffectChance = 30, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, - }, - - [MOVE_JUNGLE_HEALING] = - { - .effect = EFFECT_PLACEHOLDER, //TODO - .power = 0, - .type = TYPE_GRASS, - .accuracy = 0, - .pp = 10, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, - .priority = 0, - .split = SPLIT_STATUS, - }, - - [MOVE_WICKED_BLOW] = - { - .effect = EFFECT_ALWAYS_CRIT, - .power = 80, - .type = TYPE_DARK, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, - .split = SPLIT_PHYSICAL, - }, - - [MOVE_SURGING_STRIKES] = - { - .effect = EFFECT_PLACEHOLDER, //TODO (Multi hit + Always Crit) - .power = 25, - .type = TYPE_WATER, - .accuracy = 100, - .pp = 5, - .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, }; diff --git a/src/data/text/move_names.h b/src/data/text/move_names.h index 1eaf3137d..1e3a4222e 100644 --- a/src/data/text/move_names.h +++ b/src/data/text/move_names.h @@ -749,3 +749,78 @@ const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1] = [MOVE_WICKED_BLOW] = _("Wicked Blow"), [MOVE_SURGING_STRIKES] = _("SurgeStrikes"), }; + +static const u8 sText_Breakneck_Blitz[] = _("Breakneck Blitz"); +static const u8 sText_All_Out_Pummeling[] = _("All Out Pummeling"); +static const u8 sText_Supersonic_Skystrike[] = _("Supersonic Skystrike"); +static const u8 sText_Acid_Downpour[] = _("Acid Downpour"); +static const u8 sText_Tectonic_Rage[] = _("Tectonic Rage"); +static const u8 sText_Continental_Crush[] = _("Continental Crush"); +static const u8 sText_Savage_Spin_Out[] = _("Savage Spin Out"); +static const u8 sText_Never_Ending_Nightmare[] = _("Never Ending Nightmare"); +static const u8 sText_Corkscrew_Crash[] = _("Corkscrew Crash"); +static const u8 sText_Inferno_Overdrive[] = _("Inferno Overdrive"); +static const u8 sText_Hydro_Vortex[] = _("Hydro Vortex"); +static const u8 sText_Bloom_Doom[] = _("Bloom Doom"); +static const u8 sText_Gigavolt_Havoc[] = _("Gigavolt Havoc"); +static const u8 sText_Shattered_Psyche[] = _("Shattered Psyche"); +static const u8 sText_Subzero_Slammer[] = _("Subzero Slammer"); +static const u8 sText_Devastating_Drake[] = _("Devastating Drake"); +static const u8 sText_Black_Hole_Eclipse[] = _("Black Hole Eclipse"); +static const u8 sText_Twinkle_Tackle[] = _("Twinkle Tackle"); +static const u8 sText_Catastropika[] = _("Catastropika"); +static const u8 sText_10000000_Volt_Thunderbolt[] = _("10000000 Volt Thunderbolt"); +static const u8 sText_Stoked_Sparksurfer[] = _("Stoked Sparksurfer"); +static const u8 sText_Extreme_Evoboost[] = _("Extreme Evoboost"); +static const u8 sText_Pulverizing_Pancake[] = _("Pulverizing Pancake"); +static const u8 sText_Genesis_Supernova[] = _("Genesis Supernova"); +static const u8 sText_Sinister_Arrow_Raid[] = _("Sinister Arrow Raid"); +static const u8 sText_Malicious_Moonsault[] = _("Malicious Moonsault"); +static const u8 sText_Oceanic_Operetta[] = _("Oceanic Operetta"); +static const u8 sText_Splintered_Stormshards[] = _("Splintered Stormshards"); +static const u8 sText_Lets_Snuggle_Forever[] = _("Lets Snuggle Forever"); +static const u8 sText_Clangorous_Soulblaze[] = _("Clangorous Soulblaze"); +static const u8 sText_Guardian_Of_Alola[] = _("Guardian Of Alola"); +static const u8 sText_Searing_Sunraze_Smash[] = _("Searing Sunraze Smash"); +static const u8 sText_Menacing_Moonraze_Maelstrom[] = _("Menacing Moonraze Maelstrom"); +static const u8 sText_Light_That_Burns_The_Sky[] = _("Light That Burns The Sky"); +static const u8 sText_Soul_Stealing_7_Star_Strike[] = _("Soul Stealing 7 Star Strike"); + +const u8 *const gZMoveNames[] = +{ + [MOVE_BREAKNECK_BLITZ - MOVE_BREAKNECK_BLITZ] = sText_Breakneck_Blitz, + [MOVE_ALL_OUT_PUMMELING - MOVE_BREAKNECK_BLITZ] = sText_All_Out_Pummeling, + [MOVE_SUPERSONIC_SKYSTRIKE - MOVE_BREAKNECK_BLITZ] = sText_Supersonic_Skystrike, + [MOVE_ACID_DOWNPOUR - MOVE_BREAKNECK_BLITZ] = sText_Acid_Downpour, + [MOVE_TECTONIC_RAGE - MOVE_BREAKNECK_BLITZ] = sText_Tectonic_Rage, + [MOVE_CONTINENTAL_CRUSH - MOVE_BREAKNECK_BLITZ] = sText_Continental_Crush, + [MOVE_SAVAGE_SPIN_OUT - MOVE_BREAKNECK_BLITZ] = sText_Savage_Spin_Out, + [MOVE_NEVER_ENDING_NIGHTMARE - MOVE_BREAKNECK_BLITZ] = sText_Never_Ending_Nightmare, + [MOVE_CORKSCREW_CRASH - MOVE_BREAKNECK_BLITZ] = sText_Corkscrew_Crash, + [MOVE_INFERNO_OVERDRIVE - MOVE_BREAKNECK_BLITZ] = sText_Inferno_Overdrive, + [MOVE_HYDRO_VORTEX - MOVE_BREAKNECK_BLITZ] = sText_Hydro_Vortex, + [MOVE_BLOOM_DOOM - MOVE_BREAKNECK_BLITZ] = sText_Bloom_Doom, + [MOVE_GIGAVOLT_HAVOC - MOVE_BREAKNECK_BLITZ] = sText_Gigavolt_Havoc, + [MOVE_SHATTERED_PSYCHE - MOVE_BREAKNECK_BLITZ] = sText_Shattered_Psyche, + [MOVE_SUBZERO_SLAMMER - MOVE_BREAKNECK_BLITZ] = sText_Subzero_Slammer, + [MOVE_DEVASTATING_DRAKE - MOVE_BREAKNECK_BLITZ] = sText_Devastating_Drake, + [MOVE_BLACK_HOLE_ECLIPSE - MOVE_BREAKNECK_BLITZ] = sText_Black_Hole_Eclipse, + [MOVE_TWINKLE_TACKLE - MOVE_BREAKNECK_BLITZ] = sText_Twinkle_Tackle, + [MOVE_CATASTROPIKA - MOVE_BREAKNECK_BLITZ] = sText_Catastropika, + [MOVE_10000000_VOLT_THUNDERBOLT - MOVE_BREAKNECK_BLITZ] = sText_10000000_Volt_Thunderbolt, + [MOVE_STOKED_SPARKSURFER - MOVE_BREAKNECK_BLITZ] = sText_Stoked_Sparksurfer, + [MOVE_EXTREME_EVOBOOST - MOVE_BREAKNECK_BLITZ] = sText_Extreme_Evoboost, + [MOVE_PULVERIZING_PANCAKE - MOVE_BREAKNECK_BLITZ] = sText_Pulverizing_Pancake, + [MOVE_GENESIS_SUPERNOVA - MOVE_BREAKNECK_BLITZ] = sText_Genesis_Supernova, + [MOVE_SINISTER_ARROW_RAID - MOVE_BREAKNECK_BLITZ] = sText_Sinister_Arrow_Raid, + [MOVE_MALICIOUS_MOONSAULT - MOVE_BREAKNECK_BLITZ] = sText_Malicious_Moonsault, + [MOVE_OCEANIC_OPERETTA - MOVE_BREAKNECK_BLITZ] = sText_Oceanic_Operetta, + [MOVE_SPLINTERED_STORMSHARDS - MOVE_BREAKNECK_BLITZ] = sText_Splintered_Stormshards, + [MOVE_LETS_SNUGGLE_FOREVER - MOVE_BREAKNECK_BLITZ] = sText_Lets_Snuggle_Forever, + [MOVE_CLANGOROUS_SOULBLAZE - MOVE_BREAKNECK_BLITZ] = sText_Clangorous_Soulblaze, + [MOVE_GUARDIAN_OF_ALOLA - MOVE_BREAKNECK_BLITZ] = sText_Guardian_Of_Alola, + [MOVE_SEARING_SUNRAZE_SMASH - MOVE_BREAKNECK_BLITZ] = sText_Searing_Sunraze_Smash, + [MOVE_MENACING_MOONRAZE_MAELSTROM - MOVE_BREAKNECK_BLITZ] = sText_Menacing_Moonraze_Maelstrom, + [MOVE_LIGHT_THAT_BURNS_THE_SKY - MOVE_BREAKNECK_BLITZ] = sText_Light_That_Burns_The_Sky, + [MOVE_SOUL_STEALING_7_STAR_STRIKE - MOVE_BREAKNECK_BLITZ] = sText_Soul_Stealing_7_Star_Strike, +}; diff --git a/src/graphics.c b/src/graphics.c index c7eff5237..ad7e11d82 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -281,8 +281,8 @@ const u32 gBattleAnimSpritePal_NewHandsAndFeet[] = INCBIN_U32("graphics/battle_a const u32 gBattleAnimSpriteGfx_Tornado[] = INCBIN_U32("graphics/battle_anims/sprites/new/tornado.4bpp.lz"); const u32 gBattleAnimSpritePal_Tornado[] = INCBIN_U32("graphics/battle_anims/sprites/new/tornado.gbapal.lz"); -const u32 gBattleAnimSpriteGfx_ZMoveSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/new/z_move_symbol.4bpp.lz"); -const u32 gBattleAnimSpritePal_ZMoveSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/new/z_move_symbol.gbapal.lz"); +const u32 gBattleAnimSpriteGfx_ZMoveSymbol[] = INCBIN_U8("graphics/battle_anims/sprites/new/z_move_symbol.4bpp.lz"); +const u32 gBattleAnimSpritePal_ZMoveSymbol[] = INCBIN_U16("graphics/battle_anims/sprites/new/z_move_symbol.gbapal.lz"); // Battle anims diff --git a/src/pokemon.c b/src/pokemon.c index 62dec3253..5f781faff 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -9,6 +9,7 @@ #include "battle_pyramid.h" #include "battle_setup.h" #include "battle_tower.h" +#include "battle_z_move.h" #include "data.h" #include "event_data.h" #include "evolution_scene.h" From 4060b09bd656ff2a6f31ec1b996a5196b3a5421d Mon Sep 17 00:00:00 2001 From: Evan Date: Fri, 27 Nov 2020 17:06:36 -0500 Subject: [PATCH 002/208] expand top left move window. add z move init anim --- asm/macros/battle_script.inc | 4 + data/battle_anim_scripts.s | 113 ++++++++++++++++++++- data/battle_scripts_1.s | 15 +++ include/battle.h | 6 +- include/constants/battle_anim.h | 1 + include/constants/battle_script_commands.h | 1 + include/constants/battle_string_ids.h | 4 +- src/battle_anim_new.c | 41 ++++++++ src/battle_bg.c | 8 +- src/battle_controller_player.c | 10 +- src/battle_message.c | 4 + src/battle_z_move.c | 3 +- 12 files changed, 193 insertions(+), 17 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 41a51efeb..42aa49173 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1756,6 +1756,10 @@ .4byte \ptr .endm + .macro setzeffect + various BS_ATTACKER, VARIOUS_SET_Z_EFFECT + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 70ed22c9e..281e88dda 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -767,7 +767,44 @@ gBattleAnims_Moves:: .4byte Move_JUNGLE_HEALING .4byte Move_WICKED_BLOW .4byte Move_SURGING_STRIKES - .4byte Move_COUNT @ cannot be reached, because last move is Surging Strikes +@@@@ Z MOVES + .4byte Move_BREAKNECK_BLITZ + .4byte Move_ALL_OUT_PUMMELING + .4byte Move_SUPERSONIC_SKYSTRIKE + .4byte Move_ACID_DOWNPOUR + .4byte Move_TECTONIC_RAGE + .4byte Move_CONTINENTAL_CRUSH + .4byte Move_SAVAGE_SPIN_OUT + .4byte Move_NEVER_ENDING_NIGHTMARE + .4byte Move_CORKSCREW_CRASH + .4byte Move_INFERNO_OVERDRIVE + .4byte Move_HYDRO_VORTEX + .4byte Move_BLOOM_DOOM + .4byte Move_GIGAVOLT_HAVOC + .4byte Move_SHATTERED_PSYCHE + .4byte Move_SUBZERO_SLAMMER + .4byte Move_DEVASTATING_DRAKE + .4byte Move_BLACK_HOLE_ECLIPSE + .4byte Move_TWINKLE_TACKLE + .4byte Move_CATASTROPIKA + .4byte Move_10000000_VOLT_THUNDERBOLT + .4byte Move_STOKED_SPARKSURFER + .4byte Move_EXTREME_EVOBOOST + .4byte Move_PULVERIZING_PANCAKE + .4byte Move_GENESIS_SUPERNOVA + .4byte Move_SINISTER_ARROW_RAID + .4byte Move_MALICIOUS_MOONSAULT + .4byte Move_OCEANIC_OPERETTA + .4byte Move_SPLINTERED_STORMSHARDS + .4byte Move_LETS_SNUGGLE_FOREVER + .4byte Move_CLANGOROUS_SOULBLAZE + .4byte Move_GUARDIAN_OF_ALOLA + .4byte Move_SEARING_SUNRAZE_SMASH + .4byte Move_MENACING_MOONRAZE_MAELSTROM + .4byte Move_LIGHT_THAT_BURNS_THE_SKY + .4byte Move_SOUL_STEALING_7_STAR_STRIKE +@@@ Last Move - cannot be reached + .4byte Move_COUNT .align 2 gBattleAnims_StatusConditions:: @@ -815,6 +852,7 @@ gBattleAnims_General:: .4byte General_IllusionOff .4byte General_FormChange .4byte General_SlideOffScreen + .4byte General_ZMoveActivate .align 2 gBattleAnims_Special:: @@ -24320,6 +24358,41 @@ General_TerrainElectric: General_TerrainPsychic: end +General_ZMoveActivate: + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_Z_MOVE_SYMBOL @Z-Move Symbol + loadspritegfx ANIM_TAG_WHIP_HIT @green color + loadspritegfx ANIM_TAG_SWEAT_BEAD @blue color + loadspritegfx ANIM_TAG_PAW_PRINT @yellow color + monbg ANIM_ATTACKER + setblends 0x80c + fadetobg BG_ZMOVE_ACTIVATE + waitbgfadein + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0x0 0x0 0xFFFF + playsewithpan SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendColorCycle, 0x2, 0x6, ANIM_PAL_ATK, 0x0, 0x6, 0x0, 0xb, 0x76BC + call ZMoveBuffEffect + call ZMoveBuffEffect + call ZMoveBuffEffect + launchtemplate gZMoveSymbolSpriteTemplate 0x29 0x4 0x0 0x0 0x0 0x0 + call ZMoveBuffEffect + call ZMoveBuffEffect + waitforvisualfinish + call UnsetPsychicBg + blendoff + clearmonbg ANIM_ATTACKER + end +ZMoveBuffEffect: + launchtemplate gBlueZMoveEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x3 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 @Red Buff + delay 0x3 + launchtemplate gGreenZMoveEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x3 + launchtemplate gYellowZMoveEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x3 + return + SnatchMoveTrySwapFromSubstitute: createvisualtask AnimTask_IsAttackerBehindSubstitute, 2 jumprettrue SnatchMoveSwapSubstituteForMon @@ -24413,3 +24486,41 @@ Special_CriticalCaptureBallThrow: jumpreteq -1, BallThrowTrainerBlock goto BallThrowEnd +@@@@@@@@@@ Z MOVES @@@@@@@@@@ +Move_BREAKNECK_BLITZ:: +Move_ALL_OUT_PUMMELING: +Move_SUPERSONIC_SKYSTRIKE: +Move_ACID_DOWNPOUR: +Move_TECTONIC_RAGE: +Move_CONTINENTAL_CRUSH:: +Move_SAVAGE_SPIN_OUT:: +Move_NEVER_ENDING_NIGHTMARE:: +Move_CORKSCREW_CRASH:: +Move_INFERNO_OVERDRIVE:: +Move_HYDRO_VORTEX:: +Move_BLOOM_DOOM:: +Move_GIGAVOLT_HAVOC:: +Move_SHATTERED_PSYCHE:: +Move_SUBZERO_SLAMMER:: +Move_DEVASTATING_DRAKE:: +Move_BLACK_HOLE_ECLIPSE:: +Move_TWINKLE_TACKLE:: +Move_CATASTROPIKA:: +Move_10000000_VOLT_THUNDERBOLT:: +Move_STOKED_SPARKSURFER:: +Move_EXTREME_EVOBOOST:: +Move_PULVERIZING_PANCAKE:: +Move_GENESIS_SUPERNOVA:: +Move_SINISTER_ARROW_RAID:: +Move_MALICIOUS_MOONSAULT:: +Move_OCEANIC_OPERETTA:: +Move_SPLINTERED_STORMSHARDS:: +Move_LETS_SNUGGLE_FOREVER:: +Move_CLANGOROUS_SOULBLAZE:: +Move_GUARDIAN_OF_ALOLA:: +Move_SEARING_SUNRAZE_SMASH:: +Move_MENACING_MOONRAZE_MAELSTROM:: +Move_LIGHT_THAT_BURNS_THE_SKY:: +Move_SOUL_STEALING_7_STAR_STRIKE:: + goto Move_TACKLE + diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index f99f0089b..b595ca5d1 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7686,3 +7686,18 @@ BattleScript_PrintPlayerForfeitedLinkBattle:: atk57 waitmessage 0x40 end2 + +BattleScript_ZMoveActivateStatus:: + printstring STRINGID_ZPOWERSURROUNDS + playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL + setzeffect + printstring STRINGID_ZMOVEUNLEASHED + waitmessage 0x40 + return + +BattleScript_ZMoveActivateDamaging:: + printstring STRINGID_ZPOWERSURROUNDS + playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL + printstring STRINGID_ZMOVEUNLEASHED + waitmessage 0x40 + return diff --git a/include/battle.h b/include/battle.h index 0e484746e..06b2a942c 100644 --- a/include/battle.h +++ b/include/battle.h @@ -429,10 +429,10 @@ struct Illusion struct ZMoveData { - /*0x00*/ u8 battlerId; - /*0x01*/ u8 viable:1; // current move can become a z move - u8 viewingZMove:1; //if player is viewing the z move name instead of regular moves + /*0x00*/ u8 viable:1; // current move can become a z move + u8 viewing:1; //if player is viewing the z move name instead of regular moves u8 split:2; + u8 active:1; //is z move being used this turn u8 zUnused:4; /*0x02*/ u16 currZMove; //z move of cursor / selected z move /*0x04*/ u16 baseMove; //move turned into z move diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 871aa1e35..4d4e8f745 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -525,6 +525,7 @@ #define B_ANIM_ILLUSION_OFF 0x1C #define B_ANIM_FORM_CHANGE 0x1D #define B_ANIM_SLIDE_OFFSCREEN 0x1E // for Emergency Exit +#define B_ANIM_ZMOVE_ACTIVATE 0x1F // special animations table #define B_ANIM_LVL_UP 0x0 diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index b081907ec..8df5a0518 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -165,6 +165,7 @@ #define VARIOUS_SET_LAST_USED_ITEM 99 #define VARIOUS_PARALYZE_TYPE_IMMUNITY 100 #define VARIOUS_JUMP_IF_ABSENT 101 +#define VARIOUS_SET_Z_EFFECT 102 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 3c6d74b48..12b193f2d 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -551,7 +551,9 @@ #define STRINGID_CLOAKEDINAFREEZINGLIGHT 547 #define STRINGID_STATWASNOTLOWERED 548 #define STRINGID_FERVENTWISHREACHED 549 +#define STRINGID_ZPOWERSURROUNDS 550 +#define STRINGID_ZMOVEUNLEASHED 551 -#define BATTLESTRINGS_COUNT 550 +#define BATTLESTRINGS_COUNT 552 #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 9d1b48453..741eeb295 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -4050,6 +4050,47 @@ const struct SpriteTemplate gSteelBeamSpikeShardTemplate = }; //// Z MOVES +//activate +const struct SpriteTemplate gZMoveSymbolSpriteTemplate = +{ + .tileTag = ANIM_TAG_Z_MOVE_SYMBOL, + .paletteTag = ANIM_TAG_Z_MOVE_SYMBOL, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_LusterPurgeCircle, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gBlueZMoveEnergySpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_SWEAT_BEAD, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy, +}; +const struct SpriteTemplate gGreenZMoveEnergySpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_WHIP_HIT, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy, +}; +const struct SpriteTemplate gYellowZMoveEnergySpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_PAW_PRINT, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy, +}; /* // breakneck blitz const struct SpriteTemplate gBreakneckBlitzDanceSpriteTemplate = diff --git a/src/battle_bg.c b/src/battle_bg.c index d9d6bf87c..d64dd1a0b 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -192,7 +192,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] = .bg = 0, .tilemapLeft = 2, .tilemapTop = 55, - .width = 8, + .width = 12, //for z move names .height = 2, .paletteNum = 5, .baseBlock = 0x0300, @@ -204,7 +204,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] = .width = 8, .height = 2, .paletteNum = 5, - .baseBlock = 0x0310, + .baseBlock = 0x0318, }, { // 5 Bottom left move .bg = 0, @@ -213,7 +213,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] = .width = 8, .height = 2, .paletteNum = 5, - .baseBlock = 0x0320, + .baseBlock = 0x0328, }, { // 6 Bottom right move .bg = 0, @@ -222,7 +222,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] = .width = 8, .height = 2, .paletteNum = 5, - .baseBlock = 0x0330, + .baseBlock = 0x0338, }, { .bg = 0, diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index fb1f844a7..d69d1a948 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -630,7 +630,7 @@ static void HandleInputChooseMove(void) else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59) { PlaySE(SE_SELECT); - if (gBattleStruct->zmove.viewingZMove) + if (gBattleStruct->zmove.viewing) { ReloadMoveNames(); } @@ -697,7 +697,7 @@ static void HandleInputChooseMove(void) TryChangeZIndicator(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); } } - else if (JOY_NEW(SELECT_BUTTON)) + else if (JOY_NEW(SELECT_BUTTON) && !gBattleStruct->zmove.viewing) { if (gNumberOfMovesToChoose > 1 && !(gBattleTypeFlags & BATTLE_TYPE_LINK)) { @@ -725,10 +725,8 @@ static void HandleInputChooseMove(void) { // show z move name / info //TODO: brighten z move symbol - //ChangeMegaTriggerSprite(gBattleStruct->zmove.triggerSpriteId, gBattleStruct->zmove.viable); PlaySE(SE_SELECT); - - if (!gBattleStruct->zmove.viewingZMove) + if (!gBattleStruct->zmove.viewing) MoveSelectionDisplayZMove(gBattleStruct->zmove.currZMove); else ReloadMoveNames(); @@ -739,7 +737,7 @@ static void HandleInputChooseMove(void) static void ReloadMoveNames(void) { gBattleStruct->mega.playerSelect = FALSE; - gBattleStruct->zmove.viewingZMove = FALSE; + gBattleStruct->zmove.viewing = FALSE; MoveSelectionDestroyCursorAt(0); MoveSelectionDisplayMoveNames(); MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); diff --git a/src/battle_message.c b/src/battle_message.c index 04a939ad6..b8503e67a 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -677,6 +677,8 @@ static const u8 sText_NoOneWillBeAbleToRun[] = _("No one will be able to run awa static const u8 sText_DestinyKnotActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} fell in love\nfrom the {B_LAST_ITEM}!"); static const u8 sText_CloakedInAFreezingLight[] = _("{B_ATK_NAME_WITH_PREFIX} became cloaked\nin a freezing light!"); static const u8 sText_StatWasNotLowered[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\nwas not lowered!"); +static const u8 sText_ZPowerSurrounds[] = _("{B_ATK_NAME_WITH_PREFIX} surrounds\nitself with its Z-Power!"); +static const u8 sText_ZPowerUnleashed[] = _("{B_ATK_NAME_WITH_PREFIX} unleashes\nits full-force Z-Move!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { @@ -1218,6 +1220,8 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_GRASSYTERRAINHEALS - 12] = sText_GrassyTerrainHeals, [STRINGID_ELECTRICTERRAINPREVENTS - 12] = sText_ElectricTerrainPreventsSleep, [STRINGID_PSYCHICTERRAINPREVENTS - 12] = sText_PsychicTerrainPreventsPriority, + [STRINGID_ZPOWERSURROUNDS - 12] = sText_ZPowerSurrounds, + [STRINGID_ZMOVEUNLEASHED - 12] = sText_ZPowerUnleashed, }; const u16 gTerrainStringIds[] = diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 446a1d790..b250a06be 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -316,7 +316,6 @@ bool32 IsZMoveTriggerSpriteActive(void) void HideZMoveTriggerSprite(void) { struct Sprite *sprite = &gSprites[gBattleStruct->zmove.triggerSpriteId]; - ChangeMegaTriggerSprite(gBattleStruct->zmove.triggerSpriteId, 0); sprite->tHide = TRUE; gBattleStruct->zmove.viable = FALSE; } @@ -375,7 +374,7 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) u16 move = moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]; PlaySE(SE_SELECT); - gBattleStruct->zmove.viewingZMove = TRUE; + gBattleStruct->zmove.viewing = TRUE; if (zmove != MOVE_NONE) { // clear move slots From 2b1dfe73cf68835ca338bc03704c7f569000c28a Mon Sep 17 00:00:00 2001 From: Evan Date: Fri, 27 Nov 2020 23:38:29 -0500 Subject: [PATCH 003/208] z move unleash anim, fix active/used flags --- include/battle.h | 1 + include/battle_scripts.h | 2 ++ src/battle_anim_new.c | 2 +- src/battle_controller_player.c | 12 ++++++++++-- src/battle_script_commands.c | 1 + src/battle_util.c | 26 +++++++++++++++++++++++++- src/battle_z_move.c | 3 +++ src/graphics.c | 4 ++-- 8 files changed, 45 insertions(+), 6 deletions(-) diff --git a/include/battle.h b/include/battle.h index 06b2a942c..27a795f5b 100644 --- a/include/battle.h +++ b/include/battle.h @@ -437,6 +437,7 @@ struct ZMoveData /*0x02*/ u16 currZMove; //z move of cursor / selected z move /*0x04*/ u16 baseMove; //move turned into z move /*0x06*/ u8 triggerSpriteId; + u8 used[MAX_BATTLERS_COUNT]; //one per bank for multi-battles }; /* size = 8 */ struct BattleStruct diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 84a7ba2ef..bc1e84128 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -349,5 +349,7 @@ extern const u8 BattleScript_EmergencyExitNoPopUp[]; extern const u8 BattleScript_EmergencyExitWild[]; extern const u8 BattleScript_EmergencyExitWildNoPopUp[]; extern const u8 BattleScript_CheekPouchActivates[]; +extern const u8 BattleScript_ZMoveActivateStatus[]; +extern const u8 BattleScript_ZMoveActivateDamaging[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 741eeb295..041c37529 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -4055,7 +4055,7 @@ const struct SpriteTemplate gZMoveSymbolSpriteTemplate = { .tileTag = ANIM_TAG_Z_MOVE_SYMBOL, .paletteTag = ANIM_TAG_Z_MOVE_SYMBOL, - .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gAffineAnims_LusterPurgeCircle, diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index d69d1a948..3625fcefc 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -541,7 +541,7 @@ static void HandleInputChooseMove(void) u8 moveTarget; u32 canSelectTarget = 0; struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]); - + if (gMain.heldKeys & DPAD_ANY && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A) gPlayerDpadHoldFrames++; else @@ -561,7 +561,15 @@ static void HandleInputChooseMove(void) { moveTarget = gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].target; } - + + if (gBattleStruct->zmove.viewing) + { + gBattleStruct->zmove.active = TRUE; + gBattleStruct->zmove.viewing = FALSE; + if (gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].split != SPLIT_STATUS) + moveTarget = MOVE_TARGET_SELECTED; //damaging z moves always have selected target + } + if (moveTarget & MOVE_TARGET_USER) gMultiUsePlayerCursor = gActiveBattler; else diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d0811e77d..7e975c3c5 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5092,6 +5092,7 @@ static void Cmd_moveend(void) gSpecialStatuses[gBattlerAttacker].damagedMons = 0; gSpecialStatuses[gBattlerTarget].berryReduced = 0; gBattleScripting.moveEffect = 0; + gBattleStruct->zmove.active = FALSE; gBattleScripting.moveendState++; break; case MOVEEND_COUNT: diff --git a/src/battle_util.c b/src/battle_util.c index c1ec01ef0..a01575946 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2067,7 +2067,7 @@ u8 DoFieldEndTurnEffects(void) break; } } while (effect == 0); - + return (gBattleMainFunc != BattleTurnPassed); } @@ -2843,6 +2843,7 @@ enum CANCELLER_POWDER_MOVE, CANCELLER_POWDER_STATUS, CANCELLER_THROAT_CHOP, + CANCELLER_Z_MOVES, CANCELLER_END, CANCELLER_PSYCHIC_TERRAIN, CANCELLER_END2, @@ -3179,6 +3180,29 @@ u8 AtkCanceller_UnableToUseMove(void) } gBattleStruct->atkCancellerTracker++; break; + case CANCELLER_Z_MOVES: + if (gBattleStruct->zmove.active == TRUE) + { + RecordItemEffectBattle(gBattlerAttacker, HOLD_EFFECT_Z_CRYSTAL); + gBattleStruct->zmove.used[gBattlerAttacker] = TRUE; + //TODO - partner battles. + gBattleScripting.battler = gBattlerAttacker; + if (gBattleMoves[gCurrentMove].split == SPLIT_STATUS) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ZMoveActivateStatus; + //gBattleStruct->zmove.effect = gBattleMoves[gCurrentMove].z_move_effect; + //gBattleStruct->zmove.effectApplied = TRUE; + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ZMoveActivateDamaging; + } + effect = 1; + } + gBattleStruct->atkCancellerTracker++; + break; case CANCELLER_END: break; } diff --git a/src/battle_z_move.c b/src/battle_z_move.c index b250a06be..116c2c791 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -140,6 +140,9 @@ bool32 IsViableZMove(u8 battlerId, u16 move) gBattleStruct->zmove.currZMove = MOVE_NONE; //init + if (gBattleStruct->zmove.used[battlerId]) + return FALSE; + // Gets mon data. if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT) mon = &gEnemyParty[gBattlerPartyIndexes[battlerId]]; diff --git a/src/graphics.c b/src/graphics.c index ad7e11d82..c7eff5237 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -281,8 +281,8 @@ const u32 gBattleAnimSpritePal_NewHandsAndFeet[] = INCBIN_U32("graphics/battle_a const u32 gBattleAnimSpriteGfx_Tornado[] = INCBIN_U32("graphics/battle_anims/sprites/new/tornado.4bpp.lz"); const u32 gBattleAnimSpritePal_Tornado[] = INCBIN_U32("graphics/battle_anims/sprites/new/tornado.gbapal.lz"); -const u32 gBattleAnimSpriteGfx_ZMoveSymbol[] = INCBIN_U8("graphics/battle_anims/sprites/new/z_move_symbol.4bpp.lz"); -const u32 gBattleAnimSpritePal_ZMoveSymbol[] = INCBIN_U16("graphics/battle_anims/sprites/new/z_move_symbol.gbapal.lz"); +const u32 gBattleAnimSpriteGfx_ZMoveSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/new/z_move_symbol.4bpp.lz"); +const u32 gBattleAnimSpritePal_ZMoveSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/new/z_move_symbol.gbapal.lz"); // Battle anims From f114534ae3f55a20ccc11ba5e1896834914986b7 Mon Sep 17 00:00:00 2001 From: Evan Date: Sat, 28 Nov 2020 13:09:43 -0500 Subject: [PATCH 004/208] z move anim/effect, black hole eclipse anim --- data/battle_anim_scripts.s | 144 +++++++++ data/battle_scripts_1.s | 10 +- include/battle_anim.h | 3 + include/battle_message.h | 2 +- include/battle_scripts.h | 3 +- include/battle_z_move.h | 1 + include/constants/moves.h | 2 +- src/battle_anim_fire.c | 7 +- src/battle_anim_new.c | 217 ++++++++++++- src/battle_anim_status_effects.c | 4 +- src/battle_controller_player.c | 8 +- src/battle_gfx_sfx_util.c | 2 +- src/battle_message.c | 13 +- src/battle_script_commands.c | 9 +- src/battle_util.c | 24 +- src/battle_z_move.c | 3 +- src/data/battle_moves.h | 529 ++++++++++++++++++++++++++++++- 17 files changed, 928 insertions(+), 53 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 281e88dda..8654f5bed 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -24503,7 +24503,151 @@ Move_GIGAVOLT_HAVOC:: Move_SHATTERED_PSYCHE:: Move_SUBZERO_SLAMMER:: Move_DEVASTATING_DRAKE:: + goto Move_TACKLE + Move_BLACK_HOLE_ECLIPSE:: + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @shock wave + loadspritegfx ANIM_TAG_SHADOW_BALL @shadow ball + loadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_ICE_CHUNK @blue + loadspritegfx ANIM_TAG_BLACK_BALL_2 @black + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call EndureEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x0000 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call EndureEffect + delay 0x8 + call EndureEffect + waitforvisualfinish + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseShockwaveSpriteTemplate 0x2 0x0 + waitforvisualfinish + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_HANDS_AND_FEET @black + playsewithpan SE_M_NIGHTMARE, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseHoleUserSpriteTemplate 0x2 0x4 0x0 0x0 ANIM_ATTACKER 0x0 + launchtemplate gBlackHoleEclipseBlueRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseBlackRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseBlueRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseBlackRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + delay 0x8 + waitforvisualfinish + stopsound + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x07 0x0000 + loadspritegfx ANIM_TAG_WISP_ORB @will o wisp + invisible ANIM_ATTACKER + loopsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET, 0x10, 0x5 + launchtemplate gBlackHoleEclipseWispSpriteTemplate 0x2 0x3 0x0 0x10 0x0 + delay 0x3 + launchtemplate gBlackHoleEclipseWispSpriteTemplate 0x3 0x3 0x0 0x10 0x1 + delay 0x3 + launchtemplate gBlackHoleEclipseWispSpriteTemplate 0x4 0x3 0x0 0x10 0x2 + delay 0x3 + launchtemplate gBlackHoleEclipseWispSpriteTemplate 0x4 0x3 0x0 0x10 0x3 + waitforvisualfinish + fadetobg BG_BLACKHOLE_ECLIPSE + playsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + launchtemplate gBlackHoleEclipseRedRingSpriteTemplate 0x3 0x4 0x0 0x0 0x100 0x0 + delay 0x4 + launchtemplate gBlackHoleEclipseRedRingSpriteTemplate 0x3 0x4 0x0 0x0 0x100 0x0 + delay 0x4 + launchtemplate gBlackHoleEclipseRedRingSpriteTemplate 0x3 0x4 0x0 0x0 0x100 0x0 + waitbgfadeout + unloadspritegfx ANIM_TAG_WISP_ORB + launchtemplate gBlackHoleEclipseHoleSpriteTemplate 0x2 0x4 0x0 0x0 ANIM_TARGET 0x0 @ eclipse at target origin + delay 0x10 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x35 0xffed 0x1 0x2 @ target down and left (instantaneously (last arg)) + delay 0x2 + visible ANIM_TARGET + loopsewithpan SE_M_SUPERSONIC, SOUND_PAN_TARGET, 0xa, 0x5 + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x50 0xfc00 ANIM_TARGET 0x0 @ spin target around (0x50 (time), -0x400 (rot speed)) + launchtemplate gBlackHoleEclipseBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x30 @ target back to origin (slowly) + launchtemplate gBlackHoleEclipseBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x15 + invisible ANIM_TARGET + delay 0x8 + launchtemplate gBlackHoleEclipseBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseHoleShrinkSpriteTemplate 0x2 0x4 0x0 0x0 ANIM_TARGET 0x0 + waitforvisualfinish + loadspritegfx ANIM_TAG_SPARKLE_4 @detect + launchtemplate gTargetTwinkleSpriteTemplate 0xd 0x3 0x0 0x0 ANIM_TARGET @detect star + delay 0x2 + unloadspritegfx ANIM_TAG_SHADOW_BALL + unloadspritegfx ANIM_TAG_THIN_RING + unloadspritegfx ANIM_TAG_ICE_CHUNK + unloadspritegfx ANIM_TAG_BLACK_BALL_2 + loadspritegfx ANIM_TAG_EXPLOSION_2 + call BlackHoleEclipseExplosion + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x1, 0x0, 0x10, 0x7fff @ bg to white pal + call BlackHoleEclipseExplosion + waitforvisualfinish + delay 0x18 + invisible ANIM_TARGET + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x1 0x0 ANIM_TARGET 0x1 @ fix rotation + invisible ANIM_TARGET + delay 0x1 + waitforvisualfinish + call ResetFromWhiteScreen + end + +BlackHoleEclipseExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseRedExplosionSpriteTemplate 0x3 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseRedExplosionSpriteTemplate 0x3 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseRedExplosionSpriteTemplate 0x3 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseRedExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseRedExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return + +ResetFromWhiteScreen: + launchtask AnimTask_AllBanksInvisible 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ALL_BATTLERS 0x2 0x0 0x0 0x7FFF @everything from white + restorebg + waitbgfadeout + setarg 0x7 0xffff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitbgfadein + waitforvisualfinish + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0x0 0x0 0x7fff + waitforvisualfinish + return + Move_TWINKLE_TACKLE:: Move_CATASTROPIKA:: Move_10000000_VOLT_THUNDERBOLT:: diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index b595ca5d1..14ef9e5c3 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7687,15 +7687,7 @@ BattleScript_PrintPlayerForfeitedLinkBattle:: waitmessage 0x40 end2 -BattleScript_ZMoveActivateStatus:: - printstring STRINGID_ZPOWERSURROUNDS - playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL - setzeffect - printstring STRINGID_ZMOVEUNLEASHED - waitmessage 0x40 - return - -BattleScript_ZMoveActivateDamaging:: +BattleScript_ZMoveActivate:: printstring STRINGID_ZPOWERSURROUNDS playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL printstring STRINGID_ZMOVEUNLEASHED diff --git a/include/battle_anim.h b/include/battle_anim.h index 2f481c5f2..14e11dec3 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -206,6 +206,7 @@ u8 GetSubstituteSpriteDefault_Y(u8 battlerId); #define STAT_ANIM_MULTIPLE_MINUS1 57 #define STAT_ANIM_MULTIPLE_MINUS2 58 void LaunchStatusAnimation(u8 battlerId, u8 statusAnimId); +extern const union AnimCmd *const gSpriteAnimTable_853EE80[]; // battle_anim_ground.c void AnimTask_HorizontalShake(u8 taskId); @@ -476,7 +477,9 @@ extern const union AnimCmd *const gAnims_BlizzardIceCrystal[]; // battle_anim_fire.c void AnimFireSpread(struct Sprite *sprite); void AnimFireSpiralOutward(struct Sprite *sprite); +void AnimWillOWispOrb(struct Sprite *); extern const union AnimCmd *const gAnims_FireBlastCross[]; +extern const union AnimCmd *const gAnims_WillOWispOrb[]; // battle_anim_dragon.c extern const union AnimCmd *const gAnims_DragonBreathFire[]; diff --git a/include/battle_message.h b/include/battle_message.h index 2ebb3b837..7dc17a4b1 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -1,7 +1,7 @@ #ifndef GUARD_BATTLE_MESSAGE_H #define GUARD_BATTLE_MESSAGE_H -#define TEXT_BUFF_ARRAY_COUNT 16 +#define TEXT_BUFF_ARRAY_COUNT 20 //expanded for z move names // for 0xFD #define B_TXT_BUFF1 0x0 diff --git a/include/battle_scripts.h b/include/battle_scripts.h index bc1e84128..db8452ad0 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -349,7 +349,6 @@ extern const u8 BattleScript_EmergencyExitNoPopUp[]; extern const u8 BattleScript_EmergencyExitWild[]; extern const u8 BattleScript_EmergencyExitWildNoPopUp[]; extern const u8 BattleScript_CheekPouchActivates[]; -extern const u8 BattleScript_ZMoveActivateStatus[]; -extern const u8 BattleScript_ZMoveActivateDamaging[]; +extern const u8 BattleScript_ZMoveActivate[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/battle_z_move.h b/include/battle_z_move.h index ab3f4ad1f..c87721f52 100644 --- a/include/battle_z_move.h +++ b/include/battle_z_move.h @@ -18,5 +18,6 @@ void HideZMoveTriggerSprite(void); bool32 IsZMoveTriggerSpriteActive(void); void DestroyZMoveTriggerSprite(void); bool32 MoveSelectionDisplayZMove(u16 zmove); +const u8* GetZMoveName(u16 move); #endif // GUARD_BATTLE_Z_MOVE_H \ No newline at end of file diff --git a/include/constants/moves.h b/include/constants/moves.h index 167a2936a..4f00b4d43 100644 --- a/include/constants/moves.h +++ b/include/constants/moves.h @@ -809,7 +809,7 @@ #define MOVE_CLANGOROUS_SOULBLAZE 776 #define MOVE_GUARDIAN_OF_ALOLA 777 #define MOVE_SEARING_SUNRAZE_SMASH 778 -#define MOVE_MENACING_MOONRAZE_MAELSTROM 7979 +#define MOVE_MENACING_MOONRAZE_MAELSTROM 779 #define MOVE_LIGHT_THAT_BURNS_THE_SKY 780 #define MOVE_SOUL_STEALING_7_STAR_STRIKE 781 diff --git a/src/battle_anim_fire.c b/src/battle_anim_fire.c index df951ab1a..b59701bad 100644 --- a/src/battle_anim_fire.c +++ b/src/battle_anim_fire.c @@ -32,7 +32,6 @@ static void InitEruptionLaunchRockCoordData(struct Sprite *sprite, s16 x, s16 y) static void UpdateEruptionLaunchRockPos(struct Sprite *); static void AnimEruptionFallingRock(struct Sprite *); static void AnimEruptionFallingRock_Step(struct Sprite *); -static void AnimWillOWispOrb(struct Sprite *); static void AnimWillOWispOrb_Step(struct Sprite *); static void AnimWillOWispFire(struct Sprite *); static void AnimTask_MoveHeatWaveTargets_Step(u8 taskId); @@ -428,7 +427,7 @@ static const union AnimCmd sAnim_WillOWispOrb_3[] = ANIMCMD_END, }; -static const union AnimCmd *const sAnims_WillOWispOrb[] = +const union AnimCmd *const gAnims_WillOWispOrb[] = { sAnim_WillOWispOrb_0, sAnim_WillOWispOrb_1, @@ -441,7 +440,7 @@ const struct SpriteTemplate gWillOWispOrbSpriteTemplate = .tileTag = ANIM_TAG_WISP_ORB, .paletteTag = ANIM_TAG_WISP_ORB, .oam = &gOamData_AffineOff_ObjNormal_16x16, - .anims = sAnims_WillOWispOrb, + .anims = gAnims_WillOWispOrb, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimWillOWispOrb, @@ -1143,7 +1142,7 @@ static void AnimEruptionFallingRock_Step(struct Sprite *sprite) } } -static void AnimWillOWispOrb(struct Sprite *sprite) +void AnimWillOWispOrb(struct Sprite *sprite) { switch (sprite->data[0]) { diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 041c37529..2aef2b0a8 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -54,6 +54,7 @@ static void AnimSkyDropBallUp(struct Sprite *sprite); static void SpriteCB_SearingShotRock(struct Sprite* sprite); static void AnimHappyHourCoinShower(struct Sprite *sprite); static void SpriteCB_Geyser(struct Sprite* sprite); +static void SpriteCB_TwinkleOnBattler(struct Sprite *sprite); //////// const data //// general @@ -4097,7 +4098,7 @@ const struct SpriteTemplate gBreakneckBlitzDanceSpriteTemplate = { .tileTag = ANIM_TAG_HOLLOW_ORB, .paletteTag = ANIM_TAG_FLAT_ROCK, - .oam = OAM_OFF_16x16, + .oam = &gOamData_AffineOff_ObjNormal_16x16, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, @@ -4128,9 +4129,9 @@ const struct SpriteTemplate gAllOutPummelingOnslaughtSpriteTemplate = { .tileTag = ANIM_TAG_HANDS_AND_FEET, .paletteTag = ANIM_TAG_IMPACT, - .oam = OAM_OFF_32x32, + .oam = &gOamData_AffineOff_ObjNormal_32x32, .anims = 0x83E66CC, - .images = 0x0, + .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = 0x80B0929 }; @@ -4151,7 +4152,7 @@ const struct SpriteTemplate gSupersonicSkystrikeFlySpriteTemplate = .paletteTag = ANIM_TAG_BIRD, .oam = OAM_NORMAL_64x64, .anims = gDummySpriteAnimTable, - .images = 0x0, + .images = NULL, .affineAnims = sSupersonicSkystrikeAffineAnimTable, .callback = 0x80B1C3D }; @@ -4162,7 +4163,7 @@ const struct SpriteTemplate gAcidDownpourReversalSpriteTemplate = .paletteTag = ANIM_TAG_POISON_BUBBLE, .oam = OAM_NORMAL_16x16, .anims = gDummySpriteAnimTable, - .images = 0x0, + .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = 0x80E0E95 }; @@ -4172,24 +4173,207 @@ const struct SpriteTemplate gAcidDownpourAuraSpriteTemplate = .paletteTag = ANIM_TAG_POISON_BUBBLE, .oam = OAM_NORMAL_16x16, .anims = gDummySpriteAnimTable, - .images = 0x0, + .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = 0x80B477D }; //tectonic rage const struct SpriteTemplate gTectonicRageBlastBurnSpriteTemplate = { -TEC_RAGE_BLAST_BURN: objtemplate ANIM_TAG_FIRE_PLUME ANIM_TAG_FIRE_PLUME OAM_OFF_32x32 0x83E5C50 0x0 gDummySpriteAffineAnimTable BLASTBURN_TARGET_ASM+1 +TEC_RAGE_BLAST_BURN: objtemplate ANIM_TAG_FIRE_PLUME ANIM_TAG_FIRE_PLUME &gOamData_AffineOff_ObjNormal_32x32 0x83E5C50 0x0 gDummySpriteAffineAnimTable BLASTBURN_TARGET_ASM+1 }; const struct SpriteTemplate gTectonicRageExplosionSpriteTemplate = { -TECTONIC_EXPLODE: objtemplate ANIM_TAG_UNUSED_EXPLOSION_2 ANIM_TAG_UNUSED_EXPLOSION_2 OAM_OFF_32x32 0x83E3F90 0x0 gDummySpriteAffineAnimTable SpriteCB_AnimSpriteOnMonPos +TECTONIC_EXPLODE: objtemplate ANIM_TAG_EXPLOSION_2 ANIM_TAG_EXPLOSION_2 &gOamData_AffineOff_ObjNormal_32x32 0x83E3F90 0x0 gDummySpriteAffineAnimTable AnimSpriteOnMonPos };*/ +// black hole eclipse +const struct SpriteTemplate gBlackHoleEclipseShockwaveSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_BLACK_BALL_2, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingShockWaveOrb +}; +const struct SpriteTemplate gBlackHoleEclipseBlueRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_ICE_CHUNK, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gBlackHoleEclipseBlackRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gBlackHoleEclipseRedExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gBlackHoleEclipseWispSpriteTemplate = +{ + .tileTag = ANIM_TAG_WISP_ORB, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gAnims_WillOWispOrb, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimWillOWispOrb +}; +const struct SpriteTemplate gBlackHoleEclipseRedRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gBlackHoleEclipseBlueRingInwardsSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_ICE_CHUNK, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +static const union AffineAnimCmd gGrowingBackHoleTargetAffineCmds[] = { + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, -10, 0x88), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd *const gGrowingBlackHoleTargetAffineAnimTable[] = { + gGrowingBackHoleTargetAffineCmds, +}; +const struct SpriteTemplate gBlackHoleEclipseHoleSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHADOW_BALL, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gGrowingBlackHoleTargetAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +static const union AffineAnimCmd gShrinkingBlackHoleAffineCmds[] = { + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(-0x10, -0x10, 0xf6, 8), + AFFINEANIMCMD_END_ALT(1), +}; +static const union AffineAnimCmd *const gShrinkingBlackHoleAffineAnimTable[] = { + gShrinkingBlackHoleAffineCmds, +}; +const struct SpriteTemplate gBlackHoleEclipseHoleShrinkSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHADOW_BALL, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gShrinkingBlackHoleAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +static const union AffineAnimCmd gGrowingBackHoleAffineCmds[] = { + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, -10, 0x48), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd *const gGrowingBlackHoleAffineAnimTable[] = { + gGrowingBackHoleAffineCmds, +}; +const struct SpriteTemplate gBlackHoleEclipseHoleUserSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHADOW_BALL, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gGrowingBlackHoleAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gTargetTwinkleSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_4, + .paletteTag = ANIM_TAG_SPARKLE_4, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gSpriteAnimTable_853EE80, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_TwinkleOnBattler +}; //// functions //general +void AnimTask_AllBanksInvisible(u8 taskId) +{ + u32 i; + for (i = 0; i < gBattlersCount; i++) + { + u8 spriteId = gBattlerSpriteIds[i]; + if (spriteId != 0xFF) + gSprites[spriteId].invisible = TRUE; + } + DestroyAnimVisualTask(taskId); +} + +void AnimTask_AllBanksVisible(u8 taskId) +{ + u32 i; + for (i = 0; i < gBattlersCount; i++) + { + u8 spriteId = gBattlerSpriteIds[i]; + if (spriteId != 0xFF) + gSprites[spriteId].invisible = FALSE; + } + DestroyAnimVisualTask(taskId); +} + +void AnimTask_AllBanksInvisibleExceptAttackerAndTarget(u8 taskId) +{ + u32 i; + for (i = 0; i < gBattlersCount; ++i) + { + u8 spriteId = gBattlerSpriteIds[i]; + if (spriteId == GetAnimBattlerSpriteId(ANIM_ATTACKER) || spriteId == GetAnimBattlerSpriteId(ANIM_TARGET)) + continue; + if (spriteId != 0xFF || !IsBattlerSpriteVisible(i)) //Pokemon that are already hidden + gSprites[spriteId].invisible = TRUE; + } + DestroyAnimVisualTask(taskId); +} + static u8 LoadBattleAnimTarget(u8 arg) { u8 battler; @@ -5145,3 +5329,20 @@ void AnimTask_TechnoBlast(u8 taskId) DestroyAnimVisualTask(taskId); } +// Z MOVES +//Creates a twinkle at the location the target was knocked too in Twinkle Tackle +static void SpriteCB_TwinkleOnBattler(struct Sprite *sprite) +{ + struct Sprite* monSprite; + + if (gBattleAnimArgs[2] == ANIM_TARGET) + monSprite = &gSprites[GetAnimBattlerSpriteId(ANIM_TARGET)]; + else + monSprite = &gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)]; + + sprite->pos1 = monSprite->pos1; + sprite->pos2 = monSprite->pos2; + sprite->callback = RunStoredCallbackWhenAnimEnds; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + diff --git a/src/battle_anim_status_effects.c b/src/battle_anim_status_effects.c index 56a8afa53..17bb91628 100644 --- a/src/battle_anim_status_effects.c +++ b/src/battle_anim_status_effects.c @@ -109,7 +109,7 @@ static const union AnimCmd sSpriteAnim_853EE68[] = ANIMCMD_END }; -static const union AnimCmd *const sSpriteAnimTable_853EE80[] = +const union AnimCmd *const gSpriteAnimTable_853EE80[] = { sSpriteAnim_853EE68 }; @@ -119,7 +119,7 @@ const struct SpriteTemplate gSpinningSparkleSpriteTemplate = .tileTag = ANIM_TAG_SPARKLE_4, .paletteTag = ANIM_TAG_SPARKLE_4, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sSpriteAnimTable_853EE80, + .anims = gSpriteAnimTable_853EE80, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimSpinningSparkle, diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 3625fcefc..b9b233734 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -653,7 +653,7 @@ static void HandleInputChooseMove(void) } else if (JOY_NEW(DPAD_LEFT)) { - if (gMoveSelectionCursor[gActiveBattler] & 1) + if (!gBattleStruct->zmove.viewing && gMoveSelectionCursor[gActiveBattler] & 1) { MoveSelectionDestroyCursorAt(gMoveSelectionCursor[gActiveBattler]); gMoveSelectionCursor[gActiveBattler] ^= 1; @@ -666,7 +666,7 @@ static void HandleInputChooseMove(void) } else if (JOY_NEW(DPAD_RIGHT)) { - if (!(gMoveSelectionCursor[gActiveBattler] & 1) + if (!gBattleStruct->zmove.viewing && !(gMoveSelectionCursor[gActiveBattler] & 1) && (gMoveSelectionCursor[gActiveBattler] ^ 1) < gNumberOfMovesToChoose) { MoveSelectionDestroyCursorAt(gMoveSelectionCursor[gActiveBattler]); @@ -680,7 +680,7 @@ static void HandleInputChooseMove(void) } else if (JOY_NEW(DPAD_UP)) { - if (gMoveSelectionCursor[gActiveBattler] & 2) + if (!gBattleStruct->zmove.viewing && gMoveSelectionCursor[gActiveBattler] & 2) { MoveSelectionDestroyCursorAt(gMoveSelectionCursor[gActiveBattler]); gMoveSelectionCursor[gActiveBattler] ^= 2; @@ -693,7 +693,7 @@ static void HandleInputChooseMove(void) } else if (JOY_NEW(DPAD_DOWN)) { - if (!(gMoveSelectionCursor[gActiveBattler] & 2) + if (!gBattleStruct->zmove.viewing && !(gMoveSelectionCursor[gActiveBattler] & 2) && (gMoveSelectionCursor[gActiveBattler] ^ 2) < gNumberOfMovesToChoose) { MoveSelectionDestroyCursorAt(gMoveSelectionCursor[gActiveBattler]); diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 3d7222ffe..5305b4439 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -525,7 +525,7 @@ static void Task_ClearBitWhenSpecialAnimDone(u8 taskId) // Great function to include newly added moves that don't have animation yet. bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn) { - if (moveId >= (MOVES_COUNT - 1)) + if (moveId >= (MOVES_COUNT_Z - 1)) return TRUE; else return FALSE; diff --git a/src/battle_message.c b/src/battle_message.c index b8503e67a..f15070959 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -5,6 +5,7 @@ #include "battle_message.h" #include "battle_setup.h" #include "battle_tower.h" +#include "battle_z_move.h" #include "data.h" #include "event_data.h" #include "frontier_util.h" @@ -2553,7 +2554,9 @@ void BufferStringBattle(u16 stringID) } break; case STRINGID_USEDMOVE: // pokemon used a move msg - if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT) + if (gBattleStruct->zmove.active) + StringCopy(gBattleTextBuff3, GetZMoveName(gBattleMsgDataPtr->currentMove)); + else if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT) StringCopy(gBattleTextBuff3, sATypeMove_Table[*(&gBattleStruct->stringMoveType)]); else StringCopy(gBattleTextBuff3, gMoveNames[gBattleMsgDataPtr->currentMove]); @@ -2982,13 +2985,17 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) HANDLE_NICKNAME_STRING_CASE(gBattleScripting.battler) break; case B_TXT_CURRENT_MOVE: // current move name - if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT) + if (gBattleStruct->zmove.active) + toCpy = GetZMoveName(gBattleMsgDataPtr->currentMove); + else if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT) toCpy = sATypeMove_Table[gBattleStruct->stringMoveType]; else toCpy = gMoveNames[gBattleMsgDataPtr->currentMove]; break; case B_TXT_LAST_MOVE: // originally used move name - if (gBattleMsgDataPtr->originallyUsedMove >= MOVES_COUNT) + if (gBattleStruct->zmove.active) + toCpy = GetZMoveName(gBattleMsgDataPtr->originallyUsedMove); + else if (gBattleMsgDataPtr->originallyUsedMove >= MOVES_COUNT) toCpy = sATypeMove_Table[gBattleStruct->stringMoveType]; else toCpy = gMoveNames[gBattleMsgDataPtr->originallyUsedMove]; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 7e975c3c5..86947e09f 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1627,7 +1627,14 @@ static void Cmd_ppreduce(void) if (gBattleControllerExecFlags) return; - + + if (gBattleStruct->zmove.active) + { + gHitMarker &= ~(HITMARKER_NO_PPDEDUCT); + gBattlescriptCurrInstr++; + return; + } + if (!gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure) { switch (gBattleMoves[gCurrentMove].target) diff --git a/src/battle_util.c b/src/battle_util.c index a01575946..8cb7c624b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -95,7 +95,7 @@ void HandleAction_UseMove(void) gCurrentMove = gChosenMove = gLockedMoves[gBattlerAttacker]; } // encore forces you to use the same move - else if (gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE + else if (!gBattleStruct->zmove.active && gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE && gDisableStructs[gBattlerAttacker].encoredMove == gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos]) { gCurrentMove = gChosenMove = gDisableStructs[gBattlerAttacker].encoredMove; @@ -103,7 +103,7 @@ void HandleAction_UseMove(void) *(gBattleStruct->moveTarget + gBattlerAttacker) = GetMoveTarget(gCurrentMove, 0); } // check if the encored move wasn't overwritten - else if (gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE + else if (!gBattleStruct->zmove.active && gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE && gDisableStructs[gBattlerAttacker].encoredMove != gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos]) { gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos; @@ -122,6 +122,12 @@ void HandleAction_UseMove(void) { gCurrentMove = gChosenMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos]; } + + // check z move used + if (gBattleStruct->zmove.active) + { + gCurrentMove = gBattleStruct->zmove.currZMove; + } if (gBattleMons[gBattlerAttacker].hp != 0) { @@ -3187,18 +3193,8 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->zmove.used[gBattlerAttacker] = TRUE; //TODO - partner battles. gBattleScripting.battler = gBattlerAttacker; - if (gBattleMoves[gCurrentMove].split == SPLIT_STATUS) - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_ZMoveActivateStatus; - //gBattleStruct->zmove.effect = gBattleMoves[gCurrentMove].z_move_effect; - //gBattleStruct->zmove.effectApplied = TRUE; - } - else - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_ZMoveActivateDamaging; - } + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ZMoveActivate; effect = 1; } gBattleStruct->atkCancellerTracker++; diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 116c2c791..cdaf38849 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -42,7 +42,6 @@ static u16 GetSignatureZMove(u16 move, u16 species, u16 item); static u16 GetTypeBasedZMove(u16 move, u8 battler); static void ZMoveSelectionDisplayPpNumber(void); static void ZMoveSelectionDisplayPower(u16 move, u16 zMove); -static const u8* GetZMoveName(u16 move); static void ShowZMoveTriggerSprite(void); // Const Data @@ -517,7 +516,7 @@ static void ZMoveSelectionDisplayPpNumber(void) BattlePutTextOnWindow(gDisplayedStringBattle, 9); } -static const u8* GetZMoveName(u16 move) +const u8* GetZMoveName(u16 move) { if (IsZMove(move)) return gZMoveNames[move - MOVE_BREAKNECK_BLITZ]; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 279e7b328..3425ccdb4 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -1,4 +1,4 @@ -const struct BattleMove gBattleMoves[MOVES_COUNT] = +const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { [MOVE_NONE] = { @@ -10843,4 +10843,531 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, }, + + // Z MOVES + [MOVE_BREAKNECK_BLITZ] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, //determined from move type + .zMoveEffect = 0 + }, + [MOVE_ALL_OUT_PUMMELING] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_SUPERSONIC_SKYSTRIKE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_FLYING, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_ACID_DOWNPOUR] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_POISON, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_TECTONIC_RAGE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_GROUND, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_CONTINENTAL_CRUSH] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_ROCK, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_SAVAGE_SPIN_OUT] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_NEVER_ENDING_NIGHTMARE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_CORKSCREW_CRASH] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_INFERNO_OVERDRIVE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_FIRE, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_HYDRO_VORTEX] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_BLOOM_DOOM] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_GIGAVOLT_HAVOC] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_SHATTERED_PSYCHE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_SUBZERO_SLAMMER] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_ICE, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_DEVASTATING_DRAKE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_DRAGON, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_BLACK_HOLE_ECLIPSE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_TWINKLE_TACKLE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_CATASTROPIKA] = + { + .effect = EFFECT_HIT, + .power = 210, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_10000000_VOLT_THUNDERBOLT] = + { + .effect = EFFECT_HIT,//TODO: EFFECT_HIGH_CRITICAL, + .power = 195, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_STOKED_SPARKSURFER] = + { + .effect = EFFECT_HIT, //EFFECT_PARALYZE_HIT, + .power = 175, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_EXTREME_EVOBOOST] = + { + .effect = EFFECT_HIT,//TODO: EFFECT_EXTREME_EVOBOOST, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_STATUS, + .zMoveEffect = 0 + }, + [MOVE_PULVERIZING_PANCAKE] = + { + .effect = EFFECT_HIT, + .power = 210, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_GENESIS_SUPERNOVA] = + { + .effect = EFFECT_HIT,//TODO: EFFECT_DAMAGE_SET_TERRAIN, + .power = 185, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_SINISTER_ARROW_RAID] = + { + .effect = EFFECT_HIT, + .power = 180, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_MALICIOUS_MOONSAULT] = + { + .effect = EFFECT_HIT, + .power = 180, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_OCEANIC_OPERETTA] = + { + .effect = EFFECT_HIT, + .power = 195, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_SPLINTERED_STORMSHARDS] = + { + .effect = EFFECT_HIT, //TODO removes terrain + .power = 190, + .type = TYPE_ROCK, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_LETS_SNUGGLE_FOREVER] = + { + .effect = EFFECT_HIT, + .power = 190, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_CLANGOROUS_SOULBLAZE] = + { + .effect = EFFECT_HIT,//TODO: EFFECT_ALL_STATS_UP_HIT, + .power = 185, + .type = TYPE_DRAGON, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_GUARDIAN_OF_ALOLA] = + { + .effect = EFFECT_HIT,//TODO: EFFECT_SUPER_FANG, + .power = 1, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_SEARING_SUNRAZE_SMASH] = + { + .effect = EFFECT_HIT, + .power = 200, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_MENACING_MOONRAZE_MAELSTROM] = + { + .effect = EFFECT_HIT, + .power = 200, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_LIGHT_THAT_BURNS_THE_SKY] = + { + .effect = EFFECT_HIT, + .power = 200, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_SOUL_STEALING_7_STAR_STRIKE] = + { + .effect = EFFECT_HIT, + .power = 195, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, }; From 752aca7698228cc541e89d5902efa239c44f2222 Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 29 Nov 2020 09:22:31 -0500 Subject: [PATCH 005/208] finish z move anims --- asm/macros/battle_anim_script.inc | 82 +- data/battle_anim_scripts.s | 5514 ++++++++++++++++++++++++++- data/maps/InsideOfTruck/scripts.inc | 5 +- include/battle_anim.h | 20 + include/constants/battle_anim.h | 6 + src/battle_anim_effects_2.c | 3 +- src/battle_anim_effects_3.c | 9 +- src/battle_anim_electric.c | 3 +- src/battle_anim_fight.c | 3 +- src/battle_anim_fire.c | 17 +- src/battle_anim_flying.c | 10 +- src/battle_anim_ghost.c | 65 + src/battle_anim_ground.c | 1 - src/battle_anim_new.c | 2531 +++++++++++- src/battle_anim_poison.c | 9 +- src/battle_anim_rock.c | 54 +- src/battle_anim_status_effects.c | 19 + src/data/items.h | 15 + 18 files changed, 8240 insertions(+), 126 deletions(-) diff --git a/asm/macros/battle_anim_script.inc b/asm/macros/battle_anim_script.inc index c54845e00..71ab80c6d 100644 --- a/asm/macros/battle_anim_script.inc +++ b/asm/macros/battle_anim_script.inc @@ -288,43 +288,57 @@ createvisualtask AnimTask_IsDoubleBattle, 0 jumprettrue \ptr .endm - + @ keep CFRU macros cause I'm lazy. todo: update to createsprite and createvisualtask, respectively .macro launchtemplate launchtemplatePtr launchtemplatePriority launchtemplateArgsNo launchtemplatearg0 launchtemplatearg1 launchtemplatearg2 launchtemplatearg3 launchtemplatearg4 launchtemplatearg5 launchtemplatearg6 launchtemplatearg7 launchtemplatearg8 - .byte 0x2 - .word \launchtemplatePtr - .byte \launchtemplatePriority - .byte \launchtemplateArgsNo - .hword \launchtemplatearg0 - .hword \launchtemplatearg1 - .hword \launchtemplatearg2 - .hword \launchtemplatearg3 - .hword \launchtemplatearg4 - .hword \launchtemplatearg5 - .hword \launchtemplatearg6 - .hword \launchtemplatearg7 - .hword \launchtemplatearg8 - .endm - + .byte 0x2 + .word \launchtemplatePtr + .byte \launchtemplatePriority + .byte \launchtemplateArgsNo + .hword \launchtemplatearg0 + .hword \launchtemplatearg1 + .hword \launchtemplatearg2 + .hword \launchtemplatearg3 + .hword \launchtemplatearg4 + .hword \launchtemplatearg5 + .hword \launchtemplatearg6 + .hword \launchtemplatearg7 + .hword \launchtemplatearg8 + .endm + .macro launchtask launchtaskPtr launchtaskPriority launchtaskArgsNo launchtaskarg0 launchtaskarg1 launchtaskarg2 launchtaskarg3 launchtaskarg4 launchtaskarg5 launchtaskarg6 launchtaskarg7 launchtaskarg8 - .byte 0x3 - .word \launchtaskPtr - .byte \launchtaskPriority - .byte \launchtaskArgsNo - .hword \launchtaskarg0 - .hword \launchtaskarg1 - .hword \launchtaskarg2 - .hword \launchtaskarg3 - .hword \launchtaskarg4 - .hword \launchtaskarg5 - .hword \launchtaskarg6 - .hword \launchtaskarg7 - .hword \launchtaskarg8 - .endm - + .byte 0x3 + .word \launchtaskPtr + .byte \launchtaskPriority + .byte \launchtaskArgsNo + .hword \launchtaskarg0 + .hword \launchtaskarg1 + .hword \launchtaskarg2 + .hword \launchtaskarg3 + .hword \launchtaskarg4 + .hword \launchtaskarg5 + .hword \launchtaskarg6 + .hword \launchtaskarg7 + .hword \launchtaskarg8 + .endm + .macro setblends setblends_value -.byte 0xC -.hword \setblends_value -.endm + .byte 0xC + .hword \setblends_value + .endm +.macro launchsoundtask launchsoundtaskPtr launchsoundtaskArgsNo launchsoundtaskarg0 launchsoundtaskarg1 launchsoundtaskarg2 launchsoundtaskarg3 launchsoundtaskarg4 launchsoundtaskarg5 launchsoundtaskarg6 launchsoundtaskarg7 launchsoundtaskarg8 + .byte 0x1F + .word \launchsoundtaskPtr + .byte \launchsoundtaskArgsNo + .hword \launchsoundtaskarg0 + .hword \launchsoundtaskarg1 + .hword \launchsoundtaskarg2 + .hword \launchsoundtaskarg3 + .hword \launchsoundtaskarg4 + .hword \launchsoundtaskarg5 + .hword \launchsoundtaskarg6 + .hword \launchsoundtaskarg7 + .hword \launchsoundtaskarg8 + .endm diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 8654f5bed..bea94c3f7 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -24488,22 +24488,2194 @@ Special_CriticalCaptureBallThrow: @@@@@@@@@@ Z MOVES @@@@@@@@@@ Move_BREAKNECK_BLITZ:: + loadspritegfx ANIM_TAG_HOLLOW_ORB + loadspritegfx ANIM_TAG_IMPACT + loadspritegfx ANIM_TAG_HANDS_AND_FEET + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_METEOR + loadspritegfx ANIM_TAG_FLAT_ROCK + launchtask AnimTask_HorizontalShake 0x5 0x3 0x5 0x5 0x20 @ shake screen + launchtask AnimTask_HorizontalShake 0x5 0x3 0x4 0x5 0x20 @ shake banks + playsewithpan SE_M_EARTHQUAKE, 0x0 + monbg ANIM_ATTACKER + monbgprio_28 ANIM_ATTACKER + delay 0x1 + launchtask AnimTask_BlendPalInAndOutByTag, 0x5, 0x5, ANIM_TAG_HOLLOW_ORB, 0x4c00, 0xe, 0x0, 0x3 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x0 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x2b + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x55 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x80 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0xaa + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0xd5 + delay 0xf + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x0 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x2b + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x55 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x80 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0xaa + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0xd5 + waitforvisualfinish + clearmonbg ANIM_ATTACKER + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + fadetobg BG_DRILL + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xf700 0x300 0x1 0xffff + waitbgfadein + setblends 0x80c + delay 0x10 + launchtask AnimTask_WindUpLunge 0x5 0x7 0x0 0xffe8 0x8 0x17 0xa 0x28 0xa + delay 0x23 + invisible ANIM_ATTACKER + launchtemplate gGrowingSuperpowerTemplate 0x83 0x1 0x0 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + delay 0x8 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gBreakneckBlitzHitSpriteTemplate 0x83 0x4 0x0 0x0 0x1 0x1 @ 0, 0 + delay 0x1 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gBreakneckBlitzHitSpriteTemplate 0x83 0x4 0xa 0xfff6 0x1 0x1 @ +10, -10 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + delay 0x1 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gBreakneckBlitzHitSpriteTemplate 0x83 0x4 0xf 0xfff1 0x1 0x1 @ +15, -15 + delay 0x1 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gBreakneckBlitzHitSpriteTemplate 0x83 0x4 0x14 0xffec 0x1 0x1 @ +20, -20 + delay 0x1 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gBreakneckBlitzHitSpriteTemplate 0x83 0x4 0x19 0xffe7 0x1 0x1 @ +25, -25 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffe6 0x10 0x1 0x4 + waitforvisualfinish + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x8 0xfe00 0x1 0x0 + launchtask AnimTask_ShakeMonInPlace 0x2 0x5 0x0 0x4 0x0 0xc 0x1 + launchtask AnimTask_ShakeMonInPlace 0x2 0x5 0x1 0x4 0x0 0xc 0x1 + waitforvisualfinish + delay 0x4 + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x8 0xfe00 0x1 0x1 + delay 0xa + delay 0x19 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x6 + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0x0 0x5 + waitforvisualfinish + delay 0x10 + blendoff + clearmonbg ANIM_DEF_PARTNER + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + call UnsetPsychicBg + end + + Move_ALL_OUT_PUMMELING: + loadspritegfx ANIM_TAG_HANDS_AND_FEET + loadspritegfx ANIM_TAG_IMPACT + loadspritegfx ANIM_TAG_METEOR + loadspritegfx ANIM_TAG_FLAT_ROCK + loadspritegfx ANIM_TAG_FOCUS_ENERGY + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + call EndureEffect + loopsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER 0x9 0x2 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x1f + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call EndureEffect + waitforvisualfinish + fadetobg BG_ROCK_WRECKER + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x800 0x0 0x0 0xffff + waitbgfadein + setblends 0x80c + monbg ANIM_DEF_PARTNER + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x2 SOUND_PAN_TARGET 0x1 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffd0 0x18 0x0 0x0 0xa 0x1 ANIM_FOOT_1 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xfffa 0x12 0x0 0x0 0xa 0x1 ANIM_CHOP 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffc0 0x10 0x0 0x0 0xa 0x1 ANIM_FIST_1 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffd0 0x15 0x0 0x0 0xa 0x1 ANIM_FOOT_2 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffd0 0x14 0x0 0x0 0xa 0x1 ANIM_FIST_1 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffe0 0x17 0x0 0x0 0xa 0x1 ANIM_CHOP 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffc0 0x11 0x0 0x0 0xa 0x1 ANIM_FOOT_1 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffb0 0x10 0x0 0x0 0xa 0x1 ANIM_FOOT_2 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffa0 0x15 0x0 0x0 0xa 0x1 ANIM_CHOP 0x1 + delay 0x2 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET + delay 0x10 + launchtask AnimTask_WindUpLunge 0x5 0x7 0x0 0xffe8 0x8 0x17 0xa 0x28 0xa + delay 0x23 + invisible ANIM_ATTACKER + launchtemplate gGrowingSuperpowerTemplate 0x83 0x1 0x0 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + delay 0xc + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffd0 0x0 0x0 0x4 + waitforvisualfinish + delay 0x30 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x7 + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0x0 0x5 + waitforvisualfinish + delay 0x10 + blendoff + clearmonbg ANIM_DEF_PARTNER + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + call UnsetPsychicBg + end + + Move_SUPERSONIC_SKYSTRIKE: + loadspritegfx ANIM_TAG_ROUND_SHADOW @ fly + loadspritegfx ANIM_TAG_MUD_SAND @ dig + loadspritegfx ANIM_TAG_FOCUS_ENERGY @ focus energy + loadspritegfx ANIM_TAG_BIRD @ sky attack bird + loadspritegfx ANIM_TAG_IMPACT @ hit + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + monbg ANIM_DEF_PARTNER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x1 0x8 0x0 0x0 + launchtask AnimTask_HorizontalShake 0x5 0x3 0x0 0x2 0x10 + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x1 0xf 0x0 0x7fff + clearmonbg ANIM_DEF_PARTNER + call EndureEffect + delay 0x8 + call EndureEffect + delay 0x20 + delay 0xA + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gFlyBallUpSpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + delay 0x2 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0xc 0x4 0xfff0 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0x10 0x4 0xfff6 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xe 0x4 0xffee 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xc 0x4 0xfff0 0x12 + delay 0x30 + launchtask AnimTask_DoomDesireLightBeam 0x5 0x0 + delay 0x9 + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER + delay 0x9 + playsewithpan SE_M_MORNING_SUN, 0x0 + delay 0x9 + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_TARGET + delay 0x19 + fadetobg BG_SKY + waitbgfadeout + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 0x1 SupersonicSkystrikeOnPlayer +SupersonicSkystrikeOnOpponent: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xf800 0x800 0x0 0xffff + goto FinishSupersonicSkystrike +SupersonicSkystrikeOnPlayer: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x800 0xf800 0x0 0xffff +FinishSupersonicSkystrike: + waitbgfadein + waitforvisualfinish + monbg ANIM_DEF_PARTNER + setblends 0x80c + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_ATTACKER + launchtemplate gSupersonicSkystrikeFlySpriteTemplate 0x2 0x1 0x14 + delay 0x10 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0x15 0x0 0x4 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0xc 0xffe8 0xfff0 0x18 @ 12, -48, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0x10 0xffda 0xfff6 0x18 @ 16, -16, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xe 0xffec 0xffee 0x18 @ 14, -52, -18, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xc 0xffdc 0xfff0 0x18 @ 12, -32, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0xc 0xffd0 0xfff0 0x18 @ 12, -24, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0x10 0xfff0 0xfff6 0x18 @ 16, -38, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xe 0xffcc 0xffee 0x18 @ 14, -20, -18, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xc 0xffe0 0xfff0 0x18 @ 12, -36, -16, 24 + delay 0x30 + clearmonbg ANIM_DEF_PARTNER + blendoff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + call UnsetPsychicBg + waitforvisualfinish + end + + Move_ACID_DOWNPOUR: + loadspritegfx ANIM_TAG_BLUE_ORB @ reversal + loadspritegfx ANIM_TAG_POISON_JAB @ poison jab + loadspritegfx ANIM_TAG_POISON_BUBBLE @ poison bubbles + fadetobg BG_POISON + waitbgfadeout + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 0x1 AcidDownpourOnPlayer +AcidDownpourOnOpponent: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xff10 0x1 0xffff + goto FinishAcidDownpour +AcidDownpourOnPlayer: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xf0 0x1 0xffff +FinishAcidDownpour: + waitbgfadein + setblends 0x80c + monbg ANIM_ATTACKER + loopsewithpan SE_M_TOXIC, SOUND_PAN_TARGET, 0xd, 0x6 + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_ATTACKER 0x0 0x2 0x32 0x1 + call AcidDownpourFlareOnAttacker + call AcidDownpourFlareOnAttacker + call AcidDownpourFlareOnAttacker + delay 0x5 + clearmonbg ANIM_ATTACKER + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + blendoff + delay 0x20 + loopsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET, 0xd, 0x3 + launchtemplate gAcidDownpourReversalSpriteTemplate 0x2 0x2 0x1a 0x0 + launchtemplate gAcidDownpourReversalSpriteTemplate 0x2 0x2 0x1a 0x2a + launchtemplate gAcidDownpourReversalSpriteTemplate 0x2 0x2 0x1a 0x54 + launchtemplate gAcidDownpourReversalSpriteTemplate 0x2 0x2 0x1a 0x7e + launchtemplate gAcidDownpourReversalSpriteTemplate 0x2 0x2 0x1a 0xa8 + launchtemplate gAcidDownpourReversalSpriteTemplate 0x2 0x2 0x1a 0xd2 + delay 0x20 + panse_1B SE_M_WHIRLPOOL, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x2, 0x0 + launchtask AnimTask_CreateSurfWave 0x2 0x1 ANIM_SURF_PAL_SLUDGE_WAVE + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x0 0x7 0xd87c + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x2 0x32 0x1 + call AcidDownpourFlare + call AcidDownpourFlare + delay 0x15 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xfd00 0x15 0x0 0x2a + delay 0x2c + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x7 0x0 0xd87c + invisible ANIM_TARGET + waitforvisualfinish + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + restorebg + waitbgfadeout + setarg 0x7 0xffff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitbgfadein + waitforvisualfinish + end +AcidDownpourFlare: + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_TARGET + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_TARGET + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_TARGET + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_TARGET + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_TARGET + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_TARGET + delay 0x2 + return +AcidDownpourFlareOnAttacker: + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x1c 0x210 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x20 0x1e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x21 0x240 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x1f 0x190 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x1c 0x200 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x2 + return + + Move_TECTONIC_RAGE: + loadspritegfx ANIM_TAG_DIRT_MOUND @ dig + loadspritegfx ANIM_TAG_MUD_SAND @ rollout small rocks + loadspritegfx ANIM_TAG_ROCKS @ rollout + loadspritegfx ANIM_TAG_IMPACT @ hit + launchtemplate gDirtMoundSpriteTemplate 0x1 0x3 0x0 0x0 0xb4 + launchtemplate gDirtMoundSpriteTemplate 0x1 0x3 0x0 0x1 0xb4 + monbg_22 ANIM_ATTACKER + delay 0x1 + launchtask AnimTask_DigDownMovement 0x2 0x1 0x0 + delay 0x6 + call DigThrowDirt + call DigThrowDirt + call DigThrowDirt + call DigThrowDirt + launchtask AnimTask_TectonicRageRollout 0x2 0x0 + call DigThrowDirt + setblends 0x80c + delay 0x20 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + monbg ANIM_TARGET + launchtemplate gBasicHitSplatSpriteTemplate 0x4 0x4 0x0 0x0 0x1 0x2 + delay 0x1 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0x15 0x0 0x4 + delay 0xa + waitforvisualfinish + clearmonbg ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + invisible ANIM_TARGET + delay 0x5 + invisible ANIM_ATTACKER + waitforvisualfinish + delay 0xa + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + fadetobg BG_TECTONIC_RAGE @ brown/yellow sky uppercut + unloadspritegfx ANIM_TAG_DIRT_MOUND @ dig + unloadspritegfx ANIM_TAG_MUD_SAND @ rollout small rocks + unloadspritegfx ANIM_TAG_ROCKS @ rollout + unloadspritegfx ANIM_TAG_IMPACT @ hit + loadspritegfx ANIM_TAG_WARM_ROCK @ eruption + loadspritegfx ANIM_TAG_FIRE_PLUME @ blast burn + loadspritegfx ANIM_TAG_EXPLOSION_2 @ explosion + waitbgfadeout + visible ANIM_TARGET + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xf800 0x0 0xffff + waitbgfadein + playsewithpan SE_FALL, SOUND_PAN_ATTACKER @;Falling sound + delay 0x1e + launchtemplate gEruptionFallingRockSpriteTemplate 0x28 0x5 0xc8 0xffe0 0x0 0x64 0x0 + launchtemplate gEruptionFallingRockSpriteTemplate 0x28 0x5 0x1e 0xffe0 0x10 0x5a 0x1 + launchtemplate gEruptionFallingRockSpriteTemplate 0x28 0x5 0x96 0xffe0 0x20 0x3c 0x2 + launchtemplate gEruptionFallingRockSpriteTemplate 0x28 0x5 0x5a 0xffe0 0x30 0x50 0x3 + launchtemplate gEruptionFallingRockSpriteTemplate 0x28 0x5 0x6e 0xffe0 0x40 0x32 0x0 + launchtemplate gEruptionFallingRockSpriteTemplate 0x28 0x5 0x3c 0xffe0 0x50 0x46 0x1 + delay 0x16 + launchtask AnimTask_HorizontalShake 0x5 0x3 0x5 0x8 0x3c + launchtask AnimTask_HorizontalShake 0x5 0x3 0x4 0x8 0x3c + loopsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET, 0x10, 0xc + delay 0x30 + call TectonicRageExplosion + playsewithpan SE_M_SACRED_FIRE, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffe0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffec 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x0 0xfff0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x14 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x20 0x0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x14 0xa 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0x0 0x10 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffec 0xa 0x18 0x0 0x0 0x0 + call TectonicRageExplosion + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffc0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x6 0x6 0xffd8 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x46 0x6 0x0 0xffe0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x46 0x6 0x28 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x40 0x0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x28 0x14 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0x0 0x20 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffd8 0x14 0x18 0x0 0x0 0x0 + call TectonicRageExplosion + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffa0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x6 0x6 0xffc4 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x46 0x6 0x0 0xffd0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x46 0x6 0x3c 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x60 0x0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x3c 0x1e 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0x0 0x30 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffc4 0x1e 0x18 0x0 0x0 0x0 + call TectonicRageExplosion + waitforvisualfinish + call UnsetPsychicBg + waitbgfadein + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +TectonicRageExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return + + Move_CONTINENTAL_CRUSH:: + loadspritegfx ANIM_TAG_ROUND_SHADOW @ fly + loadspritegfx ANIM_TAG_MUD_SAND @ dig + loadspritegfx ANIM_TAG_ROCKS @ rocks + loadspritegfx ANIM_TAG_FOCUS_ENERGY @ focus energy + loadspritegfx ANIM_TAG_IMPACT @ hit + loadspritegfx ANIM_TAG_REALLY_BIG_ROCK + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call ContinentalCrashBuffEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x2dd3 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call ContinentalCrashBuffEffect + delay 0x8 + call ContinentalCrashBuffEffect + delay 0x4 + delay 0xA + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gFlyBallUpSpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + delay 0x2 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0xc 0x4 0xfff0 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0x10 0x4 0xfff6 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xe 0x4 0xffee 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xc 0x4 0xfff0 0x12 + delay 0x30 + launchtask AnimTask_GetTimeOfDay 0x2 0x0 + jumpargeq 0x0 0x0 ContinentalCrushDay + jumpargeq 0x0 0x2 ContinentalCrushAfternoon +ContinentalCrushNight: + fadetobg BG_BLUE_SKY_NIGHT + goto FinishContinentalCrush +ContinentalCrushDay: + fadetobg BG_BLUE_SKY_DAY + goto FinishContinentalCrush +ContinentalCrushAfternoon: + fadetobg BG_BLUE_SKY_AFTERNOON +FinishContinentalCrush: + delay 0x18 + invisible ANIM_TARGET + waitbgfadeout + delay 0x5 + visible ANIM_ATTACKER + delay 0x4 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x2dd3 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + call ContinentalCrushStockpileRocks + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + call ContinentalCrushStockpileRocks + launchtemplate gContinentalCrushGrowingRockSpriteTemplate 0x2 0x1 0x0 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x2dd3 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + call ContinentalCrushStockpileRocks + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + call ContinentalCrushStockpileRocks + invisible ANIM_ATTACKER + waitforvisualfinish + fadetobg BG_IN_AIR + waitbgfadeout + visible ANIM_TARGET + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xf800 0x0 0xffff + waitbgfadein + loopsewithpan SE_FALL, SOUND_PAN_ATTACKER, 0x20, 0x4 @;Falling sound + delay 0x1e + launchtemplate gContinentalCrushEruptionSpriteTemplate 0x28 0x5 0xc8 0xffe0 0x0 0x64 0x0 + launchtemplate gContinentalCrushEruptionSpriteTemplate 0x28 0x5 0x1e 0xffe0 0x10 0x5a 0x1 + launchtemplate gContinentalCrushEruptionSpriteTemplate 0x28 0x5 0x96 0xffe0 0x20 0x3c 0x2 + launchtemplate gContinentalCrushEruptionSpriteTemplate 0x28 0x5 0x5a 0xffe0 0x30 0x50 0x3 + launchtemplate gContinentalCrushEruptionSpriteTemplate 0x28 0x5 0x6e 0xffe0 0x40 0x32 0x0 + launchtemplate gContinentalCrushEruptionSpriteTemplate 0x28 0x5 0x3c 0xffe0 0x50 0x46 0x1 + delay 0x16 + launchtask AnimTask_HorizontalShake 0x5 0x3 0x5 0x8 0x1c + launchtask AnimTask_HorizontalShake 0x5 0x3 0x4 0x8 0x1c + unloadspritegfx ANIM_TAG_ROUND_SHADOW @ fly + unloadspritegfx ANIM_TAG_MUD_SAND @ dig + unloadspritegfx ANIM_TAG_FOCUS_ENERGY @ focus energy + unloadspritegfx ANIM_TAG_IMPACT @ hit + loadspritegfx ANIM_TAG_REALLY_BIG_ROCK + delay 0x30 + launchtemplate gContinentalCrushBigRockStompSpriteTemplate, 0x82, 0x4, 0, 0x3c, 3, ANIM_TARGET + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x0 0x7 0x0000 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0x15 0x0 0x4 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0xc 0xffe8 0xfff0 0x18 @ 12, -48, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0x10 0xffda 0xfff6 0x18 @ 16, -16, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xe 0xffec 0xffee 0x18 @ 14, -52, -18, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xc 0xffdc 0xfff0 0x18 @ 12, -32, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0xc 0xffd0 0xfff0 0x18 @ 12, -24, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0x10 0xfff0 0xfff6 0x18 @ 16, -38, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xe 0xffcc 0xffee 0x18 @ 14, -20, -18, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xc 0xffe0 0xfff0 0x18 @ 12, -36, -16, 24 + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x7 0x0 0x0000 @undo pal change on tgt + delay 0x10 + waitforvisualfinish + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + waitforvisualfinish + restorebg + waitbgfadeout + setarg 0x7 0xffff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitbgfadein + delay 0x4 + waitforvisualfinish + end +ContinentalCrashBuffEffect: + launchtemplate gContinentalCrushFocusEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gContinentalCrushFocusEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gContinentalCrushFocusEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gContinentalCrushFocusEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gContinentalCrushFocusEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +ContinentalCrushStockpileRocks: + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x0 0xffc0 0x20 @ 0,-32 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x2c 0xffd4 0x20 @ +44,-44 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x3c 0x0 0x20 @ +60,0 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x28 0x28 0x20 @ +40,+40 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x0 0x38 0x20 @ +0,+56 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0xffda 0x26 0x20 @ -38,+38 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0xffca 0x0 0x20 @ -54, +0 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0xffdc 0xffdc 0x20 @ -36, -36 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x0 0xffce 0x20 @ 0, -50 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x22 0xffde 0x20 @ +34, -34 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x2e 0x0 0x20 @ +46, +0 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x20 0x20 0x20 @ +32, +32 + delay 0x2 + return + + Move_SAVAGE_SPIN_OUT:: + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_RAZOR_LEAF @green color + loadspritegfx ANIM_TAG_STRING @string shot + loadspritegfx ANIM_TAG_SPIDER_WEB @spider web + loadspritegfx ANIM_TAG_MUD_SAND @rocks + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + monbg ANIM_ATTACKER + setblends 0x80c + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x4 0x0 + launchtemplate gSavageSpinOutGreenChargeSpriteTemplate 0x2 0x1 0x0 + delay 0x19 + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + delay 0x14 + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + delay 0xf + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x4 0x0 0x0 + clearmonbg ANIM_ATTACKER + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + call gSavageSpinOutStringBlastSpriteTemplateSHOT + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x5 0x0 0x32 0x1 + call gSavageSpinOutStringBlastSpriteTemplateSHOT + call gSavageSpinOutStringBlastSpriteTemplateSHOT + call gSavageSpinOutStringBlastSpriteTemplateSHOT + launchtemplate gSpiderWebSpriteTemplate 0x82 0x0 @ spider web + call gSavageSpinOutStringBlastSpriteTemplateSHOT + delay 0xe + blendoff + waitforvisualfinish + unloadspritegfx ANIM_TAG_STRING + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_COCOON + loadspritegfx ANIM_TAG_IMPACT @hit + delay 0x1 + invisible ANIM_TARGET + delay 0x0 + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + delay 0x0 + jumpargeq 0x7 ANIM_TARGET SavageSpinOutOnPlayer +SavageSpinOutOnOpponent: + launchtemplate gSavageSpinOutCacoonSpriteTemplate 0x82 0x6 0x0 ANIM_TARGET 0x2 0x0 0x0 0x80 + goto FinishSavageSpinOut +SavageSpinOutOnPlayer: + launchtemplate gSavageSpinOutCacoonSpriteTemplate 0x3 0x6 0x0 ANIM_TARGET 0x2 0x0 0x0 0x80 +FinishSavageSpinOut: + fadetobg BG_IN_AIR + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0x1000 0x0 0xffff @+0x1000 + waitbgfadein + delay 0x10 + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed @0 + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed @-0x1000 + delay 0x4 + call SavageSpinOutCrash_2 @SeismicToss2 + delay 0xa + call SavageSpinOutCrash_1 @SeismicToss1 + delay 0xa + call SavageSpinOutCrash_2 @SeismicToss2 + delay 0xa + call SavageSpinOutCrash_1 @SeismicToss1 + delay 0xc + call UnsetPsychicBg + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles - no idea why though - something to do with the background scrolling + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 @ user fly on screen on enemy side + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_ATTACKER + delay 0x1E + unloadspritegfx ANIM_TAG_MUD_SAND + unloadspritegfx ANIM_TAG_IMPACT @hit + loadspritegfx ANIM_TAG_CUT @cut + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + loadspritegfx ANIM_TAG_AIR_WAVE_2 @white/gray + launchtask AnimTask_ShakeMonInPlace 0x82 0x5 ANIM_TARGET 0x4 0x0 0xc 0x1 + launchtask AnimTask_ShakeMonInPlace 0x82 0x5 ANIM_TARGET 0x4 0x0 0xc 0x1 + createsprite gSavageSpinOutGreenCutSpriteTemplate, ANIM_TARGET, 2, 0x28, 0xffe0, 0x0 + createsprite gSavageSpinOutGreenCutSpriteTemplate, ANIM_TARGET, 2, 0x28, 0xffd0, 0x0 + playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET + delay 0xc + playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSavageSpinOutWhiteExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSavageSpinOutWhiteExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + launchtemplate gSpiderWebSpriteTemplate 0x82 0x0 @ spider web + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSavageSpinOutWhiteExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSavageSpinOutWhiteExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSavageSpinOutWhiteExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +gSavageSpinOutStringBlastSpriteTemplateSHOT: + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0xe 0xfff4 0x0 0xfff4 0xf 0x0 0x0 + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0x1a 0x8 0xc 0x8 0xf 0x0 0x0 + delay 0x3 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0xe 0xfff4 0x0 0xfff4 0xf 0x1 0x0 + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0x1a 0x8 0xc 0x8 0xf 0x1 0x0 + delay 0x3 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0xe 0xfff4 0x0 0xfff4 0xf 0x2 0x0 + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0x1a 0x8 0xc 0x8 0xf 0x2 0x0 + delay 0x3 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0xe 0xfff4 0x0 0xfff4 0xf 0x3 0x0 + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0x1a 0x8 0xc 0x8 0xf 0x3 0x0 + delay 0x3 + return +SavageSpinOutCrash_1: + createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, 0xfff6, 0xfff8, 0x1, 0x1 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x0 0xc 0xffe8 0xfff0 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x0 0x10 0xffda 0xfff6 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x1 0xe 0xffec 0xffee 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x1 0xc 0xffdc 0xfff0 0x18 + return +SavageSpinOutCrash_2: + createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, 0xa, 0xfff8, 0x1, 0x1 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x0 0xc 0xffd0 0xfff0 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x0 0x10 0xfff0 0xfff6 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x1 0xe 0xffcc 0xffee 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x1 0xc 0xffe0 0xfff0 0x18 + return +SlowSavageSpinOutBackgroundSpeed: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xfd56 0x0 0xffff @-0x2aa + delay 0x1 + return + + Move_NEVER_ENDING_NIGHTMARE:: + loadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_ASSURANCE_HAND @purple hand + loadspritegfx ANIM_TAG_FIRE_PLUME @blast burn + loadspritegfx ANIM_TAG_POISON_BUBBLE @purple + loadspritegfx ANIM_TAG_VERTICAL_HEX @hex + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call NeverendingNightmareBuffEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x40c0 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call NeverendingNightmareBuffEffect + delay 0x8 + call NeverendingNightmareBuffEffect + playsewithpan SE_M_STRING_SHOT2, SOUND_PAN_TARGET + call NeverendingNightmareAttackerRings + delay 0x1 + call NeverendingNightmareAttackerRings + delay 0x1 + call NeverendingNightmareAttackerRings + delay 0xa + playsewithpan SE_M_STRING_SHOT2, SOUND_PAN_TARGET + call NeverendingNightmareTargetRings + delay 0x1 + call NeverendingNightmareTargetRings + delay 0x1 + call NeverendingNightmareTargetRings + delay 0x1 + waitforvisualfinish + fadetobg BG_NEVERENDING_NIGHTMARE + waitbgfadein + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_TARGET 0x0 0x4 0x78 0x1 + playsewithpan SE_M_WHIRLPOOL, SOUND_PAN_TARGET + call NeverendingNightmareHands + call NeverendingNightmareHands + delay 0xa + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x0 0x10 0x40c0 @ fade to purple + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + loadspritegfx ANIM_TAG_EXPLOSION_2 + unloadspritegfx ANIM_TAG_THIN_RING + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_VERTICAL_HEX, 0x2, 0xA, 0xA, 0x580A @;Purple + call NeverendingNightmareGeyser + playsewithpan SE_M_SACRED_FIRE, SOUND_PAN_TARGET + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffe0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffec 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x0 0xfff0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x14 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x20 0x0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x14 0xa 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0x0 0x10 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffec 0xa 0x18 0x0 0x0 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + call NeverendingNightmareGeyser + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffc0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x6 0x6 0xffd8 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x46 0x6 0x0 0xffe0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x46 0x6 0x28 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x40 0x0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x28 0x14 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0x0 0x20 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffd8 0x14 0x18 0x0 0x0 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + call NeverendingNightmareGeyser + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffa0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x6 0x6 0xffc4 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x46 0x6 0x0 0xffd0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x46 0x6 0x3c 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x60 0x0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x3c 0x1e 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0x0 0x30 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffc4 0x1e 0x18 0x0 0x0 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + call NeverendingNightmareGeyser + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x10 0x0 0x40c0 @ fade to normal + waitforvisualfinish + restorebg + waitbgfadeout + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +NeverendingNightmareBuffEffect: + launchtemplate gNeverEndingNightmareFocusEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gNeverEndingNightmareFocusEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gNeverEndingNightmareFocusEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gNeverEndingNightmareFocusEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gNeverEndingNightmareFocusEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +NeverendingNightmareTargetRings: + launchtemplate gNeverEndingNightmareRingTargetSpriteTemplate 0x83 0x4 0x0 0x0 0x100 0x0 + delay 0x8 + return +NeverendingNightmareAttackerRings: + launchtemplate gNeverEndingNightmareRingAttackerSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + delay 0xe + return +NeverendingNightmareHands: + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x0 0xffc0 0x20 @ 0,-32 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x2c 0xffd4 0x20 @ +44,-44 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x3c 0x0 0x20 @ +60,0 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x28 0x28 0x20 @ +40,+40 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x0 0x38 0x20 @ +0,+56 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0xffda 0x26 0x20 @ -38,+38 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0xffca 0x0 0x20 @ -54, +0 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0xffdc 0xffdc 0x20 @ -36, -36 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x0 0xffce 0x20 @ 0, -50 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x22 0xffde 0x20 @ +34, -34 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x2e 0x0 0x20 @ +46, +0 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x20 0x20 0x20 @ +32, +32 + delay 0x2 + return +NeverendingNightmareGeyser: + createsprite gNeverEndingNightmareExplosionSpriteTemplate, ANIM_TARGET, 4, 0x0003, 0x0005, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfffc, 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0xfff5, 0xfff1, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x100D, 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0008, 0xfffb, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x4, 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0xfffa, 0x0012, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0000, 0x0005, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfffc, 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0003, 0xfff5, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x100D, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0xfff5, 0xffe1, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x4, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0008, 0xffeb, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0xfffa, 0x0002, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfffc, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0000, 0xfff5, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x100D, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0003, 0xffe5, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x4, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0xfff5, 0xffd1, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0008, 0xffdb, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfffc, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0xfffa, 0xfff2, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x100D, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0000, 0xffe5, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x4, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x10 + return + + Move_CORKSCREW_CRASH:: + loadspritegfx ANIM_TAG_SPIKES @metal bits + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_CORKSCREW @drill + loadspritegfx ANIM_TAG_WHIRLWIND_LINES @whirlwind + loadspritegfx ANIM_TAG_MUD_SAND @rock + monbg ANIM_ATTACKER + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x2 0x0 0xb 0x6318 @fade atker to gray + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_SPIKES, 0x0, 0xC, 0xC, 0x6318 @;Gray + playsewithpan SE_ESCALATOR, SOUND_PAN_ATTACKER + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_ATTACKER 0x0 0x2 0x4f 0x1 + launchtemplate gCorkscrewCrashChargeSpriteTemplate 0x2 0x1 0x0 + call CorkscrewCrashMetalFlare + call CorkscrewCrashMetalFlare + call CorkscrewCrashMetalFlare + call CorkscrewCrashMetalFlare + call CorkscrewCrashMetalFlare + waitforvisualfinish + clearmonbg ANIM_ATTACKER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x0 0xb 0x0 0x6318 @fade atker back + waitforvisualfinish + stopsound + invisible ANIM_ATTACKER + launchtemplate gCorkscrewCrashCorkscrewFlyUpSpriteTemplate 0x2 0x7 0x0 0x0 0x4e0 0x24 0x15 0x1 ANIM_ATTACKER + playsewithpan SE_ESCALATOR, SOUND_PAN_ATTACKER + fadetobg BG_HIGHSPEED_OPPONENT + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xf700 0x0 0x1 0xffff + waitbgfadein + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET CorkscrewCrashOnPlayer +CorkscrewCrashOnOpponent: + launchtemplate gCorkscrewCrashRightUpSpriteTemplate 0x32 0x5 0xfff0 0x88 0x100 0x38 0x15 + waitforvisualfinish + delay 0xa + launchtemplate gCorkscrewCrashLeftUpSpriteTemplate 0x32 0x5 0x0120 0x38 0xfff0 0x38 0x15 + waitforvisualfinish + visible ANIM_TARGET + delay 0x5 + goto FinishCorkscrewCrash +CorkscrewCrashOnPlayer: + launchtemplate gCorkscrewCrashLeftDownSpriteTemplate 0x32 0x5 0x0120 0x08 0xfff0 0x0f 0x15 + waitforvisualfinish + delay 0xa + launchtemplate gCorkscrewCrashRightDownSpriteTemplate 0x32 0x5 0xfff0 0x38 0x100 0x38 0x15 + waitforvisualfinish + visible ANIM_TARGET + delay 0x5 +FinishCorkscrewCrash: + launchtemplate gCorkscrewCrashStrikeSpriteTemplate 0x82 0x1 0x14 + loadspritegfx ANIM_TAG_IMPACT @hit + delay 0x10 + stopsound + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBasicHitSplatSpriteTemplate 0x83 0x4 0x0 0x0 0x1 0x0 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0xf 0x0 0x4 @ shove target down a bit + waitforvisualfinish + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_TARGET + launchtemplate gCorkscrewCrashCorkscrewFlyDownSpriteTemplate 0x83 0x3 0x0 0xffc0 0x0f + delay 0xf + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x2 0x30 + launchtemplate gCorkscrewCrashCorkscrewFlyDownSpriteTemplate 0x83 0x3 0x0 0xfffe 0x03 + call CorkscrewCrashSpinningWind + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x0 + launchtemplate gCorkscrewCrashCorkscrewFlyDownSpriteTemplate 0x83 0x3 0x0 0xfffe 0x03 + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x1 + launchtemplate gCorkscrewCrashCorkscrewFlyDownSpriteTemplate 0x83 0x3 0x0 0xfffe 0x03 + delay 0x4 + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x2, 0x0, 0x10, 0x7fff + waitforvisualfinish + delay 0x10 + call ResetFromWhiteScreen + waitforvisualfinish + end +CorkscrewCrashSpinningWind: + launchtemplate gWhirlwindLineSpriteTemplate 0x3 0x5 0x0 0xfff8 0x1 0x2c 0x0 + launchtemplate gWhirlwindLineSpriteTemplate 0x3 0x5 0x0 0x0 0x1 0x3c 0x1 + launchtemplate gWhirlwindLineSpriteTemplate 0x3 0x5 0x0 0x8 0x1 0x3c 0x2 + launchtemplate gWhirlwindLineSpriteTemplate 0x3 0x5 0x0 0x10 0x1 0x3c 0x3 + launchtemplate gWhirlwindLineSpriteTemplate 0x3 0x5 0x0 0x18 0x1 0x3c 0x4 + launchtemplate gWhirlwindLineSpriteTemplate 0x3 0x5 0x0 0x20 0x1 0x3c 0x0 + return +CorkscrewCrashMetalFlare: + launchtemplate gCorkscrewCrashMetalBitSpriteTemplate 0x82 0x7 0x0 0x1c 0x210 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gCorkscrewCrashMetalBitSpriteTemplate 0x82 0x7 0x0 0x20 0x1e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gCorkscrewCrashMetalBitSpriteTemplate 0x82 0x7 0x0 0x21 0x240 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gCorkscrewCrashMetalBitSpriteTemplate 0x82 0x7 0x0 0x1f 0x190 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gCorkscrewCrashMetalBitSpriteTemplate 0x82 0x7 0x0 0x1c 0x200 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gCorkscrewCrashMetalBitSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x2 + return +CorkscrewCrashSprayRocks: + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x0 0xc 0xffe8 0xfff0 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x0 0x10 0xffda 0xfff6 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x1 0xe 0xffec 0xffee 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x1 0xc 0xffdc 0xfff0 0x18 + return + + Move_INFERNO_OVERDRIVE:: + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_SMALL_EMBER @fire + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_CIRCLE_OF_LIGHT, 0x0, 0xA, 0xA, 0x1F + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + fadetobg BG_INFERNO_OVERDRIVE + waitbgfadeout + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET InfernoOverdriveOnPlayer +InfernoOverdriveOnOpponent: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xfb00 0x0 0x0 0xFFFF + goto FinishInfernoOverdrive +InfernoOverdriveOnPlayer: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0500 0x0 0x0 0xFFFF +FinishInfernoOverdrive: + waitbgfadein + monbg ANIM_ATTACKER + setblends 0x80c + loopsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_ATTACKER, 0x13, 0x8 + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_ATTACKER 0x0 0x2 0x4f 0x1 + launchtemplate gInfernoOverdriveChargeSpriteTemplate 0x2 0x1 0x0 + call InfernoOverdriveFireSpin + call InfernoOverdriveFireSpin + call InfernoOverdriveFireSpin + call InfernoOverdriveFireSpin + call InfernoOverdriveFireSpin + waitforvisualfinish + stopsound + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + unloadspritegfx ANIM_TAG_SMALL_EMBER @fire + loadspritegfx ANIM_TAG_EXPLOSION + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + loadspritegfx ANIM_TAG_METEOR @superpower + loadspritegfx ANIM_TAG_VERTICAL_HEX @red color + clearmonbg ANIM_ATTACKER + launchtemplate gInfernoOverdriveSuperpowerSpriteTemplate 0x83 0x1 0x0 @ super power shot + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + delay 0x10 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x8 0x0 0x10 0x1 + playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_TARGET 0x0 0x2 0x4f 0x1 + call InfernoOverdriveExplosion + delay 0x6 + call InfernoOverdriveExplosion + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x1, 0x0, 0x10, 0x001b @ red bg pal + delay 0x6 + call InfernoOverdriveExplosion + waitforvisualfinish + call ResetFromRedScreen + blendoff + end +InfernoOverdriveFireSpin: + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x1c 0x210 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x20 0x1e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x21 0x240 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x1f 0x190 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x1c 0x200 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x2 + return +InfernoOverdriveExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + return + + Move_HYDRO_VORTEX:: + loadspritegfx ANIM_TAG_SPLASH @dive + loadspritegfx ANIM_TAG_SWEAT_BEAD @dive + loadspritegfx ANIM_TAG_ICE_CRYSTALS @crabhammer bubbles + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_METEOR @superpower + loadspritegfx ANIM_TAG_WATER_ORB @whirlpool + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_CreateSurfWave 0x2 0x1 0x0 + delay 0x18 + panse_1B SE_M_SURF, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x2, 0x0 + waitforvisualfinish + loadspritegfx ANIM_TAG_ROUND_SHADOW + playsewithpan SE_M_HEADBUTT, SOUND_PAN_ATTACKER + launchtemplate gDiveBallSpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + waitforvisualfinish + playsewithpan SE_M_DIVE, SOUND_PAN_ATTACKER + launchtemplate gDiveWaterSplashSpriteTemplate 0x3 0x1 0x0 + call DiveSetUpWaterDroplets + call DiveSetUpWaterDroplets + call DiveSetUpWaterDroplets + call DiveSetUpWaterDroplets + call DiveSetUpWaterDroplets + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xfd00 0x15 0x0 0x1a + delay 0x1a + invisible ANIM_TARGET + waitforvisualfinish + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x7 + delay 0x5 + fadetobg BG_WATER_PULSE + waitbgfadeout + delay 0x5 + visible ANIM_ATTACKER + visible ANIM_TARGET + loopsewithpan SE_M_CRABHAMMER, SOUND_PAN_TARGET, 0x14, 0x3 + call HydroVortexBubbles + loadspritegfx ANIM_TAG_FOCUS_ENERGY + playsewithpan SE_M_WATERFALL, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x5da0 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + waitforvisualfinish + unloadspritegfx ANIM_TAG_SPLASH + unloadspritegfx ANIM_TAG_SWEAT_BEAD + loadspritegfx ANIM_TAG_IMPACT + launchtemplate gHydroVortexSuperpowerSpriteTemplate 0x83 0x1 0x0 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + invisible ANIM_ATTACKER + delay 0x10 + launchtemplate gHydroVortexImpactSpriteTemplate 0x83 0x4 0xa 0xfff8 0x1 0x1 + playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x0 0x10 0x5da0 + loadspritegfx ANIM_TAG_GUST + launchtask AnimTask_HorizontalShake 0x5 0x3 0x1 0x8 0x3c + call HydroVortexWhirlpoolHurricane + call HydroVortexWhirlpoolHurricane + call HydroVortexWhirlpoolHurricane + call HydroVortexWhirlpoolHurricane + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x10 0x0 0x5da0 + waitforvisualfinish + restorebg + waitbgfadeout + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +HydroVortexBubbles: + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0xa 0xa 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate, ANIM_TARGET, 2, 0xa, 0xa, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0x14 0xffec 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate, ANIM_TARGET, 2, 0x14, 0xffec, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0xfff1 0xf 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate ANIM_TARGET, 2, 0xfff1, 0xf, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0x0 0x0 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate ANIM_TARGET, 2, 0x0, 0x0, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0xfff6 0xffec 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate ANIM_TARGET, 2, 0xfff6, 0xffec, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0x10 0xfff8 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate ANIM_TARGET, 2, 0x10, 0xfff8, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0x5 0x8 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate ANIM_TARGET, 2, 0x5, 0x8, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0xfff0 0x0 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate ANIM_TARGET, 2, 0xfff0, 0x0, 0x14, ANIM_TARGET + return +HydroVortexWhirlpoolHurricane: + playsewithpan SE_M_WHIRLPOOL, SOUND_PAN_TARGET + launchtemplate gHydroVortexHurricaneSpriteTemplate 0x82 0x2 0x0 0xfff0 + launchtemplate gHydroVortexImpactSpriteTemplate 0x83 0x4 0xfff6 0xfff8 0x1 0x1 + launchtask AnimTask_AnimateGustTornadoPalette 0x5 0x2 0x1 0x46 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 0x1 + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 0x1 + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a 0x1 + delay 0x2 + launchtemplate gHydroVortexImpactSpriteTemplate 0x83 0x4 0xa 0xfff8 0x1 0x1 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 0x1 + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e 0x1 + launchtemplate gHydroVortexHurricaneSpriteTemplate 0x82 0x2 0x0 0xfff0 + launchtask AnimTask_AnimateGustTornadoPalette 0x5 0x2 0x1 0x46 + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce 0x1 + delay 0x2 + return + + Move_BLOOM_DOOM:: + loadspritegfx ANIM_TAG_FLOWER @petal + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_RAZOR_LEAF @green + loadspritegfx ANIM_TAG_GUST @hurricane + loadspritegfx ANIM_TAG_VERTICAL_HEX @hex diamond + monbg ANIM_ATTACKER + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + setblends 0x80c + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x4 0x0 + loopsewithpan SE_SHINY, SOUND_PAN_ATTACKER, 0x9, 0x3 + launchtemplate gBloomDoomGreenChargeSpriteTemplate 0x2 0x1 0x0 + delay 0x3C + blendoff + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x0 + playsewithpan SE_M_ATTRACT, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x4 + delay 0x2 + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x8 + playsewithpan SE_M_ATTRACT, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0xc + delay 0x2 + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x10 + playsewithpan SE_M_ATTRACT, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x14 + delay 0x2 + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x18 + playsewithpan SE_M_ATTRACT, SOUND_PAN_ATTACKER + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x4 0x0 0x0 + waitforvisualfinish + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + call BloomDoomHurricane + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + call BloomDoomFlowerGeyser + call BloomDoomFlowerGeyser + call BloomDoomHurricane + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + call BloomDoomFlowerGeyser + call BloomDoomFlowerGeyser + call BloomDoomHurricane + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + call BloomDoomFlowerGeyser + call BloomDoomFlowerGeyser + call BloomDoomHurricane + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + call BloomDoomFlowerGeyser + call BloomDoomFlowerGeyser + call BloomDoomHurricane + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + call BloomDoomFlowerGeyser + call BloomDoomFlowerGeyser + call BloomDoomHurricane + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + call BloomDoomFlowerGeyser + call BloomDoomFlowerGeyser + fadetobg BG_BLOOM_DOOM + waitbgfadein + loadspritegfx ANIM_TAG_ORBS + delay 0x5 + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x0 0x7 0x18 0x10 0x0 0x2 0x2 0x0 0x0 + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x42 0x7 0x40 0x18 0x0 0x3 0x1 0x1 0x0 + launchtemplate gAromatherapyBigFlowerSpriteTemplate 0x0 0x7 0x10 0x18 0x0 0x2 0x1 0x0 0x0 + delay 0x5 + launchsoundtask SoundTask_LoopSEAdjustPanning, 0x7, 0xf0, 0xffc0, SOUND_PAN_TARGET, 0x1, 0xf, 0x0, 0x5 + launchtask AnimTask_ShakeMon 0x2 0x5 0x0 0x0 0x4 0x32 0x1 @ shake attacker + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x4 0x0 0x72 0x1 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x0 0xb 0x33ed + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x42 0x7 0x30 0xc 0x0 0x4 0x3 0x1 0x0 + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x0 0x7 0x64 0x10 0x0 0x3 0x2 0x0 0x0 + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x0 0x7 0x4a 0x18 0xb4 0x3 0x2 0x0 0x0 + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x42 0x7 0x50 0x1e 0x0 0x4 0x1 0x1 0x0 + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x0 0x7 0x80 0xc 0x0 0x3 0x3 0x0 0x0 + launchtemplate gAromatherapyBigFlowerSpriteTemplate 0x0 0x7 0x5a 0x10 0x0 0x2 0x1 0x0 0x0 + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0xb 0x0 0x33ed + loadspritegfx ANIM_TAG_EXPLOSION @explosion + call BloomDoomPetalBlast + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_DEF, 0x1, 0x0, 0x10, 0x33ed + call BloomDoomPetalBlast + launchtask AnimTask_IsTargetPartner 0x5 0x0 + jumpargeq 0x0 0x1 BloomDoomFadeScreenTargetPartner + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL - ANIM_PAL_DEF, 0x1, 0x0, 0x10, 0x33ed @ green bg pal +BloomDoomEnding: + call BloomDoomPetalBlast + waitforvisualfinish + clearmonbg ANIM_ATTACKER + call ResetFromGreenScreen + end +BloomDoomFadeScreenTargetPartner: + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ATK | ANIM_PAL_OPPONENT1 | ANIM_PAL_OPPONENT2, 0x1, 0x0, 0x10, 0x33ed @ green bg pal + goto BloomDoomEnding +BloomDoomHurricane: + launchtemplate gBloomDoomHurricaneSpriteTemplate 0x2 0x2 0x0 0xfff0 + launchtask AnimTask_AnimateGustTornadoPalette 0x5 0x2 0x1 0x46 + return +BloomDoomFlowerGeyser: + launchtemplate gBloomDoomFlowerGeyserSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0xfffc 0x10 @ -4, -0x10 + delay 0x0 + launchtemplate gBloomDoomFlowerGeyserSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0x100D 0x10 @ + delay 0x0 + launchtemplate gBloomDoomFlowerGeyserSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0x4 0x10 + delay 0x0 + launchtemplate gBloomDoomFlowerGeyserSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0xfff0 0x10 + delay 0x0 + return +BloomDoomHyperBeam: + launchtemplate gBloomDoomGreenBeamSpriteTemplate 0x82 0x0 + launchtemplate gBloomDoomGreenBeamSpriteTemplate 0x82 0x0 + delay 0x1 + return +BloomDoomPetalBlast: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBloomDoomExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x0 0xffe0 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x16 0xffea 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x1e 0x0 0x10 + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBloomDoomExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x14 0x14 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x0 0x1c 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0xffed 0x13 0x10 + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBloomDoomExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0xffe5 0x0 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0xffee 0xffee 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x0 0xffe7 0x10 + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBloomDoomExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x11 0xffef 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x17 0x0 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x10 0x10 0x10 + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBloomDoomExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x2 + return +ResetFromGreenScreen: + launchtask AnimTask_AllBanksInvisible 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS, 0x2, 0x0, 0x0, 0x33ED @Everything from green + restorebg + waitbgfadeout + setarg 0x7 0xffff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitbgfadein + waitforvisualfinish + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG, 0x1, 0x0, 0x0, 0x33ED + waitforvisualfinish + return + + Move_GIGAVOLT_HAVOC:: + loadspritegfx ANIM_TAG_HAVOC_SPEAR + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_ELECTRIC_ORBS + loadspritegfx ANIM_TAG_ELECTRICITY + loadspritegfx ANIM_TAG_SPARK_2 + loadspritegfx ANIM_TAG_GRAY_SMOKE + loadspritegfx ANIM_TAG_THIN_RING + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x6 0x0 0x10 0x0000 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x20 0x18 0xbe 0xc 0x0 0x1 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x50 0x18 0x16 0xc 0x0 0x1 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x9c 0x18 0x79 0xd 0x0 0x1 0x1 + delay 0xa + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x64 0x18 0x3c 0xa 0x0 0x1 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0xaa 0x18 0x2a 0xb 0x0 0x1 0x1 + delay 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0xee 0x18 0xa5 0xa 0x0 0x1 0x1 + delay 0x0 + delay 0x5 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x64 0x18 0x3c 0xa 0x0 0x1 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0xaa 0x18 0x2a 0xb 0x0 0x1 0x1 + delay 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0xee 0x18 0xa5 0xa 0x0 0x1 0x1 + delay 0x5 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x20 0x14 0x0 0x0 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x60 0x14 0x1 0x0 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0xa0 0x14 0x0 0x0 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0xe0 0x14 0x2 0x0 + delay 0x5 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x64 0x18 0x3c 0xa 0x0 0x1 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0xaa 0x18 0x2a 0xb 0x0 0x1 0x1 + delay 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0xee 0x18 0xa5 0xa 0x0 0x1 0x1 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + monbg ANIM_ATTACKER + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x3c 0x2 0xc @charge particles to user + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0xe0 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x10 + launchtemplate gGigavoltHavocChargingSpearSpriteTemplate 0x2 0x1 ANIM_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x16 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x16 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x16 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x16 0x2c 0xe0 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x18 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x18 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x18 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x18 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1a 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1a 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1a 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1a 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1c 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1c 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1c 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1c 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1e 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1e 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1e 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1e 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x20 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x20 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x20 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x20 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0xa 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0xa 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0xa 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0xa 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x10 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x2a 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x2a 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x2a 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x2a 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + waitforvisualfinish + playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET + launchtemplate gGigavoltHavocLaunchSpearSpriteTemplate 0x83 0x1 0x0 + launchtemplate gElectricPuffSpriteTemplate 0x2 0x3 0x0 0x10 0x10 + delay 0x2 + launchtemplate gElectricPuffSpriteTemplate 0x2 0x3 0x0 0xfff0 0xfff0 + delay 0xe + clearmonbg ANIM_ATTACKER + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x8 0x1c @shake target + unloadspritegfx ANIM_TAG_HAVOC_SPEAR + loadspritegfx ANIM_TAG_SHOCK_3 @thunderbolt + launchtemplate gThunderboltOrbSpriteTemplate 0x83 0x4 0x2c 0x0 0x0 0x3 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x0 0x0 0xc 0x5bff + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0x20 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0x60 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0xe0 0x28 0x2 0x8003 + playsewithpan SE_M_HYPER_BEAM, SOUND_PAN_TARGET + delay 0x19 + loadspritegfx ANIM_TAG_VERTICAL_HEX + launchtemplate gGigavoltHavocRingsSpriteTemplate 0x83 0x4 0x0 0x0 0x100 0x0 + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_DEF, 0x2, 0xc, 0x0, 0x5bff + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG, 0x1, 0x10, 0x0, 0x0000 + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xa 0x0 + waitforvisualfinish + end +HavocSpearGeyser: + createsprite gGigavoltHavocGeyserSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfffc, 0x10 @ -4, -0x10 + delay 0x0 + createsprite gGigavoltHavocGeyserSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x100D, 0x10 @ + delay 0x0 + createsprite gGigavoltHavocGeyserSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x4, 0x10 + delay 0x0 + createsprite gGigavoltHavocGeyserSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x10 + delay 0x0 + return +HavocSpearSparkTarget: + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc 0x0 0x14 0x0 0x8000 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x0 0x14 0x0 0x8000 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc 0x40 0x14 0x1 0x8000 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x40 0x14 0x1 0x8000 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc 0x80 0x14 0x0 0x8000 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x80 0x14 0x0 0x8000 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc SOUND_PAN_ATTACKER 0x14 0x2 0x8000 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc SOUND_PAN_ATTACKER 0x14 0x2 0x8000 + return + + Move_SHATTERED_PSYCHE:: + loadspritegfx ANIM_TAG_IMPACT @hit + loadspritegfx ANIM_TAG_BLUE_LIGHT_WALL @reflect + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_PINK_PETAL @pink + loadspritegfx ANIM_TAG_TORN_METAL @brick break shatter + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPalExclude 0x5 0x5 0x0 0x0 0x0 0x10 0x0 + waitforvisualfinish + launchtask AnimTask_SetAllNonAttackersInvisiblity 0x5 0x1 0x1 + waitforvisualfinish + launchtemplate gShatteredPsychePinkChargeSpriteTemplate 0x2 0x1 0x0 + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER + delay 0x4 + fadetobg BG_SHATTERED_PSYCHE + delay 0x4 + launchtask AnimTask_BlendBattleAnimPalExclude 0x5 0x5 0x0 0x0 0x10 0x0 0x0 + delay 0x7 + playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER + launchtask AnimTask_ShakeMon 0x2 0x5 0x1 0x3 0x0 0xf 0x1 + launchtask AnimTask_ScaleMonAndRestore 0x5 0x5 0xfffc 0xfffc 0xf 0x1 0x1 + waitforvisualfinish +ShatteredPsycheCheckBattler: + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET ShatteredPsycheOnPlayer +ShatteredPsycheOnOpponent: + call ShatteredPsycheFlingOpponent + waitforvisualfinish + goto ShatteredPsycheFinish +ShatteredPsycheOnPlayer: + call ShatteredPsycheFlingPlayer + waitforvisualfinish + call ShatteredPsycheFlingPlayer + waitforvisualfinish +ShatteredPsycheFinish: + delay 0x8 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + restorebg + launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x3 0x0 0xf 0x1 + launchtask AnimTask_ScaleMonAndRestore 0x5 0x5 0xfffc 0xfffc 0xf 0x1 0x1 + createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x0, 0x0, 0x0 @ -8, -12 + createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x1, 0x0, 0x0 + createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x2, 0x0, 0x0 + createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x3, 0x0, 0x0 + waitbgfadeout + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +ShatteredPsycheFlingOpponent: + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffe6 0x10 0x1 0x4 @ -26, +16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x1a 0xfff0 0x1 0x1 @ 26, -16 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x1a 0xfff0 0x1 0x4 @ -26,-16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0xffe6 0x10 0x1 0x1 @ 26, 16 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x0 0x20 0x1 0x4 @ 0,32 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x0 0xffe0 0x1 0x1 @ 0, -32 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x0 0xffe0 0x1 0x4 @ 0,-32 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x0 0x20 0x1 0x1 @ 0, 32 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x1a 0x10 0x1 0x4 @ 26,16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0xffe6 0xfff0 0x1 0x1 @ -26, -16 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffe6 0xffe0 0x1 0x4 @ 26,-16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x1a 0x10 0x1 0x1 @ 0, 32 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x5 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffe6 0x10 0x1 0x4 @ -26, +16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x1a 0xfff0 0x1 0x1 @ 26, -16 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x1a 0xfff0 0x1 0x4 @ -26,-16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0xffe6 0x10 0x1 0x1 @ 26, 16 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + return +ShatteredPsycheFlingPlayer: + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffe6 0x10 0x1 0x4 @ -26,-16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x1a 0xfff0 0x1 0x1 @ 26, 16 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x20 0x0 0x1 0x4 @ 32,0 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0xffe0 0x0 0x1 0x1 @ + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffe0 0x0 0x1 0x4 @ -32,0 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x20 0x0 0x1 0x1 @ 32, 0 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xa 0x20 0x1 0x4 @ 10, -32 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0xfff6 0x5 0x1 0x1 @ 10, -32 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x5 + waitforvisualfinish + return + + Move_SUBZERO_SLAMMER:: + loadspritegfx ANIM_TAG_ICE_CRYSTALS @ice + loadspritegfx ANIM_TAG_ICE_CUBE @glacier + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_EXPLOSION_2, 0x0, 0xC, 0xC, 0x6A23 + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + fadetobg BG_ICE + waitbgfadeout + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET SubzeroSlammerOnPlayer +SubzeroSlammerOnOpponent: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xfd00 0x0 0x0 0xFFFF + goto SubzeroSlammerFinish +SubzeroSlammerOnPlayer: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0300 0x0 0x0 0xFFFF +SubzeroSlammerFinish: + waitbgfadein + monbg ANIM_ATK_PARTNER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x0 0x0 0xb 0x7e80 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0x0 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0x4 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0x8 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0xc + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0x10 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0x14 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0x18 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x20 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x0 0xb 0x0 0x7e80 + delay 0x20 + launchtask AnimTask_FrozenIceCubeAttacker 0x2 0x0 + waitplaysewithpan SE_M_HAIL, SOUND_PAN_TARGET, 0x11 + waitforvisualfinish + call SubzeroSlammerIceSwirl + launchtask AnimTask_BlendColorCycle 0x2 0x6 ANIM_PAL_ATK 0x2 0x2 0x0 0xb 0x7e80 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call SubzeroSlammerIceSwirl + call SubzeroSlammerIceSwirl + delay 0xa + clearmonbg ANIM_ATK_PARTNER + launchsoundtask SoundTask_LoopSEAdjustPanning 0x7 0xb0 0xffc0 SOUND_PAN_TARGET 0x4 0x4 0x0 0xa + launchtemplate gIceBeamOuterCrystalSpriteTemplate 0x2 0x5 0x14 0xc 0x0 0xc 0x14 + launchtemplate gIceBeamOuterCrystalSpriteTemplate 0x2 0x5 0x14 0xfff4 0x0 0xfff4 0x14 + delay 0x1 + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x4 0x0 0x7 0x7e80 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x2 0x0 0x19 0x1 + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceCrystalEffectShort + delay 0x5 + monbg ANIM_DEF_PARTNER + launchtask AnimTask_FrozenIceCube 0x82 0x0 + playsewithpan SE_M_HAIL, SOUND_PAN_TARGET + waitforvisualfinish + loadspritegfx ANIM_TAG_TORN_METAL + playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET + delay 0x3 + createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x0, 0x0, 0x0 @ -8, -12 + createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x1, 0x0, 0x0 + createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x2, 0x0, 0x0 + createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x3, 0x0, 0x0 + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x8 0x1c + call SubzeroSlammerExplosion + call SubzeroSlammerExplosion + clearmonbg ANIM_DEF_PARTNER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x5 0x7 0x0 0x7e80 + waitforvisualfinish + restorebg + waitbgfadeout + setarg 0x7 0xffff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitbgfadein + waitforvisualfinish + end +SubzeroSlammerExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSubzeroSlammerExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gIceCrystalHitLargeSpriteTemplate 0x82, 0x3, 0xfff6 0xfff6 0x0 + delay 0x3 + launchtemplate gIceCrystalHitSmallSpriteTemplate 0x82, 0x3, 0xa 0x14 0x0 + delay 0x3 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSubzeroSlammerExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gIceCrystalHitLargeSpriteTemplate 0x82, 0x3, 0xfffb 0xa 0x0 + delay 0x3 + launchtemplate gIceCrystalHitSmallSpriteTemplate 0x82, 0x3, 0x11 0xfff4 0x0 + delay 0x3 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSubzeroSlammerExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gIceCrystalHitSmallSpriteTemplate 0x82, 0x3, 0xfff1 0xf 0x0 + delay 0x3 + launchtemplate gIceCrystalHitSmallSpriteTemplate 0x82, 0x3, 0x0 0x0 0x0 + delay 0x3 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSubzeroSlammerExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + launchtemplate gIceCrystalHitLargeSpriteTemplate 0x82, 0x3, 0x14 0x2 0x0 + delay 0x3 + launchtemplate gIceCrystalHitLargeSpriteTemplate 0x82, 0x3, 0xfff6 0xfff6 0x0 + delay 0x3 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSubzeroSlammerExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + launchtemplate gIceCrystalHitSmallSpriteTemplate 0x82, 0x3, 0x11 0xfff4 0x0 + delay 0x3 + launchtemplate gIceCrystalHitSmallSpriteTemplate 0x82, 0x3, 0xfff1 0xf 0x0 + delay 0x3 + return +SubzeroSlammerIceSwirl: + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + launchtemplate gSubzeroSlammerIceSwirlSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSwirlSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + launchtemplate gSubzeroSlammerIceSwirlSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSwirlSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + launchtemplate gSubzeroSlammerIceSwirlSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSwirlSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + return + + Move_DEVASTATING_DRAKE:: - goto Move_TACKLE + loadspritegfx ANIM_TAG_PURPLE_DRAKE + loadspritegfx ANIM_TAG_POISON_BUBBLE @ purple + loadspritegfx ANIM_TAG_FOCUS_ENERGY @ focus energy + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @ shock wave + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call DevastatingDrakeBuffEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x40c0 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call DevastatingDrakeBuffEffect + delay 0x8 + call DevastatingDrakeBuffEffect + waitforvisualfinish + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeShockwaveSpriteTemplate 0x2 0x0 + delay 0x2a + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + monbg ANIM_ATTACKER + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeDrakeUpSpriteTemplate 0x2 0x7 0x0 0x0 0x4e0 0x24 0x15 0x1 ANIM_ATTACKER + clearmonbg ANIM_ATTACKER + fadetobg BG_SKY + invisible ANIM_ATTACKER + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0x1000 0x0 0xffff + waitbgfadein + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET DevastatingDrakeOnPlayer +DevastatingDrakeOnOpponent: + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeRightSpriteTemplate 0x32 0x5 0xfff0 0x88 0x100 0x38 0x15 @left to right + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeLeftSpriteTemplate 0x32 0x5 0x0120 0x38 0xfff0 0x38 0x15 @right to left + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeRightSpriteTemplate 0x32 0x5 0xfff0 0x08 0x100 0x0f 0x15 @left to right + goto DevastatingDrakeFinish +DevastatingDrakeOnPlayer: + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeLeftSpriteTemplate 0x32 0x5 0x0120 0x08 0xfff0 0x0f 0x15 @right to left + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeRightSpriteTemplate 0x32 0x5 0xfff0 0x38 0x100 0x38 0x15 @left to right + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeLeftSpriteTemplate 0x32 0x5 0x0120 0x78 0xfff0 0x58 0x15 @right to left +DevastatingDrakeFinish: + call UnsetPsychicBg + waitforvisualfinish + visible ANIM_TARGET + delay 0xa + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeStrikeSpriteTemplate 0x82 0x1 0x14 + delay 0x10 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + loadspritegfx ANIM_TAG_EXPLOSION + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_EXPLOSION, 0x0, 0xC, 0xC, 0x502B + launchtask AnimTask_HorizontalShake 0x5 0x3 0x1 0x5 0x35 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x2 0x0 0x10 0x40c0 @ fade to purple + call DevastatingDrakeExplosion + delay 0x6 + launchtask AnimTask_IsTargetPartner 0x5 0x0 + jumpargeq 0x0 0x1 DevastatingDrakeFadeTargetPartner + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL - ANIM_PAL_DEF, 0x6, 0x0, 0x10, 0x40c0 + call DevastatingDrakeExplosion + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL - ANIM_PAL_DEF, 0x0, 0x10, 0x0, 0x40c0 @ fade all but target back +DevastatingDrakeUniversalEnding: + loadspritegfx ANIM_TAG_FIRE_PLUME + loadspritegfx ANIM_TAG_VERTICAL_HEX + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + unloadspritegfx ANIM_TAG_PURPLE_DRAKE + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_FIRE_PLUME, 0x0, 0xC, 0xC, 0x502B + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_VERTICAL_HEX, 0x0, 0xC, 0xC, 0x502B + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_EXPLOSION_2, 0x0, 0xC, 0xC, 0x502B + launchtask AnimTask_HorizontalShake 0x5 0x3 0x1 0x5 0x20 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + call DevastatingDrakeGeyser + playsewithpan SE_M_SACRED_FIRE, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffe0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffec 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x0 0xfff0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x14 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x20 0x0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x14 0xa 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0x0 0x10 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffec 0xa 0x18 0x0 0x0 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + call DevastatingDrakeGeyser + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffc0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x6 0x6 0xffd8 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x46 0x6 0x0 0xffe0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x46 0x6 0x28 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x40 0x0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x28 0x14 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0x0 0x20 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffd8 0x14 0x18 0x0 0x0 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + call DevastatingDrakeGeyser + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffa0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x6 0x6 0xffc4 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x46 0x6 0x0 0xffd0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x46 0x6 0x3c 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x60 0x0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x3c 0x1e 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0x0 0x30 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffc4 0x1e 0x18 0x0 0x0 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + call DevastatingDrakeGeyser + delay 0x4 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x2 0x10 0x0 0x40c0 @ fade from purple + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ALL_BATTLERS 0x2 0x0 0x0 0x0 @ reset all colours + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +DevastatingDrakeFadeTargetPartner: + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ATK | ANIM_PAL_OPPONENT1 | ANIM_PAL_OPPONENT2, 0x6, 0x0, 0x10, 0x40c0 + call DevastatingDrakeExplosion + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ATK | ANIM_PAL_OPPONENT1 | ANIM_PAL_OPPONENT2, 0x0, 0x10, 0x0, 0x40c0 @ fade all but target back + goto DevastatingDrakeUniversalEnding +DevastatingDrakeBuffEffect: + launchtemplate gDevastatingDrakePurpleEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gDevastatingDrakePurpleEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gDevastatingDrakePurpleEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gDevastatingDrakePurpleEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gDevastatingDrakePurpleEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +DevastatingDrakeGeyser: + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0003 0x0005 0x1 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfffc 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0xfff5 0xfff1 0x1 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x100D 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0008 0xfffb 0x1 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x4 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0xfffa 0x0012 0x1 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfff0 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0000 0x0005 0x1 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfffc 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0003 0xfff5 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x100D 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0xfff5 0xffe1 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x4 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0008 0xffeb ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfff0 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0xfffa 0x0002 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfffc 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0000 0xfff5 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x100D 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0003 0xffe5 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x4 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0xfff5 0xffd1 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfff0 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0008 0xffdb ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfffc 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0xfffa 0xfff2 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x100D 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0000 0xffe5 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x4 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfff0 0x10 + return +DevastatingDrakeExplosion: + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + return + Move_BLACK_HOLE_ECLIPSE:: loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy @@ -24614,7 +26786,6 @@ Move_BLACK_HOLE_ECLIPSE:: waitforvisualfinish call ResetFromWhiteScreen end - BlackHoleEclipseExplosion: playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER launchtemplate gBlackHoleEclipseRedExplosionSpriteTemplate 0x3 0x4 0x0 0x0 ANIM_TARGET 0x1 @@ -24632,7 +26803,6 @@ BlackHoleEclipseExplosion: launchtemplate gBlackHoleEclipseRedExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 delay 0x6 return - ResetFromWhiteScreen: launchtask AnimTask_AllBanksInvisible 0xA 0x0 waitforvisualfinish @@ -24648,23 +26818,3323 @@ ResetFromWhiteScreen: waitforvisualfinish return -Move_TWINKLE_TACKLE:: -Move_CATASTROPIKA:: -Move_10000000_VOLT_THUNDERBOLT:: -Move_STOKED_SPARKSURFER:: -Move_EXTREME_EVOBOOST:: -Move_PULVERIZING_PANCAKE:: -Move_GENESIS_SUPERNOVA:: -Move_SINISTER_ARROW_RAID:: -Move_MALICIOUS_MOONSAULT:: -Move_OCEANIC_OPERETTA:: -Move_SPLINTERED_STORMSHARDS:: -Move_LETS_SNUGGLE_FOREVER:: -Move_CLANGOROUS_SOULBLAZE:: -Move_GUARDIAN_OF_ALOLA:: -Move_SEARING_SUNRAZE_SMASH:: -Move_MENACING_MOONRAZE_MAELSTROM:: -Move_LIGHT_THAT_BURNS_THE_SKY:: -Move_SOUL_STEALING_7_STAR_STRIKE:: - goto Move_TACKLE + +Move_TWINKLE_TACKLE:: + loadspritegfx ANIM_TAG_SPARKLE_2 @star + loadspritegfx ANIM_TAG_PINK_PETAL @pink + loadspritegfx ANIM_TAG_THIN_RING @ring + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER + call TwinkleTacklePinkStars + delay 0x8 + fadetobg BG_TWINKLE_TACKLE + launchtemplate gTwinkleTacklePinkRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + waitbgfadeout + invisible ANIM_TARGET + delay 0x1 + loadspritegfx ANIM_TAG_YELLOW_STAR + launchtemplate gTwinkleTackleStarGrowSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + waitforvisualfinish + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET TwinkleTackleOnPlayer +TwinkleTackleOnOpponent: + call PlayerTwinkling + goto TwinkleTackleFinish +TwinkleTackleOnPlayer: + call OpponentTwinkling +TwinkleTackleFinish: + waitforvisualfinish + delay 0x5 + visible ANIM_ATTACKER + visible ANIM_TARGET + launchtask AnimTask_SwayMon 0x5 0x5, 0x0 0x8 2048 1 ANIM_ATTACKER + call TwinkleTackleStars + waitforvisualfinish + launchtask AnimTask_SwayMon 0x5 0x5, 0x0 0x8 2048 1 ANIM_ATTACKER + call TwinkleTackleStars + waitforvisualfinish + loadspritegfx ANIM_TAG_SPARKLE_4 @detect + loadspritegfx ANIM_TAG_IMPACT @hit + loadspritegfx ANIM_TAG_PAIN_SPLIT @pain-split + delay 0x1 + launchtemplate gTwinkleTackleYellowImpactSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x0 + call TwinkleTackleStarsTarget + playsewithpan SE_M_WATERFALL, SOUND_PAN_TARGET + delay 0x5 + launchtask AnimTask_TwinkleTackleLaunch 0x2 0x1 89 + delay 89 + playsewithpan SE_M_DETECT, SOUND_PAN_TARGET + launchtemplate gTwinkleTackleTwinkleSpriteTemplate 0x8d, 0x3, 0x0 0x0 ANIM_TARGET @detect star + waitforvisualfinish + delay 0x10 + restorebg + delay 0x18 + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +TwinkleTacklePinkStars: + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xfff1 0x0 0x0 0x0 0x20 0x3c + launchtemplate gTwinkleTacklePinkRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + delay 0x8 + launchtemplate gTwinkleTacklePinkRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xc 0xfffb 0x0 0x0 0x20 0x3c + delay 0x8 + launchtemplate gTwinkleTacklePinkRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + return +PlayerTwinkling: + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 @ user fly on screen on enemy side + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x12 0x0 0x0 0x0 0x20 0x1c + delay 0x3 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x1f 0xfffb 0x0 0x0 0x20 0x1c + delay 0x16 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x90 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x80 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x70 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x60 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x50 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_TARGET + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x40 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x30 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x20 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x10 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x0 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xfff0 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xffe0 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xffd0 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xffc0 0xffc0 0x0 0x0 0x20 0x1c + return +OpponentTwinkling: + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 @ user fly on screen on enemy side + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x10 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x20 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x30 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x40 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x50 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x60 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x70 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x80 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x90 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xa0 0xfffb 0x0 0x0 0x20 0x1c + delay 0x5 + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_TARGET + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xa0 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x90 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x80 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x70 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x60 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x50 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x40 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x30 0x2c 0x0 0x0 0x20 0x1c + return +TwinkleTackleStars: + playsewithpan SE_M_TAIL_WHIP, SOUND_PAN_ATTACKER + launchtemplate gTwinkleTackleDigStarSpriteTemplate 0x2 0x6 0x0 0x0 0xc 0x4 0xfff0 0x12 + launchtemplate gTwinkleTackleDigStarSpriteTemplate 0x2 0x6 0x0 0x0 0x10 0x4 0xfff6 0x12 + launchtemplate gTwinkleTackleDigStarSpriteTemplate 0x2 0x6 0x0 0x1 0xe 0x4 0xffee 0x12 + launchtemplate gTwinkleTackleDigStarSpriteTemplate 0x2 0x6 0x0 0x1 0xc 0x4 0xfff0 0x12 + return +TwinkleTackleStarsTarget: + launchtemplate gTwinkleTackleImpactStarsSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xa0 0xffe0 + launchtemplate gTwinkleTackleImpactStarsSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xff00 0xffd8 + launchtemplate gTwinkleTackleImpactStarsSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0x80 0xfff0 + launchtemplate gTwinkleTackleImpactStarsSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0x1a0 0xffda + launchtemplate gTwinkleTackleImpactStarsSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xff80 0xffea + launchtemplate gTwinkleTackleImpactStarsSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xfe80 0xffe1 + return + +@ signature z moves +Move_CATASTROPIKA:: + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call EndureEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x5bff + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call EndureEffect + delay 0x8 + call EndureEffect + delay 0x8 + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gFlyBallUpSpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + waitforvisualfinish + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + unloadspritegfx ANIM_TAG_ROUND_SHADOW + launchtask AnimTask_GetTimeOfDay 0x2 0x0 + jumpargeq 0x0 0x0 CatastropikaDaytime + jumpargeq 0x0 0x2 CatastropikaAfternoon +CatastropikaNight: + fadetobg BG_BLUE_SKY_NIGHT + goto CatastropikaFinish +CatastropikaDaytime: + fadetobg BG_BLUE_SKY_DAY + goto CatastropikaFinish +CatastropikaAfternoon: + fadetobg BG_BLUE_SKY_AFTERNOON +CatastropikaFinish: + waitbgfadeout + visible ANIM_ATTACKER + loadspritegfx ANIM_TAG_ELECTRIC_ORBS @charge + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_SPARK_2 @spark + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x3c 0x2 0xc @charge particles to user + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0xe0 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gGrowingChargeOrbSpriteTemplate 0x2 0x1 ANIM_ATTACKER @ charge + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x16 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x16 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x16 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x16 0x2c 0xe0 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1a 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1a 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1a 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1a 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0xa 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0xa 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0xa 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0xa 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x10 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + restorebg + waitbgfadeout + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + waitforvisualfinish + loadspritegfx ANIM_TAG_METEOR + invisible ANIM_ATTACKER + visible ANIM_TARGET + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + launchtemplate gCatastrokpikaSuperpowerSpriteTemplate 0x83 0x1 0x0 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0x20 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0x60 0x8 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0xa0 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0xe0 0x8 0x2 0x3 + delay 0x1 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0x20 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0x60 0x8 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0xa0 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0xe0 0x8 0x2 0x3 + delay 0x1 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0x20 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0x60 0x8 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0xa0 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0xe0 0x8 0x2 0x3 + delay 0xd + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0x15 0x0 0x4 + loadspritegfx ANIM_TAG_MUD_SAND + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0xc 0xffe8 0xfff0 0x18 @ 12, -48, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0x10 0xffda 0xfff6 0x18 @ 16, -16, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xe 0xffec 0xffee 0x18 @ 14, -52, -18, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xc 0xffdc 0xfff0 0x18 @ 12, -32, -16, 24 + loadspritegfx ANIM_TAG_LIGHTNING @thunder + call CatastropikaThundering + invisible ANIM_TARGET + unloadspritegfx ANIM_TAG_MUD_SAND + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + call CatastropikaThundering + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + call CatastropikaThundering + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + call CatastropikaThundering + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x4, 0x0, 0x10, 0x7fff @ bg to white + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + call CatastropikaThundering + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x4, 0x10, 0x0, 0x7fff @ bg to white + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 @fix tgt position + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +CatastropikaThundering: + playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0xfff0 + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0x10 + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0xfff0 + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0x10 + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0xfff0 + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0x10 + delay 0x1 + return + + +Move_10000000_VOLT_THUNDERBOLT:: + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + loadspritegfx ANIM_TAG_SPARK_2 @sparks + loadspritegfx ANIM_TAG_LIGHTNING @lightning + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call EndureEffect + waitforvisualfinish + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate g10MillionVoltBoltYellowFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0xe0 0x28 0x2 0x3 + delay 0x2 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0xe0 0x28 0x2 0x3 + delay 0x2 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0xe0 0x28 0x2 0x3 + waitforvisualfinish + unloadspritegfx ANIM_TAG_ROUND_SHADOW + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + fadetobg BG_THUNDER + waitbgfadeout + loadspritegfx ANIM_TAG_ELECTRIC_ORBS @charge + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xff00 0x0 0x1 0xffff + waitbgfadein + visible ANIM_ATTACKER + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x3c 0x2 0xc @charge particles to user + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0xe0 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x10 + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + launchtask AnimTask_InvertScreenColor 0x2 0x3 0x101 0x101 0x101 @thunder flash + launchtemplate gGrowingChargeOrbSpriteTemplate 0x2 0x1 ANIM_ATTACKER @ charge + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x40 0xffdc + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x40 0xffec + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x40 0xc + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + launchtask AnimTask_InvertScreenColor 0x2 0x3 0x101 0x101 0x101 @thunder flash + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffc0 0xffdc + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffc0 0xffec + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffc0 0xc + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + launchtask AnimTask_InvertScreenColor 0x2 0x3 0x101 0x101 0x101 @thunder flash + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xff90 0xffdc + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xff90 0xffec + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xff90 0xc + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x10 + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + launchtask AnimTask_InvertScreenColor 0x2 0x3 0x101 0x101 0x101 @thunder flash + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffd0 0xffdc + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffd0 0xffec + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffd0 0xc + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + waitforvisualfinish + call UnsetPsychicBg + visible ANIM_TARGET + loadspritegfx ANIM_TAG_ORBS @hyper beam + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + loadspritegfx ANIM_TAG_WATER_ORB @blue + loadspritegfx ANIM_TAG_BERRY_EATEN @pink + loadspritegfx ANIM_TAG_LEAF @green + loadspritegfx ANIM_TAG_POISON_BUBBLE @purple + loopsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER, 0x5, 0xA + launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_ATTACKER 0x0 0x4 0x32 0x1 + launchtask AnimTask_FlashAnimTagWithColor, 0x2, 0x7, ANIM_TAG_ORBS, 0x1, 0xc, 0x1f, 0x10, 0x0, 0x0 + call TenMillionVoltThunderboltBeamRed + call TenMillionVoltThunderboltBeamBlue + launchtask AnimTask_ShakeMon2 0x2 0x5 ANIM_TARGET 0x4 0x0 0x32 0x1 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x2 0x0 0x9 0x07FE + call TenMillionVoltThunderboltBeamPink + call TenMillionVoltThunderboltBeamYellow + call TenMillionVoltThunderboltBeamGreen + launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x4 0x0 0x32 0x1 + call TenMillionVoltThunderboltBeamPurple + call TenMillionVoltThunderboltBeamRed + call TenMillionVoltThunderboltBeamBlue + call TenMillionVoltThunderboltBeamPink + call TenMillionVoltThunderboltBeamYellow + call TenMillionVoltThunderboltBeamGreen + call TenMillionVoltThunderboltBeamPurple + call TenMillionVoltThunderboltBeamRed + call TenMillionVoltThunderboltBeamBlue + call TenMillionVoltThunderboltBeamPink + call TenMillionVoltThunderboltBeamYellow + call TenMillionVoltThunderboltBeamGreen + call TenMillionVoltThunderboltBeamPurple + call TenMillionVoltThunderboltBeamRed + call TenMillionVoltThunderboltBeamBlue + call TenMillionVoltThunderboltBeamPink + call TenMillionVoltThunderboltBeamYellow + call TenMillionVoltThunderboltBeamGreen + call TenMillionVoltThunderboltBeamPurple + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + delay 0x6 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + delay 0x6 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + launchtemplate g10MillionVoltBoltShockwaveSpriteTemplate 0x82 0x0 @ charge out and in + waitforvisualfinish + unloadspritegfx ANIM_TAG_ORBS @hyper beam + unloadspritegfx ANIM_TAG_VERTICAL_HEX @red + unloadspritegfx ANIM_TAG_WATER_ORB @blue + unloadspritegfx ANIM_TAG_BERRY_EATEN @pink + unloadspritegfx ANIM_TAG_LEAF @green + unloadspritegfx ANIM_TAG_POISON_BUBBLE @purple + loadspritegfx ANIM_TAG_EXPLOSION @explosion + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x2 0x2c + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x00 0x30 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + call TenMillionVoltThunderboltSparkGeyser + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x00 0x37 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x2, 0x0, 0x10, 0x7fff + call TenMillionVoltThunderboltSparkGeyser + waitforvisualfinish + delay 0x10 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x3, 0x10, 0x0, 0x7fff + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +TenMillionVoltThunderboltBeamRed: + launchtemplate g10MillionVoltBoltRedBeamSpriteTemplate 0x82 0x0 + launchtemplate g10MillionVoltBoltRedBeamSpriteTemplate 0x82 0x0 + delay 0x1 + return +TenMillionVoltThunderboltBeamBlue: + launchtemplate g10MillionVoltBoltBlueBeamSpriteTemplate 0x82 0x0 + launchtemplate g10MillionVoltBoltBlueBeamSpriteTemplate 0x82 0x0 + delay 0x1 + return +TenMillionVoltThunderboltBeamPink: + launchtemplate g10MillionVoltBoltPinkBeamSpriteTemplate 0x82 0x0 + launchtemplate g10MillionVoltBoltPinkBeamSpriteTemplate 0x82 0x0 + delay 0x1 + return +TenMillionVoltThunderboltBeamYellow: + launchtemplate g10MillionVoltBoltYellowBeamSpriteTemplate 0x82 0x0 + launchtemplate g10MillionVoltBoltYellowBeamSpriteTemplate 0x82 0x0 + delay 0x1 + return +TenMillionVoltThunderboltBeamGreen: + launchtemplate g10MillionVoltBoltGreenBeamSpriteTemplate 0x82 0x0 + launchtemplate g10MillionVoltBoltGreenBeamSpriteTemplate 0x82 0x0 + delay 0x1 + return +TenMillionVoltThunderboltBeamPurple: + launchtemplate g10MillionVoltBoltPurpleBeamSpriteTemplate 0x82 0x0 + launchtemplate g10MillionVoltBoltPurpleBeamSpriteTemplate 0x82 0x0 + delay 0x1 + return +TenMillionVoltThunderboltSparkGeyser: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x8 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x8 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + return + + +Move_STOKED_SPARKSURFER:: + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + loadspritegfx ANIM_TAG_SPARK_2 @spark + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gStokedSparksurferFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0xe0 0x28 0x2 0x3 + delay 0x2 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0xe0 0x28 0x2 0x3 + delay 0x2 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0xe0 0x28 0x2 0x3 + waitforvisualfinish + unloadspritegfx ANIM_TAG_ROUND_SHADOW + launchtask AnimTask_GetTimeOfDay 0x2 0x0 + jumpargeq 0x0 0x0 StokedSparksurferDay + jumpargeq 0x0 0x2 StokedSparksurferAfternoon +StokedSparksurferNight: + fadetobg BG_BLUE_SKY_NIGHT + goto StokedSparksurferFinish +StokedSparksurferAfternoon: + fadetobg BG_BLUE_SKY_AFTERNOON +StokedSparksurferDay: + fadetobg BG_BLUE_SKY_DAY +StokedSparksurferFinish: + waitbgfadeout + visible ANIM_ATTACKER + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_ELECTRIC_ORBS @charge + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x1c 0x2 0xc + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x3c 0x1 + call EndureEffect + delay 0x8 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x5 0x0 0x10 0x5bff + call EndureEffect + delay 0x8 + call EndureEffect + delay 0x2 + loadspritegfx ANIM_TAG_SPARK + loadspritegfx ANIM_TAG_ELECTRICITY + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x0 0x10 0x0 0x5bff + launchtemplate gVoltTackleOrbSlideSpriteTemplate 0x1 0x0 + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + waitforvisualfinish + launchtask AnimTask_VoltTackleBolt 0x5 0x1 0x0 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_ATTACKER + waitforvisualfinish + launchtask AnimTask_VoltTackleBolt 0x5 0x1 0x1 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET + waitforvisualfinish + launchtask AnimTask_VoltTackleBolt 0x5 0x1 0x2 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_ATTACKER + waitforvisualfinish + launchtask AnimTask_VoltTackleBolt 0x5 0x1 0x3 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET + delay 0x1 + fadetobg BG_ZMOVE_ACTIVATE + waitbgfadeout + visible ANIM_TARGET + launchtask AnimTask_VoltTackleBolt 0x5 0x1 0x4 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET + waitforvisualfinish + unloadspritegfx ANIM_TAG_SPARK + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + unloadspritegfx ANIM_TAG_ELECTRIC_ORBS + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x5 0x1c + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x00 0x30 0x2c 0xc0 0x28 0x2 0x8003 + call StokedSparksurferSparkGeyser + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_DEF | ANIM_PAL_ATK, 0x2, 0x0, 0x10, 0x5bff + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x00 0x37 0x2c 0xc0 0x28 0x2 0x8003 + call StokedSparksurferSparkGeyser + launchtask AnimTask_VoltTackleAttackerReappear 0x5 0x0 @ attacker flicker back + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_TARGET + delay 0x4 + launchtemplate gElectricPuffSpriteTemplate 0x2 0x3 0x0 0x10 0x10 + delay 0x2 + launchtemplate gElectricPuffSpriteTemplate 0x2 0x3 0x0 0xfff0 0xfff0 + delay 0x4 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_DEF | ANIM_PAL_ATK, 0x2, 0x10, 0x0, 0x5bff + restorebg + delay 0x18 + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end + +StokedSparksurferSparkGeyser: + playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x80 0x28 0x0 0x8003 + delay 0x1a + return + + +Move_EXTREME_EVOBOOST:: + loadspritegfx ANIM_TAG_LEER @leer + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ATK | ANIM_PAL_ATK_PARTNER | ANIM_PAL_OPPONENT1 | ANIM_PAL_OPPONENT2, 0x3, 0x0, 0x10, 0x0000 + waitforvisualfinish + launchtask AnimTask_AllBanksInvisible 0xA 0x0 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ATK | ANIM_PAL_ATK_PARTNER | ANIM_PAL_OPPONENT1 | ANIM_PAL_OPPONENT2, 3, 0, 0, 0 @;Remove fading on everyone + waitforvisualfinish + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x18 0xfff4 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xffe8 0xfff4 + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x28 0xfff0 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xfff8 0xfff0 + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x8 0xfffe + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xffd8 0xfffe + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x10 0x5 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xffe0 0x5 + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x20 0xfff0 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xfff0 0xfff0 + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x5 0x0 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xffd5 0x0 + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x1c 0x5 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xffec 0x5 + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xf 0xfff4 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xffdf 0xfff4 + waitforvisualfinish + fadetobg BG_ZMOVE_ACTIVATE + waitbgfadeout + unloadspritegfx ANIM_TAG_LEER + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + loadspritegfx ANIM_TAG_BERRY_EATEN @pink + loadspritegfx ANIM_TAG_ICE_CHUNK @ice + loadspritegfx ANIM_TAG_WISP_ORB @will o wisp + loadspritegfx ANIM_TAG_WATER_ORB @blue + loadspritegfx ANIM_TAG_POISON_BUBBLE @purple + loadspritegfx ANIM_TAG_LEAF @green + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_CIRCLE_OF_LIGHT, 0x0, 0x10, 0x10, 0x5bff + waitforvisualfinish + playsewithpan SE_M_REVERSAL, SOUND_PAN_ATTACKER + launchtemplate gExtremeEvoboostRedChargeUpSpriteTemplate 0x82 0x7 0x0 0x1c 0x510 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostPinkChargeUpSpriteTemplate 0x82 0x7 0x0 0x20 0x4e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostIceChargeUpSpriteTemplate 0x82 0x7 0x0 0x21 0x540 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostBlackChargeUpSpriteTemplate 0x82 0x7 0x0 0x1f 0x490 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostBlueChargeUpSpriteTemplate 0x82 0x7 0x0 0x1c 0x500 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostPurpleChargeUpSpriteTemplate 0x82 0x7 0x0 0x21 0x4d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostYellowChargeUpSpriteTemplate 0x82 0x7 0x0 0x1c 0x510 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostGreenChargeUpSpriteTemplate 0x82 0x7 0x0 0x20 0x4e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + waitforvisualfinish + visible ANIM_ATTACKER + loopsewithpan SE_M_REFLECT, SOUND_PAN_ATTACKER, 0x15, 0xd + call ExtremeEvoboostColorCircle + launchtask AnimTask_StockpileDeformMon 0x5 0x0 @stockpile movement + call ExtremeEvoboostColorCharge + call ExtremeEvoboostColorCharge + call ExtremeEvoboostColorCharge + waitforvisualfinish + playsewithpan SE_SHINY, SOUND_PAN_ATTACKER + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ATK | ANIM_PAL_BG, 0x0, 0x0, 0x10, 0x7fff + delay 0x18 + call ResetFromWhiteScreen + end +ExtremeEvoboostColorCircle: + launchtemplate gExtremeEvoboostRedChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostPinkChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostIceChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostBlackChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostBlueChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostPurpleChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostYellowChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostGreenChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + return +ExtremeEvoboostColorCharge: + launchtemplate gExtremeEvoboostRedChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostRedStockpileSpriteTemplate 0x2 0x3 0x37 0x37 0xd + delay 0x2 + launchtemplate gExtremeEvoboostPinkChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostPinkStockpileSpriteTemplate 0x2 0x3 0xffc9 0xffc9 0xd + delay 0x2 + launchtemplate gExtremeEvoboostIceChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostIceStockpileSpriteTemplate 0x2 0x3 0x0 0x37 0xd + delay 0x2 + launchtemplate gExtremeEvoboostBlackChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostBlackStockpileSpriteTemplate 0x2 0x3 0x0 0xffc9 0xd + delay 0x2 + launchtemplate gExtremeEvoboostBlueChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostBlueStockpileSpriteTemplate 0x2 0x3 0x37 0xffde 0xd + delay 0x2 + launchtemplate gExtremeEvoboostPurpleChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostPurpleStockpileSpriteTemplate 0x2 0x3 0x37 0x22 0xd + delay 0x2 + launchtemplate gExtremeEvoboostYellowChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostYellowStockpileSpriteTemplate 0x2 0x3 0xffc9 0xffde 0xd + delay 0x2 + launchtemplate gExtremeEvoboostGreenChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostGreenStockpileSpriteTemplate 0x2 0x3 0xffc9 0x22 0xd + delay 0x2 + return + + +Move_PULVERIZING_PANCAKE:: + loadspritegfx ANIM_TAG_SPARKLE_4 @detect + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + loadspritegfx ANIM_TAG_MUD_SAND @dig + loadspritegfx ANIM_TAG_IMPACT @hit + loadspritegfx ANIM_TAG_QUICK_GUARD_HAND @black colour + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET PulverizingPancakeOnPlayer +PulverizingPancakeOnOpponent: + launchtemplate gPulverizingPancakeRedDetectSpriteTemplate 0xd 0x2 0x14 0xffec + goto PulverizingPancakeFinish +PulverizingPancakeOnPlayer: + launchtemplate gPulverizingPancakeRedDetectSpriteTemplate 0xd 0x2 0xa 0xfff2 + launchtemplate gPulverizingPancakeRedDetectSpriteTemplate 0xd 0x2 0xfff6 0xfff2 +PulverizingPancakeFinish: + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + waitforvisualfinish + fadetobg BG_SOLARBEAM_OPPONENT + waitbgfadeout + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_ATTACKER 0x0 0x2 0x32 0x1 + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gFlyBallUpSpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + delay 0x2 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0xc 0x4 0xfff0 0x22 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0x10 0x4 0xfff6 0x22 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xe 0x4 0xffee 0x22 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xc 0x4 0xfff0 0x22 + unloadspritegfx ANIM_TAG_SPARKLE_4 + unloadspritegfx ANIM_TAG_VERTICAL_HEX + fadetobg BG_IN_AIR + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0x1000 0x0 0xffff + waitbgfadein + loadspritegfx ANIM_TAG_WHITE_SHADOW + launchtask AnimTask_PulverizingPancakeWhiteShadow 0x5 0x2 0x33 0x33 @first arg is duration, last arg is move speed + delay 0x10 + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x0 0xb 0x0000 @ target darkens + call PulverizingPancakeSlowBackground @0 + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground @-0x1000 + delay 0x1 + waitbgfadein + loadspritegfx ANIM_TAG_THIN_RING @ring + unloadspritegfx ANIM_TAG_MUD_SAND @dig + loadspritegfx ANIM_TAG_ELECTRIC_ORBS @yellow + launchtemplate gBounceBallLandSpriteTemplate 0x83 0x0 + delay 0x7 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBasicHitSplatSpriteTemplate 0x82, 0x4, 0x0 0x0 0x1 0x0 @big hit marker + delay 0x0 + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x4 0x2c + launchtemplate gPulverizingPancakeYellowRingSpriteTemplate 0x83 0x4 0x0 0x0 0x100 0x0 + delay 0x5 + loadspritegfx ANIM_TAG_EXPLOSION @explosion + call PulverizingPancakeExplosion + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x2, 0x0, 0x10, 0x7fff @ everything goes white + call PulverizingPancakeExplosion + waitforvisualfinish + call ResetFromWhiteScreen + end +PulverizingPancakeDiggingRun: + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0xc 0x4 0xfff0 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0x10 0x4 0xfff6 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xe 0x4 0xffee 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xc 0x4 0xfff0 0x12 + playsewithpan SE_M_DIG, SOUND_PAN_ATTACKER + delay 0x5 + return +PulverizingPancakeSlowBackground: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xfd56 0x0 0xffff @-0x2aa + delay 0x1 + return +PulverizingPancakeExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gPulverizingPancakeExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gPulverizingPancakeYellowRingSpriteTemplate 0x83 0x4 0x0 0x0 0x100 0x0 + launchtemplate gPulverizingPancakeExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gPulverizingPancakeExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gPulverizingPancakeExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gPulverizingPancakeYellowRingSpriteTemplate 0x83 0x4 0x0 0x0 0x100 0x0 + launchtemplate gPulverizingPancakeExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return + + +Move_GENESIS_SUPERNOVA:: + loadspritegfx ANIM_TAG_BLUE_ORB @reversal + loadspritegfx ANIM_TAG_POISON_BUBBLE @poison bubble + loadspritegfx ANIM_TAG_POISON_JAB @purple + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + call SetPsychicBackground + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET GenesisSupernovaOnPlayer +GenesisSupernovaOnOpponent: + call GenesisSupernovaBuffEffectPlayer_1 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x2 0x0 0xb 0xd87c + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x70 0x1 + call GenesisSupernovaBuffEffectPlayer_2 + call GenesisSupernovaBuffEffectPlayer_1 + goto GenesisSupernovaFinish +GenesisSupernovaOnPlayer: + call GenesisSupernovaBuffOpponent_1 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x2 0x0 0xb 0xd87c + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x70 0x1 + call GenesisSupernovaBuffOpponent_2 + call GenesisSupernovaBuffOpponent_1 +GenesisSupernovaFinish: + loopsewithpan SE_M_REVERSAL, SOUND_PAN_ATTACKER, 0x18, 0x6 + call GenesisSupernovaReversalWave + call GenesisSupernovaReversalWave + call GenesisSupernovaReversalWave + delay 0x15 + unloadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + monbg ANIM_ATTACKER + setblends 0x80c + launchtemplate gGenesisSupernovaChargeSpriteTemplate 0x2 0x1 0x0 @charge + call GenesisSupernovaFlare @delay 12 per + call GenesisSupernovaFlare + call GenesisSupernovaFlare + call GenesisSupernovaFlare + call GenesisSupernovaFlare + delay 0x4 + unloadspritegfx ANIM_TAG_BLUE_ORB @reversal + loadspritegfx ANIM_TAG_WISP_ORB @will-o-wisp + loadspritegfx ANIM_TAG_METEOR @superpower + loadspritegfx ANIM_TAG_SPARKLE_2 @sparkles + launchtemplate gGenesisSupernovaSuperpowerSpriteTemplate 0x83 0x1 0x0 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x0 0xb 0x0 0xd87c + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendParticle, 0x2, 0x5, ANIM_TAG_SPARKLE_2, 0x0, 0x0, 0xc, 0x7fff + delay 0x8 + invisible ANIM_TARGET + loadspritegfx ANIM_TAG_EXPLOSION @explosion + unloadspritegfx ANIM_TAG_METEOR @superpower + call GenesisSupernovaBubbleExplosion + call GenesisSupernovaBubbleExplosion + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x3, 0x0, 0x10, 0x7fff + call GenesisSupernovaBubbleExplosion + waitforvisualfinish + delay 0x10 + launchtask AnimTask_BlendParticle, 0x2, 0x5, ANIM_TAG_SPARKLE_2, 0x0, 0xc, 0x0, 0x7fff + clearmonbg ANIM_ATTACKER + blendoff + delay 0x0 + call ResetFromWhiteScreen + waitforvisualfinish + end +GenesisSupernovaBubbleExplosion: + launchtemplate gGrantingStarsSpriteTemplate 0x2 0x6 0xfff1 0x0 ANIM_TARGET 0x0 0x20 0x3c + launchtemplate gGenesisSupernovaBubbleSpriteTemplate 0x82, 0x3, 0xa 0xa 0x0 + launchtemplate gGenesisSupernovaExplosionSpriteTemplate 0x3 0x4 0x0 0x0 ANIM_TARGET 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + delay 0x6 + launchtemplate gGenesisSupernovaBubbleSpriteTemplate 0x82, 0x3, 0x14 0xffec 0x0 + launchtemplate gGenesisSupernovaExplosionSpriteTemplate 0x3 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + delay 0x6 + launchtemplate gGrantingStarsSpriteTemplate 0x2 0x6 0xc 0xfffb ANIM_TARGET 0x0 0x20 0x3c + launchtemplate gGenesisSupernovaBubbleSpriteTemplate 0x82, 0x3, 0xffec 0xf 0x0 + launchtemplate gGenesisSupernovaExplosionSpriteTemplate 0x3 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + delay 0x6 + launchtemplate gGenesisSupernovaBubbleSpriteTemplate 0x82, 0x3, 0x0 0x0 0x0 + launchtemplate gGenesisSupernovaExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + delay 0x6 + launchtemplate gGenesisSupernovaBubbleSpriteTemplate 0x82, 0x3, 0xffec 0xffec 0x0 + launchtemplate gGenesisSupernovaExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + delay 0x6 + launchtemplate gGenesisSupernovaBubbleSpriteTemplate 0x82, 0x3, 0x10 0xfff8 0x0 + launchtemplate gGenesisSupernovaExplosionSpriteTemplate 0x3 0x4 0xffe0 0xffe8 ANIM_TARGET 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + return +GenesisSupernovaBuffEffectPlayer_1: + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x24 0x80 0x24 0x30 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x10 0x80 0x10 0x35 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x45 0x80 0x45 0x3a 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x60 0x80 0x60 0x30 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x30 0x80 0x30 0x3c 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x55 0x80 0x55 0x33 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +GenesisSupernovaBuffEffectPlayer_2: + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x29 0x80 0x29 0x31 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x73 0x80 0x73 0x32 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x4a 0x80 0x4a 0x3c 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x64 0x80 0x64 0x33 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x2c 0x80 0x2c 0x3d 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x6c 0x80 0x6c 0x30 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +GenesisSupernovaReversalWave: + launchtemplate gGenesisSupernovaReversalSpriteTemplate 0x2 0x2 0x1a 0x0 + launchtemplate gGenesisSupernovaReversalSpriteTemplate 0x2 0x2 0x1a 0x2a + launchtemplate gGenesisSupernovaReversalSpriteTemplate 0x2 0x2 0x1a 0x54 + launchtemplate gGenesisSupernovaReversalSpriteTemplate 0x2 0x2 0x1a 0x7e + return +GenesisSupernovaFlare: + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + return +GenesisSupernovaBuffOpponent_1: + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0x94 0x40 0x94 0x0 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0x80 0x40 0x80 0x0 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xb5 0x40 0xb5 0x0 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xd0 0x40 0xd0 0x0 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xa0 0x40 0xa0 0x0 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xc5 0x40 0xc5 0x0 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +GenesisSupernovaBuffOpponent_2: + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0x99 0x40 0x99 0x0 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xe3 0x40 0xe3 0x0 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xba 0x40 0xba 0x0 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xd4 0x40 0xd4 0x0 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0x9c 0x40 0x9c 0x0 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xdc 0x40 0xdc 0x0 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return + + +Move_SINISTER_ARROW_RAID:: + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + loadspritegfx ANIM_TAG_SPIRIT_ARROW @arrow + loadspritegfx ANIM_TAG_LEAF @green + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyUpSpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + waitforvisualfinish + unloadspritegfx ANIM_TAG_ROUND_SHADOW + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x10 0x388C @ bg to purple + waitforvisualfinish + visible ANIM_ATTACKER + playsewithpan SE_M_WHIRLPOOL, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowUpSpriteTemplate 0x2 0x7 0x0 0x1c 0x210 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gArrowRaidArrowUpSpriteTemplate 0x2 0x7 0x0 0x20 0x1e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gArrowRaidArrowUpSpriteTemplate 0x2 0x7 0x0 0x21 0x240 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gArrowRaidArrowUpSpriteTemplate 0x2 0x7 0x0 0x1f 0x190 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gArrowRaidArrowUpSpriteTemplate 0x2 0x7 0x0 0x1c 0x200 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gArrowRaidArrowUpSpriteTemplate 0x2 0x7 0x0 0x21 0x1d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x2 + waitforvisualfinish + invisible ANIM_ATTACKER + loadspritegfx ANIM_TAG_BIRD @sky attack + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + loadspritegfx ANIM_TAG_POISON_BUBBLE @purple + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET SinisterArrowRaidOnPlayer +SinisterArrowRaidOnOpponent: + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyRightSpriteTemplate 0x32 0x5 0xfff0 0x88 0x100 0x38 0x15 @left to right + delay 0x5 + launchtemplate gArrowRaidRightUpSpriteTemplate 0x32 0x5 0xfff0 0x8a 0x100 0x3a 0x15 @left to right + delay 0x1 + launchtemplate gArrowRaidRightUpSpriteTemplate 0x32 0x5 0xfff0 0x8c 0x100 0x3c 0x15 + delay 0x1 + launchtemplate gArrowRaidRightUpSpriteTemplate 0x32 0x5 0xfff0 0x86 0x100 0x36 0x15 + delay 0x1 + launchtemplate gArrowRaidRightUpSpriteTemplate 0x32 0x5 0xfff0 0x84 0x100 0x34 0x15 + delay 0x1 + launchtemplate gArrowRaidRightUpSpriteTemplate 0x32 0x5 0xfff0 0x88 0x100 0x38 0x15 + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER @[x0] [y0] [xf] [yf] + launchtemplate gArrowRaidFlyLeftSpriteTemplate 0x32 0x5 0x0120 0x38 0xfff0 0x38 0x15 @right to left + delay 0x5 + launchtemplate gArrowRaidLeftUpSpriteTemplate 0x32 0x5 0x0120 0x36 0xfff0 0x36 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftUpSpriteTemplate 0x32 0x5 0x0120 0x3a 0xfff0 0x3a 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftUpSpriteTemplate 0x32 0x5 0x0120 0x37 0xfff0 0x37 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftUpSpriteTemplate 0x32 0x5 0x0120 0x3c 0xfff0 0x3c 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftUpSpriteTemplate 0x32 0x5 0x0120 0x38 0xfff0 0x38 0x15 + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyRightSpriteTemplate 0x32 0x5 0xfff0 0x08 0x100 0x0f 0x15 @left to right + delay 0x5 + launchtemplate gArrowRaidRightDownSpriteTemplate 0x32 0x5 0xfff0 0x0a 0x100 0x11 0x15 + delay 0x1 + launchtemplate gArrowRaidRightDownSpriteTemplate 0x32 0x5 0xfff0 0x0c 0x100 0x13 0x15 + delay 0x1 + launchtemplate gArrowRaidRightDownSpriteTemplate 0x32 0x5 0xfff0 0x06 0x100 0xd 0x15 + delay 0x1 + launchtemplate gArrowRaidRightDownSpriteTemplate 0x32 0x5 0xfff0 0x04 0x100 0xb 0x15 + delay 0x1 + launchtemplate gArrowRaidRightDownSpriteTemplate 0x32 0x5 0xfff0 0x08 0x100 0xf 0x15 + waitforvisualfinish + call SinisterArrowRaidFlyStrike + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x3 0x4b + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x4 0x0 0x10 0x40c0 @ defender to purple + call SinisterArrowRaidStrikeOpponent + call SinisterArrowRaidOpponentExplosion + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + call SinisterArrowRaidFinalExplosion + goto SinisterArrowRaidFinish +@on player +SinisterArrowRaidOnPlayer: + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyLeftSpriteTemplate 0x32 0x5 0x0120 0x08 0xfff0 0x0f 0x15 @right to left + delay 0x5 + launchtemplate gArrowRaidFaceUpLeftSpriteTemplate 0x32 0x5 0x0120 0x0a 0xfff0 0x11 0x15 + delay 0x1 + launchtemplate gArrowRaidFaceUpLeftSpriteTemplate 0x32 0x5 0x0120 0x0c 0xfff0 0x13 0x15 + delay 0x1 + launchtemplate gArrowRaidFaceUpLeftSpriteTemplate 0x32 0x5 0x0120 0x06 0xfff0 0xd 0x15 + delay 0x1 + launchtemplate gArrowRaidFaceUpLeftSpriteTemplate 0x32 0x5 0x0120 0x04 0xfff0 0xb 0x15 + delay 0x1 + launchtemplate gArrowRaidFaceUpLeftSpriteTemplate 0x32 0x5 0x0120 0x08 0xfff0 0xf 0x15 + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyRightSpriteTemplate 0x32 0x5 0xfff0 0x38 0x100 0x38 0x15 @left to right + delay 0x5 + launchtemplate gArrowRaidRightSpriteTemplate 0x32 0x5 0xfff0 0x36 0x100 0x36 0x15 + delay 0x1 + launchtemplate gArrowRaidRightSpriteTemplate 0x32 0x5 0xfff0 0x3a 0x100 0x3a 0x15 + delay 0x1 + launchtemplate gArrowRaidRightSpriteTemplate 0x32 0x5 0xfff0 0x37 0x100 0x37 0x15 + delay 0x1 + launchtemplate gArrowRaidRightSpriteTemplate 0x32 0x5 0xfff0 0x3c 0x100 0x3c 0x15 + delay 0x1 + launchtemplate gArrowRaidRightSpriteTemplate 0x32 0x5 0xfff0 0x38 0x100 0x38 0x15 + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyLeftSpriteTemplate 0x32 0x5 0x0120 0x78 0xfff0 0x58 0x15 @right to left + delay 0x5 + launchtemplate gArrowRaidLeftDownSpriteTemplate 0x32 0x5 0x100 0x8a 0xfff0 0x3a 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftDownSpriteTemplate 0x32 0x5 0x100 0x8c 0xfff0 0x3c 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftDownSpriteTemplate 0x32 0x5 0x100 0x86 0xfff0 0x36 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftDownSpriteTemplate 0x32 0x5 0x100 0x84 0xfff0 0x34 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftDownSpriteTemplate 0x32 0x5 0x100 0x88 0xfff0 0x38 0x15 + waitforvisualfinish + call SinisterArrowRaidFlyStrike + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x3 0x4b + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x4 0x0 0x10 0x40c0 @ defender to purple + call SinisterArrowRaidArrowsStrikePlayer + call SinisterArrowRaidPlayerExplosion + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + call SinisterArrowRaidFinalExplosion +@ finish +SinisterArrowRaidFinish: + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x4 0x10 0x0 0x40c0 @ return tgt to normal + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x10 0x00 0x388C @ bg to nrml + delay 0x5 + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +SinisterArrowRaidFlyStrike: + visible ANIM_TARGET + delay 0xa + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyStrikeSpriteTemplate 0x82 0x1 0x14 + waitforvisualfinish + delay 0x5 + return +SinisterArrowRaidStrikeOpponent: + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x85 0xfff0 0xa5 0x40 0x4 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x95 0xfff0 0xb5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x75 0xfff0 0x95 0x40 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xa5 0xfff0 0xc5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x6f 0xfff0 0x8f 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x7b 0xfff0 0x9b 0x40 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x85 0xfff0 0xa5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xa2 0xfff0 0xc2 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x82 0xfff0 0xa2 0x40 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x87 0xfff0 0xa7 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x72 0xfff0 0x92 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x85 0xfff0 0xa5 0x40 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x8b 0xfff0 0xab 0x40 0x4 + delay 0x1 + return +SinisterArrowRaidOpponentExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x85 0xfff0 0xa5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x95 0xfff0 0xb5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x75 0xfff0 0x95 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xa5 0xfff0 0xc5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x6f 0xfff0 0x8f 0x40 0x4 + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x7b 0xfff0 0x9b 0x40 0x4 + delay 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x85 0xfff0 0xa5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xa2 0xfff0 0xc2 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x82 0xfff0 0xa2 0x40 0x4 + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x87 0xfff0 0xa7 0x40 0x4 + delay 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x72 0xfff0 0x92 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x85 0xfff0 0xa5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x8b 0xfff0 0xab 0x40 0x4 + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x1 + return +SinisterArrowRaidArrowsStrikePlayer: + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff5 0xfff0 0x45 0x90 0x4 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x5 0xfff0 0x55 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffe5 0xfff0 0x35 0x90 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x15 0xfff0 0x65 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffdf 0xfff0 0x2f 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffeb 0xfff0 0x3b 0x90 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff5 0xfff0 0x45 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x12 0xfff0 0x62 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff2 0xfff0 0x42 0x90 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff7 0xfff0 0x47 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffe2 0xfff0 0x32 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff5 0xfff0 0x45 0x90 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfffb 0xfff0 0x4b 0x90 0x4 + delay 0x1 + return +SinisterArrowRaidPlayerExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff5 0xfff0 0x45 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x5 0xfff0 0x55 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffe5 0xfff0 0x35 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x15 0xfff0 0x65 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffdf 0xfff0 0x2f 0x90 0x4 + launchtemplate gArrowRaidExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffeb 0xfff0 0x3b 0x90 0x4 + delay 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff5 0xfff0 0x45 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x12 0xfff0 0x62 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff2 0xfff0 0x42 0x90 0x4 + launchtemplate gArrowRaidExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff7 0xfff0 0x47 0x90 0x4 + delay 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffe2 0xfff0 0x32 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff5 0xfff0 0x45 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfffb 0xfff0 0x4b 0x90 0x4 + launchtemplate gArrowRaidExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x1 + return +SinisterArrowRaidFinalExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return + + +Move_MALICIOUS_MOONSAULT:: + loadspritegfx ANIM_TAG_FIRE_PLUME @dragon rage + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + loadspritegfx ANIM_TAG_SMALL_EMBER @fire + loadspritegfx ANIM_TAG_IMPACT @hit + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + fadetobg BG_MALICIOUS_MOONSAULT + waitbgfadeout + setblends 0x80c + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + launchtemplate gVerticalDipSpriteTemplate 0x2 0x3 0x6 0x1 0x0 + delay 0x1 + launchtemplate gFirePlumeSpriteTemplate 0x2 0x6 0xffe0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x42 0x6 0xffec 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x42 0x6 0x0 0xfff0 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x42 0x6 0x14 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x42 0x6 0x20 0x0 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x42 0x6 0x14 0xa 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x2 0x6 0x0 0x10 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x2 0x6 0xffec 0xa 0x18 0x0 0x0 0x0 + waitforvisualfinish + delay 0x0 + monbg ANIM_ATTACKER + playsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET + call MaliciousMoonsaultFireSpin + call MaliciousMoonsaultFireSpin + clearmonbg ANIM_ATTACKER + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gMaliciousMoonsaultRedFlySpriteTemplate 0x82, 0x4, 0x0 0x0 0xd 0x150 + call MaliciousMoonsaultFireSpin + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x5 0x0 0xa 0x0000 @ target darkens + delay 0x1a + playsewithpan SE_M_SWAGGER, SOUND_PAN_TARGET + launchtemplate gMaliciousMoonsaultRedBounceSpriteTemplate 0x83 0x0 + delay 0x7 + launchtemplate gMaliciousMoonsaultRedImpactSpriteTemplate 0x82, 0x4, 0x0 0x0 0x1 0x0 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0x15 0x0 0x4 + call MaliciousMoonsaultExplosion + delay 0x6 + call MaliciousMoonsaultExplosion + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x1, 0x0, 0x10, 0x001b @ fade all to red + delay 0x6 + call MaliciousMoonsaultExplosion + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + waitforvisualfinish + call ResetFromRedScreen + blendoff + end +MaliciousMoonsaultFireSpin: + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x510 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2f 0x490 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x30 0x4e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x500 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x540 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x4d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2f 0x490 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x510 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x500 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x30 0x4e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x4d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x540 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x1 + return +MaliciousMoonsaultExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMaliciousMoonsaultExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMaliciousMoonsaultExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMaliciousMoonsaultExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMaliciousMoonsaultExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMaliciousMoonsaultExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + return + + +Move_OCEANIC_OPERETTA:: + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + loadspritegfx ANIM_TAG_SPOTLIGHT + launchtask AnimTask_CreateSpotlight 0x2 0x0 + launchtask AnimTask_HardwarePaletteFade 0x2 0x5 0xf8 0x3 0x0 0xa 0x0 + waitforvisualfinish + launchtemplate gOceanOperaSpotlightSpriteTemplate 0x82, 0x3, 0x0 0xfff8 0x50 @spotlight + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_WATER_ORB @blue + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call OceanicOperettaBuffEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x7fff + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call OceanicOperettaBuffEffect + delay 0x8 + call OceanicOperettaBuffEffect + waitforvisualfinish + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + unloadspritegfx ANIM_TAG_SPOTLIGHT + launchtask AnimTask_HardwarePaletteFade 0x2 0x5 0xf8 0x3 0xa 0x0 0x1 + waitforvisualfinish + launchtask AnimTask_RemoveSpotlight 0x2 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x6 0x5da0 + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_THIN_RING + invisible ANIM_ATTACKER + launchtemplate gOceanOperaBlueChargeSpriteTemplate 0x2 0x1 0x0 @charge + delay 0x2 + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_ATTACKER 0x0 0x2 0x50 0x1 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_M_GRASSWHISTLE, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x1a + visible ANIM_TARGET + loopsewithpan SE_M_CRABHAMMER, SOUND_PAN_TARGET, 0x14, 0x5 + launchtemplate gOceanOperaMovingOrbsSpriteTemplate 0x32 0x6 0x0 0x0 0x0 0x0 0x60 0x0 @mist ball + delay 0x5c + visible ANIM_ATTACKER + delay 0x0 + loopsewithpan SE_M_CRABHAMMER, SOUND_PAN_TARGET, 0x14, 0x1 + launchtemplate gOceanOperaBlueOrbsSpriteTemplate 0x32 0x6 0x0 ANIM_TARGET 0x0 0x0 0x0 0x35 + delay 0x5 + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaExpandingRingSpriteTemplate 0x2 0x4 0x0 0x0 0x0 0x0 + delay 0x4 + launchtemplate gOceanOperaExpandingRingSpriteTemplate 0x2 0x4 0x0 0x0 0x0 0x0 + delay 0x4 + launchtemplate gOceanOperaExpandingRingSpriteTemplate 0x2 0x4 0x0 0x0 0x0 0x0 + delay 0x4 + launchtemplate gOceanOperaExpandingRingSpriteTemplate 0x2 0x4 0x0 0x0 0x0 0x0 + delay 0x4 + launchtemplate gOceanOperaExpandingRingSpriteTemplate 0x2 0x4 0x0 0x0 0x0 0x0 + delay 0x10 + loadspritegfx ANIM_TAG_EXPLOSION @explosion + loadspritegfx ANIM_TAG_SPARKLE_2 @sparkle + loadspritegfx ANIM_TAG_RAIN_DROPS @rain + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x8 0x40 + call OceanicOperettaExplosion + launchtask AnimTask_BlendBattleAnimPal 0x2 0x5 ANIM_PAL_DEF 0x2 0x0 0xb 0x5da0 + launchtask AnimTask_CreateRaindrops 0x2 0x3 0x0 0x3 0x78 + call OceanicOperettaExplosion + call OceanicOperettaExplosion + playsewithpan SE_M_RAIN_DANCE, SOUND_PAN_ATTACKER + launchtask AnimTask_CreateRaindrops 0x2 0x3 0x0 0x3 0x78 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0x2 0x5 ANIM_PAL_DEF 0x2 0xb 0x0 0x5da0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x6 0x0 0x5da0 + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +OceanicOperettaBuffEffect: + launchtemplate gOceanOperaBlueFlareSpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gOceanOperaBlueFlareSpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gOceanOperaBlueFlareSpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gOceanOperaBlueFlareSpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gOceanOperaBlueFlareSpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +OceanicOperettaExplosion: + launchtemplate gOceanOperaSparkleSpriteTemplate 0x33 0x6 0xfff1 0x0 ANIM_TARGET 0x0 0x20 0x3c + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaExplosionSpriteTemplate 0x33 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaExplosionSpriteTemplate 0x33 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaExplosionSpriteTemplate 0x33 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gOceanOperaSparkleSpriteTemplate 0x33 0x6 0xc 0xfffb ANIM_TARGET 0x0 0x20 0x3c + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaExplosionSpriteTemplate 0x33 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaExplosionSpriteTemplate 0x33 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return + + +Move_SPLINTERED_STORMSHARDS:: + loadspritegfx ANIM_TAG_ROCKS @rock + loadspritegfx ANIM_TAG_ICICLE_SPEAR @spear + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_GetLycanrocForm 0x2 0x0 + jumpargeq 0x0 0x1 SplinteredStormshardsNightForme +SplinteredStormshardsDayForme: + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0xc 0x5bff + goto SplinteredStormshardsFinishFade +SplinteredStormshardsNightForme: + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0xc 0x0000 +SplinteredStormshardsFinishFade: + waitforvisualfinish + setblends 0x80c + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET SplinteredStormshardsByOpponent +SplinteredStormshardsByPlayer: + loopsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET, 0x10, 0xc + call SplinteredStormshardsPlayer_Rising1 + delay 0x2 + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + invisible ANIM_TARGET + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + call SplinteredStormshardsPlayer_Rising1 + call SplinteredStormshardsPlayer_Rising2 + visible ANIM_ATTACKER + delay 0x1 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x60 0x80 0x60 0x30 0x30 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x5bff + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + delay 0x2 + call SplinteredStormshardsPlayer_Rising2 + call SplinteredStormshardsPlayer_Rising1 + delay 16 + waitforvisualfinish + visible ANIM_TARGET + call SplinteredStormshardsFixBackgroundFade + waitforvisualfinish + loadspritegfx ANIM_TAG_METEOR @superpower + loadspritegfx ANIM_TAG_EXPLOSION @explosion + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gHorizontalLungeSpriteTemplate 0x2 0x2 0x4 0x4 @lunge forward + delay 0x2 + invisible ANIM_ATTACKER + launchtemplate gGrowingSuperpowerTemplate 0x83 0x1 0x0 @superpower + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x4 0x60 0x1 @shake target up and down + launchtemplate gSplinteredShardsSplinterOpponentSteepSpriteTemplate 0x2 0x8 0xffd0 0x18 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x4 + launchtemplate gSplinteredShardsSplinterOpponentShallowSpriteTemplate 0x2 0x8 0xffd0 0x1 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x4 + call SplinteredStormshardsExplosionOpponent + call SplinteredStormshardsExplosionOpponent +SplinteredStormshardsEnd: + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x4, 0x0, 0x10, 0x7fff + call SplinteredStormshardsBrownExplode + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x4, 0x10, 0x0, 0x7fff + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + waitforvisualfinish + end +SplinteredStormshardsExplosionOpponent: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterOpponentSteepSpriteTemplate 0x82 0x8 0xffd0 0x20 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterOpponentShallowSpriteTemplate 0x82 0x8 0xffd0 0x0 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterOpponentShallowSpriteTemplate 0x82 0x8 0xffd0 0xfff8 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterOpponentSteepSpriteTemplate 0x82 0x8 0xffd0 0x20 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterOpponentShallowSpriteTemplate 0x82 0x8 0xffd0 0x0 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + return +SplinteredStormshardsByOpponent: + loopsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET 0x10 0xc + call SplinteredStormshardsOpponent_Rising1 + delay 0x2 + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + invisible ANIM_TARGET + launchtemplate gSplinteredShardsFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + call SplinteredStormshardsOpponent_Rising1 + call SplinteredStormshardsOpponent_Rising2 + visible ANIM_ATTACKER + delay 0x1 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xd0 0x40 0xd0 0x0 0x30 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x5bff + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + delay 0x2 + call SplinteredStormshardsOpponent_Rising2 + call SplinteredStormshardsOpponent_Rising1 + delay 16 + waitforvisualfinish + visible ANIM_TARGET + call SplinteredStormshardsFixBackgroundFade + waitforvisualfinish + visible ANIM_TARGET + loadspritegfx ANIM_TAG_METEOR @superpower + loadspritegfx ANIM_TAG_EXPLOSION @explosion + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gHorizontalLungeSpriteTemplate 0x2 0x2 0x4 0x4 @lunge forward + delay 0x2 + invisible ANIM_ATTACKER + launchtemplate gGrowingSuperpowerTemplate 0x83 0x1 0x0 @superpower + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x4 0x60 0x1 @shake target up and down + launchtemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate 0x82 0x8 0xffd0 0x18 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x4 + launchtemplate gSplinteredShardsSplinterPlayerSteepSpriteTemplate 0x82 0x8 0xffd0 0x30 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + delay 0x4 + call SplinteredStormshardsExplosionOnPlayer + call SplinteredStormshardsExplosionOnPlayer + goto SplinteredStormshardsEnd +SplinteredStormshardsExplosionOnPlayer: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate 0x82 0x8 0xffd0 0x20 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterPlayerSteepSpriteTemplate 0x82 0x8 0xffd0 0x35 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate 0x82 0x8 0xffd0 0x1c 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate 0x82 0x8 0xffd0 0x16 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterPlayerSteepSpriteTemplate 0x82 0x8 0xffd0 0x2d 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + return +SplinteredStormshardsBrownExplode: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return +SplinteredStormshardsPlayer_Rising1: + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x24 0x80 0x24 0x30 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x10 0x80 0x10 0x35 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x45 0x80 0x45 0x3a 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x60 0x80 0x60 0x30 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x30 0x80 0x30 0x3c 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x55 0x80 0x55 0x33 0x30 + delay 0x2 + return +SplinteredStormshardsPlayer_Rising2: + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x29 0x80 0x29 0x31 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x73 0x80 0x73 0x32 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x4a 0x80 0x4a 0x3c 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x64 0x80 0x64 0x33 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x2c 0x80 0x2c 0x3d 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x6c 0x80 0x6c 0x30 0x30 + delay 0x2 + return +SplinteredStormshardsOpponent_Rising1: + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x94 0x40 0x94 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x80 0x40 0x80 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xb5 0x40 0xb5 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xd0 0x40 0xd0 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xa0 0x40 0xa0 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xc5 0x40 0xc5 0x0 0x30 + delay 0x2 + return +SplinteredStormshardsOpponent_Rising2: + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x99 0x40 0x99 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xe3 0x40 0xe3 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xba 0x40 0xba 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xd4 0x40 0xd4 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x9c 0x40 0x9c 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xdc 0x40 0xdc 0x0 0x30 + delay 0x2 + return +SplinteredStormshardsFixBackgroundFade: + launchtask AnimTask_GetLycanrocForm 0x2 0x0 + jumpargeq 0x0 0x1 SplinteredStormshardsNightFormeReturn +SplinteredStormshardsDayFormeReturn: + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0xc 0x0 0x5bff + goto SplinteredStormshardsFinishFadeReturn +SplinteredStormshardsNightFormeReturn: + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0xc 0x0 0x0000 +SplinteredStormshardsFinishFadeReturn: + return + + +Move_LETS_SNUGGLE_FOREVER:: + loadspritegfx ANIM_TAG_MAGENTA_HEART @sharm + loadspritegfx ANIM_TAG_MUSIC_NOTES @music note + loadspritegfx ANIM_TAG_SMALL_BUBBLES @fake tears + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_RockMonBackAndForth 0x5 0x3 0x0 0x2 0x0 + launchtemplate gSnuggleForeverHeartSpriteTemplate 0x3 0x2 0x0 0x14 + playsewithpan SE_M_CHARM, SOUND_PAN_ATTACKER + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x1 0x1 0x1 0x0 + delay 0x7 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x0 0x3 0x3 0x80 + delay 0x8 + playsewithpan SE_M_CHARM, SOUND_PAN_ATTACKER + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x1 0x2 0x0 0x80 + delay 0x7 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x0 0x1 0x1 0x0 + delay 0x8 + playsewithpan SE_M_CHARM, SOUND_PAN_ATTACKER + delay 0x7 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x1 0x0 0x3 0x0 + delay 0x7 + fadetobg BG_SNUGGLE_FOREVER + waitbgfadeout + invisible ANIM_ATTACKER + delay 0x1 + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 + delay 0x10 + playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER + waitforvisualfinish + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 + delay 0x10 + playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER + waitforvisualfinish + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 + delay 0x10 + playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x2 0x32 0x1 + call LetsSnuggleForeverTears + delay 0x8 + call LetsSnuggleForeverTears + delay 0x8 + call LetsSnuggleForeverTears + delay 0x8 + call LetsSnuggleForeverTears + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x2, 0x0, 0x10, 0x0000 + waitforvisualfinish + loadspritegfx ANIM_TAG_SPARKLE_4 @detect + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gSnuggleForeverEyesSpriteTemplate 0xd 0x2 0xa 0xfff2 + launchtemplate gSnuggleForeverEyesSpriteTemplate 0xd 0x2 0xfff6 0xfff2 + delay 0x20 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x1 0x0 0x10 0x579D + launchtask AnimTask_GrowTarget 0x5 0x0 + delay 0x5 + loadspritegfx ANIM_TAG_IMPACT @hit + loadspritegfx ANIM_TAG_PAIN_SPLIT @painsplit + loadspritegfx ANIM_TAG_DUCK @duck + loopsewithpan SE_M_CRABHAMMER, SOUND_PAN_TARGET, 0x14, 10 + launchtask AnimTask_TranslateMonElliptical 0x2 0x5 0x0 0xffee 0xa 0xa 0x4 + launchtask AnimTask_TranslateMonElliptical 0x2 0x5 0x1 0x12 0xa 0xa 0x4 + call LetsSnuggleForeverStars_1 + call LetsSnuggleForeverImpacts + call LetsSnuggleForeverStars_2 + call LetsSnuggleForeverImpacts + call LetsSnuggleForeverStars_1 + playsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET + call LetsSnuggleForeverStars_2 + call LetsSnuggleForeverImpacts + launchtask AnimTask_TranslateMonElliptical 0x2 0x5 0x0 0xffee 0x6 0x6 0x4 + launchtask AnimTask_TranslateMonElliptical 0x2 0x5 0x1 0x12 0x6 0x6 0x4 + call LetsSnuggleForeverStars_1 + delay 0x0 + call LetsSnuggleForeverImpacts + call LetsSnuggleForeverStars_2 + delay 0x0 + call LetsSnuggleForeverImpacts + call LetsSnuggleForeverStars_1 + delay 0x0 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ALL-ANIM_PAL_DEF 0x2 0x0 0x10 0x7fff + playsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET + call LetsSnuggleForeverStars_2 + delay 0x0 + call LetsSnuggleForeverImpacts + invisible ANIM_TARGET + stopsound + waitforvisualfinish + call ResetFromWhiteScreen + end +LetsSnuggleForeverTears: + playsewithpan SE_M_TAIL_WHIP, SOUND_PAN_TARGET + launchtemplate gTearDropSpriteTemplate 0x82 0x2 ANIM_TARGET 0x0 + launchtemplate gTearDropSpriteTemplate 0x82 0x2 ANIM_TARGET 0x1 + delay 0x8 + launchtemplate gTearDropSpriteTemplate 0x82 0x2 ANIM_TARGET 0x2 + launchtemplate gTearDropSpriteTemplate 0x82 0x2 ANIM_TARGET 0x3 + return +LetsSnuggleForeverImpacts: + launchtemplate gBasicHitSplatSpriteTemplate 0x83 0x4 0x0 0xfff4 0x1 0x0 + delay 0x8 + launchtemplate gBasicHitSplatSpriteTemplate 0x83 0x4 0xfff4 0x8 0x1 0x0 + delay 0x8 + launchtemplate gBasicHitSplatSpriteTemplate 0x83 0x4 0xc 0x0 0x1 0x0 + delay 0x8 + return +LetsSnuggleForeverStars_1: + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xa0 0xffe0 + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xff00 0xffd8 + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0x80 0xfff0 + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0x1a0 0xffda + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xff80 0xffea + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xfe80 0xffe1 + return +LetsSnuggleForeverStars_2: + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0x10 0x8 0xa0 0xffe0 + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0x10 0x8 0xff00 0xffd8 + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0x10 0x8 0x80 0xfff0 + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0x10 0x8 0x1a0 0xffda + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0x10 0x8 0xff80 0xffea + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0x10 0x8 0xfe80 0xffe1 + return + + +Move_CLANGOROUS_SOULBLAZE:: + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_WATER_ORB @blue + loadspritegfx ANIM_TAG_POISON_BUBBLE @purple + loadspritegfx ANIM_TAG_AIR_WAVE_2 @white/grey + loadspritegfx ANIM_TAG_SPARKLE_2 @stars + fadetobg BG_CLANGOROUS_SOULBLAZE + waitbgfadein + launchtask AnimTask_RockMonBackAndForth 0x5 0x3 0x0 0x2 0x0 + call ClangorousSoulblazeBuffEffect + call ClangorousSoulblazeBuffEffect + call ClangorousSoulblazeBuffEffect + waitforvisualfinish + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + loadspritegfx ANIM_TAG_HORSESHOE_SIDE_FIST @fist + launchtemplate gClangorousSoulRedFistTemplate 0x2 0x8 0xfff0 0x0 0x0 0x0 0xa ANIM_ATTACKER ANIM_RIGHT_FIST 0x1 + launchtemplate gClangorousSoulRedFistTemplate 0x2 0x8 0x10 0x0 0x0 0x0 0xa ANIM_ATTACKER ANIM_LEFT_FIST 0x1 + playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET + waitforvisualfinish + loadspritegfx ANIM_TAG_THIN_RING @ring + playsewithpan SE_SHINY, SOUND_PAN_ATTACKER + launchtemplate gClangorousSoulRedRingTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + waitforvisualfinish + unloadspritegfx ANIM_TAG_HORSESHOE_SIDE_FIST + unloadspritegfx ANIM_TAG_SPARKLE_2 @stars + loadspritegfx ANIM_TAG_ROUND_SHADOW @ fly + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazeWhiteFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + delay 0x2 + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xFFE0 0x1 0xffff + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xfd00 0xa 0x0 0x2a + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_DEF_PARTNER 0xfd00 0xa 0x0 0x2a + delay 0x20 + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0x20 0x1 0xffff + delay 0xC + setblends 0x80c + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x4 0x0 + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + visible ANIM_ATTACKER + monbg ANIM_ATTACKER + loopsewithpan SE_M_PSYBEAM2, SOUND_PAN_ATTACKER, 0xe, 0xa + launchtemplate gClangoorousSoulblazePurpleChargeSpriteTemplate 0x2 0x1 0x0 @charge + call ClangorousSoulblazeEnergySwirl + call ClangorousSoulblazeEnergySwirl + call ClangorousSoulblazeEnergySwirl + call ClangorousSoulblazeEnergySwirl + call ClangorousSoulblazeEnergySwirl + waitforvisualfinish + unloadspritegfx ANIM_TAG_WATER_ORB @whirlpool + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + unloadspritegfx ANIM_TAG_ROUND_SHADOW @fly + unloadspritegfx ANIM_TAG_AIR_WAVE_2 @white + unloadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_MUSIC_NOTES @music note + clearmonbg ANIM_ATTACKER + invisible ANIM_ATTACKER + invisible ANIM_ATK_PARTNER + delay 0x0 + monbg ANIM_TARGET + playsewithpan SE_M_GIGA_DRAIN, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazePulseSpriteTemplate 0x2 0x6 0x10 0x0 0x0 0x0 0x1d 0x0 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x0 0x0 0x0 0x0 @music note + delay 0x5 + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x2 0x3c + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_DEF_PARTNER 0x2 0x3c + call ClangorousSoulblazePulse_1 + delay 0x5 + call ClangorousSoulblazePulse_2 + delay 0x5 + call ClangorousSoulblazePulse_3 + delay 0x5 + call ClangorousSoulblazePulse_4 + loadspritegfx ANIM_TAG_EXPLOSION + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET ClangorousSoulblazeOnOpponent +ClangorousSoulblazeOnPlayer: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x10 0xfff0 ANIM_ATTACKER 0x1 + delay 0x5 + call ClangorousSoulblazePulse_5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_ATTACKER 0x1 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x20 0xffe0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x20 0x0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x30 0xffe0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_3 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x30 0xfff0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_4 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x35 0x0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_5 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x40 0x10 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x40 0x0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x45 0xfff0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_3 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x50 0x10 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_4 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x50 0xffe0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_5 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x60 0xfff0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x60 0xffe0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x4, 0x0, 0x10, 0x7fff + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x65 0xfff0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_3 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x65 0xffe0 ANIM_ATTACKER 0x1 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x0 0x0 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_4 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_5 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + goto FINISH_SOULBLAZE +ClangorousSoulblazeOnOpponent: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x10 0x15 ANIM_ATTACKER 0x1 + delay 0x5 + call ClangorousSoulblazePulse_5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x10 0x0 ANIM_ATTACKER 0x1 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x20 0x25 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x20 0x5 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x30 0x25 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_3 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x30 0x15 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_4 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x35 0x0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_5 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x40 0xa ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x40 0x0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x45 0x10 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_3 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x50 0x30 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_4 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x50 0x25 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_5 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x60 0x40 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x60 0x45 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x4, 0x0, 0x10, 0x7fff + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x65 0x35 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_3 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x65 0x40 ANIM_ATTACKER 0x1 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_4 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_5 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 +FINISH_SOULBLAZE: + waitforvisualfinish + clearmonbg ANIM_TARGET + delay 0x5 + call ResetFromWhiteScreen + blendoff + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_DEF_PARTNER 0x0 0x10 + waitforvisualfinish + end +ClangorousSoulblazeEnergySwirl: + launchtemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x2 + launchtemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + launchtemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + launchtemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + return +ClangorousSoulblazeBuffEffect: + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtemplate gClangorousSoulBlueBuffTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gClangorousSoulPurpleBuffTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + launchtemplate gGrantingStarsSpriteTemplate 0x2 0x6 0xfff1 0x0 0x0 0x0 0x20 0x3c + delay 0x4 + launchtemplate gClangorousSoulWhiteBuffTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gGrantingStarsSpriteTemplate 0x2 0x6 0xc 0xfffb 0x0 0x0 0x20 0x3c + return +ClangorousSoulblazePulse_1: + playsewithpan SE_M_UPROAR, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazePulseSpriteTemplate 0x2 0x6 0x10 0x0 0x0 0x0 0x1d 0x0 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x1 0x1 0x1 0x0 + return +ClangorousSoulblazePulse_2: + playsewithpan SE_M_UPROAR, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazePulseSpriteTemplate 0x2 0x6 0x10 0x0 0x0 0x0 0x1d 0x0 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x0 0x3 0x3 0x80 + return +ClangorousSoulblazePulse_3: + playsewithpan SE_M_UPROAR, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazePulseSpriteTemplate 0x2 0x6 0x10 0x0 0x0 0x0 0x1d 0x0 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x1 0x2 0x0 0x80 + return +ClangorousSoulblazePulse_4: + playsewithpan SE_M_UPROAR, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazePulseSpriteTemplate 0x2 0x6 0x10 0x0 0x0 0x0 0x1d 0x0 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x0 0x1 0x1 0x0 + return +ClangorousSoulblazePulse_5: + playsewithpan SE_M_UPROAR, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazePulseSpriteTemplate 0x2 0x6 0x10 0x0 0x0 0x0 0x1d 0x0 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x1 0x0 0x3 0x0 + return + + +Move_GUARDIAN_OF_ALOLA:: + loadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_MUD_SAND @dig + loadspritegfx ANIM_TAG_SPEED_DUST @extremespeed + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtemplate gThinRingExpandingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_SHINY, SOUND_PAN_ATTACKER + waitforvisualfinish + unloadspritegfx ANIM_TAG_THIN_RING + playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0xff00 0xf 0x0 0x4 + call GuardianOfAlolaRocksPlayer + delay 0xa + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0x0 0x10 + call GuardianOfAlolaRocksPlayer + waitforvisualfinish + delay 0xa + playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0xff00 0xf 0x0 0x4 + call GuardianOfAlolaRocksPlayer + delay 0xa + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0x0 0x10 + call GuardianOfAlolaRocksPlayer + waitforvisualfinish + delay 0xa + delay 0x10 + call GuardianOfAlolaRocksPlayer + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x2 0xC 0xC 0x277f @;Yellow + launchtask AnimTask_NightShadeClone 0x5 0x1 0x75 + delay 0x10 + call GuardianOfAlolaRocksPlayer + delay 0x10 + call GuardianOfAlolaRocksPlayer + delay 0x10 + loadspritegfx ANIM_TAG_HORSESHOE_SIDE_FIST + call GuardianOfAlolaRocksPlayer + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x3 0x0 0xb 0x0000 + delay 0x1 + launchtask AnimTask_BlendParticle, 0x2, 0x5, ANIM_TAG_HORSESHOE_SIDE_FIST, 0x0, 0xC, 0xc, 0x277f + fadetobg BG_FISSURE + waitbgfadeout + call GuardianOfAlolaRocksPlayer + launchtask AnimTask_PositionFissureBgOnBattler 0x5 0x3 0x1 0x5 0xffff + waitbgfadein + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_TARGET + launchtemplate gGuardianOfAlolaFistSpriteTemplate 0x83 0x3 0x0 0xffd0 0x1f + delay 0x24 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x0 0xb 0x0 0x0000 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtask AnimTask_HorizontalShake 0x3 0x3 ANIM_TARGET 0xa 0x25 + loopsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET 0x10 0x9 + call GuardianOfAlolaRocksTarget + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRocksTarget + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRocksTarget + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRocksTarget + launchtask AnimTask_BlendBattleAnimPal 0x2 0x5 ANIM_PAL_ALL 0x3 0x0 0x10 0x7fff + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRocksTarget + waitforvisualfinish + call ResetFromWhiteScreen + end +GuardianOfAlolaRocksPlayer: + playsewithpan SE_M_DIG, SOUND_PAN_ATTACKER + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0xc 0x4 0xfff0 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0x10 0x4 0xfff6 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xe 0x4 0xffee 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xc 0x4 0xfff0 0x12 + return +GuardianOfAlolaRocksTarget: + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0xc 0x4 0xfff0 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0x10 0x4 0xfff6 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xe 0x4 0xffee 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xc 0x4 0xfff0 0x12 + return +GuardianOfAlolaRockGeyser: + launchtemplate gGuardianOfAlolaDirtGeyserSpriteTemplate 0x82, 0x3, 0 0xfffc 0x10 @ -4, -0x10 + delay 0x0 + launchtemplate gGuardianOfAlolaDirtGeyserSpriteTemplate 0x82, 0x3, 0 0x100D 0x10 @ + delay 0x0 + launchtemplate gGuardianOfAlolaDirtGeyserSpriteTemplate 0x82, 0x3, 0 0x4 0x10 + delay 0x0 + launchtemplate gGuardianOfAlolaDirtGeyserSpriteTemplate 0x82, 0x3, 0 0xfff0 0x10 + delay 0x0 + return + + +Move_SEARING_SUNRAZE_SMASH:: + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_SPARKLE_2 @sparkles + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0x0 0xe 0x001b + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call SearingSunrazeSmashFlare + delay 0x8 + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x7fff + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call SearingSunrazeSmashFlare + delay 0x8 + call SearingSunrazeSmashFlare + waitforvisualfinish + unloadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + unloadspritegfx ANIM_TAG_SPARKLE_2 @sparkles + loadspritegfx ANIM_TAG_WATER_ORB @blue + loadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_SHADOW_BALL @shadow ball + loadspritegfx ANIM_TAG_AIR_WAVE_2 @white/grey + playsewithpan SE_M_NIGHTMARE, SOUND_PAN_ATTACKER + launchtemplate gSearingSunrazeSmashGrowWormholeSpriteTemplate 0x2 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x10 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x35 0xffed 0x1 0x2 + delay 0x2 + loadspritegfx ANIM_TAG_METEOR @superpower + visible ANIM_TARGET + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x50 0xfc00 ANIM_TARGET 0x0 @ spin up target + call SearingSunrazeSmashRingsInward + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x30 @ target back to origin (slowly) + call SearingSunrazeSmashRingsInward + delay 0xD + invisible ANIM_TARGET + launchtemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gSearingSunrazeSmashWhiteRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x6 + launchtemplate gHorizontalLungeSpriteTemplate 0x2 0x2 0x4 0x4 @lunge forward + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + delay 0x2 + invisible ANIM_ATTACKER + launchtemplate gGrowingSuperpowerTemplate 0x83 0x1 0x0 @superpower + launchtemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_ATTACKER + fadetobg BG_COSMIC + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xf700 0x0 0x1 0xffff + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x1 0x0 ANIM_TARGET 0x1 @ fix tgt rotation + invisible ANIM_TARGET + waitbgfadein + visible ANIM_ATTACKER + visible ANIM_TARGET + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_SMALL_EMBER @fire + launchtemplate gSearingSunrazeSmashInfernoOrbSpriteTemplate 0x2 0x1 ANIM_ATTACKER + loopsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER, 0x13, 0x8 + call SearingSunrazeSmashCharge + call SearingSunrazeSmashCharge + call SearingSunrazeSmashCharge + call SearingSunrazeSmashCharge + waitforvisualfinish + unloadspritegfx ANIM_TAG_WATER_ORB @blue + unloadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashRedFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG+ANIM_PAL_ATK 0x3 0x0 0xF 0x0 + waitforvisualfinish + playsewithpan SE_ORB, SOUND_PAN_ATTACKER + unloadspritegfx ANIM_TAG_ROUND_SHADOW @fly + unloadspritegfx ANIM_TAG_SHADOW_BALL @shadow ball + loadspritegfx ANIM_TAG_GOLD_RING @beam + loadspritegfx ANIM_TAG_SMALL_RED_EYE @beam colour + invisible ANIM_ATTACKER + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + stopsound + playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET + loadspritegfx ANIM_TAG_CUT @cut + launchtemplate gSunsteelStrikeSuperpowerTemplate 0x82 0x1 0x14 +SearingSunrazeSmashImpact: + delay 0x8 + delay 0x1 + unloadspritegfx ANIM_TAG_GOLD_RING @beam + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x4 0x3c + playsewithpan SE_M_CUT, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashWhiteCutSpriteTemplate 0x82, 0x3, 0x20 0xffe0 0x0 + delay 0x2 + playsewithpan SE_M_CUT, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashWhiteCutSpriteTemplate 0x82, 0x3, 0x20 0xffe0 0x1 + delay 0x2 + playsewithpan SE_M_CUT, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashWhiteCutSpriteTemplate 0x82, 0x3, 0x1c 0xffe0 0x0 + delay 0x2 + playsewithpan SE_M_CUT, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashWhiteCutSpriteTemplate 0x82, 0x3, 0x1c 0xffe0 0x1 + delay 0x2 + playsewithpan SE_M_CUT, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashWhiteCutSpriteTemplate 0x82, 0x3, 0x2c 0xffe0 0x0 + delay 0x2 + playsewithpan SE_M_CUT, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashWhiteCutSpriteTemplate 0x82, 0x3, 0x2c 0xffe0 0x1 + delay 0x2 + loadspritegfx ANIM_TAG_CROSS_IMPACT @x + delay 0x0 + unloadspritegfx ANIM_TAG_METEOR @superpower + unloadspritegfx ANIM_TAG_DRAGON_ASCENT @dragon ascent 1 + unloadspritegfx ANIM_TAG_DRAGON_ASCENT_FOE @dragon ascent 2 + launchtemplate gSearingSunrazeSmashCrossImpactSpriteTemplate 0x82, 0x4, 0x0 0x0 0x1 0x24 + playsewithpan SE_M_LEER, SOUND_PAN_TARGET + visible ANIM_ATTACKER + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ATK, 0x3, 0xF, 0x0, 0x0 + visible ANIM_ATTACKER + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x2 0x0 0x10 0x0000 + launchtemplate gSearingSunrazeSmashShockwaveSpriteTemplate 0x82 0x0 @ charge out and in + delay 0x1c + invisible ANIM_TARGET + unloadspritegfx ANIM_TAG_CUT @cut + unloadspritegfx ANIM_TAG_CROSS_IMPACT @x + call SearingSunrazeSmashInferno + call SearingSunrazeSmashInferno + call SearingSunrazeSmashInferno + call SearingSunrazeSmashInferno + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x4, 0x0, 0x10, 0x001b @full red + call SearingSunrazeSmashInferno + call SearingSunrazeSmashInferno + call SearingSunrazeSmashInferno + waitforvisualfinish + delay 0x10 + call ResetFromRedScreen + end +SearingSunrazeSmashFlare: + launchtemplate gGrantingStarsSpriteTemplate 0x2 0x6 0xfff1 0x0 0x0 0x0 0x20 0x3c + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gGrantingStarsSpriteTemplate 0x2 0x6 0xc 0xfffb 0x0 0x0 0x20 0x3c + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return + +SearingSunrazeSmashRingsInward: + launchtemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gSearingSunrazeSmashWhiteRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + return +SearingSunrazeSmashInferno: + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x3 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x3 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x3 + return +SearingSunrazeSmashCharge: + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x510 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2f 0x490 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x30 0x4e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x500 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x540 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x4d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2f 0x490 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x510 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x500 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x30 0x4e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x4d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x540 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x1 + return +ResetFromRedScreen: + launchtask AnimTask_AllBanksInvisible 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ALL_BATTLERS 0x2 0x0 0x0 0x1B @Everything from red + restorebg + waitbgfadeout + setarg 0x7 0xffff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitbgfadein + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0x0 0x0 0x33ED + waitforvisualfinish + return + + +Move_MENACING_MOONRAZE_MAELSTROM:: + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_SPARKLE_2 @sparkles + loadspritegfx ANIM_TAG_WATER_ORB @blue + loadspritegfx ANIM_TAG_SHADOW_BALL @shadow ball + loadspritegfx ANIM_TAG_HANDS_AND_FEET @black + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0x0 0xe 0x40c0 + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call MenacingMoonrazeMaelstromFlare + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xc 0x0000 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call MenacingMoonrazeMaelstromFlare + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + delay 0x8 + call MenacingMoonrazeMaelstromFlare + waitforvisualfinish + unloadspritegfx ANIM_TAG_SPARKLE_2 @sparkles + loadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_AIR_WAVE_2 @white/grey + playsewithpan SE_M_NIGHTMARE, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromWormholeSpriteTemplate 0x2 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x10 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x35 0xffed 0x1 0x2 @ target down and left (instantaneously (last arg)) + delay 0x2 + loadspritegfx ANIM_TAG_METEOR @superpower + visible ANIM_TARGET + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x50 0xfc00 ANIM_TARGET 0x0 @ spin up target + call MenacingMoonrazeMaelstromRingsInward + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x30 @ target back to origin (slowly) + call MenacingMoonrazeMaelstromRingsInward + delay 0xD + invisible ANIM_TARGET + launchtemplate gMoonrazeMaelstromBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gMoonrazeMaelstromWhiteRingSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x6 + launchtemplate gHorizontalLungeSpriteTemplate 0x2 0x2 0x4 0x4 @lunge forward + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + delay 0x2 + invisible ANIM_ATTACKER + launchtemplate gMoonrazeMaelstromSuperpowerSpriteTemplate 0x83 0x1 0x0 @superpower + launchtemplate gMoonrazeMaelstromBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_ATTACKER + fadetobg BG_COSMIC + waitbgfadeout + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET MenacingMoonrazeMaelstromOnPlayer +MenacingMoonrazeMaelstromOnOpponent: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xfd00 0x200 0x1 0xffff + goto MenacingMoonrazeMaelstromFinish +MenacingMoonrazeMaelstromOnPlayer: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x200 0xfd00 0x1 0xffff +MenacingMoonrazeMaelstromFinish: + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x1 0x0 ANIM_TARGET 0x1 @ fix tgt rotation + invisible ANIM_TARGET + waitbgfadein + visible ANIM_ATTACKER + delay 0x2 + visible ANIM_TARGET + waitforvisualfinish + loadspritegfx ANIM_TAG_POISON_BUBBLE @poison bubble + loadspritegfx ANIM_TAG_ORBS @hyper beam + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @shock wave + unloadspritegfx ANIM_TAG_THIN_RING @ring + unloadspritegfx ANIM_TAG_AIR_WAVE_2 @white/grey + unloadspritegfx ANIM_TAG_METEOR @superpower + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + call MenacingMoonrazeMaelstromChargeUp + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xc 0x0000 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call MenacingMoonrazeMaelstromChargeUp + call MenacingMoonrazeMaelstromChargeUp + launchsoundtask SoundTask_LoopSEAdjustPanning 0x7 0xf0 0xffc0 SOUND_PAN_TARGET 0x1 0xf 0x0 0x5 + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x4 0x0 0x3c 0x1 + launchtask AnimTask_BlendBattleAnimPal 0x2 0x5 ANIM_PAL_DEF 0x4 0x0 0xc 0x0000 + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromShockwaveSpriteTemplate 0x82 0x0 + call MenacingMoonrazeMaelstromBeam + waitforvisualfinish + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @shock wave + unloadspritegfx ANIM_TAG_ORBS @hyper beam + unloadspritegfx ANIM_TAG_HANDS_AND_FEET @black + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x4 0x0 0x4c 0x1 + call MenacingMoonrazeMaelstromExplosion + call MenacingMoonrazeMaelstromExplosion + launchtask AnimTask_BlendBattleAnimPal 0x2 0x5 ANIM_PAL_ALL 0x2 0x0 0x10 0x7fff + call MenacingMoonrazeMaelstromExplosion + waitforvisualfinish + call ResetFromWhiteScreen + end +MenacingMoonrazeMaelstromExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return +MenacingMoonrazeMaelstromFlare: + launchtemplate gMoonrazeMaelstromBlackSparklesSpriteTemplate 0x2 0x6 0xfff1 0x0 0x0 0x0 0x20 0x3c + launchtemplate gMoonrazeMaelstromBlueBuffSpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gMoonrazeMaelstromBlueBuffSpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gMoonrazeMaelstromBlackSparklesSpriteTemplate 0x2 0x6 0xc 0xfffb 0x0 0x0 0x20 0x3c + launchtemplate gMoonrazeMaelstromBlackBuffSpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gMoonrazeMaelstromBlackBuffSpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gMoonrazeMaelstromBlackBuffSpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +MenacingMoonrazeMaelstromRingsInward: + launchtemplate gMoonrazeMaelstromBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gMoonrazeMaelstromWhiteRingSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gMoonrazeMaelstromBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + return +MenacingMoonrazeMaelstromChargeUp: + launchtemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x1c 0x210 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x20 0x1e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x21 0x240 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x1f 0x190 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x1c 0x200 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x21 0x1d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x21 0x240 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x1f 0x190 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +MenacingMoonrazeMaelstromBeam: + launchtemplate gMoonrazeMaelstromBeamSpriteTemplate 0x82 0x0 + launchtemplate gMoonrazeMaelstromBeamSpriteTemplate 0x82 0x0 + delay 0x1 + return + + +Move_LIGHT_THAT_BURNS_THE_SKY:: + loadspritegfx ANIM_TAG_SPARK_2 @spark + loadspritegfx ANIM_TAG_LEAF @green + loadspritegfx ANIM_TAG_ELECTRIC_ORBS @charge particles + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @psycho boost + fadetobg BG_ZMOVE_MOUNTAIN + waitbgfadeout + loadspritegfx ANIM_TAG_FOCUS_ENERGY + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call EndureEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x5bff + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call EndureEffect + delay 0x8 + call EndureEffect + delay 0x8 + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + monbg ANIM_ATTACKER + setblends 0x80c + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ALL-ANIM_PAL_ATK 0x2 0x0 0xF 0x0000 + waitforvisualfinish + launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x3c 0x2 0xc @ charge particles to attacker + delay 0x1e + loopsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER, 0xe, 0xa + launchtemplate gSuperpowerOrbSpriteTemplate, 0x83, 0x1, 0x0 + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + delay 0xe + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x2 0x0 0x4 0x0000 + clearmonbg ANIM_ATTACKER + blendoff + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0x20 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0x60 0x8 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0xa0 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0xe0 0x8 0x2 0x3 + delay 0x1 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0x20 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0x60 0x8 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0xa0 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0xe0 0x8 0x2 0x3 + delay 0x1 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0x20 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0x60 0x8 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0xa0 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0xe0 0x8 0x2 0x3 + delay 0x6 + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x3 0x3c + unloadspritegfx ANIM_TAG_LEAF @green + unloadspritegfx ANIM_TAG_ELECTRIC_ORBS @charge + loadspritegfx ANIM_TAG_FIRE_PLUME @blast burn + loadspritegfx ANIM_TAG_EXPLOSION_2 @explode + loadspritegfx ANIM_TAG_STRAIGHT_BEAM + panse_1B SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x2, 0x0 + monbg ANIM_TARGET + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x6 0x0 0x10 0x43FF @;Light yellow + call PhotonGeyserBeam + call LightThatBurnsTheSkyGeyser + call LightThatBurnsTheSkyBlast_1 + call LightThatBurnsTheSkyGeyser + call LightThatBurnsTheSkyBlast_2 + call LightThatBurnsTheSkyGeyser + launchtask AnimTask_BlendBattleAnimPal, 0x2, 0x5, ANIM_PAL_ALL - ANIM_PAL_DEF, 0x4, 0x0, 0x10, 0x43FF + call LightThatBurnsTheSkyBlast_3 + clearmonbg ANIM_TARGET + waitforvisualfinish + delay 0x10 + launchtask AnimTask_BlendBattleAnimPal 0x2 0x5 ANIM_PAL_ALL 0x0 0x10 0x0 0x43FF + restorebg + waitbgfadeout + end +LightThatBurnsTheSkyBlast_1: + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffe0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffec 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x0 0xfff0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x14 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x20 0x0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x14 0xa 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0x0 0x10 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffec 0xa 0x18 0x0 0x0 0x0 + return +LightThatBurnsTheSkyBlast_2: + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffc0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x6 0x6 0xffd8 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x46 0x6 0x0 0xffe0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x46 0x6 0x28 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x40 0x0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x28 0x14 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0x0 0x20 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffd8 0x14 0x18 0x0 0x0 0x0 + return +LightThatBurnsTheSkyBlast_3: + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffa0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x6 0x6 0xffc4 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x46 0x6 0x0 0xffd0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x46 0x6 0x3c 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x60 0x0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x3c 0x1e 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0x0 0x30 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffc4 0x1e 0x18 0x0 0x0 0x0 + return +LightThatBurnsTheSkyGeyser: + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0003 0x0005 0x1 0x0 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0xfff5 0xfff1 0x1 0x0 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0008 0xfffb 0x1 0x0 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0xfffa 0x0012 0x1 0x0 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0000 0x0005 0x1 0x0 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0003 0xfff5 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0xfff5 0xffe1 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0008 0xffeb ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0xfffa 0x0002 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0000 0xfff5 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0003 0xffe5 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0xfff5 0xffd1 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0008 0xffdb ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0xfffa 0xfff2 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0000 0xffe5 ANIM_TARGET 0x0 + delay 0x0 + return +LightThatBurnsTheSkyGreenSparks: + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x10 + return + + +Move_SOUL_STEALING_7_STAR_STRIKE:: + loadspritegfx ANIM_TAG_ROUND_SHADOW @bounce + loadspritegfx ANIM_TAG_ICE_CRYSTALS @ice blue + loadspritegfx ANIM_TAG_WISP_FIRE @will o wisp + loadspritegfx ANIM_TAG_FIRE_PLUME @blast burn + loadspritegfx ANIM_TAG_HANDS_AND_FEET @fist + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + setblends 0x80c + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET + launchtemplate gSoulStealBlastburnSpriteTemplate 0x2 0x6 0xffe0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x42 0x6 0xffec 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x42 0x6 0x0 0xfff0 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x42 0x6 0x14 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x42 0x6 0x20 0x0 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x42 0x6 0x14 0xa 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x2 0x6 0x0 0x10 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x2 0x6 0xffec 0xa 0x18 0x0 0x0 0x0 + delay 0x5 + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gSoulStealBlackFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + waitforvisualfinish + invisible ANIM_TARGET + fadetobg BG_SOULSTEALING_7STAR_STRIKE + waitbgfadeout + visible ANIM_ATTACKER + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call SoulStealingSevenStarStrikeBuffEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x0 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call SoulStealingSevenStarStrikeBuffEffect + delay 0x8 + call SoulStealingSevenStarStrikeBuffEffect + delay 0x4 + visible ANIM_TARGET + waitforvisualfinish + unloadspritegfx ANIM_TAG_FIRE_PLUME + loadspritegfx ANIM_TAG_PAIN_SPLIT @pain split + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x4 0x25 0x1 + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x14 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0x0 ANIM_TARGET 0x2 0x0 0x0 0x30 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x4 + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x10 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0x0 ANIM_TARGET 0x12 0x0 0x0 0x2c + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x4 + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x08 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0xffeb 0xfff8 0x2 0x0 0x0 0x28 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x12 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0xfffb 0xfff4 0x2 0x0 0x0 0x24 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x15 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0x5 0xfff8 0x2 0x0 0x0 0x20 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x0c 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0xfff0 0x1 0x2 0x0 0x0 0x1c + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x13 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0x0 0x1 0x2 0x0 0x0 0x18 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x0e 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0xfff0 0x10 0x2 0x0 0x0 0x14 + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x12 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0x0 0x10 0x2 0x0 0x0 0x10 + delay 0x4 + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gSoulStealBlackFlySpriteTemplate 0x82, 0x4, 0x0 0x0 0xd 0x150 + delay 0x20 + unloadspritegfx ANIM_TAG_PAIN_SPLIT + unloadspritegfx ANIM_TAG_ROUND_SHADOW + unloadspritegfx ANIM_TAG_HANDS_AND_FEET + loadspritegfx ANIM_TAG_SPARK_2 @paralyze + loadspritegfx ANIM_TAG_SNORE_Z @z + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_ATTACKER + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 + delay 0x1c + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x0 0x0 0x10 0x0000 + delay 0x1 + launchtemplate gSoulStealZStarSpriteTemplate 0x82, 0x4, 0x0 0x0 0x1 0x24 + launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x3 0x0 0x6 0x1 + launchtemplate gWillOWispFireSpriteTemplate 0x82 0x1 0x0 + launchtemplate gWillOWispFireSpriteTemplate 0x82 0x1 0x2a + launchtemplate gWillOWispFireSpriteTemplate 0x82 0x1 0x54 + launchtemplate gWillOWispFireSpriteTemplate 0x82 0x1 0x7e + launchtemplate gWillOWispFireSpriteTemplate 0x82 0x1 0xa8 + launchtemplate gWillOWispFireSpriteTemplate 0x82 0x1 0xd2 + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET + call SoulStealingSevenStarStrikeBlueParalysis + call SoulStealingSevenStarStrikeBlueParalysis + waitforvisualfinish + visible ANIM_ATTACKER + unloadspritegfx ANIM_TAG_ROUND_SHADOW + loadspritegfx ANIM_TAG_SPARKLE_4 @ detect + loadspritegfx ANIM_TAG_EXPLOSION @ explosion + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gTargetTwinkleSpriteTemplate 0x8d 0x3 0x0 0x0 ANIM_TARGET @detect star + delay 0xa + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x8 0x20 + call SoulStealingSevenStarStrikeExplosion + call SoulStealingSevenStarStrikeExplosion + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL - ANIM_PAL_DEF, 0x2, 0x0, 0x10, 0x0 @everything to black + call SoulStealingSevenStarStrikeExplosion + waitforvisualfinish + blendoff + restorebg + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x2, 0x10, 0x0, 0x0 @everything from black + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ALL_BATTLERS 0x2 0x0 0x0 0x0 + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +SoulStealingSevenStarStrikeBuffEffect: + launchtemplate gSoulStealIceBuffSpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gSoulStealIceBuffSpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gSoulStealIceBuffSpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gSoulStealIceBuffSpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gSoulStealIceBuffSpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +SoulStealingSevenStarStrikeBlueParalysis: + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_TARGET + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0x5 0x0 0x5 0x0 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0xfffb 0xa 0x5 0x1 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0xf 0x14 0x5 0x2 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0xfff1 0xfff6 0x5 0x0 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0x19 0x0 0x5 0x1 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0xfff8 0x8 0x5 0x2 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0x2 0xfff8 0x5 0x0 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0xffec 0xf 0x5 0x1 + return +SoulStealingSevenStarStrikeExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSoulStealExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSoulStealExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSoulStealExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSoulStealExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSoulStealExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return diff --git a/data/maps/InsideOfTruck/scripts.inc b/data/maps/InsideOfTruck/scripts.inc index fb75273cc..b70e9a791 100644 --- a/data/maps/InsideOfTruck/scripts.inc +++ b/data/maps/InsideOfTruck/scripts.inc @@ -50,7 +50,10 @@ InsideOfTruck_EventScript_SetIntroFlagsFemale:: @ 823BF46 end InsideOfTruck_EventScript_MovingBox:: @ 823BF6C - msgbox InsideOfTruck_Text_BoxPrintedWithMonLogo, MSGBOX_SIGN + givemon SPECIES_SNEASEL, 70, ITEM_DARKINIUM_Z + setwildbattle SPECIES_WALREIN, 53, 0 + dowildbattle + @msgbox InsideOfTruck_Text_BoxPrintedWithMonLogo, MSGBOX_SIGN end InsideOfTruck_Text_BoxPrintedWithMonLogo: @ 823BF75 diff --git a/include/battle_anim.h b/include/battle_anim.h index 14e11dec3..17b692344 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -213,6 +213,7 @@ void AnimTask_HorizontalShake(u8 taskId); void AnimMudSportDirt(struct Sprite *sprite); void AnimDirtScatter(struct Sprite *sprite); void AnimMudSportDirtRising(struct Sprite *sprite); +void AnimDirtPlumeParticle(struct Sprite *); extern const union AffineAnimCmd *const gAffineAnims_SpinningBone[]; // battle_anim_throw.c @@ -274,6 +275,7 @@ extern const union AnimCmd *const gScratchAnimTable[]; extern const union AnimCmd *const gIngrainRootAnimTable[]; extern const union AffineAnimCmd *const gSwiftStarAffineAnimTable[]; extern const union AnimCmd *const gMetronomeThroughtBubbleAnimTable[]; +extern const union AffineAnimCmd *const gStockpileAbsorptionOrbAffineAnimTable[]; // battle_anim_effects_2.c void AnimUproarRing(struct Sprite *sprite); @@ -282,6 +284,7 @@ void AnimOrbitFast(struct Sprite *sprite); void AnimOrbitScatter(struct Sprite *sprite); void AnimAngerMark(struct Sprite *sprite); void AnimHyperVoiceRing(struct Sprite *sprite); +void AnimMagentaHeart(struct Sprite *); extern const union AffineAnimCmd *const gThinRingShrinkingAffineAnimTable[]; extern const union AffineAnimCmd *const gThinRingExpandingAffineAnimTable[]; extern const union AnimCmd *const gExplosionAnimTable[]; @@ -297,8 +300,13 @@ void AnimBlackSmoke(struct Sprite *sprite); void AnimSweetScentPetal(struct Sprite *sprite); void AnimTealAlert(struct Sprite *sprite); void AnimBlockX(struct Sprite *sprite); +void AnimFlatterSpotlight_Step(struct Sprite *); +void AnimAssistPawprint(struct Sprite *); +void AnimReversalOrb(struct Sprite *); +void AnimFlatterSpotlight_Step(struct Sprite *sprite); extern const union AnimCmd *const gOpeningEyeAnimTable[]; extern const union AnimCmd *const gEclipsingOrbAnimTable[]; +extern const union AffineAnimCmd *const gSpotlightAffineAnimTable[]; // battle_anim_water.c void AnimWaterPulseRing(struct Sprite *sprite); @@ -316,16 +324,21 @@ void AnimFlyBallUp(struct Sprite *sprite); void AnimFlyBallAttack(struct Sprite *sprite); void AnimFlyBallAttack_Step(struct Sprite *sprite); void AnimFlyBallUp_Step(struct Sprite *sprite); +void AnimBounceBallLand(struct Sprite *); +void AnimEllipticalGust(struct Sprite *); extern const union AnimCmd *const gAffineAnims_AirWaveCrescent[]; extern const union AffineAnimCmd *const gAffineAnims_FlyBallUp[]; extern const union AffineAnimCmd *const gAffineAnims_FlyBallAttack[]; +extern const union AffineAnimCmd *const gAffineAnims_BounceBallLand[]; // battle_anim_poison.c void AnimSludgeBombHitParticle(struct Sprite *); void AnimAcidPoisonBubble_Step(struct Sprite *sprite); +void AnimBubbleEffect(struct Sprite *); extern const union AffineAnimCmd *const gAffineAnims_PoisonProjectile[]; extern const union AnimCmd *const gAnims_PoisonProjectile[]; extern const union AnimCmd *const gAnims_AcidPoisonDroplet[]; +extern const union AffineAnimCmd *const gAffineAnims_Bubble[]; // battle_anim_ghost.c void AnimGhostStatusSprite(struct Sprite *sprite); @@ -421,6 +434,7 @@ void AnimSparkElectricity(struct Sprite *sprite); void AnimElectricPuff(struct Sprite *sprite); void AnimSparkElectricityFlashing(struct Sprite *sprite); void AnimGrowingShockWaveOrb(struct Sprite *sprite); +void AnimElectricity(struct Sprite *); extern const union AffineAnimCmd *const gAffineAnims_GrowingElectricOrb[]; extern const union AffineAnimCmd *const gAffineAnims_FlashingSpark[]; extern const union AnimCmd *const gAnims_ThunderboltOrb[]; @@ -436,6 +450,7 @@ void AnimBasicFistOrFoot(struct Sprite *sprite); void AnimSpinningKickOrPunchFinish(struct Sprite *sprite); void AnimRevengeScratch(struct Sprite *sprite); void AnimDizzyPunchDuck(struct Sprite *sprite); +void AnimSuperpowerFireball(struct Sprite *); extern const union AnimCmd *const gAnims_HandOrFoot[]; extern const union AffineAnimCmd *const gAffineAnims_MegaPunchKick[]; extern const union AffineAnimCmd *const gAffineAnims_SpinningHandOrFoot[]; @@ -444,6 +459,7 @@ extern const union AnimCmd *const gAnims_RevengeBigScratch[]; // battle_anim_rock.c extern const union AffineAnimCmd *const gAffineAnims_Whirlpool[]; extern const union AffineAnimCmd *const gAffineAnims_BasicRock[]; +extern const union AnimCmd *const gAnims_FlyingRock[]; void AnimParticleInVortex(struct Sprite *sprite); void AnimFallingRock(struct Sprite *sprite); void AnimRaiseSprite(struct Sprite *sprite); @@ -478,8 +494,12 @@ extern const union AnimCmd *const gAnims_BlizzardIceCrystal[]; void AnimFireSpread(struct Sprite *sprite); void AnimFireSpiralOutward(struct Sprite *sprite); void AnimWillOWispOrb(struct Sprite *); +void AnimEruptionFallingRock(struct Sprite *); +void AnimFireCross(struct Sprite *); +void AnimFirePlume(struct Sprite *); extern const union AnimCmd *const gAnims_FireBlastCross[]; extern const union AnimCmd *const gAnims_WillOWispOrb[]; +extern const union AnimCmd *const gAnims_FirePlume[]; // battle_anim_dragon.c extern const union AnimCmd *const gAnims_DragonBreathFire[]; diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 4d4e8f745..901ba9041 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -614,6 +614,12 @@ #define ANIM_RIGHT_FIST 0 #define ANIM_LEFT_FIST 2 +// fist/chop frames +#define ANIM_FIST_1 0 +#define ANIM_FOOT_1 1 +#define ANIM_FOOT_2 2 +#define ANIM_CHOP 3 + // surf wave palettes #define ANIM_SURF_PAL_SURF 0 #define ANIM_SURF_PAL_MUDDY_WATER 1 diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 6c0d76055..489880aff 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -58,7 +58,6 @@ static void AnimSoftBoiledEgg_Step4(struct Sprite *); static void AnimSoftBoiledEgg_Step4_Callback(struct Sprite *); static void AnimSpeedDust(struct Sprite *); static void AnimHealBellMusicNote(struct Sprite *); -static void AnimMagentaHeart(struct Sprite *); static void AnimRedHeartProjectile(struct Sprite *); static void AnimRedHeartProjectile_Step(struct Sprite *); static void AnimRedHeartRising(struct Sprite *); @@ -3091,7 +3090,7 @@ static void AnimHealBellMusicNote(struct Sprite *sprite) SetMusicNotePalette(sprite, gBattleAnimArgs[5], gBattleAnimArgs[6]); } -static void AnimMagentaHeart(struct Sprite *sprite) +void AnimMagentaHeart(struct Sprite *sprite) { if (++sprite->data[0] == 1) InitSpritePosToAnimAttacker(sprite, FALSE); diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 2c9b7f9e3..72cd4373d 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -65,8 +65,6 @@ static void AnimPainSplitProjectile(struct Sprite *); static void AnimFlatterConfetti(struct Sprite *); static void AnimFlatterConfetti_Step(struct Sprite *); static void AnimFlatterSpotlight(struct Sprite *); -static void AnimFlatterSpotlight_Step(struct Sprite *); -static void AnimReversalOrb(struct Sprite *); static void AnimReversalOrb_Step(struct Sprite *); static void AnimYawnCloud(struct Sprite *); static void AnimYawnCloud_Step(struct Sprite *); @@ -75,7 +73,6 @@ static void AnimFacadeSweatDrop(struct Sprite *); static void AnimRoarNoiseLine(struct Sprite *); static void AnimRoarNoiseLine_Step(struct Sprite *); static void AnimGlareEyeDot(struct Sprite *); -static void AnimAssistPawprint(struct Sprite *); static void AnimSmellingSaltsHand(struct Sprite *); static void AnimSmellingSaltsHand_Step(struct Sprite *); static void AnimSmellingSaltExclamation(struct Sprite *); @@ -3144,7 +3141,7 @@ static void AnimFlatterSpotlight(struct Sprite *sprite) sprite->callback = AnimFlatterSpotlight_Step; } -static void AnimFlatterSpotlight_Step(struct Sprite *sprite) +void AnimFlatterSpotlight_Step(struct Sprite *sprite) { switch (sprite->data[1]) { @@ -3178,7 +3175,7 @@ static void AnimFlatterSpotlight_Step(struct Sprite *sprite) // Spins an orb around the attacking mon, while its path radius grows and shrinks. // arg 0: duration // arg 1: initial wave offset -static void AnimReversalOrb(struct Sprite *sprite) +void AnimReversalOrb(struct Sprite *sprite) { sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); @@ -4106,7 +4103,7 @@ static void AnimGlareEyeDot(struct Sprite *sprite) // arg 2: destination x position // arg 3: destination y position // arg 4: duration -static void AnimAssistPawprint(struct Sprite *sprite) +void AnimAssistPawprint(struct Sprite *sprite) { sprite->pos1.x = gBattleAnimArgs[0]; sprite->pos1.y = gBattleAnimArgs[1]; diff --git a/src/battle_anim_electric.c b/src/battle_anim_electric.c index 3d61ab703..b7d35a51c 100644 --- a/src/battle_anim_electric.c +++ b/src/battle_anim_electric.c @@ -15,7 +15,6 @@ static void AnimZapCannonSpark_Step(struct Sprite *); static void AnimThunderboltOrb(struct Sprite *); static void AnimThunderboltOrb_Step(struct Sprite *); static void AnimSparkElectricityFlashing_Step(struct Sprite *); -static void AnimElectricity(struct Sprite *); static void AnimTask_ElectricBolt_Step(u8 taskId); static void AnimElectricBoltSegment(struct Sprite *); static void AnimThunderWave_Step(struct Sprite *); @@ -758,7 +757,7 @@ static void AnimSparkElectricityFlashing_Step(struct Sprite *sprite) } // Electricity arcs around the target. Used for Paralysis and various electric move hits -static void AnimElectricity(struct Sprite *sprite) +void AnimElectricity(struct Sprite *sprite) { if (!InitSpritePosToAnimBattler(gBattleAnimArgs[4], sprite, FALSE)) return; diff --git a/src/battle_anim_fight.c b/src/battle_anim_fight.c index 477a15b6d..d7e3448cb 100644 --- a/src/battle_anim_fight.c +++ b/src/battle_anim_fight.c @@ -24,7 +24,6 @@ static void AnimSuperpowerOrb_Step(struct Sprite *); static void AnimSuperpowerRock(struct Sprite *); static void AnimSuperpowerRock_Step1(struct Sprite *); static void AnimSuperpowerRock_Step2(struct Sprite *); -static void AnimSuperpowerFireball(struct Sprite *); static void AnimArmThrustHit(struct Sprite *); static void AnimArmThrustHit_Step(struct Sprite *sprite); static void AnimFocusPunchFist(struct Sprite *); @@ -974,7 +973,7 @@ static void AnimSuperpowerRock_Step2(struct Sprite *sprite) DestroyAnimSprite(sprite); } -static void AnimSuperpowerFireball(struct Sprite *sprite) +void AnimSuperpowerFireball(struct Sprite *sprite) { u8 battler; diff --git a/src/battle_anim_fire.c b/src/battle_anim_fire.c index b59701bad..64194f533 100644 --- a/src/battle_anim_fire.c +++ b/src/battle_anim_fire.c @@ -8,7 +8,6 @@ #include "trig.h" static void AnimFireSpiralInward(struct Sprite *); -static void AnimFirePlume(struct Sprite *); static void AnimLargeFlame(struct Sprite *); static void sub_8109028(struct Sprite *); static void sub_8109064(struct Sprite *); @@ -21,7 +20,6 @@ static void AnimFireRing_Step1(struct Sprite *); static void AnimFireRing_Step2(struct Sprite *); static void AnimFireRing_Step3(struct Sprite *); static void UpdateFireRingCircleOffset(struct Sprite *); -static void AnimFireCross(struct Sprite *); static void AnimFireSpiralOutward_Step1(struct Sprite *); static void AnimFireSpiralOutward_Step2(struct Sprite *); static void AnimTask_EruptionLaunchRocks_Step(u8 taskId); @@ -30,7 +28,6 @@ static void AnimEruptionLaunchRock(struct Sprite *); static u16 GetEruptionLaunchRockInitialYPos(u8 spriteId); static void InitEruptionLaunchRockCoordData(struct Sprite *sprite, s16 x, s16 y); static void UpdateEruptionLaunchRockPos(struct Sprite *); -static void AnimEruptionFallingRock(struct Sprite *); static void AnimEruptionFallingRock_Step(struct Sprite *); static void AnimWillOWispOrb_Step(struct Sprite *); static void AnimWillOWispFire(struct Sprite *); @@ -110,7 +107,7 @@ static const union AnimCmd sAnim_FirePlume[] = ANIMCMD_JUMP(0), }; -static const union AnimCmd *const sAnims_FirePlume[] = +const union AnimCmd *const gAnims_FirePlume[] = { sAnim_FirePlume, }; @@ -154,7 +151,7 @@ const struct SpriteTemplate gFirePlumeSpriteTemplate = .tileTag = ANIM_TAG_FIRE_PLUME, .paletteTag = ANIM_TAG_FIRE_PLUME, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_FirePlume, + .anims = gAnims_FirePlume, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimFirePlume, @@ -166,7 +163,7 @@ const struct SpriteTemplate gUnknown_08595440 = .tileTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_SMALL_EMBER, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_FirePlume, + .anims = gAnims_FirePlume, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimFirePlume, @@ -501,7 +498,7 @@ const struct SpriteTemplate gLavaPlumeSpriteTemplate = .tileTag = ANIM_TAG_FIRE_PLUME, .paletteTag = ANIM_TAG_FIRE_PLUME, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_FirePlume, + .anims = gAnims_FirePlume, .images = NULL, .affineAnims = gLavaPlumeAffineAnims, .callback = AnimLavaPlumeOrbitScatter, @@ -575,7 +572,7 @@ void AnimFireSpread(struct Sprite *sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -static void AnimFirePlume(struct Sprite *sprite) +void AnimFirePlume(struct Sprite *sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); @@ -807,7 +804,7 @@ static void UpdateFireRingCircleOffset(struct Sprite *sprite) // arg 3: x delta // arg 4: y delta // AnimFireCross(struct Sprite *sprite) -static void AnimFireCross(struct Sprite *sprite) +void AnimFireCross(struct Sprite *sprite) { sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.y += gBattleAnimArgs[1]; @@ -1084,7 +1081,7 @@ static void UpdateEruptionLaunchRockPos(struct Sprite *sprite) sprite->invisible = TRUE; } -static void AnimEruptionFallingRock(struct Sprite *sprite) +void AnimEruptionFallingRock(struct Sprite *sprite) { sprite->pos1.x = gBattleAnimArgs[0]; sprite->pos1.y = gBattleAnimArgs[1]; diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index 7e62532ea..ab775f5f6 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -8,7 +8,6 @@ extern const struct SpriteTemplate gFlashingHitSplatSpriteTemplate; -static void AnimEllipticalGust(struct Sprite *); static void AnimEllipticalGust_Step(struct Sprite *); static void AnimGustToTarget(struct Sprite *); static void AnimGustToTarget_Step(struct Sprite *); @@ -18,7 +17,6 @@ static void sub_810EB40(struct Sprite *); static void sub_810EA4C(struct Sprite *); static void AnimWhirlwindLine(struct Sprite *); static void AnimBounceBallShrink(struct Sprite *); -static void AnimBounceBallLand(struct Sprite *); static void AnimDiveBall(struct Sprite *); static void AnimDiveBall_Step1(struct Sprite *); static void AnimDiveBall_Step2(struct Sprite *); @@ -243,7 +241,7 @@ static const union AffineAnimCmd sAffineAnim_BounceBallLand[] = AFFINEANIMCMD_END, }; -static const union AffineAnimCmd *const sAffineAnims_BounceBallLand[] = +const union AffineAnimCmd *const gAffineAnims_BounceBallLand[] = { sAffineAnim_BounceBallLand, }; @@ -255,7 +253,7 @@ const struct SpriteTemplate gBounceBallLandSpriteTemplate = .oam = &gOamData_AffineDouble_ObjNormal_64x64, .anims = gDummySpriteAnimTable, .images = NULL, - .affineAnims = sAffineAnims_BounceBallLand, + .affineAnims = gAffineAnims_BounceBallLand, .callback = AnimBounceBallLand, }; @@ -343,7 +341,7 @@ const struct SpriteTemplate gSkyAttackBirdSpriteTemplate = }; -static void AnimEllipticalGust(struct Sprite *sprite) +void AnimEllipticalGust(struct Sprite *sprite) { InitSpritePosToAnimTarget(sprite, FALSE); sprite->pos1.y += 20; @@ -977,7 +975,7 @@ static void AnimBounceBallShrink(struct Sprite *sprite) } } -static void AnimBounceBallLand(struct Sprite *sprite) +void AnimBounceBallLand(struct Sprite *sprite) { switch (sprite->data[0]) { diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index 8831cae5e..7c7453dbc 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -1400,3 +1400,68 @@ static void sub_8112FB8(struct Sprite *sprite) sprite->callback = DestroySpriteAndMatrix; } } + +//pulverizing pancake - destiny bond shadow from attacker to target +void AnimTask_PulverizingPancakeWhiteShadow(u8 taskId) +{ + struct Task *task; + s16 battler; + u8 spriteId; + s16 baseX, baseY; + s16 x, y; + + task = &gTasks[taskId]; + SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL)); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 0x10)); + task->data[5] = 0; + task->data[6] = 0; + task->data[7] = 0; + task->data[8] = 0; + task->data[9] = 16; + task->data[10] = gBattleAnimArgs[0]; + + baseX = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + baseY = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_BOTTOM); + if (!IsContest()) + { + spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55); + if (spriteId != MAX_SPRITES) + { + x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + y = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_BOTTOM); + gSprites[spriteId].data[0] = baseX << 4; + gSprites[spriteId].data[1] = baseY << 4; + gSprites[spriteId].data[2] = ((x - baseX) << 4) / gBattleAnimArgs[1]; + gSprites[spriteId].data[3] = ((y - baseY) << 4) / gBattleAnimArgs[1]; + gSprites[spriteId].data[4] = gBattleAnimArgs[1]; + gSprites[spriteId].data[5] = x; + gSprites[spriteId].data[6] = y; + gSprites[spriteId].callback = AnimDestinyBondWhiteShadow_Step; + + task->data[task->data[12] + 13] = spriteId; + task->data[12]++; + } + } + else + { + spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55); + if (spriteId != MAX_SPRITES) + { + x = 48; + y = 40; + gSprites[spriteId].data[0] = baseX << 4; + gSprites[spriteId].data[1] = baseY << 4; + gSprites[spriteId].data[2] = ((x - baseX) << 4) / gBattleAnimArgs[1]; + gSprites[spriteId].data[3] = ((y - baseY) << 4) / gBattleAnimArgs[1]; + gSprites[spriteId].data[4] = gBattleAnimArgs[1]; + gSprites[spriteId].data[5] = x; + gSprites[spriteId].data[6] = y; + gSprites[spriteId].callback = AnimDestinyBondWhiteShadow_Step; + + task->data[13] = spriteId; + task->data[12] = 1; + } + } + + task->func = AnimTask_DestinyBondWhiteShadow_Step; +} diff --git a/src/battle_anim_ground.c b/src/battle_anim_ground.c index 8c1442fd4..73a5690df 100644 --- a/src/battle_anim_ground.c +++ b/src/battle_anim_ground.c @@ -8,7 +8,6 @@ static void AnimBonemerangProjectile(struct Sprite *); static void AnimBoneHitProjectile(struct Sprite *); -static void AnimDirtPlumeParticle(struct Sprite *); static void AnimDirtPlumeParticle_Step(struct Sprite *); static void AnimDigDirtMound(struct Sprite *); static void AnimBonemerangProjectile_Step(struct Sprite *); diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 2aef2b0a8..f3592fbcd 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -5,11 +5,13 @@ #include "random.h" #include "gpu_regs.h" #include "item.h" +#include "rtc.h" #include "item_icon.h" #include "sound.h" #include "menu.h" #include "malloc.h" #include "util.h" +#include "trig.h" #include "graphics.h" #include "battle_scripts.h" #include "battle_controllers.h" @@ -54,7 +56,20 @@ static void AnimSkyDropBallUp(struct Sprite *sprite); static void SpriteCB_SearingShotRock(struct Sprite* sprite); static void AnimHappyHourCoinShower(struct Sprite *sprite); static void SpriteCB_Geyser(struct Sprite* sprite); +static void SpriteCB_GeyserTarget(struct Sprite* sprite); static void SpriteCB_TwinkleOnBattler(struct Sprite *sprite); +static void AnimBlastBurnTargetPlume_Step1(struct Sprite *sprite); +static void AnimBlastBurnTargetPlume(struct Sprite *sprite); +static void AnimEllipticalGustAttacker(struct Sprite *sprite); +static void AnimEllipticalGustAttacker_Step(struct Sprite *sprite); +static void AnimGrowingShockWaveOrbOnTarget(struct Sprite *sprite); +static void AnimTask_GrowStep(u8 taskId); +static void AnimExtremeEvoboostCircle(struct Sprite *sprite); +static void AnimExtremeEvoboostCircle_Step(struct Sprite *sprite); +static void AnimOceanicOperettaSpotlight(struct Sprite *sprite); +static void AnimSoulStealingStar(struct Sprite *sprite); +static void AnimSoulStealingStar_Step1(struct Sprite *sprite); +static void AnimSoulStealingStar_Step2(struct Sprite *sprite); //////// const data //// general @@ -4092,7 +4107,6 @@ const struct SpriteTemplate gYellowZMoveEnergySpriteTemplate = .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimEndureEnergy, }; -/* // breakneck blitz const struct SpriteTemplate gBreakneckBlitzDanceSpriteTemplate = { @@ -4102,27 +4116,17 @@ const struct SpriteTemplate gBreakneckBlitzDanceSpriteTemplate = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = 0x80B7449 -}; -const struct SpriteTemplate gBreakneckBlitzSuperpowerSpriteTemplate = -{ - .tileTag = ANIM_TAG_METEOR, - .paletteTag = ANIM_TAG_METEOR, - .oam = sGrowingSuperpowerOAM, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gSpriteAffineAnimTable_GrowingSuperpower, - .callback = SpriteCB_GrowingSuperpower + .callback = AnimDragonDanceOrb }; const struct SpriteTemplate gBreakneckBlitzHitSpriteTemplate = { .tileTag = ANIM_TAG_IMPACT, .paletteTag = ANIM_TAG_FLAT_ROCK, - .oam = OAM_NORMAL_BLEND_32x32, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, .anims = gDummySpriteAnimTable, .images = NULL, - .affineAnims = 0x83E7BF8, - .callback = 0x80BA561 + .affineAnims = gAffineAnims_HitSplat, + .callback = AnimHitSplatBasic }; // all out pummelling const struct SpriteTemplate gAllOutPummelingOnslaughtSpriteTemplate = @@ -4130,17 +4134,19 @@ const struct SpriteTemplate gAllOutPummelingOnslaughtSpriteTemplate = .tileTag = ANIM_TAG_HANDS_AND_FEET, .paletteTag = ANIM_TAG_IMPACT, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = 0x83E66CC, + .anims = gAnims_HandOrFoot, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = 0x80B0929 + .callback = AnimJumpKick }; // supersonic skystrike -static const union AffineAnimCmd sSupersonicSkystrikeAffinePlayerSide = { - .hword 0,0,0x01b9,0,0x7fff,0,0,0 +static const union AffineAnimCmd sSupersonicSkystrikeAffinePlayerSide[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), + AFFINEANIMCMD_END, }; -static const union AffineAnimCmd sSupersonicSkystrikeAffineOpponentSide = { - .hword 0,0,0x0150,0,0x7fff,0,0,0 +static const union AffineAnimCmd sSupersonicSkystrikeAffineOpponentSide[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), + AFFINEANIMCMD_END, }; static const union AffineAnimCmd* const sSupersonicSkystrikeAffineAnimTable[] = { sSupersonicSkystrikeAffinePlayerSide, @@ -4150,42 +4156,742 @@ const struct SpriteTemplate gSupersonicSkystrikeFlySpriteTemplate = { .tileTag = ANIM_TAG_BIRD, .paletteTag = ANIM_TAG_BIRD, - .oam = OAM_NORMAL_64x64, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = sSupersonicSkystrikeAffineAnimTable, - .callback = 0x80B1C3D + .callback = AnimFlyBallAttack }; //acid downpour const struct SpriteTemplate gAcidDownpourReversalSpriteTemplate = { .tileTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_BUBBLE, - .oam = OAM_NORMAL_16x16, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = 0x80E0E95 + .callback = AnimReversalOrb }; const struct SpriteTemplate gAcidDownpourAuraSpriteTemplate = { .tileTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_BUBBLE, - .oam = OAM_NORMAL_16x16, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = 0x80B477D + .callback = AnimParticleInVortex }; //tectonic rage const struct SpriteTemplate gTectonicRageBlastBurnSpriteTemplate = { -TEC_RAGE_BLAST_BURN: objtemplate ANIM_TAG_FIRE_PLUME ANIM_TAG_FIRE_PLUME &gOamData_AffineOff_ObjNormal_32x32 0x83E5C50 0x0 gDummySpriteAffineAnimTable BLASTBURN_TARGET_ASM+1 + .tileTag = ANIM_TAG_FIRE_PLUME, + .paletteTag = ANIM_TAG_FIRE_PLUME, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FirePlume, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimBlastBurnTargetPlume }; const struct SpriteTemplate gTectonicRageExplosionSpriteTemplate = { -TECTONIC_EXPLODE: objtemplate ANIM_TAG_EXPLOSION_2 ANIM_TAG_EXPLOSION_2 &gOamData_AffineOff_ObjNormal_32x32 0x83E3F90 0x0 gDummySpriteAffineAnimTable AnimSpriteOnMonPos -};*/ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_EXPLOSION_2, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// continental crush +const struct SpriteTemplate gContinentalCrushNeedleArmSpriteTemplate = +{ + .tileTag = ANIM_TAG_ROCKS, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FlyingRock, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimNeedleArmSpike +}; +const struct SpriteTemplate gContinentalCrushBigRockStompSpriteTemplate = +{ + .tileTag = ANIM_TAG_REALLY_BIG_ROCK, + .paletteTag = ANIM_TAG_REALLY_BIG_ROCK, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSpriteAffineAnimTable_LargeHailRock, + .callback = SpriteCB_FallingObject +}; +const struct SpriteTemplate gContinentalCrushFocusEnergySpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gContinentalCrushGrowingRockSpriteTemplate = +{ + .tileTag = ANIM_TAG_REALLY_BIG_ROCK, + .paletteTag = ANIM_TAG_REALLY_BIG_ROCK, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gContinentalCrushEruptionSpriteTemplate = +{ + .tileTag = ANIM_TAG_ROCKS, + .paletteTag ANIM_TAG_ROCKS, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEruptionFallingRock +}; + +// savage spin out +const struct SpriteTemplate gSavageSpinOutStringBlastSpriteTemplate = +{ + .tileTag = ANIM_TAG_STRING, + .paletteTag = ANIM_TAG_STRING, + .oam = &gOamData_AffineOff_ObjNormal_64x32, + .anims = gAffineAnims_AirWaveCrescent, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimAirWaveCrescent +}; +const struct SpriteTemplate gSavageSpinOutCacoonSpriteTemplate = +{ + .tileTag = ANIM_TAG_COCOON, + .paletteTag = ANIM_TAG_COCOON, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_Bite, + .callback = AnimBite +}; +const struct SpriteTemplate gSavageSpinOutGreenChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_RAZOR_LEAF, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gSavageSpinOutGreenCutSpriteTemplate = +{ + .tileTag = ANIM_TAG_CUT, + .paletteTag = ANIM_TAG_RAZOR_LEAF, + .oam = &gOamData_AffineOff_ObjBlend_32x32, + .anims = gCuttingSliceAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimCuttingSlice +}; +const struct SpriteTemplate gSavageSpinOutWhiteExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_AIR_WAVE_2, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// never ending nightmare +const struct SpriteTemplate gNeverEndingNightmareRingAttackerSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gNeverEndingNightmareRingTargetSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gNeverEndingNightmareFocusEnergySpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gNeverEndingNightmareHandSpriteTemplate = +{ + .tileTag = ANIM_TAG_ASSURANCE_HAND, + .paletteTag ANIM_TAG_ASSURANCE_HAND, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimNeedleArmSpike +}; +const struct SpriteTemplate gNeverEndingNightmareBlastBurnSpriteTemplate = +{ + .tileTag = ANIM_TAG_FIRE_PLUME, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FirePlume, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimBlastBurnTargetPlume +}; +const struct SpriteTemplate gNeverEndingNightmareGeyserHexSpriteTemplate = +{ + .tileTag = ANIM_TAG_VERTICAL_HEX, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gRazorLeafParticleAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_GeyserTarget +}; +const struct SpriteTemplate gNeverEndingNightmareExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// corkscrew crash +const struct SpriteTemplate gCorkscrewCrashMetalBitSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIKES, + .paletteTag = ANIM_TAG_SPIKES, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_TearDrop, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gCorkscrewCrashChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gCorkscrewCrashCorkscrewFlyUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimParticleInVortex +}; +static const union AffineAnimCmd sCorkscrewCrashFlyDownAffineOpponentSide[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x80, 1), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd* const sCorkscrewCrashFlyDownAffineAnimTable[] = { + sCorkscrewCrashFlyDownAffineOpponentSide, +}; +const struct SpriteTemplate gCorkscrewCrashCorkscrewFlyDownSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sCorkscrewCrashFlyDownAffineAnimTable, + .callback = AnimStompFoot +}; +static const union AffineAnimCmd sCorkscrewCrashStrikePlayerAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd sCorkscrewCrashStrikeTargetAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sCorkscrewCrashStrikeAffineAnimTable[] = { + sCorkscrewCrashStrikePlayerAffineAnims, + sCorkscrewCrashStrikeTargetAffineAnims, +}; +const struct SpriteTemplate gCorkscrewCrashStrikeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sCorkscrewCrashStrikeAffineAnimTable, + .callback = AnimFlyBallAttack +}; +static const union AffineAnimCmd sCorkscrewCrashLeftAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x40, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sCorkscrewCrashLeftAffineAnimTable[] = { + sCorkscrewCrashLeftAffineAnims, +}; +const struct SpriteTemplate gCorkscrewCrashLeftUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sCorkscrewCrashLeftAffineAnimTable, + .callback = AnimAssistPawprint +}; +const struct SpriteTemplate gCorkscrewCrashLeftDownSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sCorkscrewCrashLeftAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sCorkscrewCrashRightUpAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xc2, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sCorkscrewCrashRightUpAffineAnimTable[] = { + sCorkscrewCrashRightUpAffineAnims, +}; +const struct SpriteTemplate gCorkscrewCrashRightUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sCorkscrewCrashRightUpAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sCorkscrewCrashRightDownAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xba, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sCorkscrewCrashRightDownAffineAnimTable[] = { + sCorkscrewCrashRightDownAffineAnims, +}; +const struct SpriteTemplate gCorkscrewCrashRightDownSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sCorkscrewCrashRightDownAffineAnimTable, + .callback = AnimAssistPawprint +}; + +// inferno overdrive +const struct SpriteTemplate gInfernoOverdriveSuperpowerSpriteTemplate = +{ + .tileTag = ANIM_TAG_METEOR, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &sGrowingSuperpowerOAM, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSpriteAffineAnimTable_GrowingSuperpower, + .callback = SpriteCB_GrowingSuperpower +}; +const struct SpriteTemplate gInfernoOverdriveChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gInfernoOverdriveExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_EXPLOSION_2, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// hydro vortex +const struct SpriteTemplate gHydroVortexSuperpowerSpriteTemplate = +{ + .tileTag = ANIM_TAG_METEOR, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &sGrowingSuperpowerOAM, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSpriteAffineAnimTable_GrowingSuperpower, + .callback = SpriteCB_GrowingSuperpower +}; +const struct SpriteTemplate gHydroVortexHurricaneSpriteTemplate = +{ + .tileTag = ANIM_TAG_GUST, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineOff_ObjNormal_32x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEllipticalGust +}; +const struct SpriteTemplate gHydroVortexImpactSpriteTemplate = +{ + .tileTag = ANIM_TAG_IMPACT, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_HitSplat, + .callback = AnimHitSplatBasic +}; + +// bloom doom +const struct SpriteTemplate gBloomDoomPetalSpinSpriteTemplate = +{ + .tileTag = ANIM_TAG_FLOWER, + .paletteTag = ANIM_TAG_FLOWER, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gPetalDanceBigFlowerAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimFireSpiralOutward +}; +const struct SpriteTemplate gBloomDoomGreenChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag ANIM_TAG_RAZOR_LEAF, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gBloomDoomHurricaneSpriteTemplate = +{ + .tileTag = ANIM_TAG_GUST, + .paletteTag = ANIM_TAG_RAZOR_LEAF, + .oam = &gOamData_AffineOff_ObjNormal_32x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEllipticalGustAttacker, +}; +const struct SpriteTemplate gBloomDoomFlowerGeyserSpriteTemplate = +{ + .tileTag = ANIM_TAG_FLOWER, + .paletteTag = ANIM_TAG_FLOWER, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gPetalDanceBigFlowerAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_Geyser +}; +const struct SpriteTemplate gBloomDoomGreenBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_RAZOR_LEAF, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarbeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate gBloomDoomPetalStarSpriteTemplate = +{ + .tileTag = ANIM_TAG_FLOWER, + .paletteTag = ANIM_TAG_FLOWER, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gPetalDanceBigFlowerAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimNeedleArmSpike +}; +const struct SpriteTemplate gBloomDoomExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_RAZOR_LEAF, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// gigavolt havoc +const struct SpriteTemplate gGigavoltHavocChargingSpearSpriteTemplate = +{ + .tileTag = ANIM_TAG_HAVOC_SPEAR, + .paletteTag = ANIM_TAG_HAVOC_SPEAR, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gGigavoltHavocLaunchSpearSpriteTemplate = +{ + .tileTag = ANIM_TAG_HAVOC_SPEAR, + .paletteTag = ANIM_TAG_HAVOC_SPEAR, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSuperpowerFireball +}; +const struct SpriteTemplate gGigavoltHavocRingsSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gGigavoltHavocGeyserSpriteTemplate = +{ + .tileTag = ANIM_TAG_VERTICAL_HEX, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gRazorLeafParticleAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_Geyser +}; + +// shattered psyche +const struct SpriteTemplate gShatteredPsycheReflectHitSpriteTemplate = +{ + .tileTag = ANIM_TAG_BLUE_LIGHT_WALL, + .paletteTag = ANIM_TAG_BLUE_LIGHT_WALL, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_HitSplat, + .callback = AnimHitSplatBasic +}; +const struct SpriteTemplate gShatteredPsychePinkChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gShatteredPsycheRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// subzero slammer +const struct SpriteTemplate gSubzeroSlammerIceSpinSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICE_CRYSTALS, + .paletteTag = ANIM_TAG_ICE_CRYSTALS, + .oam = &gOamData_AffineNormal_ObjBlend_8x16, + .anims = gAnims_IceCrystalLarge, + .images = NULL, + .affineAnims = gAffineAnims_IceCrystalHit, + .callback = AnimFireSpiralOutward +}; +const struct SpriteTemplate gSubzeroSlammerExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_EXPLOSION_2, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gSubzeroSlammerIceSwirlSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICE_CRYSTALS, + .paletteTag = ANIM_TAG_ICE_CRYSTALS, + .oam = &gOamData_AffineNormal_ObjBlend_8x16, + .anims = gAnims_IceCrystalLarge, + .images = NULL, + .affineAnims = gAffineAnims_IceCrystalHit, + .callback = AnimParticleInVortex +}; + +// devastating drake +static const union AffineAnimCmd sDevastatingDrakeStrikePlayer[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd sDevastatingDrakeStrikeOpponent[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sDevastatingDrakeStrikeAffineAnimTable[] = { + sDevastatingDrakeStrikePlayer, + sDevastatingDrakeStrikeOpponent, +}; +static const union AffineAnimCmd sDevastatingDrakeFlyUpAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sDevastatingDrakeFlyUpAffineAnimTable[] = { + sDevastatingDrakeFlyUpAffineAnims, + sDevastatingDrakeFlyUpAffineAnims +}; +static const union AffineAnimCmd sDevastatingDrakeRightAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xc2, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sDevastatingDrakeRightAffineAnimTable[] = { + sDevastatingDrakeRightAffineAnims, + sDevastatingDrakeRightAffineAnims +}; +static const union AffineAnimCmd sDevastatingDrakeLeftAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x40, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sDevastatingDrakeLeftAffineAnimTable[] = { + sDevastatingDrakeLeftAffineAnims, + sDevastatingDrakeLeftAffineAnims, +}; +const struct SpriteTemplate gDevastatingDrakePurpleEnergySpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gDevastatingDrakeShockwaveSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingShockWaveOrb +}; +const struct SpriteTemplate gDevastatingDrakeDrakeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_PURPLE_DRAKE, + .paletteTag = ANIM_TAG_PURPLE_DRAKE, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sDevastatingDrakeFlyUpAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gDevastatingDrakeRightSpriteTemplate = +{ + .tileTag = ANIM_TAG_PURPLE_DRAKE, + .paletteTag = ANIM_TAG_PURPLE_DRAKE, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sDevastatingDrakeRightAffineAnimTable, + .callback = AnimAssistPawprint +}; +const struct SpriteTemplate gDevastatingDrakeLeftSpriteTemplate = +{ + .tileTag = ANIM_TAG_PURPLE_DRAKE, + .paletteTag = ANIM_TAG_PURPLE_DRAKE, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sDevastatingDrakeLeftAffineAnimTable, + .callback = AnimAssistPawprint +}; +const struct SpriteTemplate gDevastatingDrakeStrikeSpriteTemplate = +{ + .tileTag = ANIM_TAG_PURPLE_DRAKE, + .paletteTag = ANIM_TAG_PURPLE_DRAKE, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sDevastatingDrakeStrikeAffineAnimTable, + .callback = AnimFlyBallAttack +}; +const struct SpriteTemplate gDevastatingDrakePurpleBlastSpriteTemplate = +{ + .tileTag = ANIM_TAG_FIRE_PLUME, + .paletteTag = ANIM_TAG_FIRE_PLUME, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FirePlume, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimBlastBurnTargetPlume +}; +const struct SpriteTemplate gDevastatingDrakeHexSpriteTemplate = +{ + .tileTag = ANIM_TAG_VERTICAL_HEX, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gRazorLeafParticleAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_Geyser +}; +const struct SpriteTemplate gDevastatingDrakeExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_EXPLOSION, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gDevastatingDrakeExplosion2SpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_EXPLOSION_2, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; // black hole eclipse const struct SpriteTemplate gBlackHoleEclipseShockwaveSpriteTemplate = @@ -4333,9 +5039,1458 @@ const struct SpriteTemplate gTargetTwinkleSpriteTemplate = .callback = SpriteCB_TwinkleOnBattler }; +// twinkle tackle +static const union AffineAnimCmd sTwinkleTackleStarPlayerAffineAnims[] = { + //.hword 0x8,0x8,0x0,0x0, 0x10,0x10,0x1e00,0x0, 0x7fff,0x1,0x0,0x0 + AFFINEANIMCMD_FRAME(8, 8, 0, 0), + AFFINEANIMCMD_FRAME(0x10, 0x10, 0x0, 0x1e), + AFFINEANIMCMD_END_ALT(1), +}; +static const union AffineAnimCmd sTwinkleTackleStarOpponentAffineAnims[] = { + //.hword 0x8,0x8,0x0,0x0, 0x20,0x20,0x0f00,0x0, 0x7fff,0x1,0x0,0x0 + AFFINEANIMCMD_FRAME(8, 8, 0, 0), + AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 0xf), + AFFINEANIMCMD_END_ALT(1), +}; +static const union AffineAnimCmd *const sTwinkleTackleStarAffineAnimTable[] = { + sTwinkleTackleStarPlayerAffineAnims, + sTwinkleTackleStarOpponentAffineAnims +}; +const struct SpriteTemplate gTwinkleTacklePinkStarSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_2, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gGrantingStarsAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimGrantingStars +}; +const struct SpriteTemplate gTwinkleTacklePinkRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gTwinkleTackleStarGrowSpriteTemplate = +{ + .tileTag = ANIM_TAG_YELLOW_STAR, + .paletteTag = ANIM_TAG_YELLOW_STAR, + .oam = &gOamData_AffineDouble_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sTwinkleTackleStarAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gTwinkleTackleTwinkleSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_4, + .paletteTag = ANIM_TAG_SPARKLE_4, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gSpriteAnimTable_853EE80, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_TwinkleOnBattler +}; +const struct SpriteTemplate gTwinkleTackleDigStarSpriteTemplate = +{ + .tileTag = ANIM_TAG_YELLOW_STAR, + .paletteTag = ANIM_TAG_YELLOW_STAR, + .oam = &gOamData_AffineDouble_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimDirtPlumeParticle +}; +const struct SpriteTemplate gTwinkleTackleYellowImpactSpriteTemplate = +{ + .tileTag = ANIM_TAG_IMPACT, + .paletteTag = ANIM_TAG_YELLOW_STAR, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_HitSplat, + .callback = AnimHitSplatBasic +}; +const struct SpriteTemplate gTwinkleTackleImpactStarsSpriteTemplate = +{ + .tileTag = ANIM_TAG_PAIN_SPLIT, + .paletteTag = ANIM_TAG_YELLOW_STAR, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimDizzyPunchDuck +}; + +// catastrokpika +const struct SpriteTemplate gCatastrokpikaSuperpowerSpriteTemplate = +{ + .tileTag = ANIM_TAG_METEOR, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &sGrowingSuperpowerOAM, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSpriteAffineAnimTable_GrowingSuperpower, + .callback = SpriteCB_GrowingSuperpower +}; + +// 10e6 volt thunderbolt +const struct SpriteTemplate g10MillionVoltBoltYellowFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_SPARK_2, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; +const struct SpriteTemplate g10MillionVoltBoltShockwaveSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingShockWaveOrbOnTarget, +}; +const struct SpriteTemplate g10MillionVoltBoltRedBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarbeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate g10MillionVoltBoltBlueBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarbeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate g10MillionVoltBoltPinkBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_BERRY_EATEN, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarbeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate g10MillionVoltBoltYellowBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_ELECTRIC_ORBS, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarbeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate g10MillionVoltBoltGreenBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarbeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate g10MillionVoltBoltPurpleBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarbeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; + +// stoked sparksurfer +const struct SpriteTemplate gStokedSparksurferFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_SPARK_2, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; + +// extreme evoboost +const struct SpriteTemplate gExtremeEvoboostRedChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostPinkChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_BERRY_EATEN, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostIceChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_ICE_CHUNK, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostBlackChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WISP_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostBlueChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostPurpleChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostYellowChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostGreenChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostRedChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostPinkChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_BERRY_EATEN, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostIceChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_ICE_CHUNK, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostBlackChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WISP_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostBlueChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostPurpleChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostYellowChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostGreenChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostRedStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostPinkStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_BERRY_EATEN, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostIceStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_ICE_CHUNK, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostBlackStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_WISP_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostBlueStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostPurpleStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostYellowStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostGreenStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; + +// pulverizing pancake +const struct SpriteTemplate gPulverizingPancakeRedDetectSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_4, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gSpriteAnimTable_853EE80, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpinningSparkle +}; +const struct SpriteTemplate gPulverizingPancakeExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_ELECTRIC_ORBS, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gPulverizingPancakeYellowRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_ELECTRIC_ORBS, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// genesis supernova +const struct SpriteTemplate gGenesisSupernovaOrbRiseSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_POISON_JAB, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gAnims_PoisonProjectile, + .images = NULL, + .affineAnims = gAffineAnims_Bubble, + .callback = AnimAssistPawprint +}; +const struct SpriteTemplate gGenesisSupernovaReversalSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_POISON_JAB, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimReversalOrb +}; +const struct SpriteTemplate gGenesisSupernovaSpinUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_POISON_JAB, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gGenesisSupernovaChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_POISON_JAB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gGenesisSupernovaSuperpowerSpriteTemplate = +{ + .tileTag = ANIM_TAG_METEOR, + .paletteTag = ANIM_TAG_WISP_ORB, + .oam = &sGrowingSuperpowerOAM, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSpriteAffineAnimTable_GrowingSuperpower, + .callback = SpriteCB_GrowingSuperpower +}; +const struct SpriteTemplate gGenesisSupernovaBubbleSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_POISON_JAB, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gAnims_PoisonProjectile, + .images = NULL, + .affineAnims = gAffineAnims_Bubble, + .callback = AnimBubbleEffect +}; +const struct SpriteTemplate gGenesisSupernovaExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_WISP_ORB, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// sinister arrow raid +static const union AffineAnimCmd sArrowRaidFlyStrikePlayerAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd sArrowRaidFlyStrikeOpponentAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidFlyStrikeAffineAnimTable[] = { + sArrowRaidFlyStrikePlayerAffineAnims, + sArrowRaidFlyStrikeOpponentAffineAnims +}; +static const union AffineAnimCmd sArrowRaidFlyRightAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xc2, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidFlyRightAffineAnimTable[] = { + sArrowRaidFlyRightAffineAnims, + sArrowRaidFlyRightAffineAnims +}; +static const union AffineAnimCmd sArrowRaidFlyLeftAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x40, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidFlyLeftAffineAnimTable[] = { + sArrowRaidFlyLeftAffineAnims, + sArrowRaidFlyLeftAffineAnims +}; +const struct SpriteTemplate gArrowRaidExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gArrowRaidFlyUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; +const struct SpriteTemplate gArrowRaidFlyRightSpriteTemplate = +{ + .tileTag = ANIM_TAG_BIRD, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidFlyRightAffineAnimTable, + .callback = AnimAssistPawprint +}; +const struct SpriteTemplate gArrowRaidFlyLeftSpriteTemplate = +{ + .tileTag = ANIM_TAG_BIRD, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidFlyLeftAffineAnimTable, + .callback = AnimAssistPawprint +}; +const struct SpriteTemplate gArrowRaidFlyStrikeSpriteTemplate = +{ + .tileTag = ANIM_TAG_BIRD, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidFlyStrikeAffineAnimTable, + .callback = AnimFlyBallAttack +}; +static const union AffineAnimCmd sArrowRaidArrowUpAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xa0, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidArrowUpAffineAnimTable[] = { + sArrowRaidArrowUpAffineAnims, +}; +const struct SpriteTemplate gArrowRaidArrowUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidArrowUpAffineAnimTable, + .callback = AnimParticleInVortex +}; +static const union AffineAnimCmd sArrowRaidArrowRightUpAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x75, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidArrowRightUpAffineAnimTable[] = { + sArrowRaidArrowRightUpAffineAnims, +}; +const struct SpriteTemplate gArrowRaidRightUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidArrowRightUpAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sArrowRaidRightDownAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x60, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidRightDownAffineAnimTable[] = { + sArrowRaidRightDownAffineAnims, +}; +const struct SpriteTemplate gArrowRaidRightDownSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidRightDownAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sArrowRaidArrowLeftUpAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xe0, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidLeftUpAffineAnimTable[] = { + sArrowRaidArrowLeftUpAffineAnims, +}; +const struct SpriteTemplate gArrowRaidLeftUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidLeftUpAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sArrowRaidFaceUpLeftAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xe0, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidFaceUpLeftAffineAnimTable[] = { + sArrowRaidFaceUpLeftAffineAnims, +}; +const struct SpriteTemplate gArrowRaidFaceUpLeftSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidFaceUpLeftAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sArrowRaidArrowFaceRightAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x60, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidArrowFaceRightAffineAnimTable[] = { + sArrowRaidArrowFaceRightAffineAnims +}; +const struct SpriteTemplate gArrowRaidRightSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidArrowFaceRightAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sArrowRaidLeftDownAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xd0, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidLeftDownAffineAnimTable[] = { + sArrowRaidLeftDownAffineAnims +}; +const struct SpriteTemplate gArrowRaidLeftDownSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidLeftDownAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sArrowRaidOnslaughtAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x30, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidOnslaughtAffineAnimTable[] = { + sArrowRaidOnslaughtAffineAnims +}; +const struct SpriteTemplate gArrowRaidArrowOnslaughtSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidOnslaughtAffineAnimTable, + .callback = AnimAssistPawprint +}; + +// malicious moonsault +const struct SpriteTemplate gMaliciousMoonsaultRedFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; +const struct SpriteTemplate gMaliciousMoonsaultRedBounceSpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_BounceBallLand, + .callback = AnimBounceBallLand +}; +const struct SpriteTemplate gMaliciousMoonsaultRedImpactSpriteTemplate = +{ + .tileTag = ANIM_TAG_IMPACT, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_HitSplat, + .callback = AnimHitSplatBasic +}; +const struct SpriteTemplate gMaliciousMoonsaultFireblastSpriteTemplate = +{ + .tileTag = ANIM_TAG_SMALL_EMBER, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FireBlastCross, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimFireCross +}; +const struct SpriteTemplate gMaliciousMoonsaultExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_EXPLOSION_2, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// oceanic operetta +const struct SpriteTemplate gOceanOperaSpotlightSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPOTLIGHT, + .paletteTag = ANIM_TAG_SPOTLIGHT, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gSpotlightAffineAnimTable, + .callback = AnimOceanicOperettaSpotlight, +}; +const struct SpriteTemplate gOceanOperaBlueFlareSpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gOceanOperaBlueChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gOceanOperaBlueRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gOceanOperaMovingOrbsSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimThrowMistBall +}; +const struct SpriteTemplate gOceanOperaBlueOrbsSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimBite +}; +const struct SpriteTemplate gOceanOperaExpandingRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gOceanOperaExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gOceanOperaSparkleSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_2, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gGrantingStarsAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimGrantingStars +}; + +// splintered stormshards +const struct SpriteTemplate gSplinteredShardsFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; +const struct SpriteTemplate gSplinteredShardsExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gSplinteredShardsRisingSpearSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICICLE_SPEAR, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sSplinteredShardsOpponentSteepAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xca, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sSplinteredShardsOpponentSteepAffineAnimTable[] = { + sSplinteredShardsOpponentSteepAffineAnims, +}; +const struct SpriteTemplate gSplinteredShardsSplinterOpponentSteepSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICICLE_SPEAR, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSplinteredShardsOpponentSteepAffineAnimTable, + .callback = AnimJumpKick +}; +static const union AffineAnimCmd sSplinteredShardsOpponentShallowAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sSplinteredShardsOpponentShallowAffineAnimTable[] = { + sSplinteredShardsOpponentShallowAffineAnims +}; +const struct SpriteTemplate gSplinteredShardsSplinterOpponentShallowSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICICLE_SPEAR, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSplinteredShardsOpponentShallowAffineAnimTable, + .callback = AnimJumpKick +}; +static const union AffineAnimCmd sSplinteredShardsPlayerSteepAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x60, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sSplinteredShardsPlayerSteepAffineAnimTable[] = { + sSplinteredShardsPlayerSteepAffineAnims +}; +const struct SpriteTemplate gSplinteredShardsSplinterPlayerSteepSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICICLE_SPEAR, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSplinteredShardsPlayerSteepAffineAnimTable, + .callback = AnimJumpKick +}; +static const union AffineAnimCmd sSplinteredShardsPlayerShallowAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sSplinteredShardsPlayerShallowAffineAnimTable[] = { + sSplinteredShardsPlayerShallowAffineAnims +}; +const struct SpriteTemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICICLE_SPEAR, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSplinteredShardsPlayerShallowAffineAnimTable, + .callback = AnimJumpKick +}; + +// lets snuggle forever +const struct SpriteTemplate gSnuggleForeverEyesSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_4, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gSpriteAnimTable_853EE80, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpinningSparkle +}; +const struct SpriteTemplate gSnuggleForeverStarSpriteTemplate = +{ + .tileTag = ANIM_TAG_PAIN_SPLIT, + .paletteTag = ANIM_TAG_DUCK, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimDizzyPunchDuck +}; +const struct SpriteTemplate gSnuggleForeverHeartSpriteTemplate = +{ + .tileTag = ANIM_TAG_MAGENTA_HEART, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimMagentaHeart +}; + +// clangorous soulblaze +const struct SpriteTemplate gClangoorousSoulblazeWhiteFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_AIR_WAVE_2, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; +const struct SpriteTemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gAnims_WaterMudOrb, + .images = NULL, + .affineAnims = gAffineAnims_Whirlpool, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gClangoorousSoulblazePurpleChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gClangoorousSoulblazePulseSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = TranslateAnimSpriteToTargetMonLocation +}; + +// guardian of alola +const struct SpriteTemplate gGuardianOfAlolaFistSpriteTemplate = +{ + .tileTag = ANIM_TAG_HORSESHOE_SIDE_FIST, + .paletteTag = ANIM_TAG_HORSESHOE_SIDE_FIST, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimStompFoot +}; +const struct SpriteTemplate gGuardianOfAlolaDirtGeyserSpriteTemplate = +{ + .tileTag = ANIM_TAG_MUD_SAND, + .paletteTag = ANIM_TAG_MUD_SAND, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimMudSportDirt +}; + +// seering sunraze smash +static const union AffineAnimCmd sSearingSunrazeSmashWormholeGrowingAffineAnims[] = { + //.hword 0x100,0x100,0x0,0x0, 0x0,0x0,0x88f6,0x0, 0x7fff,0x0,0x0,0x0 + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, 0xf8, 0x88), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sSearingSunrazeSmashWormholeGrowingAffineAnimTable[] = { + sSearingSunrazeSmashWormholeGrowingAffineAnims +}; +const struct SpriteTemplate gSearingSunrazeSmashGrowWormholeSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHADOW_BALL, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSearingSunrazeSmashWormholeGrowingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gSearingSunrazeSmashWhiteRingInwardsSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_AIR_WAVE_2, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gSearingSunrazeSmashCrossImpactSpriteTemplate = +{ + .tileTag = ANIM_TAG_CROSS_IMPACT, + .paletteTag = ANIM_TAG_AIR_WAVE_2, + .oam = &gOamData_AffineOff_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimCrossImpact +}; +const struct SpriteTemplate gSearingSunrazeSmashWhiteCutSpriteTemplate = +{ + .tileTag = ANIM_TAG_CUT, + .paletteTag = ANIM_TAG_AIR_WAVE_2, + .oam = &gOamData_AffineOff_ObjBlend_32x32, + .anims = gCuttingSliceAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimCuttingSlice +}; +const struct SpriteTemplate gSearingSunrazeSmashInfernoOrbSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gSearingSunrazeSmashShockwaveSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingShockWaveOrbOnTarget +}; +const struct SpriteTemplate gSearingSunrazeSmashRedFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; + +// menacing moonraze maelstrom +const struct SpriteTemplate gMoonrazeMaelstromBlueBuffSpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gMoonrazeMaelstromBlackBuffSpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gMoonrazeMaelstromBlackSparklesSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_2, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gGrantingStarsAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimGrantingStars +}; +const struct SpriteTemplate gMoonrazeMaelstromBlueRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gMoonrazeMaelstromWhiteRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_AIR_WAVE_2, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gMoonrazeMaelstromSuperpowerSpriteTemplate = +{ + .tileTag = ANIM_TAG_METEOR, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineOff_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSuperpowerFireball +}; +const struct SpriteTemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gMoonrazeMaelstromBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarbeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate gMoonrazeMaelstromExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gMoonrazeMaelstromShockwaveSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingShockWaveOrbOnTarget +}; +static const union AffineAnimCmd sMoonrazeMaelstromWormholeAffineAnims[] = { + //.hword 0x100,0x100,0x0,0x0, 0x0,0x0,0x88f6,0x0, 0x7fff,0x0,0x0,0x0 + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, 0xf6, 0x88), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sMoonrazeMaelstromWormholeAffineAnimTable[] = { + sMoonrazeMaelstromWormholeAffineAnims +}; +const struct SpriteTemplate gMoonrazeMaelstromWormholeSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHADOW_BALL, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sMoonrazeMaelstromWormholeAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// light that burns the sky +const struct SpriteTemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARK_2, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlashingSpark, + .callback = AnimSparkElectricityFlashing +}; +const struct SpriteTemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate = +{ + .tileTag = ANIM_TAG_FIRE_PLUME, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FirePlume, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimBlastBurnTargetPlume +}; +static const struct OamData sGeyserOam = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = SPRITE_SHAPE(32x32), + .size = SPRITE_SIZE(32x32), + .priority = 1, //Above sprites +}; +const struct SpriteTemplate gLightThatBurnsTheSkyExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_EXPLOSION_2, + .oam = &sGeyserOam, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// soul stealing 7star strike +const struct SpriteTemplate gSoulStealBlackFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; +const struct SpriteTemplate gSoulStealIceBuffSpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_ICE_CRYSTALS, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gSoulStealBlueFistSpriteTemplate = +{ + .tileTag = ANIM_TAG_HANDS_AND_FEET, + .paletteTag = ANIM_TAG_ICE_CRYSTALS, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_HandOrFoot, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimJumpKick +}; +const struct SpriteTemplate gSoulStealBlueStarSpriteTemplate = +{ + .tileTag = ANIM_TAG_PAIN_SPLIT, + .paletteTag = ANIM_TAG_ICE_CRYSTALS, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_Bite, + .callback = AnimSoulStealingStar +}; +const struct SpriteTemplate gSoulStealBlueParalyzeSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARK_2, + .paletteTag = ANIM_TAG_ICE_CRYSTALS, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimElectricity +}; +const struct SpriteTemplate gSoulStealBlastburnSpriteTemplate = +{ + .tileTag = ANIM_TAG_FIRE_PLUME, + .paletteTag = ANIM_TAG_WISP_FIRE, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FirePlume, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimFirePlume +}; +const struct SpriteTemplate gSoulStealExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_WISP_FIRE, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gSoulStealZStarSpriteTemplate = +{ + .tileTag = ANIM_TAG_SNORE_Z, + .paletteTag = ANIM_TAG_SNORE_Z, + .oam = &gOamData_AffineOff_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimCrossImpact +}; //// functions //general +void AnimTask_IsTargetPartner(u8 taskId) +{ + if (gBattleAnimTarget == (gBattleAnimAttacker ^ BIT_FLANK)) + gBattleAnimArgs[0] = 1; + else + gBattleAnimArgs[0] = 0; + + DestroyAnimVisualTask(taskId); +} + void AnimTask_AllBanksInvisible(u8 taskId) { u32 i; @@ -4459,7 +6614,133 @@ static void InitSpritePosToAnimAttackersCentre(struct Sprite *sprite, bool8 resp sprite->pos1.y += gBattleAnimArgs[1]; } -//sprite callbacks +////sprite callbacks +static void AnimSoulStealingStar(struct Sprite *sprite) +{ + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[0] = gBattleAnimArgs[3]; + sprite->data[1] = gBattleAnimArgs[4]; + sprite->data[2] = gBattleAnimArgs[5]; + sprite->callback = AnimSoulStealingStar_Step1; +} + +static void AnimSoulStealingStar_Step1(struct Sprite *sprite) +{ + sprite->data[4] += sprite->data[0]; + sprite->data[5] += sprite->data[1]; + sprite->pos2.x = sprite->data[4] >> 8; + sprite->pos2.y = sprite->data[5] >> 8; + if (++sprite->data[3] == sprite->data[2]) + sprite->callback = AnimSoulStealingStar_Step2; +} + +static void AnimSoulStealingStar_Step2(struct Sprite *sprite) +{ + sprite->data[4] -= sprite->data[0]; + sprite->data[5] -= sprite->data[1]; + sprite->pos2.x = sprite->data[4] >> 8; + sprite->pos2.y = sprite->data[5] >> 8; + if (--sprite->data[3] == 0) + DestroySpriteAndMatrix(sprite); +} + +//Creates The Extreme Evoboost Circles +static void AnimExtremeEvoboostCircle(struct Sprite *sprite) +{ + InitSpritePosToAnimAttacker(sprite, FALSE); + sprite->pos1.y += 20; + sprite->data[1] = 191; + sprite->callback = AnimExtremeEvoboostCircle_Step; + sprite->callback(sprite); +} + +static void AnimExtremeEvoboostCircle_Step(struct Sprite *sprite) +{ + sprite->pos2.x = Sin(sprite->data[1], 32); + sprite->pos2.y = Cos(sprite->data[1], 8); + sprite->data[1] += 5; + sprite->data[1] &= 0xFF; + if (++sprite->data[0] == 71) + DestroyAnimSprite(sprite); +} + +static void AnimGrowingShockWaveOrbOnTarget(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); + StartSpriteAffineAnim(sprite, 2); + sprite->data[0]++; + break; + case 1: + if (sprite->affineAnimEnded) + DestroySpriteAndMatrix(sprite); + break; + } +} + +static void AnimEllipticalGustAttacker(struct Sprite *sprite) +{ + InitSpritePosToAnimAttacker(sprite, FALSE); + sprite->pos1.y += 20; + sprite->data[1] = 191; + sprite->callback = AnimEllipticalGustAttacker_Step; + sprite->callback(sprite); +} + +static void AnimEllipticalGustAttacker_Step(struct Sprite *sprite) +{ + sprite->pos2.x = Sin(sprite->data[1], 32); + sprite->pos2.y = Cos(sprite->data[1], 8); + sprite->data[1] += 5; + sprite->data[1] &= 0xFF; + if (++sprite->data[0] == 71) + DestroyAnimSprite(sprite); +} + +static void SetSpriteCoordsToAnimTargetCoords(struct Sprite *sprite) +{ + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); +} + +static void AnimBlastBurnTargetPlume(struct Sprite *sprite) +{ + SetSpriteCoordsToAnimTargetCoords(sprite); + if (GetBattlerSide(gBattleAnimTarget)) + { + sprite->pos1.x -= gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[2] = -gBattleAnimArgs[4]; + } + else + { + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[2] = gBattleAnimArgs[4]; + } + + sprite->data[1] = gBattleAnimArgs[2]; + sprite->data[4] = gBattleAnimArgs[3]; + sprite->data[3] = gBattleAnimArgs[5]; + + sprite->callback = AnimBlastBurnTargetPlume_Step1; +} +static void AnimBlastBurnTargetPlume_Step1(struct Sprite *sprite) +{ + if (++sprite->data[0] < sprite->data[4]) + { + sprite->pos2.x += sprite->data[2]; + sprite->pos2.y += sprite->data[3]; + } + + if (sprite->data[0] == sprite->data[1]) + DestroySpriteAndMatrix(sprite); +} + static void SpriteCB_SpriteToCentreOfSide(struct Sprite* sprite) { bool8 var; @@ -5258,7 +7539,193 @@ static void SpriteCB_Geyser(struct Sprite* sprite) sprite->callback = AnimMudSportDirtRising; } -// Anim Task Functions +//Launches an object upwards like they were being shot from a geyser +//arg 0: null +//arg 1: initial x pixel offset +//arg 2: initial y pixel offset +static void SpriteCB_GeyserTarget(struct Sprite* sprite) +{ + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[2]; + + sprite->data[0] = gBattleAnimArgs[1] > 0 ? 1 : -1; + sprite->callback = AnimMudSportDirtRising; +} + +//// Anim Tasks Functions +#define tSpriteId data[0] +#define tTimer data[1] +#define tInitialXPos data[2] +#define tInitialYPos data[3] +#define tSide data[4] +#define tAnimLengthTime data[5] +static const s8 sHomerunEnemyHorizontalMovement[] = +{ + 3, 3, 3, 3, + 3, 3, 2, 2, + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 1, 0, 1, + 0, 1, 0, 0, + 1, 0, 0, 1, + 0, 0, 0, 1, + 0, 0, 0, 1, +}; + +static const s8 sHomerunEnemyVerticalMovement[] = +{ + -4, -4, -4, -4, + -4, -3, -3, -2, + -2, -1, -1, -1, + -1, -1, -1, -1, + 0, -1, 0, -1, + 0, -1, 0, 0, + 0, 0, -1, 0, + 0, -1, 0, 0, + -1, 0, 0, 0, +}; + +void AnimTask_TwinkleTackleLaunchStep(u8 taskId) +{ + u16 rotation; + s16 xScale, yScale; + struct Task* task = &gTasks[taskId]; + struct Sprite* sprite = &gSprites[task->tSpriteId]; + + if (task->tTimer > task->tAnimLengthTime) + { + if (task->tTimer > task->tAnimLengthTime + 5) //Wait an extra few frames so the glint can be placed on the target + { + sprite->pos1.x = task->tInitialXPos; + sprite->pos1.y = task->tInitialYPos; + ResetSpriteRotScale(task->tSpriteId); + DestroyAnimVisualTask(taskId); + } + else + ++task->tTimer; + return; + } + else if ((u16) task->tTimer < NELEMS(sHomerunEnemyHorizontalMovement)) + { + s8 movement = sHomerunEnemyHorizontalMovement[task->tTimer]; + if (task->tSide == B_SIDE_PLAYER) + movement *= -1; + sprite->pos1.x += movement; + + movement = sHomerunEnemyVerticalMovement[task->tTimer]; + if (task->tSide == B_SIDE_PLAYER) + movement *= -1; + sprite->pos1.y += movement; + } + + xScale = 0x180; + yScale = 0x180; + rotation = (task->tTimer << 4) + (task->tTimer << 3); + + xScale += rotation; + yScale += rotation; + rotation <<= 7; + + if (task->tSide == B_SIDE_OPPONENT) + rotation *= -1; + + SetSpriteRotScale(task->tSpriteId, xScale, yScale, rotation); + + if (++task->tTimer > task->tAnimLengthTime) + sprite->invisible = TRUE; +} + +//Launches the target in Twinkle Tackle +//arg 0: Anim time +void AnimTask_TwinkleTackleLaunch(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + + task->tSpriteId = GetAnimBattlerSpriteId(ANIM_TARGET); + task->tSide = GetBattlerSide(gBattleAnimTarget); + task->tAnimLengthTime = gBattleAnimArgs[0]; + task->tInitialXPos = gSprites[task->tSpriteId].pos1.x; + task->tInitialYPos = gSprites[task->tSpriteId].pos1.y; + task->tTimer = 0; + task->func = AnimTask_TwinkleTackleLaunchStep; + + PrepareBattlerSpriteForRotScale(task->tSpriteId, ST_OAM_OBJ_NORMAL); +} +#undef tSpriteId +#undef tTimer +#undef tInitialXPos +#undef tInitialYPos +#undef tSide +#undef tAnimLengthTime + +void AnimTask_GetTimeOfDay(u8 taskId) +{ + gBattleAnimArgs[0] = 0; //Daytime is default + + RtcCalcLocalTime(); + if (gLocalTime.hours >= 20 || gLocalTime.hours < 4) + gBattleAnimArgs[0] = 1; + else if (gLocalTime.hours >= 17 && gLocalTime.hours < 20) + gBattleAnimArgs[0] = 2; + + DestroyAnimVisualTask(taskId); +} + +void AnimTask_GetLycanrocForm(u8 taskId) +{ + /* TODO - lycanroc forms + #ifdef SPECIES_LYCANROC_MIDNIGHT + if (GetIllusionPartyData(gBattleAnimAttacker)->species == SPECIES_LYCANROC_MIDNIGHT) + gBattleAnimArgs[0] = 1; + else + #endif + gBattleAnimArgs[0] = 0;*/ + + gBattleAnimArgs[0] = 0; + DestroyAnimVisualTask(taskId); +} + +// Scales up the target mon sprite +// Used in Let's Snuggle Forever +// No args. +void AnimTask_GrowTarget(u8 taskId) +{ + u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_BLEND); + SetSpriteRotScale(spriteId, 208, 208, 0); + gTasks[taskId].data[0] = 120; + gTasks[taskId].func = AnimTask_GrowStep; +} +static void AnimTask_GrowStep(u8 taskId) +{ + if (--gTasks[taskId].data[0] == -1) + { + u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); + ResetSpriteRotScale(spriteId); + DestroyAnimVisualTask(taskId); + } +} + +// Uses a spotlight sprite as a light mask to illuminate the attacker. The spotlight grows and shrinks. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: duration of fully-opened spotlight +static void AnimOceanicOperettaSpotlight(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ); + SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJWIN_ON); + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; + SetGpuReg(REG_OFFSET_WIN0H, gBattle_WIN0H); + SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); + + sprite->data[0] = gBattleAnimArgs[2]; + InitSpritePosToAnimAttacker(sprite, FALSE); + sprite->oam.objMode = ST_OAM_OBJ_WINDOW; + sprite->invisible = TRUE; + sprite->callback = AnimFlatterSpotlight_Step; +} + static void AnimTask_WaitAffineAnim(u8 taskId) { struct Task* task = &gTasks[taskId]; diff --git a/src/battle_anim_poison.c b/src/battle_anim_poison.c index f50ad1298..7c4cf74a0 100644 --- a/src/battle_anim_poison.c +++ b/src/battle_anim_poison.c @@ -8,7 +8,6 @@ static void AnimSludgeProjectile_Step(struct Sprite *); static void AnimAcidPoisonBubble(struct Sprite *); static void AnimSludgeBombHitParticle_Step(struct Sprite *); static void AnimAcidPoisonDroplet(struct Sprite *); -static void AnimBubbleEffect(struct Sprite *); static void AnimBubbleEffect_Step(struct Sprite *); static void AnimSuckerPunchStep(struct Sprite *sprite); static void AnimSuckerPunch(struct Sprite *sprite); @@ -161,7 +160,7 @@ static const union AffineAnimCmd sAffineAnim_Bubble[] = AFFINEANIMCMD_END, }; -static const union AffineAnimCmd *const sAffineAnims_Bubble[] = +const union AffineAnimCmd *const gAffineAnims_Bubble[] = { sAffineAnim_Bubble, }; @@ -173,7 +172,7 @@ const struct SpriteTemplate gPoisonBubbleSpriteTemplate = .oam = &gOamData_AffineNormal_ObjNormal_16x16, .anims = gAnims_PoisonProjectile, .images = NULL, - .affineAnims = sAffineAnims_Bubble, + .affineAnims = gAffineAnims_Bubble, .callback = AnimBubbleEffect, }; @@ -184,7 +183,7 @@ const struct SpriteTemplate gWaterBubbleSpriteTemplate = .oam = &gOamData_AffineNormal_ObjBlend_16x16, .anims = gAnims_WaterBubble, .images = NULL, - .affineAnims = sAffineAnims_Bubble, + .affineAnims = gAffineAnims_Bubble, .callback = AnimBubbleEffect, }; @@ -505,7 +504,7 @@ static void AnimAcidPoisonDroplet(struct Sprite *sprite) // arg 0: initial x pixel offset // arg 1: initial y pixel offset // arg 2: 0 = single-target, 1 = multi-target -static void AnimBubbleEffect(struct Sprite *sprite) +void AnimBubbleEffect(struct Sprite *sprite) { if (!gBattleAnimArgs[2]) { diff --git a/src/battle_anim_rock.c b/src/battle_anim_rock.c index b5c0f4b1c..7e0c7cb5d 100644 --- a/src/battle_anim_rock.c +++ b/src/battle_anim_rock.c @@ -43,7 +43,7 @@ static const union AnimCmd sAnim_FlyingRock_2[] = ANIMCMD_END, }; -static const union AnimCmd *const sAnims_FlyingRock[] = +const union AnimCmd *const gAnims_FlyingRock[] = { sAnim_FlyingRock_0, sAnim_FlyingRock_1, @@ -55,7 +55,7 @@ const struct SpriteTemplate gFallingRockSpriteTemplate = .tileTag = ANIM_TAG_ROCKS, .paletteTag = ANIM_TAG_ROCKS, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_FlyingRock, + .anims = gAnims_FlyingRock, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimFallingRock, @@ -66,7 +66,7 @@ const struct SpriteTemplate gRockFragmentSpriteTemplate = .tileTag = ANIM_TAG_ROCKS, .paletteTag = ANIM_TAG_ROCKS, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_FlyingRock, + .anims = gAnims_FlyingRock, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimRockFragment, @@ -708,6 +708,54 @@ void AnimTask_Rollout(u8 taskId) task->func = AnimTask_Rollout_Step; } +void AnimTask_TectonicRageRollout(u8 taskId) +{ + u16 var0, var1, var2, var3; + int var5; + s16 pan1, pan2; + struct Task *task; + u8 rolloutCounter = 1; + + task = &gTasks[taskId]; + + var0 = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + var1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 24; + var2 = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + var3 = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + 24; + + if (BATTLE_PARTNER(gBattleAnimAttacker) == gBattleAnimTarget) + var3 = var1; + + task->data[8] = 48 - (rolloutCounter * 8); //rollout speed + task->data[0] = 0; + task->data[11] = 0; + task->data[9] = 0; + task->data[12] = 1; + + var5 = task->data[8]; + if (var5 < 0) + var5 += 7; + + task->data[10] = (var5 >> 3) - 1; + + task->data[2] = var0 * 8; + task->data[3] = var1 * 8; + task->data[4] = ((var2 - var0) * 8) / task->data[8]; + task->data[5] = ((var3 - var1) * 8) / task->data[8]; + task->data[6] = 0; + task->data[7] = 0; + + pan1 = BattleAnimAdjustPanning(-64); + pan2 = BattleAnimAdjustPanning(63); + + task->data[13] = pan1; + task->data[14] = (pan2 - pan1) / task->data[8]; + task->data[1] = rolloutCounter; + task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER); + + task->func = AnimTask_Rollout_Step; +} + static void AnimTask_Rollout_Step(u8 taskId) { struct Task *task; diff --git a/src/battle_anim_status_effects.c b/src/battle_anim_status_effects.c index 17bb91628..5f6f8834e 100644 --- a/src/battle_anim_status_effects.c +++ b/src/battle_anim_status_effects.c @@ -380,6 +380,25 @@ static void sub_80A9E78(struct Sprite *sprite) } } +void AnimTask_FrozenIceCubeAttacker(u8 taskId) +{ + s16 x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - 32; + s16 y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) - 36; + u8 spriteId; + + if (IsContest()) + x -= 6; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + spriteId = CreateSprite(&gFrozenIceCubeSpriteTemplate, x, y, 4); + if (GetSpriteTileStartByTag(ANIM_TAG_ICE_CUBE) == 0xFFFF) + gSprites[spriteId].invisible = TRUE; + SetSubspriteTables(&gSprites[spriteId], sFrozenIceCubeSubspriteTable); + gTasks[taskId].data[15] = spriteId; + gTasks[taskId].func = AnimTask_FrozenIceCube_Step1; +} + + void AnimTask_FrozenIceCube(u8 taskId) { s16 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) - 32; diff --git a/src/data/items.h b/src/data/items.h index 30beb5352..61157f806 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -4884,4 +4884,19 @@ const struct Item gItems[] = .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 0, }, + + //TEST + [ITEM_DARKINIUM_Z] = + { + .name = _("Darkinium Z"), + .itemId = ITEM_DARKINIUM_Z, + .price = 0, + .description = sDummyDesc, + .importance = 1, + .pocket = POCKET_KEY_ITEMS, + .holdEffectParam = TYPE_DARK, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + }, }; From 71857f4c89aba190205af5b657238ba84a86cb77 Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 29 Nov 2020 10:16:01 -0500 Subject: [PATCH 006/208] secondary id for type-z moves, fix signature z move loading --- src/battle_z_move.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_z_move.c b/src/battle_z_move.c index cdaf38849..fb8025d2f 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -186,11 +186,11 @@ bool32 IsViableZMove(u8 battlerId, u16 move) u16 zMove = GetSignatureZMove(move, gBattleMons[battlerId].species, item); if (zMove != MOVE_NONE) { - gBattleStruct->zmove.currZMove = MOVE_Z_SIGNATURE; //signature z move exists + gBattleStruct->zmove.currZMove = zMove; //signature z move exists return TRUE; } - if (move != MOVE_NONE && zMove != MOVE_Z_SIGNATURE && gBattleMoves[move].type == ItemId_GetHoldEffectParam(item)) + if (move != MOVE_NONE && zMove != MOVE_Z_SIGNATURE && gBattleMoves[move].type == ItemId_GetSecondaryId(item)) { if (gBattleMoves[move].split == SPLIT_STATUS) gBattleStruct->zmove.currZMove = MOVE_Z_SIGNATURE; From a0bde704931d33b0619d5c906b511a1a11e10f74 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 30 Nov 2020 10:55:46 -0500 Subject: [PATCH 007/208] z move effects --- data/battle_scripts_1.s | 104 ++++- data/maps/InsideOfTruck/scripts.inc | 5 +- include/battle.h | 7 +- include/battle_scripts.h | 8 +- include/battle_z_move.h | 1 + include/constants/battle_move_effects.h | 2 + include/constants/battle_string_ids.h | 18 +- src/battle_controller_player.c | 6 + src/battle_message.c | 31 +- src/battle_script_commands.c | 52 ++- src/battle_util.c | 24 +- src/battle_z_move.c | 159 ++++++- src/data/battle_moves.h | 18 +- src/data/items.h | 538 +++++++++++++++++++++++- src/data/pokemon/level_up_learnsets.h | 2 +- 15 files changed, 932 insertions(+), 43 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 14ef9e5c3..7301e53ae 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -365,6 +365,8 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectFairyLock .4byte BattleScript_EffectAllySwitch .4byte BattleScript_EffectSleepHit + .4byte BattleScript_EffectExtremeEvoboost + .4byte BattleScript_EffectTerrainHit BattleScript_EffectSleepHit: setmoveeffect MOVE_EFFECT_SLEEP @@ -7687,9 +7689,109 @@ BattleScript_PrintPlayerForfeitedLinkBattle:: waitmessage 0x40 end2 -BattleScript_ZMoveActivate:: +@ z moves / effects +BattleScript_ZMoveActivateDamaging:: printstring STRINGID_ZPOWERSURROUNDS playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL printstring STRINGID_ZMOVEUNLEASHED waitmessage 0x40 return + +BattleScript_ZMoveActivateStatus:: + printstring STRINGID_ZPOWERSURROUNDS + playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL + setzeffect + printstring STRINGID_ZMOVEUNLEASHED + waitmessage 0x40 + return + +BattleScript_ZEffectPrintString:: + printfromtable gZEffectStringIds + waitmessage 0x40 + return + +BattleScript_RecoverHPZMove:: + healthbarupdate BS_SCRIPTING + datahpupdate BS_SCRIPTING + printfromtable gZEffectStringIds + waitmessage 0x40 + return + +BattleScript_StatUpZMove:: + statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StatUpZMoveEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x3, BattleScript_StatUpZMoveEnd + playanimation BS_SCRIPTING, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gZEffectStringIds + waitmessage 0x40 +BattleScript_StatUpZMoveEnd: + return + +BattleScript_EffectExtremeEvoboost:: + attackcanceler + attackstring + ppreduce + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_DEF, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPEED, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPATK, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPDEF, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim + goto BattleScript_ButItFailed +BattleScript_ExtremeEvoboostAnim: + attackanimation + waitanimation +BattleScript_ExtremeEvoboostAtk:: + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPEED | BIT_SPATK | BIT_SPDEF, 0x0 + setstatchanger STAT_ATK, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostDef + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_ExtremeEvoboostDef:: + setstatchanger STAT_DEF, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostSpeed + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_ExtremeEvoboostSpeed:: + setstatchanger STAT_SPEED, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostSpAtk + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_ExtremeEvoboostSpAtk:: + setstatchanger STAT_SPATK, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostSpDef + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_ExtremeEvoboostSpDef:: + setstatchanger STAT_SPDEF, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostEnd + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_ExtremeEvoboostEnd:: + goto BattleScript_MoveEnd + +BattleScript_EffectTerrainHit: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage 0x40 + resultmessage + waitmessage 0x40 + setterrain BattleScript_TryFaint +@@@ TODO - 'restore' bg @@@ + printfromtable gTerrainStringIds +BattleScript_TryFaint: + tryfaintmon BS_TARGET, FALSE, NULL + goto BattleScript_MoveEnd + diff --git a/data/maps/InsideOfTruck/scripts.inc b/data/maps/InsideOfTruck/scripts.inc index b70e9a791..82a014132 100644 --- a/data/maps/InsideOfTruck/scripts.inc +++ b/data/maps/InsideOfTruck/scripts.inc @@ -50,8 +50,9 @@ InsideOfTruck_EventScript_SetIntroFlagsFemale:: @ 823BF46 end InsideOfTruck_EventScript_MovingBox:: @ 823BF6C - givemon SPECIES_SNEASEL, 70, ITEM_DARKINIUM_Z - setwildbattle SPECIES_WALREIN, 53, 0 + givemon SPECIES_MEW, 55, ITEM_MEWNIUM_Z + givemon SPECIES_CHARIZARD, 50, ITEM_FIRIUM_Z + setwildbattle SPECIES_AGGRON, 40, 0 dowildbattle @msgbox InsideOfTruck_Text_BoxPrintedWithMonLogo, MSGBOX_SIGN end diff --git a/include/battle.h b/include/battle.h index 27a795f5b..274577622 100644 --- a/include/battle.h +++ b/include/battle.h @@ -433,11 +433,16 @@ struct ZMoveData u8 viewing:1; //if player is viewing the z move name instead of regular moves u8 split:2; u8 active:1; //is z move being used this turn - u8 zUnused:4; + u8 zStatusActive:1; + u8 healReplacement:1; //TODO: z-parting shot + u8 zUnused:2; /*0x02*/ u16 currZMove; //z move of cursor / selected z move /*0x04*/ u16 baseMove; //move turned into z move /*0x06*/ u8 triggerSpriteId; + u8 effect; u8 used[MAX_BATTLERS_COUNT]; //one per bank for multi-battles + u16 toBeUsed[MAX_BATTLERS_COUNT]; //TODO z moves per battler to be used + u8 splits[MAX_BATTLERS_COUNT]; }; /* size = 8 */ struct BattleStruct diff --git a/include/battle_scripts.h b/include/battle_scripts.h index db8452ad0..830fa9453 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -349,6 +349,12 @@ extern const u8 BattleScript_EmergencyExitNoPopUp[]; extern const u8 BattleScript_EmergencyExitWild[]; extern const u8 BattleScript_EmergencyExitWildNoPopUp[]; extern const u8 BattleScript_CheekPouchActivates[]; -extern const u8 BattleScript_ZMoveActivate[]; +// zmoves +extern const u8 BattleScript_ZMoveActivateDamaging[]; +extern const u8 BattleScript_ZMoveActivateStatus[]; +extern const u8 BattleScript_ZEffectPrintString[]; +extern const u8 BattleScript_RecoverHPZMove[]; +extern const u8 BattleScript_StatUpZMove[]; +extern const u8 BattleScript_EffectExtremeEvoboost[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/battle_z_move.h b/include/battle_z_move.h index c87721f52..a6c3921e5 100644 --- a/include/battle_z_move.h +++ b/include/battle_z_move.h @@ -19,5 +19,6 @@ bool32 IsZMoveTriggerSpriteActive(void); void DestroyZMoveTriggerSprite(void); bool32 MoveSelectionDisplayZMove(u16 zmove); const u8* GetZMoveName(u16 move); +void SetZEffect(void); #endif // GUARD_BATTLE_Z_MOVE_H \ No newline at end of file diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index b018429de..f4ce80d60 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -351,5 +351,7 @@ #define EFFECT_FAIRY_LOCK 345 #define EFFECT_ALLY_SWITCH 346 #define EFFECT_SLEEP_HIT 347 // Relic Song +#define EFFECT_EXTREME_EVOBOOST 348 +#define EFFECT_DAMAGE_SET_TERRAIN 349 //genesis supernova #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 12b193f2d..7286b86e7 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -553,7 +553,23 @@ #define STRINGID_FERVENTWISHREACHED 549 #define STRINGID_ZPOWERSURROUNDS 550 #define STRINGID_ZMOVEUNLEASHED 551 +#define STRINGID_ZMOVERESETSSTATS 552 +#define STRINGID_ZMOVEALLSTATSUP 553 +#define STRINGID_ZMOVEZBOOSTCRIT 554 +#define STRINGID_ZMOVERESTOREHP 555 +#define STRINGID_ZMOVESTATUP 556 +#define STRINGID_ZMOVEHPTRAP 557 +#define STRINGID_TERRAINREMOVED 558 -#define BATTLESTRINGS_COUNT 552 +#define BATTLESTRINGS_COUNT 558 + +// z effects +#define MULTISTRING_Z_RESET_STATS 0 +#define MULTISTRING_Z_ALL_STATS_UP 1 +#define MULTISTRING_Z_BOOST_CRITS 2 +#define MULTISTRING_Z_FOLLOW_ME 3 +#define MULTISTRING_Z_RECOVER_HP 4 +#define MULTISTRING_Z_STAT_UP 5 +#define MULTISTRING_Z_HP_TRAP 6 #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index b9b233734..dd7511b20 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -564,6 +564,12 @@ static void HandleInputChooseMove(void) if (gBattleStruct->zmove.viewing) { + u16 chosenMove = moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]; + + //gBattleStruct->zmove.toBeUsed[gActiveBattler] = gBattleStruct->zmove.currZMove; + + gBattleStruct->zmove.baseMove = chosenMove; + gBattleStruct->zmove.split = GetBattleMoveSplit(chosenMove); gBattleStruct->zmove.active = TRUE; gBattleStruct->zmove.viewing = FALSE; if (gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].split != SPLIT_STATUS) diff --git a/src/battle_message.c b/src/battle_message.c index f15070959..c634e1646 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -680,9 +680,24 @@ static const u8 sText_CloakedInAFreezingLight[] = _("{B_ATK_NAME_WITH_PREFIX} be static const u8 sText_StatWasNotLowered[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\nwas not lowered!"); static const u8 sText_ZPowerSurrounds[] = _("{B_ATK_NAME_WITH_PREFIX} surrounds\nitself with its Z-Power!"); static const u8 sText_ZPowerUnleashed[] = _("{B_ATK_NAME_WITH_PREFIX} unleashes\nits full-force Z-Move!"); +static const u8 sText_ZMoveResetsStats[] = _(""); +static const u8 sText_ZMoveAllStatsUp[] = _(""); +static const u8 sText_ZMoveBoostCrit[] = _(""); +static const u8 sText_ZMoveRestoreHp[] = _(""); +static const u8 sText_ZMoveStatUp[] = _(""); +static const u8 sText_ZMoveHpSwitchInTrap[] = _(""); +static const u8 sText_TerrainReturnedToNormal[] = _("The terrain returned to\nnormal!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_ZPOWERSURROUNDS - 12] = sText_ZPowerSurrounds, + [STRINGID_ZMOVEUNLEASHED - 12] = sText_ZPowerUnleashed, + [STRINGID_ZMOVERESETSSTATS - 12] = sText_ZMoveResetsStats, + [STRINGID_ZMOVEALLSTATSUP - 12] = sText_ZMoveAllStatsUp, + [STRINGID_ZMOVEZBOOSTCRIT - 12] = sText_ZMoveBoostCrit, + [STRINGID_ZMOVERESTOREHP - 12] = sText_ZMoveRestoreHp, + [STRINGID_ZMOVESTATUP - 12] = sText_ZMoveStatUp, + [STRINGID_ZMOVEHPTRAP - 12] = sText_ZMoveHpSwitchInTrap, [STRINGID_STATWASNOTLOWERED - 12] = sText_StatWasNotLowered, [STRINGID_CLOAKEDINAFREEZINGLIGHT - 12] = sText_CloakedInAFreezingLight, [STRINGID_DESTINYKNOTACTIVATES - 12] = sText_DestinyKnotActivates, @@ -1221,13 +1236,23 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_GRASSYTERRAINHEALS - 12] = sText_GrassyTerrainHeals, [STRINGID_ELECTRICTERRAINPREVENTS - 12] = sText_ElectricTerrainPreventsSleep, [STRINGID_PSYCHICTERRAINPREVENTS - 12] = sText_PsychicTerrainPreventsPriority, - [STRINGID_ZPOWERSURROUNDS - 12] = sText_ZPowerSurrounds, - [STRINGID_ZMOVEUNLEASHED - 12] = sText_ZPowerUnleashed, + [STRINGID_TERRAINREMOVED - 12] = sText_TerrainReturnedToNormal, +}; + +const u16 gZEffectStringIds[] = +{ + [MULTISTRING_Z_RESET_STATS] = STRINGID_ZMOVERESETSSTATS, + [MULTISTRING_Z_ALL_STATS_UP]= STRINGID_ZMOVEALLSTATSUP, + [MULTISTRING_Z_BOOST_CRITS] = STRINGID_ZMOVEZBOOSTCRIT, + [MULTISTRING_Z_FOLLOW_ME] = STRINGID_PKMNCENTERATTENTION, + [MULTISTRING_Z_RECOVER_HP] = STRINGID_ZMOVERESTOREHP, + [MULTISTRING_Z_STAT_UP] = STRINGID_ZMOVESTATUP, + [MULTISTRING_Z_HP_TRAP] = STRINGID_ZMOVEHPTRAP, }; const u16 gTerrainStringIds[] = { - STRINGID_TERRAINBECOMESMISTY, STRINGID_TERRAINBECOMESGRASSY, STRINGID_TERRAINBECOMESELECTRIC, STRINGID_TERRAINBECOMESPSYCHIC + STRINGID_TERRAINBECOMESMISTY, STRINGID_TERRAINBECOMESGRASSY, STRINGID_TERRAINBECOMESELECTRIC, STRINGID_TERRAINBECOMESPSYCHIC, STRINGID_TERRAINREMOVED, }; const u16 gTerrainPreventsStringIds[] = diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 86947e09f..fc4ad5c90 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6,6 +6,7 @@ #include "battle_anim.h" #include "battle_ai_script_commands.h" #include "battle_scripts.h" +#include "battle_z_move.h" #include "constants/moves.h" #include "constants/abilities.h" #include "item.h" @@ -1469,6 +1470,12 @@ static bool32 AccuracyCalcHelper(u16 move) RecordAbilityBattle(gBattlerTarget, ABILITY_NO_GUARD); return TRUE; } + + if (gBattleStruct->zmove.active && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)) + { + JumpIfMoveFailed(7, move); + return TRUE; + } if ((gStatuses3[gBattlerTarget] & STATUS3_PHANTOM_FORCE) || (!(gBattleMoves[move].flags & FLAG_HIT_IN_AIR) && gStatuses3[gBattlerTarget] & STATUS3_ON_AIR) @@ -1628,13 +1635,6 @@ static void Cmd_ppreduce(void) if (gBattleControllerExecFlags) return; - if (gBattleStruct->zmove.active) - { - gHitMarker &= ~(HITMARKER_NO_PPDEDUCT); - gBattlescriptCurrInstr++; - return; - } - if (!gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure) { switch (gBattleMoves[gCurrentMove].target) @@ -6929,12 +6929,12 @@ static bool32 HasAttackerFaintedTarget(void) return FALSE; } -static void HandleTerrainMove(u32 moveEffect) +static void HandleTerrainMove(u16 move) { u32 statusFlag = 0; u8 *timer = NULL; - - switch (moveEffect) + + switch (gBattleMoves[move].effect) { case EFFECT_MISTY_TERRAIN: statusFlag = STATUS_FIELD_MISTY_TERRAIN, timer = &gFieldTimers.mistyTerrainTimer; @@ -6952,6 +6952,31 @@ static void HandleTerrainMove(u32 moveEffect) statusFlag = STATUS_FIELD_PSYCHIC_TERRAIN, timer = &gFieldTimers.psychicTerrainTimer; gBattleCommunication[MULTISTRING_CHOOSER] = 3; break; + case EFFECT_DAMAGE_SET_TERRAIN: + switch (gBattleMoves[move].argument) + { + case 0: //genesis supernova + statusFlag = STATUS_FIELD_PSYCHIC_TERRAIN, timer = &gFieldTimers.psychicTerrainTimer; + gBattleCommunication[MULTISTRING_CHOOSER] = 3; + break; + case 1: //splintered stormshards + if (!(gFieldStatuses & (STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN))) + { + //no terrain to remove -> jump to battle script pointer + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + } + else + { + // remove all terrain + gFieldStatuses &= ~(STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN); + gBattleCommunication[MULTISTRING_CHOOSER] = 4; + gBattlescriptCurrInstr += 7; + } + return; + default: + break; + } + break; } if (gFieldStatuses & statusFlag || statusFlag == 0) @@ -7764,7 +7789,7 @@ static void Cmd_various(void) } break; case VARIOUS_SET_TERRAIN: - HandleTerrainMove(gBattleMoves[gCurrentMove].effect); + HandleTerrainMove(gCurrentMove); return; case VARIOUS_TRY_ME_FIRST: if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) @@ -8308,6 +8333,9 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; } return; + case VARIOUS_SET_Z_EFFECT: + SetZEffect(); //handles battle script jumping internally + return; } gBattlescriptCurrInstr += 3; @@ -8817,7 +8845,7 @@ static void Cmd_setdrainedhp(void) gBattlescriptCurrInstr++; } -static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr) +u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr) { bool32 certain = FALSE; bool32 notProtectAffected = FALSE; diff --git a/src/battle_util.c b/src/battle_util.c index 8cb7c624b..26f30d3c0 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3190,11 +3190,21 @@ u8 AtkCanceller_UnableToUseMove(void) if (gBattleStruct->zmove.active == TRUE) { RecordItemEffectBattle(gBattlerAttacker, HOLD_EFFECT_Z_CRYSTAL); - gBattleStruct->zmove.used[gBattlerAttacker] = TRUE; + gBattleStruct->zmove.used[gBattlerAttacker] = TRUE; //TODO - partner battles. gBattleScripting.battler = gBattlerAttacker; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_ZMoveActivate; + + if (IS_MOVE_STATUS(gBattleStruct->zmove.baseMove)) + { + gBattleStruct->zmove.effect = gBattleMoves[gBattleStruct->zmove.baseMove].zMoveEffect; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ZMoveActivateStatus; + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ZMoveActivateDamaging; + } effect = 1; } gBattleStruct->atkCancellerTracker++; @@ -6390,6 +6400,9 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) u32 i; u16 basePower = gBattleMoves[move].power; u32 weight, hpFraction, speed; + + if (gBattleStruct->zmove.active) + return gBattleMoves[gBattleStruct->zmove.baseMove].zMovePower; switch (gBattleMoves[move].effect) { @@ -7794,7 +7807,10 @@ bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId) u8 GetBattleMoveSplit(u32 moveId) { - if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) + //TODO - light that burns the sky, photon geyser + if (gBattleStruct->zmove.active && !IS_MOVE_STATUS(moveId)) + return gBattleStruct->zmove.split; + else if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) return gBattleMoves[moveId].split; else if (gBattleMoves[moveId].type < TYPE_MYSTERY) return SPLIT_PHYSICAL; diff --git a/src/battle_z_move.c b/src/battle_z_move.c index fb8025d2f..36cd326ea 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -6,6 +6,7 @@ #include "battle_interface.h" #include "battle_message.h" #include "battle_z_move.h" +#include "battle_scripts.h" #include "graphics.h" #include "sprite.h" #include "window.h" @@ -35,6 +36,8 @@ #include "constants/items.h" #include "constants/species.h" #include "constants/hold_effects.h" +#include "constants/battle_string_ids.h" +#include "constants/battle_move_effects.h" // Function Declarations static void SpriteCB_ZMoveTrigger(struct Sprite *sprite); @@ -43,6 +46,7 @@ static u16 GetTypeBasedZMove(u16 move, u8 battler); static void ZMoveSelectionDisplayPpNumber(void); static void ZMoveSelectionDisplayPower(u16 move, u16 zMove); static void ShowZMoveTriggerSprite(void); +static bool32 AreMainStatsMaxed(u8 battlerId); // Const Data static const struct SignatureZMove sSignatureZMoves[] = @@ -84,6 +88,7 @@ static const struct SignatureZMove sSignatureZMoves[] = static const u8 sText_ResetStats[] = _("Reset Lowered Stats"); static const u8 sText_StatsPlus[] = _("+ All Stats"); +static const u8 sText_StatsPlus2[] = _("++ All Stats"); static const u8 sText_CritHitsPlus[] = _("+ Critical Hit Chance"); static const u8 sText_FollowMe[] = _("Follow Me"); static const u8 sText_RecoverHP[] = _("Recover HP"); @@ -387,19 +392,21 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) BattlePutTextOnWindow(gDisplayedStringBattle, i + 3); } - if (zmove == MOVE_Z_SIGNATURE) + //if (zmove == MOVE_Z_SIGNATURE) + if (IS_MOVE_STATUS(move)) { u8 zEffect = gBattleMoves[move].zMoveEffect; - + + gDisplayedStringBattle[0] = EOS; + if (zEffect == Z_EFFECT_CURSE) { if (moveInfo->monType1 == TYPE_GHOST || moveInfo->monType2 == TYPE_GHOST || moveInfo->monType3 == TYPE_GHOST) zEffect = Z_EFFECT_RECOVER_HP; else zEffect = Z_EFFECT_ATK_UP_1; - } - - gDisplayedStringBattle[0] = EOS; + } + switch (zEffect) { case Z_EFFECT_RESET_STATS: @@ -469,6 +476,13 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) gDisplayedStringBattle[1] = CHAR_HYPHEN; StringCopy(gDisplayedStringBattle + 2, gMoveNames[move]); } + else if (zmove == MOVE_EXTREME_EVOBOOST) + { + //damaging move -> status z move + StringCopy(gDisplayedStringBattle, sText_StatsPlus2); + BattlePutTextOnWindow(gDisplayedStringBattle, 5); //Slot of Move 3 + StringCopy(gDisplayedStringBattle, GetZMoveName(zmove)); + } else { ZMoveSelectionDisplayPower(move, zmove); @@ -524,3 +538,138 @@ const u8* GetZMoveName(u16 move) return gZMoveNames[0]; //failsafe } +#define Z_EFFECT_BS_LENGTH 3 +// This function kinda cheats by setting a return battle script to after the setzeffect various command +// and then jumping to a z effect script +void SetZEffect(void) +{ + u32 i; + + gBattleStruct->zmove.zStatusActive = TRUE; + if (gBattleStruct->zmove.effect == Z_EFFECT_CURSE) + { + if (IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST)) + gBattleStruct->zmove.effect = Z_EFFECT_RECOVER_HP; + else + gBattleStruct->zmove.effect = Z_EFFECT_ATK_UP_1; + } + + gBattleScripting.battler = gBattlerAttacker; + switch (gBattleStruct->zmove.effect) + { + case Z_EFFECT_RESET_STATS: + for (i = 0; i < NUM_BATTLE_STATS - 1; i++) + { + if (gBattleMons[gBattlerAttacker].statStages[i] < DEFAULT_STAT_STAGE) + gBattleMons[gBattlerAttacker].statStages[i] = DEFAULT_STAT_STAGE; + } + gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_RESET_STATS; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString - Z_EFFECT_BS_LENGTH; + break; + case Z_EFFECT_ALL_STATS_UP_1: + if (!AreMainStatsMaxed(gBattlerAttacker)) + { + for (i = 0; i < STAT_ACC - 1; i++) //Doesn't increase Acc or Evsn + { + if (gBattleMons[gBattlerAttacker].statStages[i] < 12) + ++gBattleMons[gBattlerAttacker].statStages[i]; + } + gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_ALL_STATS_UP; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString - Z_EFFECT_BS_LENGTH; + } + break; + case Z_EFFECT_BOOST_CRITS: + if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY)) + { + gBattleMons[gBattlerAttacker].status2 |= STATUS2_FOCUS_ENERGY; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_BOOST_CRITS; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString - Z_EFFECT_BS_LENGTH; + } + break; + case Z_EFFECT_FOLLOW_ME: + gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTimer = 1; + gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTarget = gBattlerAttacker; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_FOLLOW_ME; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString - Z_EFFECT_BS_LENGTH; + break; + case Z_EFFECT_RECOVER_HP: + if (gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP) + { + gBattleMoveDamage = (-1) * gBattleMons[gBattlerAttacker].maxHP; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_RECOVER_HP; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_RecoverHPZMove - Z_EFFECT_BS_LENGTH; + } + break; + case Z_EFFECT_RESTORE_REPLACEMENT_HP: + gBattleStruct->zmove.healReplacement = TRUE; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_HP_TRAP; + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString - Z_EFFECT_BS_LENGTH; + break; + case Z_EFFECT_ATK_UP_1: + case Z_EFFECT_DEF_UP_1: + case Z_EFFECT_SPD_UP_1: + case Z_EFFECT_SPATK_UP_1: + case Z_EFFECT_SPDEF_UP_1: + case Z_EFFECT_ACC_UP_1: + case Z_EFFECT_EVSN_UP_1: + SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_1 + 1, 1, FALSE); + gBattleScripting.animArg1 = 0xE + (gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_1 + 1); + gBattleScripting.animArg2 = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_STAT_UP; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_StatUpZMove - Z_EFFECT_BS_LENGTH; + break; + case Z_EFFECT_ATK_UP_2: + case Z_EFFECT_DEF_UP_2: + case Z_EFFECT_SPD_UP_2: + case Z_EFFECT_SPATK_UP_2: + case Z_EFFECT_SPDEF_UP_2: + case Z_EFFECT_ACC_UP_2: + case Z_EFFECT_EVSN_UP_2: + SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_2 + 1, 2, FALSE); + gBattleScripting.animArg1 = 0xE + (gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_2 + 1); + gBattleScripting.animArg2 = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_STAT_UP; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_StatUpZMove - Z_EFFECT_BS_LENGTH; + break; + case Z_EFFECT_ATK_UP_3: + case Z_EFFECT_DEF_UP_3: + case Z_EFFECT_SPD_UP_3: + case Z_EFFECT_SPATK_UP_3: + case Z_EFFECT_SPDEF_UP_3: + case Z_EFFECT_ACC_UP_3: + case Z_EFFECT_EVSN_UP_3: + SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_3 + 1, 3, FALSE); + gBattleScripting.animArg1 = 0xE + (gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_3 + 1); + gBattleScripting.animArg2 = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_STAT_UP; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_StatUpZMove - Z_EFFECT_BS_LENGTH; + break; + default: + gBattlescriptCurrInstr += 3; + break; + } + + gBattleStruct->zmove.zStatusActive = FALSE; +} + +#define STAT_STAGE(battler, stat) (gBattleMons[battler].statStages[stat - 1]) +static bool32 AreMainStatsMaxed(u8 battlerId) +{ + u32 i; + for (i = STAT_ATK; i <= STAT_SPDEF; i++) + { + if (STAT_STAGE(battlerId, i) < MAX_STAT_STAGE) + return FALSE; + } + return TRUE; +} + diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 3425ccdb4..0760c6160 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11132,7 +11132,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = }, [MOVE_10000000_VOLT_THUNDERBOLT] = { - .effect = EFFECT_HIT,//TODO: EFFECT_HIGH_CRITICAL, + .effect = EFFECT_HIT, .power = 195, .type = TYPE_ELECTRIC, .accuracy = 0, @@ -11140,14 +11140,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = 0, + .flags = FLAG_HIGH_CRIT, .zMovePower = 0, .split = SPLIT_SPECIAL, .zMoveEffect = 0 }, [MOVE_STOKED_SPARKSURFER] = { - .effect = EFFECT_HIT, //EFFECT_PARALYZE_HIT, + .effect = EFFECT_PARALYZE_HIT, .power = 175, .type = TYPE_ELECTRIC, .accuracy = 0, @@ -11162,7 +11162,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = }, [MOVE_EXTREME_EVOBOOST] = { - .effect = EFFECT_HIT,//TODO: EFFECT_EXTREME_EVOBOOST, + .effect = EFFECT_EXTREME_EVOBOOST, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, @@ -11192,7 +11192,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = }, [MOVE_GENESIS_SUPERNOVA] = { - .effect = EFFECT_HIT,//TODO: EFFECT_DAMAGE_SET_TERRAIN, + .effect = EFFECT_DAMAGE_SET_TERRAIN, .power = 185, .type = TYPE_PSYCHIC, .accuracy = 0, @@ -11203,6 +11203,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .flags = 0, .zMovePower = 0, .split = SPLIT_SPECIAL, + .argument = 0, //psychic terrain .zMoveEffect = 0 }, [MOVE_SINISTER_ARROW_RAID] = @@ -11252,7 +11253,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = }, [MOVE_SPLINTERED_STORMSHARDS] = { - .effect = EFFECT_HIT, //TODO removes terrain + .effect = EFFECT_DAMAGE_SET_TERRAIN, .power = 190, .type = TYPE_ROCK, .accuracy = 0, @@ -11263,6 +11264,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .flags = 0, .zMovePower = 0, .split = SPLIT_PHYSICAL, + .argument = 1, //remove terrain .zMoveEffect = 0 }, [MOVE_LETS_SNUGGLE_FOREVER] = @@ -11282,7 +11284,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = }, [MOVE_CLANGOROUS_SOULBLAZE] = { - .effect = EFFECT_HIT,//TODO: EFFECT_ALL_STATS_UP_HIT, + .effect = EFFECT_ALL_STATS_UP_HIT, .power = 185, .type = TYPE_DRAGON, .accuracy = 0, @@ -11297,7 +11299,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = }, [MOVE_GUARDIAN_OF_ALOLA] = { - .effect = EFFECT_HIT,//TODO: EFFECT_SUPER_FANG, + .effect = EFFECT_SUPER_FANG, .power = 1, .type = TYPE_FAIRY, .accuracy = 0, diff --git a/src/data/items.h b/src/data/items.h index 61157f806..c630d0427 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -4885,18 +4885,548 @@ const struct Item gItems[] = .secondaryId = 0, }, - //TEST + [ITEM_NORMALIUM_Z] = + { + .name = _("Normalium Z"), + .itemId = ITEM_NORMALIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_NORMAL + }, + [ITEM_FIGHTINIUM_Z] = + { + .name = _("Fightinium Z"), + .itemId = ITEM_FIGHTINIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_FIGHTING + }, + [ITEM_FLYINIUM_Z] = + { + .name = _("Flyinium Z"), + .itemId = ITEM_FLYINIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_FLYING + }, + [ITEM_POISONIUM_Z] = + { + .name = _("Poisinium Z"), + .itemId = ITEM_POISONIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_POISON + }, + [ITEM_GROUNDIUM_Z] = + { + .name = _("Groundium Z"), + .itemId = ITEM_GROUNDIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_GROUND + }, + [ITEM_ROCKIUM_Z] = + { + .name = _("Rockium Z"), + .itemId = ITEM_ROCKIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_ROCK + }, + [ITEM_BUGINIUM_Z] = + { + .name = _("Buginium Z"), + .itemId = ITEM_BUGINIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_BUG + }, + [ITEM_GHOSTIUM_Z] = + { + .name = _("Ghostium Z"), + .itemId = ITEM_GHOSTIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_GHOST + }, + [ITEM_STEELIUM_Z] = + { + .name = _("Steelium Z"), + .itemId = ITEM_STEELIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_STEEL + }, + [ITEM_FIRIUM_Z] = + { + .name = _("Firium Z"), + .itemId = ITEM_FIRIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_FIRE + }, + [ITEM_WATERIUM_Z] = + { + .name = _("Waterium Z"), + .itemId = ITEM_WATERIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_WATER + }, + [ITEM_GRASSIUM_Z] = + { + .name = _("Grassium Z"), + .itemId = ITEM_GRASSIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_GRASS + }, + [ITEM_ELECTRIUM_Z] = + { + .name = _("Electrium Z"), + .itemId = ITEM_ELECTRIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_ELECTRIC + }, + [ITEM_PSYCHIUM_Z] = + { + .name = _("Psychium Z"), + .itemId = ITEM_PSYCHIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_PSYCHIC + }, + [ITEM_ICIUM_Z] = + { + .name = _("Icium Z"), + .itemId = ITEM_ICIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_ICE + }, + [ITEM_DRAGONIUM_Z] = + { + .name = _("Dragonium Z"), + .itemId = ITEM_DRAGONIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_DRAGON + }, [ITEM_DARKINIUM_Z] = { .name = _("Darkinium Z"), .itemId = ITEM_DARKINIUM_Z, .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, .description = sDummyDesc, - .importance = 1, - .pocket = POCKET_KEY_ITEMS, - .holdEffectParam = TYPE_DARK, + .importance = 0, + .pocket = POCKET_ITEMS, .type = 4, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_DARK + }, + [ITEM_FAIRIUM_Z] = + { + .name = _("Fairium Z"), + .itemId = ITEM_FAIRIUM_Z, + .price = 0, .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = TYPE_FAIRY + }, + [ITEM_ALORAICHIUM_Z] = + { + .name = _("Aloraichium Z"), + .itemId = ITEM_ALORAICHIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_DECIDIUM_Z] = + { + .name = _("Decidium Z"), + .itemId = ITEM_DECIDIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_EEVIUM_Z] = + { + .name = _("Eevium Z"), + .itemId = ITEM_EEVIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_INCINIUM_Z] = + { + .name = _("Incinium Z"), + .itemId = ITEM_INCINIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_KOMMONIUM_Z] = + { + .name = _("Kommonium Z"), + .itemId = ITEM_KOMMONIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_LUNALIUM_Z] = + { + .name = _("Lunalium Z"), + .itemId = ITEM_LUNALIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_LYCANIUM_Z] = + { + .name = _("Lycanium Z"), + .itemId = ITEM_LYCANIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_MARSHADIUM_Z] = + { + .name = _("Marshadium Z"), + .itemId = ITEM_MARSHADIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_MEWNIUM_Z] = + { + .name = _("Mewnium Z"), + .itemId = ITEM_MEWNIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_MIMIKIUM_Z] = + { + .name = _("Mimikium Z"), + .itemId = ITEM_MIMIKIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_PIKANIUM_Z] = + { + .name = _("Pikanium Z"), + .itemId = ITEM_PIKANIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_PIKASHUNIUM_Z] = + { + .name = _("Pikashunium Z"), + .itemId = ITEM_PIKASHUNIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_PRIMARIUM_Z] = + { + .name = _("Primarium Z"), + .itemId = ITEM_PRIMARIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_SNORLIUM_Z] = + { + .name = _("Snorlium Z"), + .itemId = ITEM_SNORLIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_SOLGANIUM_Z] = + { + .name = _("Solganium Z"), + .itemId = ITEM_SOLGANIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 // signature z move + }, + [ITEM_TAPUNIUM_Z] = + { + .name = _("Tapunium Z"), + .itemId = ITEM_TAPUNIUM_Z, + .price = 0, + .holdEffect = HOLD_EFFECT_Z_CRYSTAL, + .holdEffectParam = 0, + .description = sDummyDesc, + .importance = 0, + .pocket = POCKET_ITEMS, + .type = 4, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .battleUsage = 0, + .battleUseFunc = NULL, + .secondaryId = 255 //signature z move }, }; diff --git a/src/data/pokemon/level_up_learnsets.h b/src/data/pokemon/level_up_learnsets.h index 46c685572..69742ac25 100644 --- a/src/data/pokemon/level_up_learnsets.h +++ b/src/data/pokemon/level_up_learnsets.h @@ -440,7 +440,7 @@ static const struct LevelUpMove sPikachuLevelUpLearnset[] = { LEVEL_UP_MOVE( 5, MOVE_GROWL), LEVEL_UP_MOVE( 7, MOVE_PLAY_NICE), LEVEL_UP_MOVE(10, MOVE_QUICK_ATTACK), - LEVEL_UP_MOVE(13, MOVE_ELECTRO_BALL), + LEVEL_UP_MOVE(13, MOVE_VOLT_TACKLE), LEVEL_UP_MOVE(18, MOVE_THUNDER_WAVE), LEVEL_UP_MOVE(21, MOVE_FEINT), LEVEL_UP_MOVE(23, MOVE_DOUBLE_TEAM), From fd8951d040f09e1831b2b87e221be7f0c48d3695 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 1 Dec 2020 08:24:33 -0500 Subject: [PATCH 008/208] trainer z move ai --- data/maps/InsideOfTruck/scripts.inc | 11 +- include/battle.h | 4 +- include/battle_ai_script_commands.h | 1 + include/battle_z_move.h | 4 + include/constants/battle_config.h | 3 + include/constants/moves.h | 2 - src/battle_ai_script_commands.c | 2 +- src/battle_controller_opponent.c | 37 ++- src/battle_controller_player.c | 6 +- src/battle_script_commands.c | 3 + src/battle_util.c | 20 +- src/battle_z_move.c | 320 +++++++++++++++++++++++--- src/data/pokemon/level_up_learnsets.h | 2 + src/data/trainer_parties.h | 8 +- src/data/trainers.h | 4 +- 15 files changed, 364 insertions(+), 63 deletions(-) diff --git a/data/maps/InsideOfTruck/scripts.inc b/data/maps/InsideOfTruck/scripts.inc index 82a014132..8214611f7 100644 --- a/data/maps/InsideOfTruck/scripts.inc +++ b/data/maps/InsideOfTruck/scripts.inc @@ -50,12 +50,17 @@ InsideOfTruck_EventScript_SetIntroFlagsFemale:: @ 823BF46 end InsideOfTruck_EventScript_MovingBox:: @ 823BF6C - givemon SPECIES_MEW, 55, ITEM_MEWNIUM_Z + givemon SPECIES_STARMIE, 55, ITEM_WATERIUM_Z givemon SPECIES_CHARIZARD, 50, ITEM_FIRIUM_Z - setwildbattle SPECIES_AGGRON, 40, 0 - dowildbattle + + trainerbattle_no_intro TRAINER_VIOLET, sText_test + + @setwildbattle SPECIES_AGGRON, 40, 0 + @dowildbattle @msgbox InsideOfTruck_Text_BoxPrintedWithMonLogo, MSGBOX_SIGN end +sText_test: + .string "hi$" InsideOfTruck_Text_BoxPrintedWithMonLogo: @ 823BF75 .string "The box is printed with a POKéMON logo.\p" diff --git a/include/battle.h b/include/battle.h index 274577622..9844eb2d6 100644 --- a/include/battle.h +++ b/include/battle.h @@ -436,12 +436,12 @@ struct ZMoveData u8 zStatusActive:1; u8 healReplacement:1; //TODO: z-parting shot u8 zUnused:2; - /*0x02*/ u16 currZMove; //z move of cursor / selected z move - /*0x04*/ u16 baseMove; //move turned into z move + /*0x02*/ u16 currZMove; //z move of move cursor is on /*0x06*/ u8 triggerSpriteId; u8 effect; u8 used[MAX_BATTLERS_COUNT]; //one per bank for multi-battles u16 toBeUsed[MAX_BATTLERS_COUNT]; //TODO z moves per battler to be used + u16 baseMoves[MAX_BATTLERS_COUNT]; u8 splits[MAX_BATTLERS_COUNT]; }; /* size = 8 */ diff --git a/include/battle_ai_script_commands.h b/include/battle_ai_script_commands.h index bd990d77a..f8c27bd87 100644 --- a/include/battle_ai_script_commands.h +++ b/include/battle_ai_script_commands.h @@ -23,5 +23,6 @@ void RecordAbilityBattle(u8 battlerId, u8 abilityId); void ClearBattlerAbilityHistory(u8 battlerId); void RecordItemEffectBattle(u8 battlerId, u8 itemEffect); void ClearBattlerItemEffectHistory(u8 battlerId); +bool32 HasMoveWithSplit(u32 battler, u32 split); #endif // GUARD_BATTLE_AI_SCRIPT_COMMANDS_H diff --git a/include/battle_z_move.h b/include/battle_z_move.h index a6c3921e5..70347439a 100644 --- a/include/battle_z_move.h +++ b/include/battle_z_move.h @@ -3,6 +3,8 @@ #include "constants/z_move_effects.h" +#define MOVE_Z_STATUS 0xFFFF + struct SignatureZMove { u16 species; @@ -11,6 +13,7 @@ struct SignatureZMove u16 zmove; }; +void QueueZMove(u8 battlerId, u16 baseMove); bool32 IsViableZMove(u8 battlerId, u16 move); bool32 TryChangeZIndicator(u8 battlerId, u16 move); void CreateZMoveTriggerSprite(u8, bool8); @@ -20,5 +23,6 @@ void DestroyZMoveTriggerSprite(void); bool32 MoveSelectionDisplayZMove(u16 zmove); const u8* GetZMoveName(u16 move); void SetZEffect(void); +bool32 ShouldAIUseZMove(u8 activeId, u8 targetId, u16 *baseMove, u8 *chosenMoveId); #endif // GUARD_BATTLE_Z_MOVE_H \ No newline at end of file diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index a5c14023f..0f3047199 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -145,6 +145,9 @@ #define B_INCINERATE_GEMS GEN_6 // In Gen6+, Incinerate can destroy Gems. #define B_MINIMIZE_DMG_ACC GEN_6 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks. +// AI Settings +#define B_AI_PREFER_STATUS_Z_MOVES FALSE // If TRUE, the AI will prefer z-status moves over damaging z moves + // Ability settings #define B_ABILITY_WEATHER GEN_6 // In Gen5+, weather caused by abilities lasts the same amount of turns as induced from a move. Before, they lasted till the battle's end or weather change by a move. #define B_GALE_WINGS GEN_6 // In Gen7+ requires full HP to trigger. diff --git a/include/constants/moves.h b/include/constants/moves.h index 4f00b4d43..f655b8374 100644 --- a/include/constants/moves.h +++ b/include/constants/moves.h @@ -819,6 +819,4 @@ #define MOVES_COUNT MOVES_COUNT_GEN8 #define MOVES_COUNT_Z (MOVE_SOUL_STEALING_7_STAR_STRIKE + 1) -#define MOVE_Z_SIGNATURE 0xFFFF //signature z move - #endif // GUARD_CONSTANTS_MOVES_H diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index 39246c732..9c39c935c 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -2600,7 +2600,7 @@ static u16 *GetMovesArray(u32 battler) return gBattleResources->battleHistory->usedMoves[battler]; } -static bool32 HasMoveWithSplit(u32 battler, u32 split) +bool32 HasMoveWithSplit(u32 battler, u32 split) { s32 i; u16 *moves = GetMovesArray(battler); diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 78765a386..36f05b6a8 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -9,6 +9,7 @@ #include "battle_setup.h" #include "battle_tower.h" #include "battle_tv.h" +#include "battle_z_move.h" #include "bg.h" #include "data.h" #include "frontier_util.h" @@ -1573,18 +1574,34 @@ static void OpponentHandleChooseMove(void) BtlController_EmitTwoReturnValues(1, 15, gBattlerTarget); break; default: - if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) - gBattlerTarget = gActiveBattler; - if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH) { - gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); - if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) - gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); + u16 chosenMove = moveInfo->moves[chosenMoveId]; + + if (ShouldAIUseZMove(gActiveBattler, gBattlerTarget, moveInfo->moves, &chosenMoveId)) + { + QueueZMove(gActiveBattler, moveInfo->moves[chosenMoveId]); + chosenMove = moveInfo->moves[chosenMoveId]; + gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); + if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) + gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); + } + else + { + if (gBattleMoves[chosenMove].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + gBattlerTarget = gActiveBattler; + if (gBattleMoves[chosenMove].target & MOVE_TARGET_BOTH) + { + gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); + if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) + gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); + } + } + + if (CanMegaEvolve(gActiveBattler)) // If opponent can mega evolve, do it. + BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (RET_MEGA_EVOLUTION) | (gBattlerTarget << 8)); + else + BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (gBattlerTarget << 8)); } - if (CanMegaEvolve(gActiveBattler)) // If opponent can mega evolve, do it. - BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (RET_MEGA_EVOLUTION) | (gBattlerTarget << 8)); - else - BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (gBattlerTarget << 8)); break; } OpponentBufferExecCompleted(); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index dd7511b20..034c45eb6 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -566,11 +566,7 @@ static void HandleInputChooseMove(void) { u16 chosenMove = moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]; - //gBattleStruct->zmove.toBeUsed[gActiveBattler] = gBattleStruct->zmove.currZMove; - - gBattleStruct->zmove.baseMove = chosenMove; - gBattleStruct->zmove.split = GetBattleMoveSplit(chosenMove); - gBattleStruct->zmove.active = TRUE; + QueueZMove(gActiveBattler, chosenMove); gBattleStruct->zmove.viewing = FALSE; if (gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].split != SPLIT_STATUS) moveTarget = MOVE_TARGET_SELECTED; //damaging z moves always have selected target diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index fc4ad5c90..a40cad90b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5099,7 +5099,10 @@ static void Cmd_moveend(void) gSpecialStatuses[gBattlerAttacker].damagedMons = 0; gSpecialStatuses[gBattlerTarget].berryReduced = 0; gBattleScripting.moveEffect = 0; + // clear attacker z move data gBattleStruct->zmove.active = FALSE; + gBattleStruct->zmove.toBeUsed[gBattlerAttacker] = MOVE_NONE; + gBattleStruct->zmove.effect = EFFECT_HIT; gBattleScripting.moveendState++; break; case MOVEEND_COUNT: diff --git a/src/battle_util.c b/src/battle_util.c index 26f30d3c0..3f856e23b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -124,9 +124,9 @@ void HandleAction_UseMove(void) } // check z move used - if (gBattleStruct->zmove.active) + if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker]) { - gCurrentMove = gBattleStruct->zmove.currZMove; + gCurrentMove = gBattleStruct->zmove.toBeUsed[gBattlerAttacker]; } if (gBattleMons[gBattlerAttacker].hp != 0) @@ -3187,16 +3187,17 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->atkCancellerTracker++; break; case CANCELLER_Z_MOVES: - if (gBattleStruct->zmove.active == TRUE) + if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker] != MOVE_NONE) { + //attacker has a queued z move + gBattleStruct->zmove.active = TRUE; RecordItemEffectBattle(gBattlerAttacker, HOLD_EFFECT_Z_CRYSTAL); gBattleStruct->zmove.used[gBattlerAttacker] = TRUE; - //TODO - partner battles. + //TODO - partner battles gBattleScripting.battler = gBattlerAttacker; - - if (IS_MOVE_STATUS(gBattleStruct->zmove.baseMove)) + if (IS_MOVE_STATUS(gBattleStruct->zmove.splits[gBattlerAttacker])) { - gBattleStruct->zmove.effect = gBattleMoves[gBattleStruct->zmove.baseMove].zMoveEffect; + gBattleStruct->zmove.effect = gBattleMoves[gBattleStruct->zmove.baseMoves[gBattlerAttacker]].zMoveEffect; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_ZMoveActivateStatus; } @@ -6402,7 +6403,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) u32 weight, hpFraction, speed; if (gBattleStruct->zmove.active) - return gBattleMoves[gBattleStruct->zmove.baseMove].zMovePower; + return gBattleMoves[gBattleStruct->zmove.baseMoves[battlerAtk]].zMovePower; switch (gBattleMoves[move].effect) { @@ -7589,6 +7590,9 @@ bool32 CanMegaEvolve(u8 battlerId) // Check if trainer already mega evolved a pokemon. if (mega->alreadyEvolved[battlerPosition]) return FALSE; + if (gBattleStruct->zmove.toBeUsed[battlerId]) + return FALSE; //cannot use z move and mega evolve on same turn + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { if (IsPartnerMonFromSameTrainer(battlerId) diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 36cd326ea..e8dc7210b 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -2,6 +2,7 @@ #include "malloc.h" #include "battle.h" #include "pokemon.h" +#include "battle_ai_script_commands.h" #include "battle_controllers.h" #include "battle_interface.h" #include "battle_message.h" @@ -38,6 +39,10 @@ #include "constants/hold_effects.h" #include "constants/battle_string_ids.h" #include "constants/battle_move_effects.h" +#include "constants/abilities.h" +#include "constants/moves.h" + +#define STAT_STAGE(battler, stat) (gBattleMons[battler].statStages[stat - 1]) // Function Declarations static void SpriteCB_ZMoveTrigger(struct Sprite *sprite); @@ -46,7 +51,8 @@ static u16 GetTypeBasedZMove(u16 move, u8 battler); static void ZMoveSelectionDisplayPpNumber(void); static void ZMoveSelectionDisplayPower(u16 move, u16 zMove); static void ShowZMoveTriggerSprite(void); -static bool32 AreMainStatsMaxed(u8 battlerId); +static bool32 AreStatsMaxed(u8 battlerId, u8 n); +static u8 GetZMoveScore(u8 battlerAtk, u8 battlerDef, u16 baseMove, u16 zMove); // Const Data static const struct SignatureZMove sSignatureZMoves[] = @@ -132,6 +138,13 @@ bool8 IsZMove(u16 move) return move >= FIRST_Z_MOVE && move <= LAST_Z_MOVE; } +void QueueZMove(u8 battlerId, u16 baseMove) +{ + gBattleStruct->zmove.toBeUsed[battlerId] = gBattleStruct->zmove.currZMove; + gBattleStruct->zmove.baseMoves[battlerId] = baseMove; + gBattleStruct->zmove.splits[battlerId] = GetBattleMoveSplit(baseMove); +} + bool32 IsViableZMove(u8 battlerId, u16 move) { struct Pokemon *mon; @@ -169,8 +182,7 @@ bool32 IsViableZMove(u8 battlerId, u16 move) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { - if (IsPartnerMonFromSameTrainer(battlerId) - && (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)]))) + if (IsPartnerMonFromSameTrainer(battlerId) && (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)]))) return FALSE; //partner has mega evolved or is about to mega evolve } @@ -187,7 +199,6 @@ bool32 IsViableZMove(u8 battlerId, u16 move) if (holdEffect == HOLD_EFFECT_Z_CRYSTAL) #endif { - //TODO: status z moves u16 zMove = GetSignatureZMove(move, gBattleMons[battlerId].species, item); if (zMove != MOVE_NONE) { @@ -195,10 +206,10 @@ bool32 IsViableZMove(u8 battlerId, u16 move) return TRUE; } - if (move != MOVE_NONE && zMove != MOVE_Z_SIGNATURE && gBattleMoves[move].type == ItemId_GetSecondaryId(item)) + if (move != MOVE_NONE && zMove != MOVE_Z_STATUS && gBattleMoves[move].type == ItemId_GetSecondaryId(item)) { - if (gBattleMoves[move].split == SPLIT_STATUS) - gBattleStruct->zmove.currZMove = MOVE_Z_SIGNATURE; + if (IS_MOVE_STATUS(gBattleMoves[move].split)) + gBattleStruct->zmove.currZMove = MOVE_Z_STATUS; else gBattleStruct->zmove.currZMove = GetTypeBasedZMove(move, battlerId); @@ -392,7 +403,7 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) BattlePutTextOnWindow(gDisplayedStringBattle, i + 3); } - //if (zmove == MOVE_Z_SIGNATURE) + //if (zmove == MOVE_Z_STATUS) if (IS_MOVE_STATUS(move)) { u8 zEffect = gBattleMoves[move].zMoveEffect; @@ -500,18 +511,18 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) static void ZMoveSelectionDisplayPower(u16 move, u16 zMove) { - u8 *txtPtr; - u16 power = gBattleMoves[move].zMovePower; + u8 *txtPtr; + u16 power = gBattleMoves[move].zMovePower; - if (zMove >= MOVE_CATASTROPIKA) - power = gBattleMoves[zMove].power; + if (zMove >= MOVE_CATASTROPIKA) + power = gBattleMoves[zMove].power; - if (gBattleMoves[move].split != SPLIT_STATUS) - { - txtPtr = StringCopy(gDisplayedStringBattle, sText_PowerColon); - ConvertIntToDecimalStringN(txtPtr, power, STR_CONV_MODE_LEFT_ALIGN, 3); - BattlePutTextOnWindow(gDisplayedStringBattle, 5); //bottom left - } + if (gBattleMoves[move].split != SPLIT_STATUS) + { + txtPtr = StringCopy(gDisplayedStringBattle, sText_PowerColon); + ConvertIntToDecimalStringN(txtPtr, power, STR_CONV_MODE_LEFT_ALIGN, 3); + BattlePutTextOnWindow(gDisplayedStringBattle, 5); //bottom left + } } static void ZMoveSelectionDisplayPpNumber(void) @@ -568,7 +579,7 @@ void SetZEffect(void) gBattlescriptCurrInstr = BattleScript_ZEffectPrintString - Z_EFFECT_BS_LENGTH; break; case Z_EFFECT_ALL_STATS_UP_1: - if (!AreMainStatsMaxed(gBattlerAttacker)) + if (!AreStatsMaxed(gBattlerAttacker, STAT_SPDEF)) { for (i = 0; i < STAT_ACC - 1; i++) //Doesn't increase Acc or Evsn { @@ -661,15 +672,270 @@ void SetZEffect(void) gBattleStruct->zmove.zStatusActive = FALSE; } -#define STAT_STAGE(battler, stat) (gBattleMons[battler].statStages[stat - 1]) -static bool32 AreMainStatsMaxed(u8 battlerId) +static bool32 AreStatsMaxed(u8 battlerId, u8 n) { u32 i; - for (i = STAT_ATK; i <= STAT_SPDEF; i++) - { - if (STAT_STAGE(battlerId, i) < MAX_STAT_STAGE) - return FALSE; - } - return TRUE; + for (i = STAT_ATK; i <= n; i++) + { + if (STAT_STAGE(battlerId, i) < MAX_STAT_STAGE) + return FALSE; + } + return TRUE; +} + +#define STAT_CAN_RISE(bank, stat) ((gBattleMons[bank].statStages[stat-1] < 12 && GetBattlerAbility(bank) != ABILITY_CONTRARY) || (GetBattlerAbility(bank) == ABILITY_CONTRARY && gBattleMons[bank].statStages[stat-1] > 0)) +#define STAT_CAN_FALL(bank, stat) ((gBattleMons[bank].statStages[stat-1] > 0 && GetBattlerAbility(bank) != ABILITY_CONTRARY) || (GetBattlerAbility(bank) == ABILITY_CONTRARY && gBattleMons[bank].statStages[stat-1] < 12)) +//TODO - this could be a lot better +bool32 ShouldAIUseZMove(u8 battlerAtk, u8 battlerDef, u16 *baseMoves, u8 *chosenMoveId) +{ + u32 i; + u16 possibleZMoves[MAX_MON_MOVES]; + u8 zMoveIndex = 0xFF; + u16 zMove = MOVE_NONE; + u8 scores[MAX_MON_MOVES] = {0}; + + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && battlerDef == BATTLE_PARTNER(battlerAtk)) + return FALSE; //don't use z move on partner + + if (gBattleStruct->zmove.used[battlerAtk]) + return FALSE; //cant use z move twice + + // check possible z moves and select the 'best' one + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (baseMoves[i] != MOVE_NONE && IsViableZMove(battlerAtk, baseMoves[i])) //updates gBattleStruct->zmove.currZMove + { + if (zMove != MOVE_NONE) + { + scores[i] = GetZMoveScore(battlerAtk, battlerDef, baseMoves[i], zMove); + // another z move option already exists. compare them + #if B_AI_PREFER_STATUS_Z_MOVES == TRUE + if (scores[i] > scores[zMoveIndex] || (IS_MOVE_STATUS(gBattleStruct->zmove.currZMove) && !IS_MOVE_STATUS(zMove) && scores[i] != 0)) + { + zMove = gBattleStruct->zmove.currZMove; + zMoveIndex = i; + } + #else + if (scores[i] > scores[zMoveIndex] || (!IS_MOVE_STATUS(gBattleStruct->zmove.currZMove) && IS_MOVE_STATUS(zMove) && scores[i] != 0)) + { + zMove = gBattleStruct->zmove.currZMove; + zMoveIndex = i; + } + #endif + } + else + { + zMove = gBattleStruct->zmove.currZMove; + zMoveIndex = i; + } + } + } + + if (zMoveIndex == 0xFF || scores[zMoveIndex] == 0) + { + return FALSE; //no available z moves + } + else + { + *chosenMoveId = zMoveIndex; + gBattleStruct->zmove.baseMoves[battlerAtk] = baseMoves[*chosenMoveId]; + gBattleStruct->zmove.currZMove = zMove; //z move the AI is looking at + return TRUE; + } + + return FALSE; +} + +static u8 GetZMoveScore(u8 battlerAtk, u8 battlerDef, u16 baseMove, u16 zMove) +{ + u8 score = 0; + u8 expectedDamage = 0; + u32 i; + + if (zMove != MOVE_Z_STATUS) + { + u8 defAbility = GetBattlerAbility(battlerDef); + u16 defSpecies = gBattleMons[battlerDef].species; + + /*if (baseMove == MOVE_FAKE_OUT && gDisableStructs[battlerAtk].isFirstTurn) + return FALSE; //Prefer actual Fake Out over Breakneck Blitz*/ + + /*if (MoveBlockedBySubstitute(zMove, battlerAtk, battlerDef) + || (defMovePrediction == MOVE_SUBSTITUTE + && !MoveWouldHitFirst(zMove, battlerAtk, battlerDef) + && !MoveIgnoresSubstitutes(zMove, ABILITY(battlerAtk)))) + return FALSE; //Don't use a Z-Move on a Substitute or if the enemy is going to go first and use Substitute*/ + + #ifdef POKEMON_EXPANSION + if (defAbility == ABILITY_DISGUISE && defSpecies == SPECIES_MIMIKYU) + return 0; //Don't waste a Z-Move busting Mimikyu's disguise + if (defAbility == ABILITY_ICEFACE && defSpecies == SPECIES_EISCUE && IS_MOVE_PHYSICAL(baseMove)) + return 0; //Don't waste a Z-Move busting Eiscue's Ice Face + #endif + + /*if (defMovePrediction == MOVE_PROTECT || defMovePrediction == MOVE_KINGSSHIELD || defMovePrediction == MOVE_SPIKYSHIELD || defMovePrediction == MOVE_OBSTRUCT + || (IsDynamaxed(battlerDef) && SPLIT(defMovePrediction) == SPLIT_STATUS)) + return FALSE; //Don't waste a Z-Move on a Protect*/ + + /*if (IsRaidBattle() && gNewBS->dynamaxData.raidShieldsUp && SIDE(battlerAtk) == B_SIDE_PLAYER && SIDE(battlerDef) == B_SIDE_OPPONENT) //Partner AI on Raid Pokemon with shields up + { + if (gNewBS->dynamaxData.shieldCount - gNewBS->dynamaxData.shieldsDestroyed <= 2 //Less than 3 shields left + && gNewBS->dynamaxData.stormLevel < 3) //The Raid boss hasn't almost won + return FALSE; //Don't waste a Z-Move breaking a shield + + u16 bankAtkPartner = BATTLE_PARTNER(battlerAtk); + u16 partnerMove = GetAIChosenMove(bankAtkPartner, battlerDef); + + if (SPLIT(partnerMove) == SPLIT_STATUS + || MoveWouldHitFirst(partnerMove, bankAtkPartner, battlerAtk) + || (gChosenMovesByBanks[bankAtkPartner] != MOVE_NONE && gBattleStruct->moveTarget[bankAtkPartner] != battlerDef)) //Not targeting raid Pokemon + return FALSE; //Don't waste a Z-Move if partner can't destroy shield first + }*/ + + //These moves should always be turned into Z-Moves, regardless if they KO or not + switch (gBattleMoves[baseMove].effect) + { + case EFFECT_RECHARGE: + case EFFECT_SEMI_INVULNERABLE: + case EFFECT_SKULL_BASH: + case EFFECT_SOLARBEAM: + case EFFECT_LAST_RESORT: + //todo: sky drop + return 255; + } + if (baseMove == MOVE_SKY_ATTACK) + return 255; + + gBattleStruct->zmove.active = TRUE; //for damage calc only + expectedDamage = AI_CalcDamage(baseMove, battlerAtk, battlerDef); + gBattleStruct->zmove.active = FALSE; + if (expectedDamage >= gBattleMons[battlerDef].hp) + return 0; //base move knocks out already, no need for z move + + return (expectedDamage > 255) ? 255 : expectedDamage; + } + else //Status Move + { + u8 zEffect = gBattleMoves[baseMove].zMoveEffect; + + switch (zEffect) + { + case Z_EFFECT_NONE: + return 0; + case Z_EFFECT_RESET_STATS: + for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) + { + if (i == STAT_ATK && !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) //Only reset lowered Attack if useful + continue; + else if (i == STAT_ATK && !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) //Only reset lowered Special Attack if useful + continue; + + if (STAT_STAGE(battlerAtk, i) < 6) + return 50; //Want to reset any negative stats + } + break; + case Z_EFFECT_ALL_STATS_UP_1: + if (!AreStatsMaxed(battlerAtk, STAT_EVASION)) //all battle stats maxed + return 80; + break; + case Z_EFFECT_BOOST_CRITS: + if (!(gBattleMons[battlerAtk].status2 & STATUS2_FOCUS_ENERGY)) + return 30; //kinda meh? + break; + case Z_EFFECT_FOLLOW_ME: + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + return 30; //kinda meh? + break; + case Z_EFFECT_ATK_UP_1: + if (STAT_CAN_RISE(battlerAtk, STAT_ATK) && HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + return 60; + break; + case Z_EFFECT_ATK_UP_2: + if (STAT_CAN_RISE(battlerAtk, STAT_ATK) && HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + return 70; + break; + case Z_EFFECT_ATK_UP_3: + if (STAT_CAN_RISE(battlerAtk, STAT_ATK) && HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + return 80; + break; + case Z_EFFECT_DEF_UP_1: + if (STAT_CAN_RISE(battlerAtk, STAT_DEF)) + return 50; + break; + case Z_EFFECT_DEF_UP_2: + if (STAT_CAN_RISE(battlerAtk, STAT_DEF)) + return 60; + break; + case Z_EFFECT_DEF_UP_3: + if (STAT_CAN_RISE(battlerAtk, STAT_DEF)) + return 70; + break; + case Z_EFFECT_SPATK_UP_1: + if (STAT_CAN_RISE(battlerAtk, STAT_SPATK) && HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + return 50; + break; + case Z_EFFECT_SPATK_UP_2: + if (STAT_CAN_RISE(battlerAtk, STAT_SPATK) && HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + return 60; + break; + case Z_EFFECT_SPATK_UP_3: + if (STAT_CAN_RISE(battlerAtk, STAT_SPATK) && HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + return 70; + break; + case Z_EFFECT_SPDEF_UP_1: + if (STAT_CAN_RISE(battlerAtk, STAT_SPDEF)) + return 50; + break; + case Z_EFFECT_SPDEF_UP_2: + if (STAT_CAN_RISE(battlerAtk, STAT_SPDEF)) + return 60; + break; + case Z_EFFECT_SPDEF_UP_3: + if (STAT_CAN_RISE(battlerAtk, STAT_SPDEF)) + return 70; + break; + case Z_EFFECT_SPD_UP_1: + if (STAT_CAN_RISE(battlerAtk, STAT_SPEED)) + return 50; + break; + case Z_EFFECT_SPD_UP_2: + if (STAT_CAN_RISE(battlerAtk, STAT_SPEED)) + return 60; + break; + case Z_EFFECT_SPD_UP_3: + if (STAT_CAN_RISE(battlerAtk, STAT_SPEED)) + return 70; + break; + case Z_EFFECT_ACC_UP_1: + if (STAT_CAN_RISE(battlerAtk, STAT_ACC)) + return 20; //TODO: only if knows low-accuracy move + break; + case Z_EFFECT_ACC_UP_2: + if (STAT_CAN_RISE(battlerAtk, STAT_ACC)) + return 40; //TODO: only if knows low-accuracy move + break; + case Z_EFFECT_ACC_UP_3: + //if (STAT_CAN_RISE(battlerAtk, STAT_ACC) && MoveInMovesetWithAccuracyLessThan(battlerAtk, battlerDef, 90, FALSE)) + if (STAT_CAN_RISE(battlerAtk, STAT_ACC)) + return 60; //TODO: only if knows low-accuracy move + break; + case Z_EFFECT_EVSN_UP_1: + if (STAT_CAN_RISE(battlerAtk, STAT_EVASION)) + return 40; + break; + case Z_EFFECT_EVSN_UP_2: + if (STAT_CAN_RISE(battlerAtk, STAT_EVASION)) + return 60; + break; + case Z_EFFECT_EVSN_UP_3: + if (STAT_CAN_RISE(battlerAtk, STAT_EVASION)) + return 80; + break; + default: //Recover HP + return 70; + } + } + + return score; } diff --git a/src/data/pokemon/level_up_learnsets.h b/src/data/pokemon/level_up_learnsets.h index 69742ac25..6b76f7b9c 100644 --- a/src/data/pokemon/level_up_learnsets.h +++ b/src/data/pokemon/level_up_learnsets.h @@ -2385,6 +2385,8 @@ static const struct LevelUpMove sStarmieLevelUpLearnset[] = { LEVEL_UP_MOVE( 1, MOVE_RECOVER), LEVEL_UP_MOVE( 1, MOVE_SWIFT), LEVEL_UP_MOVE(40, MOVE_CONFUSE_RAY), + LEVEL_UP_MOVE(40, MOVE_PSYCHIC), + LEVEL_UP_MOVE(50, MOVE_WATER_PULSE), LEVEL_UP_END }; diff --git a/src/data/trainer_parties.h b/src/data/trainer_parties.h index 824a49dc3..2c57f6ffc 100644 --- a/src/data/trainer_parties.h +++ b/src/data/trainer_parties.h @@ -429,16 +429,18 @@ static const struct TrainerMonNoItemCustomMoves sParty_Felix[] = { } }; -static const struct TrainerMonNoItemDefaultMoves sParty_Violet[] = { +static const struct TrainerMonItemDefaultMoves sParty_Violet[] = { { .iv = 0, - .lvl = 26, + .lvl = 45, .species = SPECIES_ROSELIA, + .heldItem = ITEM_GRASSIUM_Z, }, { .iv = 0, - .lvl = 26, + .lvl = 40, .species = SPECIES_GLOOM, + .heldItem = 0, } }; diff --git a/src/data/trainers.h b/src/data/trainers.h index 163a8296d..defe0accf 100644 --- a/src/data/trainers.h +++ b/src/data/trainers.h @@ -547,7 +547,7 @@ const struct Trainer gTrainers[] = { [TRAINER_VIOLET] = { - .partyFlags = 0, + .partyFlags = F_TRAINER_PARTY_HELD_ITEM, .trainerClass = TRAINER_CLASS_AROMA_LADY, .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_AROMA_LADY, @@ -556,7 +556,7 @@ const struct Trainer gTrainers[] = { .doubleBattle = FALSE, .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Violet), - .party = {.NoItemDefaultMoves = sParty_Violet}, + .party = {.ItemDefaultMoves = sParty_Violet}, }, [TRAINER_ROSE_2] = From ce19e33cc47ad7ff055be90fbf7f5deabee84e6a Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 1 Dec 2020 13:43:15 -0500 Subject: [PATCH 009/208] handle double and multi battles --- include/battle.h | 9 +- include/battle_ai_script_commands.h | 2 +- include/battle_controllers.h | 1 + include/battle_z_move.h | 6 +- include/constants/battle_config.h | 3 - src/battle_ai_script_commands.c | 20 +- src/battle_controller_opponent.c | 22 +- src/battle_controller_player.c | 34 +-- src/battle_controller_player_partner.c | 6 +- src/battle_main.c | 2 + src/battle_util.c | 24 +- src/battle_z_move.c | 316 +++++-------------------- 12 files changed, 126 insertions(+), 319 deletions(-) diff --git a/include/battle.h b/include/battle.h index 9844eb2d6..86205ad10 100644 --- a/include/battle.h +++ b/include/battle.h @@ -431,19 +431,20 @@ struct ZMoveData { /*0x00*/ u8 viable:1; // current move can become a z move u8 viewing:1; //if player is viewing the z move name instead of regular moves - u8 split:2; u8 active:1; //is z move being used this turn u8 zStatusActive:1; u8 healReplacement:1; //TODO: z-parting shot + u8 activeSplit:1; //active z move split u8 zUnused:2; - /*0x02*/ u16 currZMove; //z move of move cursor is on - /*0x06*/ u8 triggerSpriteId; + /*0x01*/ u8 triggerSpriteId; + /*0x02*/ u8 possibleZMoves[MAX_BATTLERS_COUNT]; + /*0x02*/ u16 chosenZMove; //z move of move cursor is on u8 effect; u8 used[MAX_BATTLERS_COUNT]; //one per bank for multi-battles u16 toBeUsed[MAX_BATTLERS_COUNT]; //TODO z moves per battler to be used u16 baseMoves[MAX_BATTLERS_COUNT]; u8 splits[MAX_BATTLERS_COUNT]; -}; /* size = 8 */ +}; struct BattleStruct { diff --git a/include/battle_ai_script_commands.h b/include/battle_ai_script_commands.h index f8c27bd87..31313fc3d 100644 --- a/include/battle_ai_script_commands.h +++ b/include/battle_ai_script_commands.h @@ -7,7 +7,7 @@ #define AI_CHOICE_WATCH 5 #define AI_CHOICE_SWITCH 7 -s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef); +s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, bool32 considerZPower); s32 AI_CalcPartyMonDamage(u16 move, u8 battlerAtk, u8 battlerDef, struct Pokemon *mon); u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); void BattleAI_SetupItems(void); diff --git a/include/battle_controllers.h b/include/battle_controllers.h index e0eeca6be..b0fbf485a 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -113,6 +113,7 @@ struct ChooseMoveStruct u8 monType2; u8 monType3; struct MegaEvolutionData mega; + struct ZMoveData zmove; }; enum diff --git a/include/battle_z_move.h b/include/battle_z_move.h index 70347439a..ae2b38834 100644 --- a/include/battle_z_move.h +++ b/include/battle_z_move.h @@ -15,7 +15,7 @@ struct SignatureZMove void QueueZMove(u8 battlerId, u16 baseMove); bool32 IsViableZMove(u8 battlerId, u16 move); -bool32 TryChangeZIndicator(u8 battlerId, u16 move); +bool32 TryChangeZIndicator(u8 battlerId, u8 moveIndex); void CreateZMoveTriggerSprite(u8, bool8); void HideZMoveTriggerSprite(void); bool32 IsZMoveTriggerSpriteActive(void); @@ -23,6 +23,8 @@ void DestroyZMoveTriggerSprite(void); bool32 MoveSelectionDisplayZMove(u16 zmove); const u8* GetZMoveName(u16 move); void SetZEffect(void); -bool32 ShouldAIUseZMove(u8 activeId, u8 targetId, u16 *baseMove, u8 *chosenMoveId); +bool32 ShouldAIUseZMove(u8 activeId, u8 targetId, u16 chosenMove); +bool32 IsZMoveUsable(u8 battlerId, u16 moveIndex); +void GetUsableZMoves(u8 battlerId, u16 *moves); #endif // GUARD_BATTLE_Z_MOVE_H \ No newline at end of file diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 0f3047199..a5c14023f 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -145,9 +145,6 @@ #define B_INCINERATE_GEMS GEN_6 // In Gen6+, Incinerate can destroy Gems. #define B_MINIMIZE_DMG_ACC GEN_6 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks. -// AI Settings -#define B_AI_PREFER_STATUS_Z_MOVES FALSE // If TRUE, the AI will prefer z-status moves over damaging z moves - // Ability settings #define B_ABILITY_WEATHER GEN_6 // In Gen5+, weather caused by abilities lasts the same amount of turns as induced from a move. Before, they lasted till the battle's end or weather change by a move. #define B_GALE_WINGS GEN_6 // In Gen7+ requires full HP to trigger. diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index 9c39c935c..d7e5e94c3 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -5,6 +5,7 @@ #include "battle_ai_script_commands.h" #include "battle_factory.h" #include "battle_setup.h" +#include "battle_z_move.h" #include "data.h" #include "item.h" #include "pokemon.h" @@ -422,9 +423,10 @@ void BattleAI_SetupAIData(u8 defaultScoreMoves) { dmg = 0; move = gBattleMons[sBattler_AI].moves[i]; + if (gBattleMoves[move].power != 0 && !(moveLimitations & gBitTable[i])) { - dmg = AI_CalcDamage(move, sBattler_AI, gBattlerTarget) * (100 - (Random() % 10)) / 100; + dmg = AI_CalcDamage(move, sBattler_AI, gBattlerTarget, TRUE) * (100 - (Random() % 10)) / 100; if (dmg == 0) dmg = 1; } @@ -904,10 +906,16 @@ static bool32 AI_GetIfCrit(u32 move, u8 battlerAtk, u8 battlerDef) return isCrit; } -s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) +s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, bool32 considerZPower) { s32 dmg, moveType; - + + if (considerZPower && IsViableZMove(battlerAtk, move)) + { + gBattleStruct->zmove.baseMoves[battlerAtk] = move; + gBattleStruct->zmove.active = TRUE; //temporarily enable z moves for damage calcs + } + SaveBattlerData(battlerAtk); SaveBattlerData(battlerDef); @@ -922,6 +930,8 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) RestoreBattlerData(battlerAtk); RestoreBattlerData(battlerDef); + gBattleStruct->zmove.active = FALSE; + gBattleStruct->zmove.baseMoves[battlerAtk] = MOVE_NONE; return dmg; } @@ -935,7 +945,7 @@ s32 AI_CalcPartyMonDamage(u16 move, u8 battlerAtk, u8 battlerDef, struct Pokemon battleMons[i] = gBattleMons[i]; PokemonToBattleMon(mon, &gBattleMons[battlerAtk]); - dmg = AI_CalcDamage(move, battlerAtk, battlerDef); + dmg = AI_CalcDamage(move, battlerAtk, battlerDef, TRUE); for (i = 0; i < MAX_BATTLERS_COUNT; i++) gBattleMons[i] = battleMons[i]; @@ -2674,7 +2684,7 @@ static void Cmd_if_ai_can_go_down(void) for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && !(unusable & gBitTable[i]) - && AI_CalcDamage(moves[i], gBattlerTarget, sBattler_AI) >= gBattleMons[sBattler_AI].hp) + && AI_CalcDamage(moves[i], gBattlerTarget, sBattler_AI, TRUE) >= gBattleMons[sBattler_AI].hp) { gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1); return; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 36f05b6a8..9e6a61d40 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1576,26 +1576,18 @@ static void OpponentHandleChooseMove(void) default: { u16 chosenMove = moveInfo->moves[chosenMoveId]; - - if (ShouldAIUseZMove(gActiveBattler, gBattlerTarget, moveInfo->moves, &chosenMoveId)) + + if (gBattleMoves[chosenMove].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + gBattlerTarget = gActiveBattler; + if (gBattleMoves[chosenMove].target & MOVE_TARGET_BOTH) { - QueueZMove(gActiveBattler, moveInfo->moves[chosenMoveId]); - chosenMove = moveInfo->moves[chosenMoveId]; gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); } - else - { - if (gBattleMoves[chosenMove].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) - gBattlerTarget = gActiveBattler; - if (gBattleMoves[chosenMove].target & MOVE_TARGET_BOTH) - { - gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); - if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) - gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); - } - } + + if (ShouldAIUseZMove(gActiveBattler, gBattlerTarget, chosenMove)) + QueueZMove(gActiveBattler, moveInfo->moves[chosenMoveId]); if (CanMegaEvolve(gActiveBattler)) // If opponent can mega evolve, do it. BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (RET_MEGA_EVOLUTION) | (gBattlerTarget << 8)); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 034c45eb6..ca6717180 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -653,9 +653,9 @@ static void HandleInputChooseMove(void) PlayerBufferExecCompleted(); } } - else if (JOY_NEW(DPAD_LEFT)) + else if (JOY_NEW(DPAD_LEFT) && !gBattleStruct->zmove.viewing) { - if (!gBattleStruct->zmove.viewing && gMoveSelectionCursor[gActiveBattler] & 1) + if (gMoveSelectionCursor[gActiveBattler] & 1) { MoveSelectionDestroyCursorAt(gMoveSelectionCursor[gActiveBattler]); gMoveSelectionCursor[gActiveBattler] ^= 1; @@ -663,12 +663,12 @@ static void HandleInputChooseMove(void) MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); - TryChangeZIndicator(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); + TryChangeZIndicator(gActiveBattler, gMoveSelectionCursor[gActiveBattler]); } } - else if (JOY_NEW(DPAD_RIGHT)) + else if (JOY_NEW(DPAD_RIGHT) && !gBattleStruct->zmove.viewing) { - if (!gBattleStruct->zmove.viewing && !(gMoveSelectionCursor[gActiveBattler] & 1) + if (!(gMoveSelectionCursor[gActiveBattler] & 1) && (gMoveSelectionCursor[gActiveBattler] ^ 1) < gNumberOfMovesToChoose) { MoveSelectionDestroyCursorAt(gMoveSelectionCursor[gActiveBattler]); @@ -677,12 +677,12 @@ static void HandleInputChooseMove(void) MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); - TryChangeZIndicator(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); + TryChangeZIndicator(gActiveBattler, gMoveSelectionCursor[gActiveBattler]); } } - else if (JOY_NEW(DPAD_UP)) + else if (JOY_NEW(DPAD_UP) && !gBattleStruct->zmove.viewing) { - if (!gBattleStruct->zmove.viewing && gMoveSelectionCursor[gActiveBattler] & 2) + if (gMoveSelectionCursor[gActiveBattler] & 2) { MoveSelectionDestroyCursorAt(gMoveSelectionCursor[gActiveBattler]); gMoveSelectionCursor[gActiveBattler] ^= 2; @@ -690,12 +690,12 @@ static void HandleInputChooseMove(void) MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); - TryChangeZIndicator(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); + TryChangeZIndicator(gActiveBattler, gMoveSelectionCursor[gActiveBattler]); } } - else if (JOY_NEW(DPAD_DOWN)) + else if (JOY_NEW(DPAD_DOWN) && !gBattleStruct->zmove.viewing) { - if (!gBattleStruct->zmove.viewing && !(gMoveSelectionCursor[gActiveBattler] & 2) + if (!(gMoveSelectionCursor[gActiveBattler] & 2) && (gMoveSelectionCursor[gActiveBattler] ^ 2) < gNumberOfMovesToChoose) { MoveSelectionDestroyCursorAt(gMoveSelectionCursor[gActiveBattler]); @@ -704,7 +704,7 @@ static void HandleInputChooseMove(void) MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); - TryChangeZIndicator(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); + TryChangeZIndicator(gActiveBattler, gMoveSelectionCursor[gActiveBattler]); } } else if (JOY_NEW(SELECT_BUTTON) && !gBattleStruct->zmove.viewing) @@ -723,7 +723,7 @@ static void HandleInputChooseMove(void) gBattlerControllerFuncs[gActiveBattler] = HandleMoveSwitching; } } - else if (gMain.newKeys & START_BUTTON) + else if (JOY_NEW(START_BUTTON)) { if (CanMegaEvolve(gActiveBattler)) { @@ -731,13 +731,13 @@ static void HandleInputChooseMove(void) ChangeMegaTriggerSprite(gBattleStruct->mega.triggerSpriteId, gBattleStruct->mega.playerSelect); PlaySE(SE_SELECT); } - else if (gBattleStruct->zmove.currZMove != MOVE_NONE) + else if (gBattleStruct->zmove.viable) { // show z move name / info //TODO: brighten z move symbol PlaySE(SE_SELECT); if (!gBattleStruct->zmove.viewing) - MoveSelectionDisplayZMove(gBattleStruct->zmove.currZMove); + MoveSelectionDisplayZMove(gBattleStruct->zmove.chosenZMove); else ReloadMoveNames(); } @@ -2766,7 +2766,9 @@ static void PlayerHandleChooseMove(void) CreateMegaTriggerSprite(gActiveBattler, 0); if (!IsZMoveTriggerSpriteActive()) gBattleStruct->zmove.triggerSpriteId = 0xFF; - gBattleStruct->zmove.viable = IsViableZMove(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); //is current move a z move + + GetUsableZMoves(gActiveBattler, moveInfo->moves); + gBattleStruct->zmove.viable = IsZMoveUsable(gActiveBattler, gMoveSelectionCursor[gActiveBattler]); CreateZMoveTriggerSprite(gActiveBattler, gBattleStruct->zmove.viable); gBattlerControllerFuncs[gActiveBattler] = HandleChooseMoveAfterDma3; } diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 9743e92e0..14dced42f 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -7,6 +7,7 @@ #include "battle_interface.h" #include "battle_setup.h" #include "battle_tower.h" +#include "battle_z_move.h" #include "bg.h" #include "data.h" #include "item_use.h" @@ -1516,7 +1517,7 @@ static void PlayerPartnerHandleChooseMove(void) BattleAI_SetupAIData(0xF); chosenMoveId = BattleAI_ChooseMoveOrAction(); - + if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED)) gBattlerTarget = gActiveBattler; if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH) @@ -1525,6 +1526,9 @@ static void PlayerPartnerHandleChooseMove(void) if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) gBattlerTarget = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); } + + if (ShouldAIUseZMove(gActiveBattler, gBattlerTarget, moveInfo->moves[chosenMoveId])) + QueueZMove(gActiveBattler, moveInfo->moves[chosenMoveId]); BtlController_EmitTwoReturnValues(1, 10, chosenMoveId | (gBattlerTarget << 8)); PlayerPartnerBufferExecCompleted(); diff --git a/src/battle_main.c b/src/battle_main.c index e5ba05bbc..6b1e26a97 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3801,6 +3801,7 @@ static void HandleTurnActionSelectionState(void) { struct ChooseMoveStruct moveInfo; + moveInfo.zmove = gBattleStruct->zmove; moveInfo.mega = gBattleStruct->mega; moveInfo.species = gBattleMons[gActiveBattler].species; moveInfo.monType1 = gBattleMons[gActiveBattler].type1; @@ -3913,6 +3914,7 @@ static void HandleTurnActionSelectionState(void) } gBattleStruct->mega.toEvolve &= ~(gBitTable[BATTLE_PARTNER(GetBattlerPosition(gActiveBattler))]); + gBattleStruct->zmove.toBeUsed[BATTLE_PARTNER(GetBattlerPosition(gActiveBattler))] = MOVE_NONE; BtlController_EmitEndBounceEffect(0); MarkBattlerForControllerExec(gActiveBattler); return; diff --git a/src/battle_util.c b/src/battle_util.c index 3f856e23b..9a5ca9dcf 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1400,7 +1400,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } - if (gDisableStructs[gActiveBattler].tauntTimer != 0 && gBattleMoves[move].power == 0) + if (!gBattleStruct->zmove.active && gDisableStructs[gActiveBattler].tauntTimer != 0 && gBattleMoves[move].power == 0) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1415,7 +1415,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } - if (gDisableStructs[gActiveBattler].throatChopTimer != 0 && gBattleMoves[move].flags & FLAG_SOUND) + if (!gBattleStruct->zmove.active && gDisableStructs[gActiveBattler].throatChopTimer != 0 && gBattleMoves[move].flags & FLAG_SOUND) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1430,7 +1430,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } - if (GetImprisonedMovesCount(gActiveBattler, move)) + if (!gBattleStruct->zmove.active && GetImprisonedMovesCount(gActiveBattler, move)) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1445,7 +1445,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } - if (IsGravityPreventingMove(move)) + if (!gBattleStruct->zmove.active && IsGravityPreventingMove(move)) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1460,7 +1460,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } - if (IsHealBlockPreventingMove(gActiveBattler, move)) + if (!gBattleStruct->zmove.active && IsHealBlockPreventingMove(gActiveBattler, move)) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1475,7 +1475,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } - if (IsBelchPreventingMove(gActiveBattler, move)) + if (!gBattleStruct->zmove.active && IsBelchPreventingMove(gActiveBattler, move)) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1543,7 +1543,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check) s32 i; gPotentialItemEffectBattler = battlerId; - + for (i = 0; i < MAX_MON_MOVES; i++) { if (gBattleMons[battlerId].moves[i] == 0 && check & MOVE_LIMITATION_ZEROMOVE) @@ -3191,9 +3191,12 @@ u8 AtkCanceller_UnableToUseMove(void) { //attacker has a queued z move gBattleStruct->zmove.active = TRUE; + gBattleStruct->zmove.activeSplit = gBattleStruct->zmove.splits[gBattlerAttacker]; RecordItemEffectBattle(gBattlerAttacker, HOLD_EFFECT_Z_CRYSTAL); - gBattleStruct->zmove.used[gBattlerAttacker] = TRUE; - //TODO - partner battles + gBattleStruct->zmove.used[gBattlerAttacker] = TRUE; + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsPartnerMonFromSameTrainer(gBattlerAttacker)) + gBattleStruct->zmove.used[BATTLE_PARTNER(gBattlerAttacker)] = TRUE; //if 1v1 double, set partner used flag as well + gBattleScripting.battler = gBattlerAttacker; if (IS_MOVE_STATUS(gBattleStruct->zmove.splits[gBattlerAttacker])) { @@ -7811,9 +7814,8 @@ bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId) u8 GetBattleMoveSplit(u32 moveId) { - //TODO - light that burns the sky, photon geyser if (gBattleStruct->zmove.active && !IS_MOVE_STATUS(moveId)) - return gBattleStruct->zmove.split; + return gBattleStruct->zmove.activeSplit; else if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) return gBattleMoves[moveId].split; else if (gBattleMoves[moveId].type < TYPE_MYSTERY) diff --git a/src/battle_z_move.c b/src/battle_z_move.c index e8dc7210b..3bb67f684 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -140,9 +140,10 @@ bool8 IsZMove(u16 move) void QueueZMove(u8 battlerId, u16 baseMove) { - gBattleStruct->zmove.toBeUsed[battlerId] = gBattleStruct->zmove.currZMove; + gBattleStruct->zmove.toBeUsed[battlerId] = gBattleStruct->zmove.chosenZMove; gBattleStruct->zmove.baseMoves[battlerId] = baseMove; - gBattleStruct->zmove.splits[battlerId] = GetBattleMoveSplit(baseMove); + //TODO - light that burns the sky + gBattleStruct->zmove.splits[battlerId] = gBattleMoves[baseMove].split; } bool32 IsViableZMove(u8 battlerId, u16 move) @@ -155,19 +156,19 @@ bool32 IsViableZMove(u8 battlerId, u16 move) u16 holdEffect; u16 species; - gBattleStruct->zmove.currZMove = MOVE_NONE; //init - if (gBattleStruct->zmove.used[battlerId]) return FALSE; - // Gets mon data. - if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT) + // Gets mon data + species = gBattleMons[battlerId].species; + item = gBattleMons[battlerId].item; + /*if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT) mon = &gEnemyParty[gBattlerPartyIndexes[battlerId]]; else mon = &gPlayerParty[gBattlerPartyIndexes[battlerId]]; species = GetMonData(mon, MON_DATA_SPECIES); - item = GetMonData(mon, MON_DATA_HELD_ITEM); + item = GetMonData(mon, MON_DATA_HELD_ITEM);*/ if (gBattleTypeFlags & (BATTLE_TYPE_SAFARI | BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_FRONTIER)) return FALSE; @@ -202,16 +203,16 @@ bool32 IsViableZMove(u8 battlerId, u16 move) u16 zMove = GetSignatureZMove(move, gBattleMons[battlerId].species, item); if (zMove != MOVE_NONE) { - gBattleStruct->zmove.currZMove = zMove; //signature z move exists + gBattleStruct->zmove.chosenZMove = zMove; //signature z move exists return TRUE; } if (move != MOVE_NONE && zMove != MOVE_Z_STATUS && gBattleMoves[move].type == ItemId_GetSecondaryId(item)) { if (IS_MOVE_STATUS(gBattleMoves[move].split)) - gBattleStruct->zmove.currZMove = MOVE_Z_STATUS; + gBattleStruct->zmove.chosenZMove = move; else - gBattleStruct->zmove.currZMove = GetTypeBasedZMove(move, battlerId); + gBattleStruct->zmove.chosenZMove = GetTypeBasedZMove(move, battlerId); return TRUE; } @@ -220,9 +221,30 @@ bool32 IsViableZMove(u8 battlerId, u16 move) return FALSE; } -bool32 TryChangeZIndicator(u8 battlerId, u16 move) +void GetUsableZMoves(u8 battlerId, u16 *moves) { - bool32 viableZMove = IsViableZMove(battlerId, move); + u32 i; + gBattleStruct->zmove.possibleZMoves[battlerId] = 0; + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] != MOVE_NONE && IsViableZMove(battlerId, moves[i])) + gBattleStruct->zmove.possibleZMoves[battlerId] |= (1 << i); + } +} + +bool32 IsZMoveUsable(u8 battlerId, u16 moveIndex) +{ + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsPartnerMonFromSameTrainer(battlerId) && gBattleStruct->zmove.toBeUsed[BATTLE_PARTNER(battlerId)] != MOVE_NONE) + return FALSE; //player's other mon has a z move queued up already + if (gBattleStruct->zmove.possibleZMoves[battlerId] & (1 << moveIndex)) + return TRUE; + return FALSE; +} + +bool32 TryChangeZIndicator(u8 battlerId, u8 moveIndex) +{ + //bool32 viableZMove = IsViableZMove(battlerId, move); + bool32 viableZMove = IsZMoveUsable(battlerId, moveIndex); if (gBattleStruct->zmove.viable && !viableZMove) HideZMoveTriggerSprite(); //was a viable z move, now is not -> slide out @@ -268,7 +290,6 @@ void CreateZMoveTriggerSprite(u8 battlerId, bool8 viable) gSprites[gBattleStruct->zmove.triggerSpriteId].tBattler = battlerId; gSprites[gBattleStruct->zmove.triggerSpriteId].tHide = (viable == TRUE) ? FALSE : TRUE; - ChangeMegaTriggerSprite(gBattleStruct->zmove.triggerSpriteId, 0); } static void SpriteCB_ZMoveTrigger(struct Sprite *sprite) @@ -351,6 +372,7 @@ void DestroyZMoveTriggerSprite(void) FreeSpriteTilesByTag(TAG_ZMOVE_TRIGGER_TILE); if (gBattleStruct->zmove.triggerSpriteId != 0xFF) DestroySprite(&gSprites[gBattleStruct->zmove.triggerSpriteId]); + gBattleStruct->zmove.triggerSpriteId = 0xFF; } @@ -370,13 +392,9 @@ static u16 GetSignatureZMove(u16 move, u16 species, u16 item) static u16 GetTypeBasedZMove(u16 move, u8 battler) { - u8 moveType; - //handle dynamic move types - SetTypeBeforeUsingMove(battler, move); - GET_MOVE_TYPE(move, moveType); + u8 moveType = gBattleMoves[move].type; - // get z move from split - // TODO: light that burns the sky gets split from relative stats + // get z move from type if (moveType < TYPE_FIRE) return MOVE_BREAKNECK_BLITZ + moveType; else if (moveType >= TYPE_FAIRY) @@ -683,259 +701,35 @@ static bool32 AreStatsMaxed(u8 battlerId, u8 n) return TRUE; } -#define STAT_CAN_RISE(bank, stat) ((gBattleMons[bank].statStages[stat-1] < 12 && GetBattlerAbility(bank) != ABILITY_CONTRARY) || (GetBattlerAbility(bank) == ABILITY_CONTRARY && gBattleMons[bank].statStages[stat-1] > 0)) -#define STAT_CAN_FALL(bank, stat) ((gBattleMons[bank].statStages[stat-1] > 0 && GetBattlerAbility(bank) != ABILITY_CONTRARY) || (GetBattlerAbility(bank) == ABILITY_CONTRARY && gBattleMons[bank].statStages[stat-1] < 12)) //TODO - this could be a lot better -bool32 ShouldAIUseZMove(u8 battlerAtk, u8 battlerDef, u16 *baseMoves, u8 *chosenMoveId) +bool32 ShouldAIUseZMove(u8 battlerAtk, u8 battlerDef, u16 chosenMove) { - u32 i; - u16 possibleZMoves[MAX_MON_MOVES]; - u8 zMoveIndex = 0xFF; - u16 zMove = MOVE_NONE; - u8 scores[MAX_MON_MOVES] = {0}; - + // simple logic. just upgrades chosen move to z move if possible, unless regular move would kill opponent if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && battlerDef == BATTLE_PARTNER(battlerAtk)) return FALSE; //don't use z move on partner - if (gBattleStruct->zmove.used[battlerAtk]) return FALSE; //cant use z move twice - - // check possible z moves and select the 'best' one - for (i = 0; i < MAX_MON_MOVES; i++) - { - if (baseMoves[i] != MOVE_NONE && IsViableZMove(battlerAtk, baseMoves[i])) //updates gBattleStruct->zmove.currZMove - { - if (zMove != MOVE_NONE) - { - scores[i] = GetZMoveScore(battlerAtk, battlerDef, baseMoves[i], zMove); - // another z move option already exists. compare them - #if B_AI_PREFER_STATUS_Z_MOVES == TRUE - if (scores[i] > scores[zMoveIndex] || (IS_MOVE_STATUS(gBattleStruct->zmove.currZMove) && !IS_MOVE_STATUS(zMove) && scores[i] != 0)) - { - zMove = gBattleStruct->zmove.currZMove; - zMoveIndex = i; - } - #else - if (scores[i] > scores[zMoveIndex] || (!IS_MOVE_STATUS(gBattleStruct->zmove.currZMove) && IS_MOVE_STATUS(zMove) && scores[i] != 0)) - { - zMove = gBattleStruct->zmove.currZMove; - zMoveIndex = i; - } - #endif - } - else - { - zMove = gBattleStruct->zmove.currZMove; - zMoveIndex = i; - } - } - } - if (zMoveIndex == 0xFF || scores[zMoveIndex] == 0) + if (IsViableZMove(battlerAtk, chosenMove)) { - return FALSE; //no available z moves - } - else - { - *chosenMoveId = zMoveIndex; - gBattleStruct->zmove.baseMoves[battlerAtk] = baseMoves[*chosenMoveId]; - gBattleStruct->zmove.currZMove = zMove; //z move the AI is looking at + #ifdef POKEMON_EXPANSION + if (defAbility == ABILITY_DISGUISE && defSpecies == SPECIES_MIMIKYU) + return 0; //Don't waste a Z-Move busting Mimikyu's disguise + if (defAbility == ABILITY_ICEFACE && defSpecies == SPECIES_EISCUE && IS_MOVE_PHYSICAL(chosenMove)) + return 0; //Don't waste a Z-Move busting Eiscue's Ice Face + #endif + + if (IS_MOVE_STATUS(chosenMove) && !IS_MOVE_STATUS(gBattleStruct->zmove.chosenZMove)) + return FALSE; + else if (!IS_MOVE_STATUS(chosenMove) && IS_MOVE_STATUS(gBattleStruct->zmove.chosenZMove)) + return FALSE; + + if (!IS_MOVE_STATUS(chosenMove) && AI_CalcDamage(chosenMove, battlerAtk, battlerDef, FALSE) >= gBattleMons[battlerDef].hp) + return FALSE; //don't waste damaging z move if regular is expected to faint target + return TRUE; } return FALSE; } - -static u8 GetZMoveScore(u8 battlerAtk, u8 battlerDef, u16 baseMove, u16 zMove) -{ - u8 score = 0; - u8 expectedDamage = 0; - u32 i; - - if (zMove != MOVE_Z_STATUS) - { - u8 defAbility = GetBattlerAbility(battlerDef); - u16 defSpecies = gBattleMons[battlerDef].species; - - /*if (baseMove == MOVE_FAKE_OUT && gDisableStructs[battlerAtk].isFirstTurn) - return FALSE; //Prefer actual Fake Out over Breakneck Blitz*/ - - /*if (MoveBlockedBySubstitute(zMove, battlerAtk, battlerDef) - || (defMovePrediction == MOVE_SUBSTITUTE - && !MoveWouldHitFirst(zMove, battlerAtk, battlerDef) - && !MoveIgnoresSubstitutes(zMove, ABILITY(battlerAtk)))) - return FALSE; //Don't use a Z-Move on a Substitute or if the enemy is going to go first and use Substitute*/ - - #ifdef POKEMON_EXPANSION - if (defAbility == ABILITY_DISGUISE && defSpecies == SPECIES_MIMIKYU) - return 0; //Don't waste a Z-Move busting Mimikyu's disguise - if (defAbility == ABILITY_ICEFACE && defSpecies == SPECIES_EISCUE && IS_MOVE_PHYSICAL(baseMove)) - return 0; //Don't waste a Z-Move busting Eiscue's Ice Face - #endif - - /*if (defMovePrediction == MOVE_PROTECT || defMovePrediction == MOVE_KINGSSHIELD || defMovePrediction == MOVE_SPIKYSHIELD || defMovePrediction == MOVE_OBSTRUCT - || (IsDynamaxed(battlerDef) && SPLIT(defMovePrediction) == SPLIT_STATUS)) - return FALSE; //Don't waste a Z-Move on a Protect*/ - - /*if (IsRaidBattle() && gNewBS->dynamaxData.raidShieldsUp && SIDE(battlerAtk) == B_SIDE_PLAYER && SIDE(battlerDef) == B_SIDE_OPPONENT) //Partner AI on Raid Pokemon with shields up - { - if (gNewBS->dynamaxData.shieldCount - gNewBS->dynamaxData.shieldsDestroyed <= 2 //Less than 3 shields left - && gNewBS->dynamaxData.stormLevel < 3) //The Raid boss hasn't almost won - return FALSE; //Don't waste a Z-Move breaking a shield - - u16 bankAtkPartner = BATTLE_PARTNER(battlerAtk); - u16 partnerMove = GetAIChosenMove(bankAtkPartner, battlerDef); - - if (SPLIT(partnerMove) == SPLIT_STATUS - || MoveWouldHitFirst(partnerMove, bankAtkPartner, battlerAtk) - || (gChosenMovesByBanks[bankAtkPartner] != MOVE_NONE && gBattleStruct->moveTarget[bankAtkPartner] != battlerDef)) //Not targeting raid Pokemon - return FALSE; //Don't waste a Z-Move if partner can't destroy shield first - }*/ - - //These moves should always be turned into Z-Moves, regardless if they KO or not - switch (gBattleMoves[baseMove].effect) - { - case EFFECT_RECHARGE: - case EFFECT_SEMI_INVULNERABLE: - case EFFECT_SKULL_BASH: - case EFFECT_SOLARBEAM: - case EFFECT_LAST_RESORT: - //todo: sky drop - return 255; - } - if (baseMove == MOVE_SKY_ATTACK) - return 255; - - gBattleStruct->zmove.active = TRUE; //for damage calc only - expectedDamage = AI_CalcDamage(baseMove, battlerAtk, battlerDef); - gBattleStruct->zmove.active = FALSE; - if (expectedDamage >= gBattleMons[battlerDef].hp) - return 0; //base move knocks out already, no need for z move - - return (expectedDamage > 255) ? 255 : expectedDamage; - } - else //Status Move - { - u8 zEffect = gBattleMoves[baseMove].zMoveEffect; - - switch (zEffect) - { - case Z_EFFECT_NONE: - return 0; - case Z_EFFECT_RESET_STATS: - for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) - { - if (i == STAT_ATK && !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) //Only reset lowered Attack if useful - continue; - else if (i == STAT_ATK && !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) //Only reset lowered Special Attack if useful - continue; - - if (STAT_STAGE(battlerAtk, i) < 6) - return 50; //Want to reset any negative stats - } - break; - case Z_EFFECT_ALL_STATS_UP_1: - if (!AreStatsMaxed(battlerAtk, STAT_EVASION)) //all battle stats maxed - return 80; - break; - case Z_EFFECT_BOOST_CRITS: - if (!(gBattleMons[battlerAtk].status2 & STATUS2_FOCUS_ENERGY)) - return 30; //kinda meh? - break; - case Z_EFFECT_FOLLOW_ME: - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - return 30; //kinda meh? - break; - case Z_EFFECT_ATK_UP_1: - if (STAT_CAN_RISE(battlerAtk, STAT_ATK) && HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) - return 60; - break; - case Z_EFFECT_ATK_UP_2: - if (STAT_CAN_RISE(battlerAtk, STAT_ATK) && HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) - return 70; - break; - case Z_EFFECT_ATK_UP_3: - if (STAT_CAN_RISE(battlerAtk, STAT_ATK) && HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) - return 80; - break; - case Z_EFFECT_DEF_UP_1: - if (STAT_CAN_RISE(battlerAtk, STAT_DEF)) - return 50; - break; - case Z_EFFECT_DEF_UP_2: - if (STAT_CAN_RISE(battlerAtk, STAT_DEF)) - return 60; - break; - case Z_EFFECT_DEF_UP_3: - if (STAT_CAN_RISE(battlerAtk, STAT_DEF)) - return 70; - break; - case Z_EFFECT_SPATK_UP_1: - if (STAT_CAN_RISE(battlerAtk, STAT_SPATK) && HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) - return 50; - break; - case Z_EFFECT_SPATK_UP_2: - if (STAT_CAN_RISE(battlerAtk, STAT_SPATK) && HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) - return 60; - break; - case Z_EFFECT_SPATK_UP_3: - if (STAT_CAN_RISE(battlerAtk, STAT_SPATK) && HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) - return 70; - break; - case Z_EFFECT_SPDEF_UP_1: - if (STAT_CAN_RISE(battlerAtk, STAT_SPDEF)) - return 50; - break; - case Z_EFFECT_SPDEF_UP_2: - if (STAT_CAN_RISE(battlerAtk, STAT_SPDEF)) - return 60; - break; - case Z_EFFECT_SPDEF_UP_3: - if (STAT_CAN_RISE(battlerAtk, STAT_SPDEF)) - return 70; - break; - case Z_EFFECT_SPD_UP_1: - if (STAT_CAN_RISE(battlerAtk, STAT_SPEED)) - return 50; - break; - case Z_EFFECT_SPD_UP_2: - if (STAT_CAN_RISE(battlerAtk, STAT_SPEED)) - return 60; - break; - case Z_EFFECT_SPD_UP_3: - if (STAT_CAN_RISE(battlerAtk, STAT_SPEED)) - return 70; - break; - case Z_EFFECT_ACC_UP_1: - if (STAT_CAN_RISE(battlerAtk, STAT_ACC)) - return 20; //TODO: only if knows low-accuracy move - break; - case Z_EFFECT_ACC_UP_2: - if (STAT_CAN_RISE(battlerAtk, STAT_ACC)) - return 40; //TODO: only if knows low-accuracy move - break; - case Z_EFFECT_ACC_UP_3: - //if (STAT_CAN_RISE(battlerAtk, STAT_ACC) && MoveInMovesetWithAccuracyLessThan(battlerAtk, battlerDef, 90, FALSE)) - if (STAT_CAN_RISE(battlerAtk, STAT_ACC)) - return 60; //TODO: only if knows low-accuracy move - break; - case Z_EFFECT_EVSN_UP_1: - if (STAT_CAN_RISE(battlerAtk, STAT_EVASION)) - return 40; - break; - case Z_EFFECT_EVSN_UP_2: - if (STAT_CAN_RISE(battlerAtk, STAT_EVASION)) - return 60; - break; - case Z_EFFECT_EVSN_UP_3: - if (STAT_CAN_RISE(battlerAtk, STAT_EVASION)) - return 80; - break; - default: //Recover HP - return 70; - } - } - - return score; -} From 9755923cc371b4053647ba0ce3ee8bae04993bed Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 1 Dec 2020 14:44:45 -0500 Subject: [PATCH 010/208] light that burns the sky split, fix electric z move anims --- data/battle_anim_scripts.s | 397 +++++++++++++++++-------------------- include/battle_util.h | 1 + src/battle_anim_new.c | 2 +- src/battle_util.c | 18 ++ src/battle_z_move.c | 7 +- 5 files changed, 210 insertions(+), 215 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index bea94c3f7..77ff627b5 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -25975,6 +25975,7 @@ Move_GIGAVOLT_HAVOC:: waitforvisualfinish launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x6 0x0 0x10 0x0000 playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gGigavoltHavocChargingSpearSpriteTemplate 0x2 0x1 ANIM_ATTACKER launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x20 0x18 0xbe 0xc 0x0 0x1 0x0 launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x50 0x18 0x16 0xc 0x0 0x1 0x0 launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x9c 0x18 0x79 0xd 0x0 0x1 0x1 @@ -26003,72 +26004,64 @@ Move_GIGAVOLT_HAVOC:: playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER monbg ANIM_ATTACKER playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x3c 0x2 0xc @charge particles to user - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0x20 0x28 0x0 0x3 +@ launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x3c 0x2 0xc @charge particles to user +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0x20 0x28 0x0 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0x60 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0xe0 0x28 0x2 0x3 delay 0x14 playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c 0x40 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c 0x40 0x28 0x1 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 delay 0x14 playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c 0x0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c 0x0 0x28 0x0 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c 0x80 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c 0x80 0x28 0x0 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 - delay 0x10 - launchtemplate gGigavoltHavocChargingSpearSpriteTemplate 0x2 0x1 ANIM_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x16 0x2c 0x20 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x16 0x2c 0x60 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x16 0x2c 0xa0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x16 0x2c 0xe0 0x28 0x2 0x3 delay 0x14 - playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x18 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x18 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x18 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x18 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 delay 0x14 - playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1a 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1a 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1a 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1a 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 delay 0x14 - playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1c 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1c 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1c 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1c 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 delay 0x14 - playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1e 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1e 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1e 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x1e 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 delay 0x14 - playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x20 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x20 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x20 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x20 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0xa 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0xa 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0xa 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0xa 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 - delay 0x10 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x2a 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x2a 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x2a 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x2a 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 waitforvisualfinish playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET launchtemplate gGigavoltHavocLaunchSpearSpriteTemplate 0x83 0x1 0x0 @@ -26082,38 +26075,37 @@ Move_GIGAVOLT_HAVOC:: loadspritegfx ANIM_TAG_SHOCK_3 @thunderbolt launchtemplate gThunderboltOrbSpriteTemplate 0x83 0x4 0x2c 0x0 0x0 0x3 launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x0 0x0 0xc 0x5bff - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0x20 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0x60 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0xe0 0x28 0x2 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0x20 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0x60 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0xe0 0x28 0x2 0x8003 playsewithpan SE_M_HYPER_BEAM, SOUND_PAN_TARGET delay 0x19 loadspritegfx ANIM_TAG_VERTICAL_HEX - launchtemplate gGigavoltHavocRingsSpriteTemplate 0x83 0x4 0x0 0x0 0x100 0x0 playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET - call HavocSpearSparkTarget +@ call HavocSpearSparkTarget call HavocSpearGeyser playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET - call HavocSpearSparkTarget +@ call HavocSpearSparkTarget call HavocSpearGeyser playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET - call HavocSpearSparkTarget +@ call HavocSpearSparkTarget call HavocSpearGeyser playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET - call HavocSpearSparkTarget +@ call HavocSpearSparkTarget call HavocSpearGeyser playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET - call HavocSpearSparkTarget +@ call HavocSpearSparkTarget call HavocSpearGeyser playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET - call HavocSpearSparkTarget +@ call HavocSpearSparkTarget call HavocSpearGeyser playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET - call HavocSpearSparkTarget +@ call HavocSpearSparkTarget call HavocSpearGeyser playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_DEF, 0x2, 0xc, 0x0, 0x5bff @@ -26125,22 +26117,22 @@ Move_GIGAVOLT_HAVOC:: end HavocSpearGeyser: createsprite gGigavoltHavocGeyserSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfffc, 0x10 @ -4, -0x10 - delay 0x0 + delay 1 createsprite gGigavoltHavocGeyserSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x100D, 0x10 @ - delay 0x0 + delay 1 createsprite gGigavoltHavocGeyserSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x4, 0x10 - delay 0x0 + delay 1 createsprite gGigavoltHavocGeyserSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x10 - delay 0x0 + delay 1 return HavocSpearSparkTarget: - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc 0x0 0x14 0x0 0x8000 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc 0x0 0x14 0x0 0x8000 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x0 0x14 0x0 0x8000 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc 0x40 0x14 0x1 0x8000 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc 0x40 0x14 0x1 0x8000 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x40 0x14 0x1 0x8000 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc 0x80 0x14 0x0 0x8000 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc 0x80 0x14 0x0 0x8000 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x80 0x14 0x0 0x8000 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc SOUND_PAN_ATTACKER 0x14 0x2 0x8000 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc SOUND_PAN_ATTACKER 0x14 0x2 0x8000 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc SOUND_PAN_ATTACKER 0x14 0x2 0x8000 return @@ -27020,18 +27012,18 @@ CatastropikaFinish: launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0x60 0x28 0x1 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0xe0 0x28 0x2 0x3 - delay 0x14 - playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 - delay 0x14 - playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 +@ delay 0x14 +@ playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c 0x0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c 0x40 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c 0x80 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 +@ delay 0x14 +@ playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x40 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x80 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 delay 0x14 playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER launchtemplate gGrowingChargeOrbSpriteTemplate 0x2 0x1 ANIM_ATTACKER @ charge @@ -27065,24 +27057,29 @@ CatastropikaFinish: launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 delay 0x14 playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0xa 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0xa 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0xa 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0xa 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 - delay 0x10 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 restorebg waitbgfadeout playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER @@ -27117,31 +27114,11 @@ CatastropikaFinish: call CatastropikaThundering invisible ANIM_TARGET unloadspritegfx ANIM_TAG_MUD_SAND - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 call CatastropikaThundering - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 call CatastropikaThundering - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 call CatastropikaThundering launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x4, 0x0, 0x10, 0x7fff @ bg to white - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 call CatastropikaThundering - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 waitforvisualfinish launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x4, 0x10, 0x0, 0x7fff @ bg to white launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 @fix tgt position @@ -27152,17 +27129,17 @@ CatastropikaFinish: CatastropikaThundering: playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0xfff0 - delay 0x1 + delay 2 launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0x10 - delay 0x1 + delay 2 launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0xfff0 - delay 0x1 + delay 2 launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0x10 - delay 0x1 + delay 2 launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0xfff0 - delay 0x1 + delay 2 launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0x10 - delay 0x1 + delay 2 return @@ -27185,10 +27162,10 @@ Move_10000000_VOLT_THUNDERBOLT:: launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0xa0 0x28 0x0 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0xe0 0x28 0x2 0x3 delay 0x2 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0x20 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0x60 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0xa0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0xe0 0x28 0x2 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0x20 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0x60 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0xa0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0xe0 0x28 0x2 0x3 delay 0x2 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0x20 0x28 0x0 0x3 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0x60 0x28 0x1 0x3 @@ -27228,10 +27205,10 @@ Move_10000000_VOLT_THUNDERBOLT:: launchtemplate gLightningSpriteTemplate 0x82 0x2 0x40 0xc delay 0x14 playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x40 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x80 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 delay 0x14 playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET launchtask AnimTask_InvertScreenColor 0x2 0x3 0x101 0x101 0x101 @thunder flash @@ -27256,10 +27233,10 @@ Move_10000000_VOLT_THUNDERBOLT:: launchtemplate gLightningSpriteTemplate 0x82 0x2 0xff90 0xc delay 0x14 playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x40 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x80 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 delay 0x10 playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET launchtask AnimTask_InvertScreenColor 0x2 0x3 0x101 0x101 0x101 @thunder flash @@ -27269,10 +27246,10 @@ Move_10000000_VOLT_THUNDERBOLT:: delay 0x1 launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffd0 0xc playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x0 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x40 0x28 0x1 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x80 0x28 0x0 0x3 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x40 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x80 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 waitforvisualfinish call UnsetPsychicBg visible ANIM_TARGET @@ -27284,7 +27261,7 @@ Move_10000000_VOLT_THUNDERBOLT:: loadspritegfx ANIM_TAG_POISON_BUBBLE @purple loopsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER, 0x5, 0xA launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_ATTACKER 0x0 0x4 0x32 0x1 - launchtask AnimTask_FlashAnimTagWithColor, 0x2, 0x7, ANIM_TAG_ORBS, 0x1, 0xc, 0x1f, 0x10, 0x0, 0x0 +@ launchtask AnimTask_FlashAnimTagWithColor, 0x2, 0x7, ANIM_TAG_ORBS, 0x1, 0xc, 0x1f, 0x10, 0x0, 0x0 call TenMillionVoltThunderboltBeamRed call TenMillionVoltThunderboltBeamBlue launchtask AnimTask_ShakeMon2 0x2 0x5 ANIM_TARGET 0x4 0x0 0x32 0x1 @@ -27305,28 +27282,28 @@ Move_10000000_VOLT_THUNDERBOLT:: call TenMillionVoltThunderboltBeamPink call TenMillionVoltThunderboltBeamYellow call TenMillionVoltThunderboltBeamGreen - call TenMillionVoltThunderboltBeamPurple - call TenMillionVoltThunderboltBeamRed - call TenMillionVoltThunderboltBeamBlue - call TenMillionVoltThunderboltBeamPink - call TenMillionVoltThunderboltBeamYellow - call TenMillionVoltThunderboltBeamGreen - call TenMillionVoltThunderboltBeamPurple +@ call TenMillionVoltThunderboltBeamPurple +@ call TenMillionVoltThunderboltBeamRed +@ call TenMillionVoltThunderboltBeamBlue +@ call TenMillionVoltThunderboltBeamPink +@ call TenMillionVoltThunderboltBeamYellow +@ call TenMillionVoltThunderboltBeamGreen +@ call TenMillionVoltThunderboltBeamPurple playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 - delay 0x6 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 - delay 0x6 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 +@ delay 0x6 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 +@ delay 0x6 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER launchtemplate g10MillionVoltBoltShockwaveSpriteTemplate 0x82 0x0 @ charge out and in waitforvisualfinish @@ -27338,15 +27315,15 @@ Move_10000000_VOLT_THUNDERBOLT:: unloadspritegfx ANIM_TAG_POISON_BUBBLE @purple loadspritegfx ANIM_TAG_EXPLOSION @explosion launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x2 0x2c - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x00 0x30 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x00 0x30 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 call TenMillionVoltThunderboltSparkGeyser - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x00 0x37 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x00 0x37 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x2, 0x0, 0x10, 0x7fff call TenMillionVoltThunderboltSparkGeyser waitforvisualfinish @@ -27359,62 +27336,62 @@ Move_10000000_VOLT_THUNDERBOLT:: TenMillionVoltThunderboltBeamRed: launchtemplate g10MillionVoltBoltRedBeamSpriteTemplate 0x82 0x0 launchtemplate g10MillionVoltBoltRedBeamSpriteTemplate 0x82 0x0 - delay 0x1 + delay 4 return TenMillionVoltThunderboltBeamBlue: launchtemplate g10MillionVoltBoltBlueBeamSpriteTemplate 0x82 0x0 launchtemplate g10MillionVoltBoltBlueBeamSpriteTemplate 0x82 0x0 - delay 0x1 + delay 4 return TenMillionVoltThunderboltBeamPink: launchtemplate g10MillionVoltBoltPinkBeamSpriteTemplate 0x82 0x0 launchtemplate g10MillionVoltBoltPinkBeamSpriteTemplate 0x82 0x0 - delay 0x1 + delay 4 return TenMillionVoltThunderboltBeamYellow: launchtemplate g10MillionVoltBoltYellowBeamSpriteTemplate 0x82 0x0 launchtemplate g10MillionVoltBoltYellowBeamSpriteTemplate 0x82 0x0 - delay 0x1 + delay 4 return TenMillionVoltThunderboltBeamGreen: launchtemplate g10MillionVoltBoltGreenBeamSpriteTemplate 0x82 0x0 launchtemplate g10MillionVoltBoltGreenBeamSpriteTemplate 0x82 0x0 - delay 0x1 + delay 4 return TenMillionVoltThunderboltBeamPurple: launchtemplate g10MillionVoltBoltPurpleBeamSpriteTemplate 0x82 0x0 launchtemplate g10MillionVoltBoltPurpleBeamSpriteTemplate 0x82 0x0 - delay 0x1 + delay 4 return TenMillionVoltThunderboltSparkGeyser: playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x8003 delay 0x4 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x80 0x28 0x0 0x8003 delay 0x4 playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x80 0x28 0x0 0x8003 delay 0x4 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x80 0x28 0x0 0x8003 delay 0x4 playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 @@ -27538,28 +27515,28 @@ StokedSparksurferFinish: StokedSparksurferSparkGeyser: playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x40 0x28 0x1 0x8003 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x80 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x8003 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x8003 delay 0x4 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x0 0x28 0x0 0x8003 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x80 0x28 0x0 0x8003 delay 0x4 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x0 0x28 0x0 0x8003 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x80 0x28 0x0 0x8003 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x40 0x28 0x1 0x8003 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x80 0x28 0x0 0x8003 delay 0x4 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x0 0x28 0x0 0x8003 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x40 0x28 0x1 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x80 0x28 0x0 0x8003 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x0 0x28 0x0 0x8003 - launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x40 0x28 0x1 0x8003 launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x80 0x28 0x0 0x8003 delay 0x1a return diff --git a/include/battle_util.h b/include/battle_util.h index 31e410f17..2584dcb68 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -131,5 +131,6 @@ bool32 SetIllusionMon(struct Pokemon *mon, u32 battlerId); bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 battlerId); u8 GetBattleMoveSplit(u32 moveId); bool32 IsPartnerMonFromSameTrainer(u8 battlerId); +u8 GetSplitBasedOnStats(u8 battlerId); #endif // GUARD_BATTLE_UTIL_H diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index f3592fbcd..1c039e56f 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -4688,7 +4688,7 @@ const struct SpriteTemplate gGigavoltHavocGeyserSpriteTemplate = .anims = gRazorLeafParticleAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = SpriteCB_Geyser + .callback = SpriteCB_GeyserTarget }; // shattered psyche diff --git a/src/battle_util.c b/src/battle_util.c index 9a5ca9dcf..047b7be0a 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7823,3 +7823,21 @@ u8 GetBattleMoveSplit(u32 moveId) else return SPLIT_SPECIAL; } + +//photon geyser & light that burns the sky +u8 GetSplitBasedOnStats(u8 battlerId) +{ + u32 attack = gBattleMons[battlerId].attack; + u32 spAttack = gBattleMons[battlerId].spAttack; + + attack = attack * gStatStageRatios[gBattleMons[battlerId].statStages[STAT_ATK]][0]; + attack = attack / gStatStageRatios[gBattleMons[battlerId].statStages[STAT_ATK]][1]; + + spAttack = spAttack * gStatStageRatios[gBattleMons[battlerId].statStages[STAT_SPATK]][0]; + spAttack = spAttack / gStatStageRatios[gBattleMons[battlerId].statStages[STAT_SPATK]][1]; + + if (spAttack >= attack) + return SPLIT_SPECIAL; + else + return SPLIT_PHYSICAL; +} diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 3bb67f684..eca0cd518 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -142,7 +142,8 @@ void QueueZMove(u8 battlerId, u16 baseMove) { gBattleStruct->zmove.toBeUsed[battlerId] = gBattleStruct->zmove.chosenZMove; gBattleStruct->zmove.baseMoves[battlerId] = baseMove; - //TODO - light that burns the sky + if (gBattleStruct->zmove.chosenZMove == MOVE_LIGHT_THAT_BURNS_THE_SKY) + gBattleStruct->zmove.splits[battlerId] = GetSplitBasedOnStats(battlerId); gBattleStruct->zmove.splits[battlerId] = gBattleMoves[baseMove].split; } @@ -174,7 +175,7 @@ bool32 IsViableZMove(u8 battlerId, u16 move) return FALSE; #ifdef ITEM_Z_RING - if (!CheckBagHasItem(ITEM_Z_RING, 1)) + if ((GetBattlerPosition(battlerId) == B_POSITION_PLAYER_LEFT || (!gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(battlerId) == B_POSITION_PLAYER_RIGHT) && !CheckBagHasItem(ITEM_Z_RING, 1)) return FALSE; #endif @@ -243,7 +244,6 @@ bool32 IsZMoveUsable(u8 battlerId, u16 moveIndex) bool32 TryChangeZIndicator(u8 battlerId, u8 moveIndex) { - //bool32 viableZMove = IsViableZMove(battlerId, move); bool32 viableZMove = IsZMoveUsable(battlerId, moveIndex); if (gBattleStruct->zmove.viable && !viableZMove) @@ -269,7 +269,6 @@ void CreateZMoveTriggerSprite(u8 battlerId, bool8 viable) { s16 x, y; - // TODO: test mega trigger and z trigger together LoadSpritePalette(&sSpritePalette_ZMoveTrigger); if (GetSpriteTileStartByTag(TAG_ZMOVE_TRIGGER_TILE) == 0xFFFF) LoadCompressedSpriteSheetUsingHeap(&sSpriteSheet_ZMoveTrigger); From f54cd0b25d3102849635ff6cca1e113686b7698d Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 1 Dec 2020 15:35:39 -0500 Subject: [PATCH 011/208] fix z effect scripts --- data/battle_scripts_1.s | 18 ++++++++++++++---- include/battle.h | 14 +++++++------- include/battle_scripts.h | 1 + src/battle_message.c | 14 +++++++------- src/battle_script_commands.c | 10 ++++++++++ src/battle_util.c | 4 ++-- src/battle_z_move.c | 21 +++++++++------------ 7 files changed, 50 insertions(+), 32 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 7301e53ae..66d1936e7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7701,8 +7701,8 @@ BattleScript_ZMoveActivateStatus:: printstring STRINGID_ZPOWERSURROUNDS playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL setzeffect - printstring STRINGID_ZMOVEUNLEASHED - waitmessage 0x40 +@ printstring STRINGID_ZMOVEUNLEASHED +@ waitmessage 0x40 return BattleScript_ZEffectPrintString:: @@ -7719,12 +7719,22 @@ BattleScript_RecoverHPZMove:: BattleScript_StatUpZMove:: statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StatUpZMoveEnd - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x3, BattleScript_StatUpZMoveEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatUpZMoveEnd playanimation BS_SCRIPTING, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 - printfromtable gZEffectStringIds + printstring STRINGID_ZMOVESTATUP + waitmessage 0x40 + printfromtable gStatUpStringIds waitmessage 0x40 BattleScript_StatUpZMoveEnd: return + +BattleScript_HealReplacementZMove:: + playanimation BS_SCRIPTING B_ANIM_WISH_HEAL 0x0 + printfromtable gZEffectStringIds + waitmessage 0x40 + healthbarupdate BS_SCRIPTING + datahpupdate BS_SCRIPTING + return BattleScript_EffectExtremeEvoboost:: attackcanceler diff --git a/include/battle.h b/include/battle.h index 86205ad10..b73edb791 100644 --- a/include/battle.h +++ b/include/battle.h @@ -430,18 +430,18 @@ struct Illusion struct ZMoveData { /*0x00*/ u8 viable:1; // current move can become a z move - u8 viewing:1; //if player is viewing the z move name instead of regular moves - u8 active:1; //is z move being used this turn + u8 viewing:1; // if player is viewing the z move name instead of regular moves + u8 active:1; // is z move being used this turn u8 zStatusActive:1; - u8 healReplacement:1; //TODO: z-parting shot - u8 activeSplit:1; //active z move split - u8 zUnused:2; + u8 healReplacement:1; + u8 activeSplit:2; // active z move split + u8 zUnused:1; /*0x01*/ u8 triggerSpriteId; /*0x02*/ u8 possibleZMoves[MAX_BATTLERS_COUNT]; - /*0x02*/ u16 chosenZMove; //z move of move cursor is on + /*0x02*/ u16 chosenZMove; // z move of move cursor is on u8 effect; u8 used[MAX_BATTLERS_COUNT]; //one per bank for multi-battles - u16 toBeUsed[MAX_BATTLERS_COUNT]; //TODO z moves per battler to be used + u16 toBeUsed[MAX_BATTLERS_COUNT]; // z moves per battler to be used u16 baseMoves[MAX_BATTLERS_COUNT]; u8 splits[MAX_BATTLERS_COUNT]; }; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 830fa9453..553402f7d 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -355,6 +355,7 @@ extern const u8 BattleScript_ZMoveActivateStatus[]; extern const u8 BattleScript_ZEffectPrintString[]; extern const u8 BattleScript_RecoverHPZMove[]; extern const u8 BattleScript_StatUpZMove[]; +extern const u8 BattleScript_HealReplacementZMove[]; extern const u8 BattleScript_EffectExtremeEvoboost[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/src/battle_message.c b/src/battle_message.c index c634e1646..145c998d7 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -680,12 +680,12 @@ static const u8 sText_CloakedInAFreezingLight[] = _("{B_ATK_NAME_WITH_PREFIX} be static const u8 sText_StatWasNotLowered[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\nwas not lowered!"); static const u8 sText_ZPowerSurrounds[] = _("{B_ATK_NAME_WITH_PREFIX} surrounds\nitself with its Z-Power!"); static const u8 sText_ZPowerUnleashed[] = _("{B_ATK_NAME_WITH_PREFIX} unleashes\nits full-force Z-Move!"); -static const u8 sText_ZMoveResetsStats[] = _(""); -static const u8 sText_ZMoveAllStatsUp[] = _(""); -static const u8 sText_ZMoveBoostCrit[] = _(""); -static const u8 sText_ZMoveRestoreHp[] = _(""); -static const u8 sText_ZMoveStatUp[] = _(""); -static const u8 sText_ZMoveHpSwitchInTrap[] = _(""); +static const u8 sText_ZMoveResetsStats[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} returned its\ndecreased stats to normal using\lits Z-Power!"); +static const u8 sText_ZMoveAllStatsUp[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted all\nof its stats using its Z-Power!"); +static const u8 sText_ZMoveBoostCrit[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted its\ncritical-hit ratio using its Z-Power!"); +static const u8 sText_ZMoveRestoreHp[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} restored its\nHP using its Z-Power!"); +static const u8 sText_ZMoveStatUp[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted\nits stats using its Z-Power!"); +static const u8 sText_ZMoveHpSwitchInTrap[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s HP was restored by the Z-Power!"); static const u8 sText_TerrainReturnedToNormal[] = _("The terrain returned to\nnormal!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = @@ -2579,7 +2579,7 @@ void BufferStringBattle(u16 stringID) } break; case STRINGID_USEDMOVE: // pokemon used a move msg - if (gBattleStruct->zmove.active) + if (gBattleStruct->zmove.active && gBattleStruct->zmove.activeSplit != SPLIT_STATUS) StringCopy(gBattleTextBuff3, GetZMoveName(gBattleMsgDataPtr->currentMove)); else if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT) StringCopy(gBattleTextBuff3, sATypeMove_Table[*(&gBattleStruct->stringMoveType)]); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a40cad90b..9164a15ea 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5866,6 +5866,16 @@ static void Cmd_switchineffects(void) BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_StickyWebOnSwitchIn; } + else if (gBattleMons[gActiveBattler].hp != gBattleMons[gActiveBattler].maxHP && gBattleStruct->zmove.healReplacement) + { + gBattleStruct->zmove.healReplacement = FALSE; + gBattleMoveDamage = -1 * (gBattleMons[gActiveBattler].maxHP); + gBattleScripting.battler = gActiveBattler; + BattleScriptPushCursor(); + gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_HP_TRAP; + gBattlescriptCurrInstr = BattleScript_HealReplacementZMove; + return; + } else { // There is a hack here to ensure the truant counter will be 0 when the battler's next turn starts. diff --git a/src/battle_util.c b/src/battle_util.c index 047b7be0a..6789b52ec 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -124,7 +124,7 @@ void HandleAction_UseMove(void) } // check z move used - if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker]) + if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker] != MOVE_NONE && !IS_MOVE_STATUS(gCurrentMove)) { gCurrentMove = gBattleStruct->zmove.toBeUsed[gBattlerAttacker]; } @@ -3198,7 +3198,7 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->zmove.used[BATTLE_PARTNER(gBattlerAttacker)] = TRUE; //if 1v1 double, set partner used flag as well gBattleScripting.battler = gBattlerAttacker; - if (IS_MOVE_STATUS(gBattleStruct->zmove.splits[gBattlerAttacker])) + if (gBattleStruct->zmove.activeSplit == SPLIT_STATUS) { gBattleStruct->zmove.effect = gBattleMoves[gBattleStruct->zmove.baseMoves[gBattlerAttacker]].zMoveEffect; BattleScriptPushCursor(); diff --git a/src/battle_z_move.c b/src/battle_z_move.c index eca0cd518..81b0b01d1 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -593,7 +593,7 @@ void SetZEffect(void) } gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_RESET_STATS; BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); - gBattlescriptCurrInstr = BattleScript_ZEffectPrintString - Z_EFFECT_BS_LENGTH; + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; break; case Z_EFFECT_ALL_STATS_UP_1: if (!AreStatsMaxed(gBattlerAttacker, STAT_SPDEF)) @@ -605,7 +605,7 @@ void SetZEffect(void) } gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_ALL_STATS_UP; BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); - gBattlescriptCurrInstr = BattleScript_ZEffectPrintString - Z_EFFECT_BS_LENGTH; + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; } break; case Z_EFFECT_BOOST_CRITS: @@ -614,7 +614,7 @@ void SetZEffect(void) gBattleMons[gBattlerAttacker].status2 |= STATUS2_FOCUS_ENERGY; gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_BOOST_CRITS; BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); - gBattlescriptCurrInstr = BattleScript_ZEffectPrintString - Z_EFFECT_BS_LENGTH; + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; } break; case Z_EFFECT_FOLLOW_ME: @@ -622,7 +622,7 @@ void SetZEffect(void) gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTarget = gBattlerAttacker; gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_FOLLOW_ME; BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); - gBattlescriptCurrInstr = BattleScript_ZEffectPrintString - Z_EFFECT_BS_LENGTH; + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; break; case Z_EFFECT_RECOVER_HP: if (gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP) @@ -630,14 +630,14 @@ void SetZEffect(void) gBattleMoveDamage = (-1) * gBattleMons[gBattlerAttacker].maxHP; gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_RECOVER_HP; BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); - gBattlescriptCurrInstr = BattleScript_RecoverHPZMove - Z_EFFECT_BS_LENGTH; + gBattlescriptCurrInstr = BattleScript_RecoverHPZMove; } break; case Z_EFFECT_RESTORE_REPLACEMENT_HP: gBattleStruct->zmove.healReplacement = TRUE; BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_HP_TRAP; - gBattlescriptCurrInstr = BattleScript_ZEffectPrintString - Z_EFFECT_BS_LENGTH; + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; break; case Z_EFFECT_ATK_UP_1: case Z_EFFECT_DEF_UP_1: @@ -649,9 +649,8 @@ void SetZEffect(void) SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_1 + 1, 1, FALSE); gBattleScripting.animArg1 = 0xE + (gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_1 + 1); gBattleScripting.animArg2 = 0; - gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_STAT_UP; BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); - gBattlescriptCurrInstr = BattleScript_StatUpZMove - Z_EFFECT_BS_LENGTH; + gBattlescriptCurrInstr = BattleScript_StatUpZMove; break; case Z_EFFECT_ATK_UP_2: case Z_EFFECT_DEF_UP_2: @@ -663,9 +662,8 @@ void SetZEffect(void) SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_2 + 1, 2, FALSE); gBattleScripting.animArg1 = 0xE + (gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_2 + 1); gBattleScripting.animArg2 = 0; - gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_STAT_UP; BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); - gBattlescriptCurrInstr = BattleScript_StatUpZMove - Z_EFFECT_BS_LENGTH; + gBattlescriptCurrInstr = BattleScript_StatUpZMove; break; case Z_EFFECT_ATK_UP_3: case Z_EFFECT_DEF_UP_3: @@ -677,9 +675,8 @@ void SetZEffect(void) SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_3 + 1, 3, FALSE); gBattleScripting.animArg1 = 0xE + (gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_3 + 1); gBattleScripting.animArg2 = 0; - gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_STAT_UP; BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); - gBattlescriptCurrInstr = BattleScript_StatUpZMove - Z_EFFECT_BS_LENGTH; + gBattlescriptCurrInstr = BattleScript_StatUpZMove; break; default: gBattlescriptCurrInstr += 3; From 25abdeacc53d244f698363346a276adaef870861 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 1 Dec 2020 16:36:44 -0500 Subject: [PATCH 012/208] tidy up z move code --- include/battle.h | 32 +- include/battle_ai_script_commands.h | 1 - include/battle_message.h | 2 +- include/constants/items.h | 42 +- ld_script.txt | 4 +- src/battle_ai_script_commands.c | 2 +- src/battle_main.c | 2 +- src/battle_z_move.c | 9 - src/data/battle_moves.h | 2353 ++++++++++++++++++++++++--- src/data/items.h | 545 ------- src/data/trainer_parties.h | 8 +- src/data/trainers.h | 4 +- 12 files changed, 2142 insertions(+), 862 deletions(-) diff --git a/include/battle.h b/include/battle.h index cae439ad7..f91809be5 100644 --- a/include/battle.h +++ b/include/battle.h @@ -429,21 +429,21 @@ struct Illusion struct ZMoveData { - /*0x00*/ u8 viable:1; // current move can become a z move - u8 viewing:1; // if player is viewing the z move name instead of regular moves - u8 active:1; // is z move being used this turn - u8 zStatusActive:1; - u8 healReplacement:1; - u8 activeSplit:2; // active z move split - u8 zUnused:1; - /*0x01*/ u8 triggerSpriteId; - /*0x02*/ u8 possibleZMoves[MAX_BATTLERS_COUNT]; - /*0x02*/ u16 chosenZMove; // z move of move cursor is on - u8 effect; - u8 used[MAX_BATTLERS_COUNT]; //one per bank for multi-battles - u16 toBeUsed[MAX_BATTLERS_COUNT]; // z moves per battler to be used - u16 baseMoves[MAX_BATTLERS_COUNT]; - u8 splits[MAX_BATTLERS_COUNT]; + u8 viable:1; // current move can become a z move + u8 viewing:1; // if player is viewing the z move name instead of regular moves + u8 active:1; // is z move being used this turn + u8 zStatusActive:1; + u8 healReplacement:1; + u8 activeSplit:2; // active z move split + u8 zUnused:1; + u8 triggerSpriteId; + u8 possibleZMoves[MAX_BATTLERS_COUNT]; + u16 chosenZMove; // z move of move cursor is on + u8 effect; + u8 used[MAX_BATTLERS_COUNT]; //one per bank for multi-battles + u16 toBeUsed[MAX_BATTLERS_COUNT]; // z moves per battler to be used + u16 baseMoves[MAX_BATTLERS_COUNT]; + u8 splits[MAX_BATTLERS_COUNT]; }; struct BattleStruct @@ -745,7 +745,7 @@ extern u16 gBattle_WIN1V; extern u8 gDisplayedStringBattle[400]; extern u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT]; extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT]; -extern u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT]; +extern u8 gBattleTextBuff3[30]; //to handle stupidly large z move names extern u32 gBattleTypeFlags; extern u8 gBattleTerrain; extern u32 gUnknown_02022FF4; diff --git a/include/battle_ai_script_commands.h b/include/battle_ai_script_commands.h index 6a7300cba..d2a861339 100644 --- a/include/battle_ai_script_commands.h +++ b/include/battle_ai_script_commands.h @@ -23,6 +23,5 @@ void RecordAbilityBattle(u8 battlerId, u16 abilityId); void ClearBattlerAbilityHistory(u8 battlerId); void RecordItemEffectBattle(u8 battlerId, u8 itemEffect); void ClearBattlerItemEffectHistory(u8 battlerId); -bool32 HasMoveWithSplit(u32 battler, u32 split); #endif // GUARD_BATTLE_AI_SCRIPT_COMMANDS_H diff --git a/include/battle_message.h b/include/battle_message.h index c2f6bd8c6..bc4ce8f00 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -1,7 +1,7 @@ #ifndef GUARD_BATTLE_MESSAGE_H #define GUARD_BATTLE_MESSAGE_H -#define TEXT_BUFF_ARRAY_COUNT 20 //expanded for z move names +#define TEXT_BUFF_ARRAY_COUNT 16 // for 0xFD #define B_TXT_BUFF1 0x0 diff --git a/include/constants/items.h b/include/constants/items.h index 72a5bc71c..95c6aacfe 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -464,47 +464,7 @@ #define ITEM_MAGMA_EMBLEM 375 #define ITEM_OLD_SEA_MAP 376 - - -#define ITEM_NORMALIUM_Z 568 -#define ITEM_FIGHTINIUM_Z 569 -#define ITEM_FLYINIUM_Z 570 -#define ITEM_POISONIUM_Z 571 -#define ITEM_GROUNDIUM_Z 572 -#define ITEM_ROCKIUM_Z 573 -#define ITEM_BUGINIUM_Z 574 -#define ITEM_GHOSTIUM_Z 575 -#define ITEM_STEELIUM_Z 576 -#define ITEM_FIRIUM_Z 577 -#define ITEM_WATERIUM_Z 578 -#define ITEM_GRASSIUM_Z 579 -#define ITEM_ELECTRIUM_Z 580 -#define ITEM_PSYCHIUM_Z 581 -#define ITEM_ICIUM_Z 582 -#define ITEM_DRAGONIUM_Z 583 -#define ITEM_DARKINIUM_Z 584 -#define ITEM_FAIRIUM_Z 585 -#define ITEM_ALORAICHIUM_Z 586 -#define ITEM_DECIDIUM_Z 587 -#define ITEM_EEVIUM_Z 588 -#define ITEM_INCINIUM_Z 589 -#define ITEM_KOMMONIUM_Z 590 -#define ITEM_LUNALIUM_Z 591 -#define ITEM_LYCANIUM_Z 592 -#define ITEM_MARSHADIUM_Z 593 -#define ITEM_MEWNIUM_Z 594 -#define ITEM_MIMIKIUM_Z 595 -#define ITEM_PIKANIUM_Z 596 -#define ITEM_PIKASHUNIUM_Z 597 -#define ITEM_PRIMARIUM_Z 598 -#define ITEM_SNORLIUM_Z 599 -#define ITEM_SOLGANIUM_Z 600 -#define ITEM_TAPUNIUM_Z 601 - - - - -#define ITEMS_COUNT 602 +#define ITEMS_COUNT 377 #define ITEM_FIELD_ARROW ITEMS_COUNT #define FIRST_BERRY_INDEX ITEM_CHERI_BERRY diff --git a/ld_script.txt b/ld_script.txt index a7a7075fb..1f8822667 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -87,7 +87,7 @@ SECTIONS { src/battle_bg.o(.text); src/battle_main.o(.text); src/battle_util.o(.text); - src/battle_z_move.o(.text); + src/battle_z_move.o(.text); src/battle_script_commands.o(.text); src/battle_util2.o(.text); src/battle_controller_player.o(.text); @@ -475,7 +475,7 @@ SECTIONS { src/battle_bg.o(.rodata); src/battle_main.o(.rodata); src/battle_util.o(.rodata); - src/battle_z_move.o(.rodata); + src/battle_z_move.o(.rodata); src/battle_script_commands.o(.rodata); src/battle_controller_player.o(.rodata); src/battle_anim_smokescreen.o(.rodata); diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index 4eb9987e7..553489369 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -2610,7 +2610,7 @@ static u16 *GetMovesArray(u32 battler) return gBattleResources->battleHistory->usedMoves[battler]; } -bool32 HasMoveWithSplit(u32 battler, u32 split) +static bool32 HasMoveWithSplit(u32 battler, u32 split) { s32 i; u16 *moves = GetMovesArray(battler); diff --git a/src/battle_main.c b/src/battle_main.c index 40141f208..91fc9efb3 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -134,7 +134,7 @@ EWRAM_DATA u16 gBattle_WIN1V = 0; EWRAM_DATA u8 gDisplayedStringBattle[400] = {0}; EWRAM_DATA u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT] = {0}; EWRAM_DATA u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT] = {0}; -EWRAM_DATA u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT] = {0}; +EWRAM_DATA u8 gBattleTextBuff3[30] = {0}; //expanded for stupidly long z move names EWRAM_DATA u32 gBattleTypeFlags = 0; EWRAM_DATA u8 gBattleTerrain = 0; EWRAM_DATA u32 gUnknown_02022FF4 = 0; diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 81b0b01d1..7f45b867f 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -160,17 +160,8 @@ bool32 IsViableZMove(u8 battlerId, u16 move) if (gBattleStruct->zmove.used[battlerId]) return FALSE; - // Gets mon data species = gBattleMons[battlerId].species; item = gBattleMons[battlerId].item; - /*if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT) - mon = &gEnemyParty[gBattlerPartyIndexes[battlerId]]; - else - mon = &gPlayerParty[gBattlerPartyIndexes[battlerId]]; - - species = GetMonData(mon, MON_DATA_SPECIES); - item = GetMonData(mon, MON_DATA_HELD_ITEM);*/ - if (gBattleTypeFlags & (BATTLE_TYPE_SAFARI | BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_FRONTIER)) return FALSE; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 0760c6160..702c9af38 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -208,6 +208,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_RAZOR_WIND] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif .effect = EFFECT_TWO_TURNS_ATTACK, .power = 80, .type = TYPE_NORMAL, @@ -216,7 +221,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_BOTH, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_SPECIAL, .zMovePower = 160, .zMoveEffect = Z_EFFECT_NONE, @@ -224,11 +228,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SWORDS_DANCE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .pp = 20, + #else + .pp = 30, + #endif .effect = EFFECT_ATTACK_UP_2, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, - .pp = 30, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, @@ -288,15 +296,23 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_WHIRLWIND] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .accuracy = 0, + .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #elif B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 100, + .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .accuracy = 100, + .flags = FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_ROAR, .power = 0, .type = TYPE_NORMAL, - .accuracy = 100, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = -6, - .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPDEF_UP_1, @@ -304,8 +320,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FLY] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .power = 90, + #else + .power = 70, + #endif .effect = EFFECT_SEMI_INVULNERABLE, - .power = 90, .type = TYPE_FLYING, .accuracy = 95, .pp = 15, @@ -320,10 +340,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_BIND] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 85, + #else + .accuracy = 75, + #endif .effect = EFFECT_TRAP, .power = 15, .type = TYPE_NORMAL, - .accuracy = 85, .pp = 20, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, @@ -352,11 +376,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_VINE_WHIP] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 45, + .pp = 25, + #elif B_UPDATED_MOVE_DATA >= GEN_4 + .power = 35, + .pp = 15, + #else + .power = 35, + .pp = 10, + #endif .effect = EFFECT_HIT, - .power = 45, .type = TYPE_GRASS, .accuracy = 100, - .pp = 25, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -416,11 +448,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_JUMP_KICK] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 100, + .pp = 10, + #elif B_UPDATED_MOVE_DATA == GEN_4 + .power = 85, + .pp = 25, + #else + .power = 70, + .pp = 25, + #endif .effect = EFFECT_RECOIL_IF_MISS, - .power = 100, .type = TYPE_FIGHTING, .accuracy = 95, - .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -528,10 +568,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_TACKLE] = { + #if B_UPDATED_MOVE_DATA >= GEN_7 + .power = 40, + .accuracy = 100, + #elif B_UPDATED_MOVE_DATA >= GEN_5 + .power = 50, + .accuracy = 100, + #else + .power = 35, + .accuracy = 95, + #endif .effect = EFFECT_HIT, - .power = 40, .type = TYPE_NORMAL, - .accuracy = 100, .pp = 35, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -560,10 +608,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_WRAP] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 90, + #else + .accuracy = 85, + #endif .effect = EFFECT_TRAP, .power = 15, .type = TYPE_NORMAL, - .accuracy = 85, .pp = 20, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, @@ -592,11 +644,16 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_THRASH] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 120, + .pp = 10, + #else + .power = 90, + .pp = 20, + #endif .effect = EFFECT_RAMPAGE, - .power = 120, .type = TYPE_NORMAL, .accuracy = 100, - .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_RANDOM, .priority = 0, @@ -672,10 +729,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_PIN_MISSILE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 25, + .accuracy = 95, + #else + .power = 14, + .accuracy = 85, + #endif .effect = EFFECT_MULTI_HIT, - .power = 25, .type = TYPE_BUG, - .accuracy = 95, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -736,15 +798,23 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ROAR] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .accuracy = 0, + .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_MAGICCOAT_AFFECTED, + #elif B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 100, + .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_MAGICCOAT_AFFECTED, + #else + .accuracy = 100, + .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, + #endif .effect = EFFECT_ROAR, .power = 0, .type = TYPE_NORMAL, - .accuracy = 100, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = -6, - .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_DEF_UP_1, @@ -800,15 +870,23 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_DISABLE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 100, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, + #elif B_UPDATED_MOVE_DATA == GEN_4 + .accuracy = 80, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .accuracy = 55, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_DISABLE, .power = 0, .type = TYPE_NORMAL, - .accuracy = 100, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_RESET_STATS, @@ -816,7 +894,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ACID] = { - .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, + #if B_UPDATED_MOVE_DATA >= GEN_4 + .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, + #else + .effect = EFFECT_DEFENSE_DOWN_HIT, + #endif .power = 40, .type = TYPE_POISON, .accuracy = 100, @@ -848,16 +930,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FLAMETHROWER] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 90, + #else + .power = 95, + #endif .effect = EFFECT_BURN_HIT, - .power = 90, .type = TYPE_FIRE, .accuracy = 100, .pp = 15, .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, - .split = SPLIT_SPECIAL, .zMovePower = 175, .zMoveEffect = Z_EFFECT_NONE, }, @@ -896,8 +980,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_HYDRO_PUMP] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 110, + #else + .power = 120, + #endif .effect = EFFECT_HIT, - .power = 110, .type = TYPE_WATER, .accuracy = 80, .pp = 5, @@ -912,13 +1000,21 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SURF] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 90, + .target = MOVE_TARGET_FOES_AND_ALLY, + #elif B_UPDATED_MOVE_DATA >= GEN_4 + .power = 95, + .target = MOVE_TARGET_FOES_AND_ALLY, + #else + .power = 95, + .target = MOVE_TARGET_BOTH, + #endif .effect = EFFECT_HIT, - .power = 90, .type = TYPE_WATER, .accuracy = 100, .pp = 15, .secondaryEffectChance = 0, - .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_UNDERWATER, .split = SPLIT_SPECIAL, @@ -928,8 +1024,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ICE_BEAM] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 90, + #else + .power = 95, + #endif .effect = EFFECT_FREEZE_HIT, - .power = 90, .type = TYPE_ICE, .accuracy = 100, .pp = 10, @@ -944,8 +1044,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_BLIZZARD] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 110, + #else + .power = 120, + #endif .effect = EFFECT_FREEZE_HIT, - .power = 110, .type = TYPE_ICE, .accuracy = 70, .pp = 5, @@ -1056,11 +1160,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SUBMISSION] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .pp = 20, + #else + .pp = 25, + #endif .effect = EFFECT_RECOIL_25, .power = 80, .type = TYPE_FIGHTING, .accuracy = 80, - .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -1088,6 +1196,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_COUNTER] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED, + #else + .flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_COUNTER, .power = 1, .type = TYPE_FIGHTING, @@ -1096,7 +1209,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_DEPENDS, .priority = -5, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED, .split = SPLIT_PHYSICAL, .zMovePower = 100, .zMoveEffect = Z_EFFECT_NONE, @@ -1136,11 +1248,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ABSORB] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .pp = 25, + #else + .pp = 20, + #endif .effect = EFFECT_ABSORB, .power = 20, .type = TYPE_GRASS, .accuracy = 100, - .pp = 25, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -1152,11 +1268,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MEGA_DRAIN] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .pp = 15, + #else + .pp = 10, + #endif .effect = EFFECT_ABSORB, .power = 40, .type = TYPE_GRASS, .accuracy = 100, - .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -1184,11 +1304,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_GROWTH] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .pp = 20, + #else + .pp = 40, + #endif .effect = EFFECT_GROWTH, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, - .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, @@ -1280,11 +1404,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_PETAL_DANCE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 120, + .pp = 10, + #elif B_UPDATED_MOVE_DATA == GEN_4 + .power = 90, + .pp = 20, + #else + .power = 70, + .pp = 20, + #endif .effect = EFFECT_RAMPAGE, - .power = 120, .type = TYPE_GRASS, .accuracy = 100, - .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_RANDOM, .priority = 0, @@ -1328,16 +1460,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FIRE_SPIN] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 35, + .accuracy = 85, + #else + .power = 15, + .accuracy = 70, + #endif .effect = EFFECT_TRAP, - .power = 35, .type = TYPE_FIRE, - .accuracy = 85, .pp = 15, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, .zMovePower = 100, .zMoveEffect = Z_EFFECT_NONE, }, @@ -1360,8 +1495,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_THUNDERBOLT] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 90, + #else + .power = 95, + #endif .effect = EFFECT_PARALYZE_HIT, - .power = 90, .type = TYPE_ELECTRIC, .accuracy = 100, .pp = 15, @@ -1376,10 +1515,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_THUNDER_WAVE] = { + #if B_UPDATED_MOVE_DATA >= GEN_7 + .accuracy = 90, + #else + .accuracy = 100, + #endif .effect = EFFECT_PARALYZE, .power = 0, .type = TYPE_ELECTRIC, - .accuracy = 90, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -1392,8 +1535,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_THUNDER] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 110, + #else + .power = 120, + #endif .effect = EFFECT_THUNDER, - .power = 110, .type = TYPE_ELECTRIC, .accuracy = 70, .pp = 10, @@ -1456,8 +1603,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_DIG] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .power = 80, + #else + .power = 60, + #endif .effect = EFFECT_SEMI_INVULNERABLE, - .power = 80, .type = TYPE_GROUND, .accuracy = 100, .pp = 10, @@ -1472,10 +1623,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_TOXIC] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 90, + #else + .accuracy = 85, + #endif .effect = EFFECT_TOXIC, .power = 0, .type = TYPE_POISON, - .accuracy = 90, .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, @@ -1680,11 +1835,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_RECOVER] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .pp = 10, + #else + .pp = 20, + #endif .effect = EFFECT_RESTORE_HP, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, - .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, @@ -1712,11 +1871,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MINIMIZE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .pp = 10, + #else + .pp = 20, + #endif .effect = EFFECT_MINIMIZE, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, - .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, @@ -1792,11 +1955,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_BARRIER] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .pp = 20, + #else + .pp = 30, + #endif .effect = EFFECT_DEFENSE_UP_2, .power = 0, .type = TYPE_PSYCHIC, .accuracy = 0, - .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, @@ -1872,14 +2039,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_BIDE] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .accuracy = 0, + .priority = 1, + #else + .accuracy = 100, + .priority = 0, + #endif .effect = EFFECT_BIDE, .power = 1, .type = TYPE_NORMAL, - .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, .zMovePower = 100, @@ -1952,8 +2124,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_LICK] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 30, + #else + .power = 20, + #endif .effect = EFFECT_PARALYZE_HIT, - .power = 30, .type = TYPE_GHOST, .accuracy = 100, .pp = 30, @@ -1968,11 +2144,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SMOG] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 30, + #else + .power = 20, + #endif .effect = EFFECT_POISON_HIT, - .power = 20, .type = TYPE_POISON, .accuracy = 70, - .pp = 30, + .pp = 20, .secondaryEffectChance = 40, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -2016,8 +2196,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FIRE_BLAST] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 120, + #else + .power = 110, + #endif .effect = EFFECT_BURN_HIT, - .power = 110, .type = TYPE_FIRE, .accuracy = 85, .pp = 5, @@ -2032,7 +2216,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_WATERFALL] = { - .effect = EFFECT_FLINCH_HIT, + #if B_UPDATED_MOVE_DATA >= GEN_4 + .effect = EFFECT_FLINCH_HIT, + #else + .effect = EFFECT_HIT, + #endif .power = 80, .type = TYPE_WATER, .accuracy = 100, @@ -2048,11 +2236,16 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_CLAMP] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 85, + .pp = 15, + #else + .accuracy = 75, + .pp = 10, + #endif .effect = EFFECT_TRAP, .power = 35, .type = TYPE_WATER, - .accuracy = 85, - .pp = 15, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -2080,11 +2273,16 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SKULL_BASH] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 130, + .pp = 10, + #else + .power = 100, + .pp = 15, + #endif .effect = EFFECT_SKULL_BASH, - .power = 130, .type = TYPE_NORMAL, .accuracy = 100, - .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -2144,6 +2342,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_KINESIS] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_ACCURACY_DOWN, .power = 0, .type = TYPE_PSYCHIC, @@ -2151,9 +2354,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, - .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, @@ -2176,11 +2376,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_HI_JUMP_KICK] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 130, + .pp = 10, + #elif B_UPDATED_MOVE_DATA == GEN_4 + .power = 100, + .pp = 20, + #else + .power = 85, + .pp = 20, + #endif .effect = EFFECT_RECOIL_IF_MISS, - .power = 130, .type = TYPE_FIGHTING, .accuracy = 90, - .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -2192,10 +2400,16 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_GLARE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .accuracy = 100, + #elif B_UPDATED_MOVE_DATA == GEN_5 + .accuracy = 90, + #else + .accuracy = 75, + #endif .effect = EFFECT_PARALYZE, .power = 0, .type = TYPE_NORMAL, - .accuracy = 100, .pp = 30, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -2224,13 +2438,21 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_POISON_GAS] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .accuracy = 90, + .target = MOVE_TARGET_FOES_AND_ALLY, + #elif B_UPDATED_MOVE_DATA == GEN_5 + .accuracy = 80, + .target = MOVE_TARGET_FOES_AND_ALLY, + #else + .accuracy = 55, + .target = MOVE_TARGET_BOTH, + #endif .effect = EFFECT_POISON, .power = 0, .type = TYPE_POISON, - .accuracy = 90, .pp = 40, .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, @@ -2256,11 +2478,16 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_LEECH_LIFE] = { + #if B_UPDATED_MOVE_DATA >= GEN_7 + .power = 80, + .pp = 10, + #else + .power = 20, + .pp = 15, + #endif .effect = EFFECT_ABSORB, - .power = 80, .type = TYPE_BUG, .accuracy = 100, - .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -2321,8 +2548,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_BUBBLE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 40, + #else + .power = 20, + #endif .effect = EFFECT_SPEED_DOWN_HIT, - .power = 40, .type = TYPE_WATER, .accuracy = 100, .pp = 30, @@ -2369,10 +2600,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FLASH] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .accuracy = 100, + #else + .accuracy = 70, + #endif .effect = EFFECT_ACCURACY_DOWN, .power = 0, .type = TYPE_NORMAL, - .accuracy = 100, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -2385,10 +2620,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_PSYWAVE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .accuracy = 100, + #else + .accuracy = 80, + #endif .effect = EFFECT_PSYWAVE, .power = 1, .type = TYPE_PSYCHIC, - .accuracy = 100, .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -2417,11 +2656,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ACID_ARMOR] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .pp = 20, + #else + .pp = 40, + #endif .effect = EFFECT_DEFENSE_UP_2, .power = 0, .type = TYPE_POISON, .accuracy = 0, - .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, @@ -2433,10 +2676,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_CRABHAMMER] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 100, + .accuracy = 90, + #elif B_UPDATED_MOVE_DATA == GEN_5 + .power = 90, + .accuracy = 90, + #else + .power = 90, + .accuracy = 85, + #endif .effect = EFFECT_HIT, - .power = 100, .type = TYPE_WATER, - .accuracy = 90, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -2561,6 +2812,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_CONVERSION] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_SNATCH_AFFECTED, + #else + .flags = 0, + #endif .effect = EFFECT_CONVERSION, .power = 0, .type = TYPE_NORMAL, @@ -2569,7 +2825,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, @@ -2641,15 +2896,20 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_STRUGGLE] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .accuracy = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .accuracy = 100, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif .effect = EFFECT_RECOIL_25, .power = 50, .type = TYPE_NORMAL, - .accuracy = 0, .pp = 1, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, .zMovePower = 100, .zMoveEffect = Z_EFFECT_NONE, @@ -2689,11 +2949,16 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_THIEF] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 60, + .pp = 25, + #else + .power = 40, + .pp = 10, + #endif .effect = EFFECT_THIEF, - .power = 60, .type = TYPE_DARK, .accuracy = 100, - .pp = 25, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -2705,15 +2970,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SPIDER_WEB] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_MEAN_LOOK, .power = 0, .type = TYPE_BUG, - .accuracy = 100, + .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_DEF_UP_1, @@ -2721,10 +2990,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MIND_READER] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .accuracy = 0, + #else + .accuracy = 100, + #endif .effect = EFFECT_LOCK_ON, .power = 0, .type = TYPE_NORMAL, - .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -2737,10 +3010,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_NIGHTMARE] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .accuracy = 100, + #else + .accuracy = 0, + #endif .effect = EFFECT_NIGHTMARE, .power = 0, .type = TYPE_GHOST, - .accuracy = 100, .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -2769,8 +3046,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SNORE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 50, + #else + .power = 40, + #endif .effect = EFFECT_SNORE, - .power = 50, .type = TYPE_NORMAL, .accuracy = 100, .pp = 15, @@ -2785,9 +3066,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_CURSE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .type = TYPE_GHOST, + #else + .type = TYPE_MYSTERY, + #endif .effect = EFFECT_CURSE, .power = 0, - .type = TYPE_GHOST, .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, @@ -2817,13 +3102,17 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_CONVERSION_2] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .target = MOVE_TARGET_USER, + #else + .target = MOVE_TARGET_FOES_AND_ALLY, + #endif .effect = EFFECT_CONVERSION_2, .power = 0, .type = TYPE_NORMAL, .accuracy = 100, .pp = 30, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -2849,13 +3138,21 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_COTTON_SPORE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .accuracy = 100, + .target = MOVE_TARGET_BOTH, + #elif B_UPDATED_MOVE_DATA == GEN_5 + .accuracy = 100, + .target = MOVE_TARGET_FOES_AND_ALLY, + #else + .accuracy = 85, + .target = MOVE_TARGET_FOES_AND_ALLY, + #endif .effect = EFFECT_SPEED_DOWN_2, .power = 0, .type = TYPE_GRASS, - .accuracy = 100, .pp = 40, .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, @@ -2881,6 +3178,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SPITE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_SPITE, .power = 0, .type = TYPE_GHOST, @@ -2889,7 +3191,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_RECOVER_HP, @@ -2945,10 +3246,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SCARY_FACE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 100, + #else + .accuracy = 90, + #endif .effect = EFFECT_SPEED_DOWN_2, .power = 0, .type = TYPE_NORMAL, - .accuracy = 100, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -2961,6 +3266,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FAINT_ATTACK] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif .effect = EFFECT_HIT, .power = 60, .type = TYPE_DARK, @@ -2969,7 +3279,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, @@ -2977,9 +3286,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SWEET_KISS] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .type = TYPE_FAIRY, + #else + .type = TYPE_NORMAL, + #endif .effect = EFFECT_CONFUSE, .power = 0, - .type = TYPE_FAIRY, .accuracy = 75, .pp = 10, .secondaryEffectChance = 0, @@ -3057,6 +3370,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SPIKES] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_MAGICCOAT_AFFECTED, + #else + .flags = 0, + #endif .effect = EFFECT_SPIKES, .power = 0, .type = TYPE_GROUND, @@ -3065,7 +3383,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_OPPONENTS_FIELD, .priority = 0, - .flags = FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_DEF_UP_1, @@ -3073,8 +3390,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ZAP_CANNON] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .power = 120, + #else + .power = 100, + #endif .effect = EFFECT_PARALYZE_HIT, - .power = 120, .type = TYPE_ELECTRIC, .accuracy = 50, .pp = 5, @@ -3089,15 +3410,23 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FORESIGHT] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, + #elif B_UPDATED_MOVE_DATA >= GEN_4 + .accuracy = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .accuracy = 100, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_FORESIGHT, .power = 0, .type = TYPE_NORMAL, - .accuracy = 0, .pp = 40, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_BOOST_CRITS, @@ -3169,10 +3498,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_BONE_RUSH] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 90, + #else + .accuracy = 80, + #endif .effect = EFFECT_MULTI_HIT, .power = 25, .type = TYPE_GROUND, - .accuracy = 90, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -3185,10 +3518,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_LOCK_ON] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .accuracy = 100, + #else + .accuracy = 0, + #endif .effect = EFFECT_LOCK_ON, .power = 0, .type = TYPE_NORMAL, - .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -3201,11 +3538,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_OUTRAGE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 120, + .pp = 10, + #elif B_UPDATED_MOVE_DATA == GEN_4 + .power = 120, + .pp = 15, + #else + .power = 90, + .pp = 15, + #endif .effect = EFFECT_RAMPAGE, - .power = 120, .type = TYPE_DRAGON, .accuracy = 100, - .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_RANDOM, .priority = 0, @@ -3233,11 +3578,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_GIGA_DRAIN] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 75, + .pp = 10, + #elif B_UPDATED_MOVE_DATA == GEN_4 + .power = 60, + .pp = 10, + #else + .power = 60, + .pp = 5, + #endif .effect = EFFECT_ABSORB, - .power = 75, .type = TYPE_GRASS, .accuracy = 100, - .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -3265,9 +3618,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_CHARM] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .type = TYPE_FAIRY, + #else + .type = TYPE_NORMAL, + #endif .effect = EFFECT_ATTACK_DOWN_2, .power = 0, - .type = TYPE_FAIRY, .accuracy = 100, .pp = 20, .secondaryEffectChance = 0, @@ -3313,10 +3670,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SWAGGER] = { + #if B_UPDATED_MOVE_DATA >= GEN_7 + .accuracy = 85, + #else + .accuracy = 90, + #endif .effect = EFFECT_SWAGGER, .power = 0, .type = TYPE_NORMAL, - .accuracy = 85, .pp = 15, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, @@ -3361,8 +3722,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FURY_CUTTER] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 40, + #elif B_UPDATED_MOVE_DATA == GEN_5 + .power = 20, + #else + .power = 10, + #endif .effect = EFFECT_FURY_CUTTER, - .power = 40, .type = TYPE_BUG, .accuracy = 95, .pp = 20, @@ -3393,15 +3760,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MEAN_LOOK] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_MEAN_LOOK, .power = 0, .type = TYPE_NORMAL, - .accuracy = 100, + .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPDEF_UP_1, @@ -3633,6 +4004,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ENCORE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_ENCORE, .power = 0, .type = TYPE_NORMAL, @@ -3641,7 +4017,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPD_UP_1, @@ -3665,8 +4040,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_RAPID_SPIN] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .power = 50, + #else + .power = 20, + #endif .effect = EFFECT_RAPID_SPIN, - .power = 20, .type = TYPE_NORMAL, .accuracy = 100, .pp = 40, @@ -3777,9 +4156,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MOONLIGHT] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .type = TYPE_FAIRY, + #else + .type = TYPE_NORMAL, + #endif .effect = EFFECT_MOONLIGHT, .power = 0, - .type = TYPE_FAIRY, .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, @@ -3873,7 +4256,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_CRUNCH] = { - .effect = EFFECT_DEFENSE_DOWN_HIT, + #if B_UPDATED_MOVE_DATA >= GEN_4 + .effect = EFFECT_DEFENSE_DOWN_HIT, + #else + .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, + #endif .power = 80, .type = TYPE_DARK, .accuracy = 100, @@ -3889,6 +4276,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MIRROR_COAT] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .flags = FLAG_PROTECT_AFFECTED, + #else + .flags = FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_MIRROR_COAT, .power = 1, .type = TYPE_PSYCHIC, @@ -3897,7 +4289,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_DEPENDS, .priority = -5, - .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, .zMovePower = 100, .zMoveEffect = Z_EFFECT_NONE, @@ -3905,6 +4296,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_PSYCH_UP] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_SNATCH_AFFECTED, + #else + .flags = 0, + #endif .effect = EFFECT_PSYCH_UP, .power = 0, .type = TYPE_NORMAL, @@ -3913,7 +4309,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_RECOVER_HP, @@ -3921,6 +4316,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_EXTREME_SPEED] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .priority = 2, + #else + .priority = 1, + #endif .effect = EFFECT_HIT, .power = 80, .type = TYPE_NORMAL, @@ -3928,7 +4328,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, - .priority = 2, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, .zMovePower = 160, @@ -3937,6 +4336,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ANCIENT_POWER] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, + #else + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, + #endif .effect = EFFECT_ALL_STATS_UP_HIT, .power = 60, .type = TYPE_ROCK, @@ -3945,7 +4349,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, @@ -3969,11 +4372,21 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FUTURE_SIGHT] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 120, + .accuracy = 100, + .pp = 10, + #elif B_UPDATED_MOVE_DATA == GEN_5 + .power = 100, + .accuracy = 100, + .pp = 10, + #else + .power = 80, + .accuracy = 90, + .pp = 15, + #endif .effect = EFFECT_FUTURE_SIGHT, - .power = 120, .type = TYPE_PSYCHIC, - .accuracy = 100, - .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -3985,8 +4398,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ROCK_SMASH] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .power = 40, + #else + .power = 20, + #endif .effect = EFFECT_DEFENSE_DOWN_HIT, - .power = 40, .type = TYPE_FIGHTING, .accuracy = 100, .pp = 15, @@ -4001,10 +4418,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_WHIRLPOOL] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 35, + .accuracy = 85, + #else + .power = 15, + .accuracy = 70, + #endif .effect = EFFECT_TRAP, - .power = 35, .type = TYPE_WATER, - .accuracy = 85, .pp = 15, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, @@ -4018,7 +4440,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_BEAT_UP] = { .effect = EFFECT_BEAT_UP, - .power = 10, + #if B_BEAT_UP_DMG >= GEN_5 + .power = 1, + #else + .power = 10, + #endif .type = TYPE_DARK, .accuracy = 100, .pp = 10, @@ -4033,6 +4459,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FAKE_OUT] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, + #endif .effect = EFFECT_FAKE_OUT, .power = 40, .type = TYPE_NORMAL, @@ -4040,8 +4471,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, - .priority = 1, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, + .priority = 3, .split = SPLIT_PHYSICAL, .zMovePower = 100, .zMoveEffect = Z_EFFECT_NONE, @@ -4049,8 +4479,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_UPROAR] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 90, + #else + .power = 50, + #endif .effect = EFFECT_UPROAR, - .power = 90, .type = TYPE_NORMAL, .accuracy = 100, .pp = 10, @@ -4065,11 +4499,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_STOCKPILE] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .pp = 20, + #else + .pp = 10, + #endif .effect = EFFECT_STOCKPILE, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, - .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, @@ -4081,8 +4519,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SPIT_UP] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .power = 1, + #else + .power = 100, + #endif .effect = EFFECT_SPIT_UP, - .power = 100, .type = TYPE_NORMAL, .accuracy = 100, .pp = 10, @@ -4113,8 +4555,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_HEAT_WAVE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 95, + #else + .power = 100, + #endif .effect = EFFECT_BURN_HIT, - .power = 95, .type = TYPE_FIRE, .accuracy = 90, .pp = 10, @@ -4145,6 +4591,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_TORMENT] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_TORMENT, .power = 0, .type = TYPE_DARK, @@ -4153,7 +4604,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_DEF_UP_1, @@ -4177,10 +4627,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_WILL_O_WISP] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .accuracy = 85, + #else + .accuracy = 75, + #endif .effect = EFFECT_WILL_O_WISP, .power = 0, .type = TYPE_FIRE, - .accuracy = 85, .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -4241,8 +4695,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SMELLING_SALT] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 70, + #else + .power = 60, + #endif .effect = EFFECT_SMELLINGSALT, - .power = 70, .type = TYPE_NORMAL, .accuracy = 100, .pp = 10, @@ -4306,6 +4764,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_TAUNT] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED, + #endif .effect = EFFECT_TAUNT, .power = 0, .type = TYPE_DARK, @@ -4313,22 +4776,23 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED, - .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_HELPING_HAND] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .target = MOVE_TARGET_ALLY, + #else + .target = MOVE_TARGET_USER, + #endif .effect = EFFECT_HELPING_HAND, .power = 0, .type = TYPE_NORMAL, .accuracy = 100, .pp = 20, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, .priority = 5, .flags = 0, .split = SPLIT_STATUS, @@ -4370,6 +4834,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_WISH] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_SNATCH_AFFECTED, + #else + .flags = 0, + #endif .effect = EFFECT_WISH, .power = 0, .type = TYPE_NORMAL, @@ -4377,9 +4846,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_SNATCH_AFFECTED, - .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, @@ -4450,6 +4916,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_RECYCLE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_SNATCH_AFFECTED, + #else + .flags = 0, + #endif .effect = EFFECT_RECYCLE, .power = 0, .type = TYPE_NORMAL, @@ -4458,7 +4929,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPD_UP_2, @@ -4514,8 +4984,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_KNOCK_OFF] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 65, + #else + .power = 20, + #endif .effect = EFFECT_KNOCK_OFF, - .power = 65, .type = TYPE_DARK, .accuracy = 100, .pp = 20, @@ -4578,6 +5052,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_IMPRISON] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_PROTECT_AFFECTED | FLAG_SNATCH_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED, + #endif .effect = EFFECT_IMPRISON, .power = 0, .type = TYPE_PSYCHIC, @@ -4586,7 +5065,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPDEF_UP_2, @@ -4658,8 +5136,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_DIVE] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .power = 80, + #else + .power = 60, + #endif .effect = EFFECT_SEMI_INVULNERABLE, - .power = 80, .type = TYPE_WATER, .accuracy = 100, .pp = 10, @@ -4770,6 +5252,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_TEETER_DANCE] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DANCE, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_DANCE, + #endif .effect = EFFECT_TEETER_DANCE, .power = 0, .type = TYPE_NORMAL, @@ -4778,7 +5265,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_DANCE, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPATK_UP_1, @@ -4882,12 +5368,16 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_POISON_FANG] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .secondaryEffectChance = 50, + #else + .secondaryEffectChance = 30, + #endif .effect = EFFECT_POISON_FANG, .power = 50, .type = TYPE_POISON, .accuracy = 100, .pp = 15, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_STRONG_JAW_BOOST, @@ -4946,10 +5436,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_METEOR_MASH] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 90, + .accuracy = 90, + #else + .power = 100, + .accuracy = 85, + #endif .effect = EFFECT_ATTACK_UP_HIT, - .power = 90, .type = TYPE_STEEL, - .accuracy = 90, .pp = 10, .secondaryEffectChance = 20, .target = MOVE_TARGET_SELECTED, @@ -5026,8 +5521,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_AIR_CUTTER] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 60, + #else + .power = 55, + #endif .effect = EFFECT_HIT, - .power = 60, .type = TYPE_FLYING, .accuracy = 95, .pp = 25, @@ -5042,15 +5541,23 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_OVERHEAT] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 130, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #elif B_UPDATED_MOVE_DATA >= GEN_4 + .power = 130, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .power = 140, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif .effect = EFFECT_OVERHEAT, - .power = 130, .type = TYPE_FIRE, .accuracy = 90, .pp = 5, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, .zMovePower = 195, .zMoveEffect = Z_EFFECT_NONE, @@ -5058,15 +5565,20 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ODOR_SLEUTH] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .accuracy = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, + #else + .accuracy = 100, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_FORESIGHT, .power = 0, .type = TYPE_NORMAL, - .accuracy = 0, .pp = 40, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_ATK_UP_1, @@ -5074,11 +5586,17 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ROCK_TOMB] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 60, + .accuracy = 95, + .pp = 15, + #else + .power = 50, + .accuracy = 80, + .pp = 10, + #endif .effect = EFFECT_SPEED_DOWN_HIT, - .power = 60, .type = TYPE_ROCK, - .accuracy = 95, - .pp = 15, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -5218,11 +5736,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_EXTRASENSORY] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .pp = 20, + #else + .pp = 30, + #endif .effect = EFFECT_FLINCH_MINIMIZE_HIT, .power = 80, .type = TYPE_PSYCHIC, .accuracy = 100, - .pp = 20, .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -5250,10 +5772,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SAND_TOMB] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 35, + .accuracy = 85, + #else + .power = 15, + .accuracy = 70, + #endif .effect = EFFECT_TRAP, - .power = 35, .type = TYPE_GROUND, - .accuracy = 85, .pp = 15, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, @@ -5282,8 +5809,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MUDDY_WATER] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 90, + #else + .power = 95, + #endif .effect = EFFECT_ACCURACY_DOWN_HIT, - .power = 90, .type = TYPE_WATER, .accuracy = 85, .pp = 10, @@ -5298,8 +5829,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_BULLET_SEED] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 25, + #else + .power = 10, + #endif .effect = EFFECT_MULTI_HIT, - .power = 25, .type = TYPE_GRASS, .accuracy = 100, .pp = 30, @@ -5330,8 +5865,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ICICLE_SPEAR] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 25, + #else + .power = 10, + #endif .effect = EFFECT_MULTI_HIT, - .power = 25, .type = TYPE_ICE, .accuracy = 100, .pp = 30, @@ -5362,15 +5901,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_BLOCK] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_MEAN_LOOK, .power = 0, .type = TYPE_NORMAL, - .accuracy = 100, + .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_DEF_UP_1, @@ -5491,15 +6034,29 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_COVET] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 60, + .pp = 25, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #elif B_UPDATED_MOVE_DATA == GEN_5 + .power = 60, + .pp = 40, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #elif B_UPDATED_MOVE_DATA == GEN_4 + .power = 40, + .pp = 40, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .power = 40, + .pp = 40, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_THIEF, - .power = 60, .type = TYPE_NORMAL, .accuracy = 100, - .pp = 25, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, @@ -5507,7 +6064,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_VOLT_TACKLE] = { - .effect = EFFECT_RECOIL_33_STATUS, + #if B_UPDATED_MOVE_DATA >= GEN_4 + .effect = EFFECT_RECOIL_33_STATUS, + .argument = STATUS1_PARALYSIS, + #else + .effect = EFFECT_RECOIL_33, + #endif .power = 120, .type = TYPE_ELECTRIC, .accuracy = 100, @@ -5517,7 +6079,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_RECKLESS_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, - .argument = STATUS1_PARALYSIS, .zMovePower = 190, .zMoveEffect = Z_EFFECT_NONE, }, @@ -5572,8 +6133,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_LEAF_BLADE] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .power = 90, + #else + .power = 70, + #endif .effect = EFFECT_HIT, - .power = 90, .type = TYPE_GRASS, .accuracy = 100, .pp = 15, @@ -5604,10 +6169,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ROCK_BLAST] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .accuracy = 90, + #else + .accuracy = 80, + #endif .effect = EFFECT_MULTI_HIT, .power = 25, .type = TYPE_ROCK, - .accuracy = 90, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -5652,10 +6221,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_DOOM_DESIRE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 140, + .accuracy = 100, + #else + .power = 120, + .accuracy = 85, + #endif .effect = EFFECT_FUTURE_SIGHT, - .power = 140, .type = TYPE_STEEL, - .accuracy = 100, .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -5716,6 +6290,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MIRACLE_EYE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_MIRACLE_EYE, .power = 0, .type = TYPE_PSYCHIC, @@ -5724,7 +6303,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPATK_UP_1, @@ -5732,8 +6310,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_WAKE_UP_SLAP] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 70, + #else + .power = 60, + #endif .effect = EFFECT_WAKE_UP_SLAP, - .power = 70, .type = TYPE_FIGHTING, .accuracy = 100, .pp = 10, @@ -5781,6 +6363,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_HEALING_WISH] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_SNATCH_AFFECTED, + #else + .flags = 0, + #endif .effect = EFFECT_HEALING_WISH, .power = 0, .type = TYPE_PSYCHIC, @@ -5789,7 +6376,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_NONE, @@ -5829,15 +6415,23 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FEINT] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 30, + .flags = FLAG_MIRROR_MOVE_AFFECTED, + #elif B_UPDATED_MOVE_DATA >= GEN_5 + .power = 30, + .flags = 0, + #else + .power = 50, + .flags = 0, + #endif .effect = EFFECT_FEINT, - .power = 30, .type = TYPE_NORMAL, .accuracy = 100, .pp = 10, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 2, - .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, .zMovePower = 100, .zMoveEffect = Z_EFFECT_NONE, @@ -5861,11 +6455,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_TAILWIND] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .pp = 15, + #else + .pp = 30, + #endif .effect = EFFECT_TAILWIND, .power = 0, .type = TYPE_FLYING, .accuracy = 0, - .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, @@ -5877,6 +6475,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ACUPRESSURE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = 0, + #else + .flags = FLAG_SNATCH_AFFECTED, + #endif .effect = EFFECT_ACUPRESSURE, .power = 0, .type = TYPE_NORMAL, @@ -5885,7 +6488,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER | MOVE_TARGET_ALLY, .priority = 0, - .flags = 0, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_BOOST_CRITS, @@ -5893,6 +6495,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_METAL_BURST] = { + #if B_UPDATED_MOVE_DATA >= GEN_4 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .flags = FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_METAL_BURST, .power = 0, .type = TYPE_STEEL, @@ -5901,8 +6508,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_DEPENDS, .priority = 0, - .flags = 0, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_U_TURN] = @@ -5955,8 +6562,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ASSURANCE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 60, + #else + .power = 50, + #endif .effect = EFFECT_ASSURANCE, - .power = 60, .type = TYPE_DARK, .accuracy = 100, .pp = 10, @@ -5971,6 +6582,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_EMBARGO] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_EMBARGO, .power = 0, .type = TYPE_DARK, @@ -5979,7 +6595,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPATK_UP_1, @@ -6003,10 +6618,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_PSYCHO_SHIFT] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .accuracy = 100, + #else + .accuracy = 90, + #endif .effect = EFFECT_PSYCHO_SHIFT, .power = 0, .type = TYPE_PSYCHIC, - .accuracy = 100, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -6033,6 +6652,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_HEAL_BLOCK] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_HEAL_BLOCK, .power = 0, .type = TYPE_PSYCHIC, @@ -6041,7 +6665,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPATK_UP_2, @@ -6063,6 +6686,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_POWER_TRICK] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_SNATCH_AFFECTED, + #else + .flags = 0, + #endif .effect = EFFECT_POWER_TRICK, .power = 0, .type = TYPE_PSYCHIC, @@ -6071,7 +6699,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_ATK_UP_1, @@ -6095,6 +6722,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_LUCKY_CHANT] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_SNATCH_AFFECTED, + #else + .flags = 0, + #endif .effect = EFFECT_LUCKY_CHANT, .power = 0, .type = TYPE_NORMAL, @@ -6103,7 +6735,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_EVSN_UP_1, @@ -6191,8 +6822,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_LAST_RESORT] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 140, + #else + .power = 130, + #endif .effect = EFFECT_LAST_RESORT, - .power = 140, .type = TYPE_NORMAL, .accuracy = 100, .pp = 5, @@ -6223,8 +6858,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SUCKER_PUNCH] = { + #if B_UPDATED_MOVE_DATA >= GEN_7 + .power = 70, + #else + .power = 80, + #endif .effect = EFFECT_SUCKER_PUNCH, - .power = 70, .type = TYPE_DARK, .accuracy = 100, .pp = 5, @@ -6239,6 +6878,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_TOXIC_SPIKES] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_MAGICCOAT_AFFECTED, + #else + .flags = 0, + #endif .effect = EFFECT_TOXIC_SPIKES, .power = 0, .type = TYPE_POISON, @@ -6247,7 +6891,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_OPPONENTS_FIELD, .priority = 0, - .flags = FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_DEF_UP_1, @@ -6271,6 +6914,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_AQUA_RING] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_SNATCH_AFFECTED, + #else + .flags = 0, + #endif .effect = EFFECT_AQUA_RING, .power = 0, .type = TYPE_WATER, @@ -6279,7 +6927,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_DEF_UP_1, @@ -6287,6 +6934,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MAGNET_RISE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_SNATCH_AFFECTED, + #else + .flags = 0, + #endif .effect = EFFECT_MAGNET_RISE, .power = 0, .type = TYPE_ELECTRIC, @@ -6295,7 +6947,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_EVSN_UP_1, @@ -6336,8 +6987,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_AURA_SPHERE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 80, + #else + .power = 90, + #endif .effect = EFFECT_HIT, - .power = 80, .type = TYPE_FIGHTING, .accuracy = 0, .pp = 20, @@ -6448,11 +7103,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_AIR_SLASH] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .pp = 15, + #else + .pp = 20, + #endif .effect = EFFECT_FLINCH_HIT, .power = 75, .type = TYPE_FLYING, .accuracy = 95, - .pp = 15, .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -6496,8 +7155,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_DRAGON_PULSE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 85, + #else + .power = 90, + #endif .effect = EFFECT_HIT, - .power = 85, .type = TYPE_DRAGON, .accuracy = 100, .pp = 10, @@ -6528,8 +7191,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_POWER_GEM] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 80, + #else + .power = 70, + #endif .effect = EFFECT_HIT, - .power = 80, .type = TYPE_ROCK, .accuracy = 100, .pp = 20, @@ -6544,11 +7211,16 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_DRAIN_PUNCH] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .power = 75, + .pp = 10, + #else + .power = 60, + .pp = 5, + #endif .effect = EFFECT_ABSORB, - .power = 75, .type = TYPE_FIGHTING, .accuracy = 100, - .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -6592,8 +7264,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ENERGY_BALL] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 90, + #else + .power = 80, + #endif .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, - .power = 90, .type = TYPE_GRASS, .accuracy = 100, .pp = 10, @@ -6915,6 +7591,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_DEFOG] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_DEFOG, .power = 0, .type = TYPE_FLYING, @@ -6923,7 +7604,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_ACC_UP_1, @@ -6947,8 +7627,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_DRACO_METEOR] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 130, + #else + .power = 140, + #endif .effect = EFFECT_OVERHEAT, - .power = 130, .type = TYPE_DRAGON, .accuracy = 90, .pp = 5, @@ -6995,8 +7679,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_LEAF_STORM] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 130, + #else + .power = 140, + #endif .effect = EFFECT_OVERHEAT, - .power = 130, .type = TYPE_GRASS, .accuracy = 90, .pp = 5, @@ -7059,10 +7747,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_GUNK_SHOT] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .accuracy = 80, + #else + .accuracy = 70, + #endif .effect = EFFECT_POISON_HIT, .power = 120, .type = TYPE_POISON, - .accuracy = 80, .pp = 5, .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, @@ -7139,6 +7831,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_STEALTH_ROCK] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_MAGICCOAT_AFFECTED, + #else + .flags = 0, + #endif .effect = EFFECT_STEALTH_ROCK, .power = 0, .type = TYPE_ROCK, @@ -7147,7 +7844,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_OPPONENTS_FIELD, .priority = 0, - .flags = FLAG_MAGICCOAT_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_DEF_UP_1, @@ -7171,8 +7867,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_CHATTER] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 65, + #else + .power = 60, + #endif .effect = EFFECT_CONFUSE_HIT, - .power = 65, .type = TYPE_FLYING, .accuracy = 100, .pp = 20, @@ -7379,6 +8079,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_LUNAR_DANCE] = { + #if B_UPDATED_MOVE_DATA >= GEN_5 + .flags = FLAG_DANCE | FLAG_SNATCH_AFFECTED, + #else + .flags = FLAG_DANCE, + #endif .effect = EFFECT_HEALING_WISH, .power = 0, .type = TYPE_PSYCHIC, @@ -7387,7 +8092,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_DANCE | FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_NONE, @@ -7411,10 +8115,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MAGMA_STORM] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 100, + .accuracy = 75, + #elif B_UPDATED_MOVE_DATA == GEN_5 + .power = 120, + .accuracy = 75, + #else + .power = 120, + .accuracy = 70, + #endif .effect = EFFECT_TRAP, - .power = 100, .type = TYPE_FIRE, - .accuracy = 75, .pp = 5, .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, @@ -7427,10 +8139,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_DARK_VOID] = { + #if B_UPDATED_MOVE_DATA >= GEN_7 + .accuracy = 50, + #else + .accuracy = 80, + #endif .effect = EFFECT_SLEEP, .power = 0, .type = TYPE_DARK, - .accuracy = 50, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_BOTH, @@ -7556,6 +8272,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_WONDER_ROOM] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .priority = 0, + #else + .priority = -7, + #endif .effect = EFFECT_WONDER_ROOM, .power = 0, .type = TYPE_PSYCHIC, @@ -7563,7 +8284,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 0, .flags = 0, .split = SPLIT_STATUS, .zMovePower = 0, @@ -7620,6 +8340,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_RAGE_POWDER] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .priority = 2, + #else + .priority = 3, + #endif .effect = EFFECT_FOLLOW_ME, .power = 0, .type = TYPE_BUG, @@ -7627,7 +8352,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 2, .flags = FLAG_POWDER, .split = SPLIT_STATUS, .zMovePower = 0, @@ -7652,6 +8376,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MAGIC_ROOM] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .priority = 0, + #else + .priority = -7, + #endif .effect = EFFECT_MAGIC_ROOM, .power = 0, .type = TYPE_PSYCHIC, @@ -7659,7 +8388,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 0, .flags = 0, .split = SPLIT_STATUS, .zMovePower = 0, @@ -7684,8 +8412,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_STORM_THROW] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 60, + #else + .power = 40, + #endif .effect = EFFECT_ALWAYS_CRIT, - .power = 60, .type = TYPE_FIGHTING, .accuracy = 100, .pp = 10, @@ -7764,11 +8496,16 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SYNCHRONOISE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 120, + .pp = 10, + #else + .power = 70, + .pp = 15, + #endif .effect = EFFECT_SYNCHRONOISE, - .power = 120, .type = TYPE_PSYCHIC, .accuracy = 100, - .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, @@ -7844,8 +8581,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_LOW_SWEEP] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 65, + #else + .power = 60, + #endif .effect = EFFECT_SPEED_DOWN_HIT, - .power = 65, .type = TYPE_FIGHTING, .accuracy = 100, .pp = 20, @@ -8037,6 +8778,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ALLY_SWITCH] = { + #if B_UPDATED_MOVE_DATA >= GEN_7 + .priority = 2, + #else + .priority = 1, + #endif .effect = EFFECT_ALLY_SWITCH, .power = 0, .type = TYPE_PSYCHIC, @@ -8044,7 +8790,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 1, .flags = 0, .split = SPLIT_STATUS, .zMovePower = 0, @@ -8101,8 +8846,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_HEX] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 65, + #else + .power = 50, + #endif .effect = EFFECT_HEX, - .power = 65, .type = TYPE_GHOST, .accuracy = 100, .pp = 10, @@ -8165,8 +8914,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_INCINERATE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 60, + #else + .power = 30, + #endif .effect = EFFECT_INCINERATE, - .power = 60, .type = TYPE_FIRE, .accuracy = 100, .pp = 15, @@ -8261,6 +9014,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_BESTOW] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .flags = FLAG_MIRROR_MOVE_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #endif .effect = EFFECT_BESTOW, .power = 0, .type = TYPE_NORMAL, @@ -8269,7 +9027,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPD_UP_2, @@ -8293,8 +9050,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_WATER_PLEDGE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 80, + #else + .power = 50, + #endif .effect = EFFECT_PLEDGE, - .power = 80, .type = TYPE_WATER, .accuracy = 100, .pp = 10, @@ -8309,8 +9070,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FIRE_PLEDGE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 80, + #else + .power = 50, + #endif .effect = EFFECT_PLEDGE, - .power = 80, .type = TYPE_FIRE, .accuracy = 100, .pp = 10, @@ -8325,8 +9090,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_GRASS_PLEDGE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 80, + #else + .power = 50, + #endif .effect = EFFECT_PLEDGE, - .power = 80, .type = TYPE_GRASS, .accuracy = 100, .pp = 10, @@ -8357,8 +9126,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_STRUGGLE_BUG] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 50, + #else + .power = 30, + #endif .effect = EFFECT_SPECIAL_ATTACK_DOWN_HIT, - .power = 50, .type = TYPE_BUG, .accuracy = 100, .pp = 20, @@ -8389,8 +9162,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FROST_BREATH] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 60, + #else + .power = 40, + #endif .effect = EFFECT_ALWAYS_CRIT, - .power = 60, .type = TYPE_ICE, .accuracy = 90, .pp = 10, @@ -8533,11 +9310,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SACRED_SWORD] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .pp = 15, + #else + .pp = 20, + #endif .effect = EFFECT_HIT, .power = 90, .type = TYPE_FIGHTING, .accuracy = 100, - .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -8677,8 +9458,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_HURRICANE] = { + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 110, + #else + .power = 120, + #endif .effect = EFFECT_HURRICANE, - .power = 110, .type = TYPE_FLYING, .accuracy = 70, .pp = 10, @@ -8741,8 +9526,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_TECHNO_BLAST] = { - .effect = EFFECT_HIT, - .power = 120, + #if B_UPDATED_MOVE_DATA >= GEN_6 + .power = 120, + #else + .power = 85, + #endif + .effect = EFFECT_CHANGE_TYPE_ON_ITEM, .type = TYPE_NORMAL, .accuracy = 100, .pp = 5, @@ -8751,6 +9540,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_SPECIAL, + .argument = HOLD_EFFECT_DRIVE, .zMovePower = 190, .zMoveEffect = Z_EFFECT_NONE, }, @@ -8967,8 +9757,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FLYING_PRESS] = { + #if B_UPDATED_MOVE_DATA >= GEN_7 + .power = 100, + #else + .power = 80, + #endif .effect = EFFECT_TWO_TYPED_MOVE, - .power = 100, .type = TYPE_FIGHTING, .accuracy = 95, .pp = 10, @@ -9049,8 +9843,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_FELL_STINGER] = { + #if B_UPDATED_MOVE_DATA >= GEN_7 + .power = 50, + #else + .power = 30, + #endif .effect = EFFECT_FELL_STINGER, - .power = 50, .type = TYPE_BUG, .accuracy = 100, .pp = 25, @@ -9131,8 +9929,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_PARABOLIC_CHARGE] = { + #if B_UPDATED_MOVE_DATA >= GEN_7 + .power = 65, + #else + .power = 50, + #endif .effect = EFFECT_ABSORB, - .power = 65, .type = TYPE_ELECTRIC, .accuracy = 100, .pp = 20, @@ -9228,10 +10030,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_TOPSY_TURVY] = { + #if B_UPDATED_MOVE_DATA >= GEN_7 + .accuracy = 0, + #else + .accuracy = 100, + #endif .effect = EFFECT_TOPSY_TURVY, .power = 0, .type = TYPE_DARK, - .accuracy = 0, .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -9470,7 +10276,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_DIAMOND_STORM] = { - .effect = EFFECT_DEFENSE_UP2_HIT, + #if B_UPDATED_MOVE_DATA >= GEN_4 + .effect = EFFECT_DEFENSE_UP2_HIT, + #else + .effect = EFFECT_DEFENSE_UP_HIT, + #endif .power = 100, .type = TYPE_ROCK, .accuracy = 95, @@ -9518,6 +10328,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_WATER_SHURIKEN] = { + #if B_WATER_SHURIKEN_SPLIT >= GEN_7 + .split = SPLIT_SPECIAL, + #else + .split = SPLIT_PHYSICAL, + #endif .effect = EFFECT_MULTI_HIT, .power = 15, .type = TYPE_WATER, @@ -9527,15 +10342,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 1, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_SPECIAL, .zMovePower = 100, .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MYSTICAL_FIRE] = { + #if B_UPDATED_MOVE_DATA >= GEN_7 + .power = 75, + #else + .power = 65, + #endif .effect = EFFECT_SPECIAL_ATTACK_DOWN_HIT, - .power = 75, .type = TYPE_FIRE, .accuracy = 100, .pp = 10, @@ -10766,8 +11584,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MULTI_ATTACK] = { - .effect = EFFECT_PLACEHOLDER, - .power = 90, + #if B_UPDATED_MOVE_DATA >= GEN_8 + .power = 120, + #else + .power = 90, + #endif + .effect = EFFECT_CHANGE_TYPE_ON_ITEM, .type = TYPE_NORMAL, .accuracy = 100, .pp = 10, @@ -10776,6 +11598,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .argument = HOLD_EFFECT_MEMORY, .zMovePower = 175, .zMoveEffect = Z_EFFECT_NONE, }, @@ -10827,6 +11650,262 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .zMovePower = 180, .zMoveEffect = Z_EFFECT_NONE, }, + + [MOVE_ZIPPY_ZAP] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .power = 80, + .pp = 10, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .power = 50, + .pp = 15, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif + .effect = EFFECT_ALWAYS_CRIT, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 2, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_SPLISHY_SPLASH] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif + .effect = EFFECT_PARALYZE_HIT, + .power = 90, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 15, + .secondaryEffectChance = 30, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .split = SPLIT_SPECIAL, + }, + + [MOVE_FLOATY_FALL] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + #else + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED, + #endif + .effect = EFFECT_FLINCH_HIT, + .power = 90, + .type = TYPE_FLYING, + .accuracy = 95, + .pp = 15, + .secondaryEffectChance = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_PIKA_PAPOW] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif + .effect = EFFECT_RETURN, + .power = 1, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 20, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + }, + + [MOVE_BOUNCY_BUBBLE] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .power = 60, + .pp = 20, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .argument = 100, // restores 100% HP instead of 50% HP + #else + .power = 90, + .pp = 15, + .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif + .effect = EFFECT_ABSORB, + .type = TYPE_WATER, + .accuracy = 100, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + }, + + [MOVE_BUZZY_BUZZ] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .power = 60, + .pp = 20, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .power = 90, + .pp = 15, + .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif + .effect = EFFECT_PARALYZE_HIT, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + }, + + [MOVE_SIZZLY_SLIDE] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .power = 60, + .pp = 20, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .power = 90, + .pp = 15, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif + .effect = EFFECT_BURN_HIT, + .type = TYPE_FIRE, + .accuracy = 100, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_GLITZY_GLOW] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .power = 80, + .accuracy = 95, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .power = 90, + .accuracy = 100, + .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif + .effect = EFFECT_PLACEHOLDER, //TODO (Light Screen + Hit) + .type = TYPE_PSYCHIC, + .pp = 15, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + }, + + [MOVE_BADDY_BAD] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .power = 80, + .accuracy = 95, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .power = 90, + .accuracy = 100, + .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif + .effect = EFFECT_PLACEHOLDER, //TODO (Reflect + Hit) + .type = TYPE_DARK, + .pp = 15, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + }, + + [MOVE_SAPPY_SEED] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .power = 100, + .accuracy = 90, + .pp = 10, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .power = 90, + .accuracy = 100, + .pp = 15, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif + .effect = EFFECT_PLACEHOLDER, //TODO (Leech Seed + Hit) + .type = TYPE_GRASS, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_FREEZY_FROST] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .power = 100, + .accuracy = 90, + .pp = 10, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .power = 90, + .accuracy = 100, + .pp = 15, + .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif + .effect = EFFECT_PLACEHOLDER, //TODO (Haze + Hit) + .type = TYPE_ICE, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + }, + + [MOVE_SPARKLY_SWIRL] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .power = 120, + .accuracy = 85, + .pp = 5, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .power = 90, + .accuracy = 100, + .pp = 15, + .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif + .effect = EFFECT_PLACEHOLDER, //TODO (Heal Bell + Hit) + .type = TYPE_FAIRY, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + }, + + [MOVE_VEEVEE_VOLLEY] = + { + #if B_UPDATED_MOVE_DATA >= GEN_8 + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #else + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + #endif + .effect = EFFECT_RETURN, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 20, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_PHYSICAL, + }, [MOVE_DOUBLE_IRON_BASH] = { @@ -10844,6 +11923,804 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .zMoveEffect = Z_EFFECT_NONE, }, + [MOVE_DYNAMAX_CANNON] = + { + .effect = EFFECT_HIT, + .power = 100, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_SNIPE_SHOT] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 80, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 15, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_JAW_LOCK] = + { + .effect = EFFECT_MEAN_LOOK, + .power = 80, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_STRONG_JAW_BOOST, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_STUFF_CHEEKS] = + { + .effect = EFFECT_DEFENSE_UP_2, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, + .priority = 0, + .flags = FLAG_SNATCH_AFFECTED, + .split = SPLIT_STATUS, + }, + + [MOVE_NO_RETREAT] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 0, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, + .priority = 0, + .flags = FLAG_SNATCH_AFFECTED, + .split = SPLIT_STATUS, + }, + + [MOVE_TAR_SHOT] = + { + .effect = EFFECT_SPEED_DOWN, + .power = 0, + .type = TYPE_ROCK, + .accuracy = 100, + .pp = 15, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + .split = SPLIT_STATUS, + }, + + [MOVE_MAGIC_POWDER] = + { + .effect = EFFECT_THIRD_TYPE, + .power = 0, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 20, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, + .split = SPLIT_STATUS, + .argument = TYPE_PSYCHIC, + }, + + [MOVE_DRAGON_DARTS] = + { + .effect = EFFECT_MULTI_HIT, //TODO + .power = 50, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_TEATIME] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, + .priority = 0, + .flags = 0, + .split = SPLIT_STATUS, + }, + + [MOVE_OCTOLOCK] = + { + .effect = EFFECT_MEAN_LOOK, + .power = 0, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 15, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + .split = SPLIT_STATUS, + }, + + [MOVE_BOLT_BEAK] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 85, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_FISHIOUS_REND] = + { + .effect = EFFECT_PLACEHOLDER, //TODO. same as bolt beak + .power = 85, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_STRONG_JAW_BOOST, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_COURT_CHANGE] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, + .priority = 0, + .flags = FLAG_MIRROR_MOVE_AFFECTED, + .split = SPLIT_STATUS, + }, + + [MOVE_CLANGOROUS_SOUL] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 0, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, + .priority = 0, + .flags = FLAG_SNATCH_AFFECTED | FLAG_SOUND, + .split = SPLIT_STATUS, + }, + + [MOVE_BODY_PRESS] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 80, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_DECORATE] = + { + .effect = EFFECT_PLACEHOLDER, // TODO .. EFFECT_DECORATE + .power = 0, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 15, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .split = SPLIT_STATUS, + }, + + [MOVE_DRUM_BEATING] = + { + .effect = EFFECT_SPEED_DOWN_HIT, + .power = 80, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_SNAP_TRAP] = + { + .effect = EFFECT_TRAP, //TODO: add case/effect + .power = 35, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 15, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_PYRO_BALL] = + { + .effect = EFFECT_BURN_HIT, + .power = 120, + .type = TYPE_FIRE, + .accuracy = 90, + .pp = 5, + .secondaryEffectChance = 10, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_BALLISTIC, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_BEHEMOTH_BLADE] = + { + .effect = EFFECT_HIT, //TODO: 2x damage if dynamaxed? meh... + .power = 100, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_BEHEMOTH_BASH] = + { + .effect = EFFECT_HIT, //TODO: 2x damage if dynamaxed? meh... + .power = 100, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_AURA_WHEEL] = + { + .effect = EFFECT_SPEED_UP_HIT, + .power = 110, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_BREAKING_SWIPE] = + { + .effect = EFFECT_ATTACK_DOWN_HIT, + .power = 60, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 15, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_BRANCH_POKE] = + { + .effect = EFFECT_HIT, + .power = 40, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 40, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_OVERDRIVE] = + { + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_SOUND, + .split = SPLIT_SPECIAL, + }, + + [MOVE_APPLE_ACID] = + { + .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, + .power = 80, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_GRAV_APPLE] = + { + .effect = EFFECT_DEFENSE_DOWN_HIT, + .power = 80, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_SPIRIT_BREAK] = + { + .effect = EFFECT_SPECIAL_ATTACK_DOWN_HIT, + .power = 75, + .type = TYPE_FAIRY, + .accuracy = 100, + .pp = 15, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_STRANGE_STEAM] = + { + .effect = EFFECT_CONFUSE_HIT, + .power = 90, + .type = TYPE_FAIRY, + .accuracy = 95, + .pp = 10, + .secondaryEffectChance = 20, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_LIFE_DEW] = + { + .effect = EFFECT_RESTORE_HP, + .power = 0, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, + .priority = 0, + .flags = FLAG_SNATCH_AFFECTED, + .split = SPLIT_STATUS, + }, + + [MOVE_OBSTRUCT] = + { + .effect = EFFECT_PLACEHOLDER, //TODO. EFFECT_PROTECT? + .power = 0, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, + .priority = 4, + .flags = 0, + .split = SPLIT_STATUS, + }, + + [MOVE_FALSE_SURRENDER] = + { + .effect = EFFECT_HIT, + .power = 80, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_METEOR_ASSAULT] = + { + .effect = EFFECT_RECHARGE, + .power = 150, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_ETERNABEAM] = + { + .effect = EFFECT_RECHARGE, + .power = 160, + .type = TYPE_DRAGON, + .accuracy = 90, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_STEEL_BEAM] = + { + .effect = EFFECT_RECOIL_50, + .power = 140, + .type = TYPE_STEEL, + .accuracy = 95, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_EXPANDING_FORCE] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 80, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_STEEL_ROLLER] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 130, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_SCALE_SHOT] = + { + .effect = EFFECT_PLACEHOLDER, //TODO (EFFECT_MULTI_HIT + ABILITY_WEAK_ARMOR, + .power = 25, + .type = TYPE_DRAGON, + .accuracy = 90, + .pp = 20, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_METEOR_BEAM] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 120, + .type = TYPE_ROCK, + .accuracy = 90, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_SHELL_SIDE_ARM] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 90, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_MISTY_EXPLOSION] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 100, + .type = TYPE_FAIRY, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_GRASSY_GLIDE] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 70, + .type = TYPE_GRASS, + .accuracy = 100, + .pp = 20, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_RISING_VOLTAGE] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 70, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 20, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_TERRAIN_PULSE] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 50, + .type = TYPE_NORMAL, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST, + .split = SPLIT_SPECIAL, + }, + + [MOVE_SKITTER_SMACK] = + { + .effect = EFFECT_SPECIAL_ATTACK_DOWN_HIT, + .power = 70, + .type = TYPE_BUG, + .accuracy = 90, + .pp = 10, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_BURNING_JEALOUSY] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 70, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_LASH_OUT] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 75, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_POLTERGEIST] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 110, + .type = TYPE_GHOST, + .accuracy = 90, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_CORROSIVE_GAS] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 0, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 40, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_FOES_AND_ALLY, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGICCOAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + .split = SPLIT_STATUS, + }, + + [MOVE_COACHING] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 0, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_ALLY, + .priority = 0, + .flags = 0, + .split = SPLIT_STATUS, + }, + + [MOVE_FLIP_TURN] = + { + .effect = EFFECT_HIT_ESCAPE, + .power = 60, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 20, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_TRIPLE_AXEL] = + { + .effect = EFFECT_TRIPLE_KICK, //TODO: Increase damage by 20 instead of 10 + .power = 20, + .type = TYPE_ICE, + .accuracy = 90, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_DUAL_WINGBEAT] = + { + .effect = EFFECT_DOUBLE_HIT, + .power = 40, + .type = TYPE_FLYING, + .accuracy = 90, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_SCORCHING_SANDS] = + { + .effect = EFFECT_SCALD, + .power = 70, + .type = TYPE_GROUND, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 30, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, + .split = SPLIT_SPECIAL, + }, + + [MOVE_JUNGLE_HEALING] = + { + .effect = EFFECT_PLACEHOLDER, //TODO + .power = 0, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, + .priority = 0, + .split = SPLIT_STATUS, + }, + + [MOVE_WICKED_BLOW] = + { + .effect = EFFECT_ALWAYS_CRIT, + .power = 80, + .type = TYPE_DARK, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, + .split = SPLIT_PHYSICAL, + }, + + [MOVE_SURGING_STRIKES] = + { + .effect = EFFECT_PLACEHOLDER, //TODO (Multi hit + Always Crit) + .power = 25, + .type = TYPE_WATER, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_IRON_FIST_BOOST, + .split = SPLIT_PHYSICAL, + }, + // Z MOVES [MOVE_BREAKNECK_BLITZ] = { diff --git a/src/data/items.h b/src/data/items.h index c630d0427..30beb5352 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -4884,549 +4884,4 @@ const struct Item gItems[] = .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 0, }, - - [ITEM_NORMALIUM_Z] = - { - .name = _("Normalium Z"), - .itemId = ITEM_NORMALIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_NORMAL - }, - [ITEM_FIGHTINIUM_Z] = - { - .name = _("Fightinium Z"), - .itemId = ITEM_FIGHTINIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_FIGHTING - }, - [ITEM_FLYINIUM_Z] = - { - .name = _("Flyinium Z"), - .itemId = ITEM_FLYINIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_FLYING - }, - [ITEM_POISONIUM_Z] = - { - .name = _("Poisinium Z"), - .itemId = ITEM_POISONIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_POISON - }, - [ITEM_GROUNDIUM_Z] = - { - .name = _("Groundium Z"), - .itemId = ITEM_GROUNDIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_GROUND - }, - [ITEM_ROCKIUM_Z] = - { - .name = _("Rockium Z"), - .itemId = ITEM_ROCKIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_ROCK - }, - [ITEM_BUGINIUM_Z] = - { - .name = _("Buginium Z"), - .itemId = ITEM_BUGINIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_BUG - }, - [ITEM_GHOSTIUM_Z] = - { - .name = _("Ghostium Z"), - .itemId = ITEM_GHOSTIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_GHOST - }, - [ITEM_STEELIUM_Z] = - { - .name = _("Steelium Z"), - .itemId = ITEM_STEELIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_STEEL - }, - [ITEM_FIRIUM_Z] = - { - .name = _("Firium Z"), - .itemId = ITEM_FIRIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_FIRE - }, - [ITEM_WATERIUM_Z] = - { - .name = _("Waterium Z"), - .itemId = ITEM_WATERIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_WATER - }, - [ITEM_GRASSIUM_Z] = - { - .name = _("Grassium Z"), - .itemId = ITEM_GRASSIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_GRASS - }, - [ITEM_ELECTRIUM_Z] = - { - .name = _("Electrium Z"), - .itemId = ITEM_ELECTRIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_ELECTRIC - }, - [ITEM_PSYCHIUM_Z] = - { - .name = _("Psychium Z"), - .itemId = ITEM_PSYCHIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_PSYCHIC - }, - [ITEM_ICIUM_Z] = - { - .name = _("Icium Z"), - .itemId = ITEM_ICIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_ICE - }, - [ITEM_DRAGONIUM_Z] = - { - .name = _("Dragonium Z"), - .itemId = ITEM_DRAGONIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_DRAGON - }, - [ITEM_DARKINIUM_Z] = - { - .name = _("Darkinium Z"), - .itemId = ITEM_DARKINIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_DARK - }, - [ITEM_FAIRIUM_Z] = - { - .name = _("Fairium Z"), - .itemId = ITEM_FAIRIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = TYPE_FAIRY - }, - [ITEM_ALORAICHIUM_Z] = - { - .name = _("Aloraichium Z"), - .itemId = ITEM_ALORAICHIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_DECIDIUM_Z] = - { - .name = _("Decidium Z"), - .itemId = ITEM_DECIDIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_EEVIUM_Z] = - { - .name = _("Eevium Z"), - .itemId = ITEM_EEVIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_INCINIUM_Z] = - { - .name = _("Incinium Z"), - .itemId = ITEM_INCINIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_KOMMONIUM_Z] = - { - .name = _("Kommonium Z"), - .itemId = ITEM_KOMMONIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_LUNALIUM_Z] = - { - .name = _("Lunalium Z"), - .itemId = ITEM_LUNALIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_LYCANIUM_Z] = - { - .name = _("Lycanium Z"), - .itemId = ITEM_LYCANIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_MARSHADIUM_Z] = - { - .name = _("Marshadium Z"), - .itemId = ITEM_MARSHADIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_MEWNIUM_Z] = - { - .name = _("Mewnium Z"), - .itemId = ITEM_MEWNIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_MIMIKIUM_Z] = - { - .name = _("Mimikium Z"), - .itemId = ITEM_MIMIKIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_PIKANIUM_Z] = - { - .name = _("Pikanium Z"), - .itemId = ITEM_PIKANIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_PIKASHUNIUM_Z] = - { - .name = _("Pikashunium Z"), - .itemId = ITEM_PIKASHUNIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_PRIMARIUM_Z] = - { - .name = _("Primarium Z"), - .itemId = ITEM_PRIMARIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_SNORLIUM_Z] = - { - .name = _("Snorlium Z"), - .itemId = ITEM_SNORLIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_SOLGANIUM_Z] = - { - .name = _("Solganium Z"), - .itemId = ITEM_SOLGANIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 // signature z move - }, - [ITEM_TAPUNIUM_Z] = - { - .name = _("Tapunium Z"), - .itemId = ITEM_TAPUNIUM_Z, - .price = 0, - .holdEffect = HOLD_EFFECT_Z_CRYSTAL, - .holdEffectParam = 0, - .description = sDummyDesc, - .importance = 0, - .pocket = POCKET_ITEMS, - .type = 4, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, - .battleUsage = 0, - .battleUseFunc = NULL, - .secondaryId = 255 //signature z move - }, }; diff --git a/src/data/trainer_parties.h b/src/data/trainer_parties.h index 2c57f6ffc..824a49dc3 100644 --- a/src/data/trainer_parties.h +++ b/src/data/trainer_parties.h @@ -429,18 +429,16 @@ static const struct TrainerMonNoItemCustomMoves sParty_Felix[] = { } }; -static const struct TrainerMonItemDefaultMoves sParty_Violet[] = { +static const struct TrainerMonNoItemDefaultMoves sParty_Violet[] = { { .iv = 0, - .lvl = 45, + .lvl = 26, .species = SPECIES_ROSELIA, - .heldItem = ITEM_GRASSIUM_Z, }, { .iv = 0, - .lvl = 40, + .lvl = 26, .species = SPECIES_GLOOM, - .heldItem = 0, } }; diff --git a/src/data/trainers.h b/src/data/trainers.h index defe0accf..163a8296d 100644 --- a/src/data/trainers.h +++ b/src/data/trainers.h @@ -547,7 +547,7 @@ const struct Trainer gTrainers[] = { [TRAINER_VIOLET] = { - .partyFlags = F_TRAINER_PARTY_HELD_ITEM, + .partyFlags = 0, .trainerClass = TRAINER_CLASS_AROMA_LADY, .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_AROMA_LADY, @@ -556,7 +556,7 @@ const struct Trainer gTrainers[] = { .doubleBattle = FALSE, .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Violet), - .party = {.ItemDefaultMoves = sParty_Violet}, + .party = {.NoItemDefaultMoves = sParty_Violet}, }, [TRAINER_ROSE_2] = From 7f4e936e87e61affc5658cedb2da714a9e4cf105 Mon Sep 17 00:00:00 2001 From: Evan Date: Fri, 1 Jan 2021 08:49:29 -0700 Subject: [PATCH 013/208] fix z move ordering --- include/constants/moves.h | 70 +++++++++++++++++++-------------------- src/data/battle_moves.h | 1 + 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/include/constants/moves.h b/include/constants/moves.h index 8b0b091f9..b566021ea 100644 --- a/include/constants/moves.h +++ b/include/constants/moves.h @@ -785,42 +785,42 @@ #define MOVES_COUNT_GEN8 755 // Z Moves -#define MOVE_BREAKNECK_BLITZ 747 -#define MOVE_ALL_OUT_PUMMELING 748 -#define MOVE_SUPERSONIC_SKYSTRIKE 749 -#define MOVE_ACID_DOWNPOUR 750 -#define MOVE_TECTONIC_RAGE 751 -#define MOVE_CONTINENTAL_CRUSH 752 -#define MOVE_SAVAGE_SPIN_OUT 753 -#define MOVE_NEVER_ENDING_NIGHTMARE 754 -#define MOVE_CORKSCREW_CRASH 755 -#define MOVE_INFERNO_OVERDRIVE 756 -#define MOVE_HYDRO_VORTEX 757 -#define MOVE_BLOOM_DOOM 758 -#define MOVE_GIGAVOLT_HAVOC 759 -#define MOVE_SHATTERED_PSYCHE 760 -#define MOVE_SUBZERO_SLAMMER 761 -#define MOVE_DEVASTATING_DRAKE 762 -#define MOVE_BLACK_HOLE_ECLIPSE 763 -#define MOVE_TWINKLE_TACKLE 764 +#define MOVE_BREAKNECK_BLITZ 756 +#define MOVE_ALL_OUT_PUMMELING 757 +#define MOVE_SUPERSONIC_SKYSTRIKE 758 +#define MOVE_ACID_DOWNPOUR 759 +#define MOVE_TECTONIC_RAGE 760 +#define MOVE_CONTINENTAL_CRUSH 761 +#define MOVE_SAVAGE_SPIN_OUT 762 +#define MOVE_NEVER_ENDING_NIGHTMARE 763 +#define MOVE_CORKSCREW_CRASH 764 +#define MOVE_INFERNO_OVERDRIVE 765 +#define MOVE_HYDRO_VORTEX 766 +#define MOVE_BLOOM_DOOM 767 +#define MOVE_GIGAVOLT_HAVOC 768 +#define MOVE_SHATTERED_PSYCHE 769 +#define MOVE_SUBZERO_SLAMMER 770 +#define MOVE_DEVASTATING_DRAKE 771 +#define MOVE_BLACK_HOLE_ECLIPSE 772 +#define MOVE_TWINKLE_TACKLE 773 //signature z moves -#define MOVE_CATASTROPIKA 765 -#define MOVE_10000000_VOLT_THUNDERBOLT 766 -#define MOVE_STOKED_SPARKSURFER 767 -#define MOVE_EXTREME_EVOBOOST 768 -#define MOVE_PULVERIZING_PANCAKE 769 -#define MOVE_GENESIS_SUPERNOVA 770 -#define MOVE_SINISTER_ARROW_RAID 771 -#define MOVE_MALICIOUS_MOONSAULT 772 -#define MOVE_OCEANIC_OPERETTA 773 -#define MOVE_SPLINTERED_STORMSHARDS 774 -#define MOVE_LETS_SNUGGLE_FOREVER 775 -#define MOVE_CLANGOROUS_SOULBLAZE 776 -#define MOVE_GUARDIAN_OF_ALOLA 777 -#define MOVE_SEARING_SUNRAZE_SMASH 778 -#define MOVE_MENACING_MOONRAZE_MAELSTROM 779 -#define MOVE_LIGHT_THAT_BURNS_THE_SKY 780 -#define MOVE_SOUL_STEALING_7_STAR_STRIKE 781 +#define MOVE_CATASTROPIKA 774 +#define MOVE_10000000_VOLT_THUNDERBOLT 775 +#define MOVE_STOKED_SPARKSURFER 776 +#define MOVE_EXTREME_EVOBOOST 777 +#define MOVE_PULVERIZING_PANCAKE 778 +#define MOVE_GENESIS_SUPERNOVA 779 +#define MOVE_SINISTER_ARROW_RAID 780 +#define MOVE_MALICIOUS_MOONSAULT 781 +#define MOVE_OCEANIC_OPERETTA 782 +#define MOVE_SPLINTERED_STORMSHARDS 783 +#define MOVE_LETS_SNUGGLE_FOREVER 784 +#define MOVE_CLANGOROUS_SOULBLAZE 785 +#define MOVE_GUARDIAN_OF_ALOLA 786 +#define MOVE_SEARING_SUNRAZE_SMASH 787 +#define MOVE_MENACING_MOONRAZE_MAELSTROM 788 +#define MOVE_LIGHT_THAT_BURNS_THE_SKY 789 +#define MOVE_SOUL_STEALING_7_STAR_STRIKE 790 #define FIRST_Z_MOVE MOVE_BREAKNECK_BLITZ #define LAST_Z_MOVE MOVE_SOUL_STEALING_7_STAR_STRIKE diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 8ec92bfce..74390c2c4 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -13360,4 +13360,5 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .zMovePower = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = 0 + }, }; From 0ef91d4601dacdee8a7475188fe3fe6097a0a4ff Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Mon, 1 Mar 2021 16:36:39 -0700 Subject: [PATCH 014/208] Update src/battle_z_move.c Co-authored-by: ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> --- src/battle_z_move.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 55dc271bd..ceabda40c 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -58,7 +58,7 @@ static u8 GetZMoveScore(u8 battlerAtk, u8 battlerDef, u16 baseMove, u16 zMove); static const struct SignatureZMove sSignatureZMoves[] = { #ifdef POKEMON_EXPANSION - {SPECIES_RAICHU_A, ITEM_ALORAICHIUM_Z, MOVE_THUNDERBOLT, MOVE_STOKED_SPARKSURFER}, + {SPECIES_RAICHU_ALOLAN, ITEM_ALORAICHIUM_Z, MOVE_THUNDERBOLT, MOVE_STOKED_SPARKSURFER}, {SPECIES_DECIDUEYE, ITEM_DECIDIUM_Z, MOVE_SPIRIT_SHACKLE, MOVE_SINISTER_ARROW_RAID}, {SPECIES_INCINEROAR, ITEM_INCINIUM_Z, MOVE_DARKEST_LARIAT, MOVE_MALICIOUS_MOONSAULT}, {SPECIES_KOMMO_O, ITEM_KOMMONIUM_Z, MOVE_CLANGING_SCALES, MOVE_CLANGOROUS_SOULBLAZE}, From b663eb7188154df64912c9b263b28a86dc3dbf4c Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Mon, 1 Mar 2021 16:38:32 -0700 Subject: [PATCH 015/208] Update src/battle_z_move.c Co-authored-by: ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> --- src/battle_z_move.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_z_move.c b/src/battle_z_move.c index ceabda40c..99d6e1a09 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -65,7 +65,8 @@ static const struct SignatureZMove sSignatureZMoves[] = {SPECIES_LUNALA, ITEM_LUNALIUM_Z, MOVE_MOONGEIST_BEAM, MOVE_MENACING_MOONRAZE_MAELSTROM}, {SPECIES_NECROZMA_DAWN_WINGS, ITEM_LUNALIUM_Z, MOVE_MOONGEIST_BEAM, MOVE_MENACING_MOONRAZE_MAELSTROM}, {SPECIES_LYCANROC, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS}, - {SPECIES_LYCANROC_N, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS}, + {SPECIES_LYCANROC_MIDNIGHT, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS}, + {SPECIES_LYCANROC_DUSK, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS}, {SPECIES_MARSHADOW, ITEM_MARSHADIUM_Z, MOVE_SPECTRAL_THIEF, MOVE_SOUL_STEALING_7_STAR_STRIKE}, {SPECIES_MIMIKYU, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER}, From d686bab213fb015baee31dd671d3d3e5a0dda1ac Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Mon, 1 Mar 2021 16:38:41 -0700 Subject: [PATCH 016/208] Update src/battle_z_move.c Co-authored-by: ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> --- src/battle_z_move.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 99d6e1a09..9d8e785d2 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -71,13 +71,13 @@ static const struct SignatureZMove sSignatureZMoves[] = {SPECIES_MARSHADOW, ITEM_MARSHADIUM_Z, MOVE_SPECTRAL_THIEF, MOVE_SOUL_STEALING_7_STAR_STRIKE}, {SPECIES_MIMIKYU, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER}, {SPECIES_MIMIKYU_BUSTED, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER}, - {SPECIES_PIKACHU_CAP_ORIGINAL, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, - {SPECIES_PIKACHU_CAP_HOENN, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, - {SPECIES_PIKACHU_CAP_SINNOH, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, - {SPECIES_PIKACHU_CAP_UNOVA, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, - {SPECIES_PIKACHU_CAP_KALOS, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, - {SPECIES_PIKACHU_CAP_ALOLA, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, - {SPECIES_PIKACHU_CAP_PARTNER, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_ORIGINAL_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_HOENN_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_SINNOH_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_UNOVA_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_KALOS_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_ALOLA_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_PARTNER_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, {SPECIES_PRIMARINA, ITEM_PRIMARIUM_Z, MOVE_SPARKLING_ARIA, MOVE_OCEANIC_OPERETTA}, {SPECIES_SOLGALEO, ITEM_SOLGANIUM_Z, MOVE_SUNSTEEL_STRIKE, MOVE_SEARING_SUNRAZE_SMASH}, {SPECIES_NECROZMA_DUSK_MANE, ITEM_SOLGANIUM_Z, MOVE_SUNSTEEL_STRIKE, MOVE_SEARING_SUNRAZE_SMASH}, From fa32603e73d29369bc9916a97d48086bec9ddd65 Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Mon, 1 Mar 2021 16:38:49 -0700 Subject: [PATCH 017/208] Update src/battle_z_move.c Co-authored-by: ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> --- src/battle_z_move.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 9d8e785d2..d2beb3a49 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -167,7 +167,7 @@ bool32 IsViableZMove(u8 battlerId, u16 move) return FALSE; #ifdef ITEM_Z_RING - if ((GetBattlerPosition(battlerId) == B_POSITION_PLAYER_LEFT || (!gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(battlerId) == B_POSITION_PLAYER_RIGHT) && !CheckBagHasItem(ITEM_Z_RING, 1)) + if ((GetBattlerPosition(battlerId) == B_POSITION_PLAYER_LEFT || (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(battlerId) == B_POSITION_PLAYER_RIGHT)) && !CheckBagHasItem(ITEM_Z_RING, 1)) return FALSE; #endif From 26ada227626c25afc6a0c3d6d546a6a861eb1e2a Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Mon, 1 Mar 2021 16:38:54 -0700 Subject: [PATCH 018/208] Update src/battle_z_move.c Co-authored-by: ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> --- src/battle_z_move.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_z_move.c b/src/battle_z_move.c index d2beb3a49..868c70948 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -700,9 +700,9 @@ bool32 ShouldAIUseZMove(u8 battlerAtk, u8 battlerDef, u16 chosenMove) if (IsViableZMove(battlerAtk, chosenMove)) { #ifdef POKEMON_EXPANSION - if (defAbility == ABILITY_DISGUISE && defSpecies == SPECIES_MIMIKYU) + if (gBattleMons[battlerDef].ability == ABILITY_DISGUISE && gBattleMons[battlerDef].species == SPECIES_MIMIKYU) return 0; // Don't waste a Z-Move busting Mimikyu's disguise - if (defAbility == ABILITY_ICEFACE && defSpecies == SPECIES_EISCUE && IS_MOVE_PHYSICAL(chosenMove)) + if (gBattleMons[battlerDef].ability == ABILITY_ICE_FACE && gBattleMons[battlerDef].species == SPECIES_EISCUE && IS_MOVE_PHYSICAL(chosenMove)) return 0; // Don't waste a Z-Move busting Eiscue's Ice Face #endif From 847700fbb67c3ba1e0429ebef1faff2358a837df Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 1 Mar 2021 17:14:56 -0700 Subject: [PATCH 019/208] fix GetIllusionMonPtr --- src/battle_anim_new.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index c97013f30..0449ab1fc 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -7680,7 +7680,7 @@ void AnimTask_GetLycanrocForm(u8 taskId) { #ifdef POKEMON_EXPANSION - if (GetIllusionPartyData(gBattleAnimAttacker)->species == SPECIES_LYCANROC_MIDNIGHT) + if (GetIllusionMonPtr(gBattleAnimAttacker)->species == SPECIES_LYCANROC_MIDNIGHT) gBattleAnimArgs[0] = 1; else #endif From fe6ce337180654821bc02cb32b87db3925623ca8 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 1 Mar 2021 17:37:05 -0700 Subject: [PATCH 020/208] fix AnimTask_GetLycanrocForm --- src/battle_anim_new.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 0449ab1fc..d9fb78cdf 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -7680,7 +7680,7 @@ void AnimTask_GetLycanrocForm(u8 taskId) { #ifdef POKEMON_EXPANSION - if (GetIllusionMonPtr(gBattleAnimAttacker)->species == SPECIES_LYCANROC_MIDNIGHT) + if (GetMonData(GetIllusionMonPtr(gBattleAnimAttacker), MON_DATA_SPECIES) == SPECIES_LYCANROC_MIDNIGHT) gBattleAnimArgs[0] = 1; else #endif From 5636706386c7915da9a9ea96c8908af6d3c48caa Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 2 Apr 2021 09:08:08 -0600 Subject: [PATCH 021/208] fix battle move data --- src/data/battle_moves.h | 51 ++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index e4590fb3f..acdf34c75 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -946,6 +946,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, + .split = SPLIT_SPECIAL, .zMovePower = 175, .zMoveEffect = Z_EFFECT_NONE, }, @@ -1769,7 +1771,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 0, + .priority = -6, .flags = 0, .split = SPLIT_STATUS, .zMovePower = 0, @@ -1797,7 +1799,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .effect = EFFECT_MIMIC, .power = 0, .type = TYPE_NORMAL, - .accuracy = 100, + .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -2361,6 +2363,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 15, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, @@ -3228,7 +3232,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 3, + .priority = 4, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, .zMovePower = 0, @@ -3496,7 +3500,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 5, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 3, + .priority = 4, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, .zMovePower = 0, @@ -3616,7 +3620,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 3, + .priority = 4, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, .zMovePower = 0, @@ -3924,7 +3928,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, - .split = SPLIT_SPECIAL, + .split = SPLIT_PHYSICAL, .zMovePower = 180, .zMoveEffect = Z_EFFECT_NONE, }, @@ -4118,7 +4122,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .effect = EFFECT_VITAL_THROW, .power = 70, .type = TYPE_FIGHTING, - .accuracy = 100, + .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -4239,7 +4243,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_DANCE, + .flags = 0, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPD_UP_1, @@ -4730,7 +4734,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, - .priority = 3, + .priority = 2, .flags = 0, .split = SPLIT_STATUS, .zMovePower = 0, @@ -4783,6 +4787,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_ATK_UP_1, }, @@ -4828,7 +4834,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .effect = EFFECT_ROLE_PLAY, .power = 0, .type = TYPE_PSYCHIC, - .accuracy = 100, + .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -4853,6 +4859,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, + .priority = 0, + .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, @@ -4978,7 +4986,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .effect = EFFECT_YAWN, .power = 0, .type = TYPE_NORMAL, - .accuracy = 100, + .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -5046,7 +5054,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .effect = EFFECT_SKILL_SWAP, .power = 0, .type = TYPE_PSYCHIC, - .accuracy = 100, + .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -5948,7 +5956,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 0, - .flags = FLAG_SNATCH_AFFECTED, + .flags = FLAG_SNATCH_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, .zMovePower = 0, .zMoveEffect = Z_EFFECT_ATK_UP_1, @@ -7910,7 +7918,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_JUDGMENT] = { - .effect = EFFECT_HIT, + .effect = EFFECT_CHANGE_TYPE_ON_ITEM, .power = 100, .type = TYPE_NORMAL, .accuracy = 100, @@ -7920,6 +7928,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .argument = HOLD_EFFECT_PLATE, .zMovePower = 180, .zMoveEffect = Z_EFFECT_NONE, }, @@ -8351,7 +8360,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_AUTOTOMIZE] = { - .effect = EFFECT_HIT, + .effect = EFFECT_AUTOTOMIZE, .power = 0, .type = TYPE_STEEL, .accuracy = 0, @@ -10812,7 +10821,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { .effect = EFFECT_PLACEHOLDER, .power = 0, - .type = TYPE_MYSTERY, + .type = TYPE_DARK, .accuracy = 0, .pp = 0, .secondaryEffectChance = 0, @@ -10929,7 +10938,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, .zMovePower = 180, .zMoveEffect = Z_EFFECT_NONE, @@ -11034,10 +11043,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_TOXIC_THREAD] = { .effect = EFFECT_TOXIC_THREAD, - .power = 20, + .power = 0, .type = TYPE_POISON, .accuracy = 100, - .pp = 0, + .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, @@ -11329,7 +11338,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = -3, - .flags = FLAG_PROTECT_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, .zMovePower = 180, .zMoveEffect = Z_EFFECT_NONE, @@ -11961,7 +11970,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .accuracy = 100, .pp = 5, .secondaryEffectChance = 30, - .target = MOVE_TARGET_FOES_AND_ALLY, + .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, .zMovePower = 120, From 42c7a5fea22d5f35118eaa513809f7a4352e9ff2 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 2 Apr 2021 10:28:08 -0600 Subject: [PATCH 022/208] fix z move move IDs --- include/constants/moves.h | 70 +++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/include/constants/moves.h b/include/constants/moves.h index 262da8423..392c8a30d 100644 --- a/include/constants/moves.h +++ b/include/constants/moves.h @@ -785,42 +785,42 @@ #define MOVES_COUNT_GEN8 755 // Z Moves -#define MOVE_BREAKNECK_BLITZ 756 -#define MOVE_ALL_OUT_PUMMELING 757 -#define MOVE_SUPERSONIC_SKYSTRIKE 758 -#define MOVE_ACID_DOWNPOUR 759 -#define MOVE_TECTONIC_RAGE 760 -#define MOVE_CONTINENTAL_CRUSH 761 -#define MOVE_SAVAGE_SPIN_OUT 762 -#define MOVE_NEVER_ENDING_NIGHTMARE 763 -#define MOVE_CORKSCREW_CRASH 764 -#define MOVE_INFERNO_OVERDRIVE 765 -#define MOVE_HYDRO_VORTEX 766 -#define MOVE_BLOOM_DOOM 767 -#define MOVE_GIGAVOLT_HAVOC 768 -#define MOVE_SHATTERED_PSYCHE 769 -#define MOVE_SUBZERO_SLAMMER 770 -#define MOVE_DEVASTATING_DRAKE 771 -#define MOVE_BLACK_HOLE_ECLIPSE 772 -#define MOVE_TWINKLE_TACKLE 773 +#define MOVE_BREAKNECK_BLITZ (MOVES_COUNT_GEN8 + 0) +#define MOVE_ALL_OUT_PUMMELING (MOVES_COUNT_GEN8 + 1) +#define MOVE_SUPERSONIC_SKYSTRIKE (MOVES_COUNT_GEN8 + 2) +#define MOVE_ACID_DOWNPOUR (MOVES_COUNT_GEN8 + 3) +#define MOVE_TECTONIC_RAGE (MOVES_COUNT_GEN8 + 4) +#define MOVE_CONTINENTAL_CRUSH (MOVES_COUNT_GEN8 + 5) +#define MOVE_SAVAGE_SPIN_OUT (MOVES_COUNT_GEN8 + 6) +#define MOVE_NEVER_ENDING_NIGHTMARE (MOVES_COUNT_GEN8 + 7) +#define MOVE_CORKSCREW_CRASH (MOVES_COUNT_GEN8 + 8) +#define MOVE_INFERNO_OVERDRIVE (MOVES_COUNT_GEN8 + 9) +#define MOVE_HYDRO_VORTEX (MOVES_COUNT_GEN8 + 10) +#define MOVE_BLOOM_DOOM (MOVES_COUNT_GEN8 + 11) +#define MOVE_GIGAVOLT_HAVOC (MOVES_COUNT_GEN8 + 12) +#define MOVE_SHATTERED_PSYCHE (MOVES_COUNT_GEN8 + 13) +#define MOVE_SUBZERO_SLAMMER (MOVES_COUNT_GEN8 + 14) +#define MOVE_DEVASTATING_DRAKE (MOVES_COUNT_GEN8 + 15) +#define MOVE_BLACK_HOLE_ECLIPSE (MOVES_COUNT_GEN8 + 16) +#define MOVE_TWINKLE_TACKLE (MOVES_COUNT_GEN8 + 17) //signature z moves -#define MOVE_CATASTROPIKA 774 -#define MOVE_10000000_VOLT_THUNDERBOLT 775 -#define MOVE_STOKED_SPARKSURFER 776 -#define MOVE_EXTREME_EVOBOOST 777 -#define MOVE_PULVERIZING_PANCAKE 778 -#define MOVE_GENESIS_SUPERNOVA 779 -#define MOVE_SINISTER_ARROW_RAID 780 -#define MOVE_MALICIOUS_MOONSAULT 781 -#define MOVE_OCEANIC_OPERETTA 782 -#define MOVE_SPLINTERED_STORMSHARDS 783 -#define MOVE_LETS_SNUGGLE_FOREVER 784 -#define MOVE_CLANGOROUS_SOULBLAZE 785 -#define MOVE_GUARDIAN_OF_ALOLA 786 -#define MOVE_SEARING_SUNRAZE_SMASH 787 -#define MOVE_MENACING_MOONRAZE_MAELSTROM 788 -#define MOVE_LIGHT_THAT_BURNS_THE_SKY 789 -#define MOVE_SOUL_STEALING_7_STAR_STRIKE 790 +#define MOVE_CATASTROPIKA (MOVES_COUNT_GEN8 + 18) +#define MOVE_10000000_VOLT_THUNDERBOLT (MOVES_COUNT_GEN8 + 19) +#define MOVE_STOKED_SPARKSURFER (MOVES_COUNT_GEN8 + 20) +#define MOVE_EXTREME_EVOBOOST (MOVES_COUNT_GEN8 + 21) +#define MOVE_PULVERIZING_PANCAKE (MOVES_COUNT_GEN8 + 22) +#define MOVE_GENESIS_SUPERNOVA (MOVES_COUNT_GEN8 + 23) +#define MOVE_SINISTER_ARROW_RAID (MOVES_COUNT_GEN8 + 24) +#define MOVE_MALICIOUS_MOONSAULT (MOVES_COUNT_GEN8 + 25) +#define MOVE_OCEANIC_OPERETTA (MOVES_COUNT_GEN8 + 26) +#define MOVE_SPLINTERED_STORMSHARDS (MOVES_COUNT_GEN8 + 27) +#define MOVE_LETS_SNUGGLE_FOREVER (MOVES_COUNT_GEN8 + 28) +#define MOVE_CLANGOROUS_SOULBLAZE (MOVES_COUNT_GEN8 + 29) +#define MOVE_GUARDIAN_OF_ALOLA (MOVES_COUNT_GEN8 + 30) +#define MOVE_SEARING_SUNRAZE_SMASH (MOVES_COUNT_GEN8 + 31) +#define MOVE_MENACING_MOONRAZE_MAELSTROM (MOVES_COUNT_GEN8 + 32) +#define MOVE_LIGHT_THAT_BURNS_THE_SKY (MOVES_COUNT_GEN8 + 33) +#define MOVE_SOUL_STEALING_7_STAR_STRIKE (MOVES_COUNT_GEN8 + 34) #define FIRST_Z_MOVE MOVE_BREAKNECK_BLITZ #define LAST_Z_MOVE MOVE_SOUL_STEALING_7_STAR_STRIKE From 71b85031e0dee8c91d039fd7075c169070b594ba Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Tue, 6 Apr 2021 15:42:21 -0600 Subject: [PATCH 023/208] update NUM_BATTLE_MOVE_EFFECTS --- include/constants/battle_move_effects.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 1cc460f17..fe7d465be 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -354,6 +354,6 @@ #define EFFECT_EXTREME_EVOBOOST 348 #define EFFECT_DAMAGE_SET_TERRAIN 349 //genesis supernova -#define NUM_BATTLE_MOVE_EFFECTS 348 +#define NUM_BATTLE_MOVE_EFFECTS 350 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H From 4d6e64b336262306afa286fa8794a1321bd4babf Mon Sep 17 00:00:00 2001 From: ExpoSeed <> Date: Thu, 10 Jun 2021 11:48:26 -0500 Subject: [PATCH 024/208] Review comments. --- src/battle_anim_new.c | 6 +++--- src/battle_z_move.c | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 6c7c3605f..53137b8c6 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -4258,7 +4258,7 @@ const struct SpriteTemplate gContinentalCrushGrowingRockSpriteTemplate = const struct SpriteTemplate gContinentalCrushEruptionSpriteTemplate = { .tileTag = ANIM_TAG_ROCKS, - .paletteTag ANIM_TAG_ROCKS, + .paletteTag = ANIM_TAG_ROCKS, .oam = &gOamData_AffineOff_ObjNormal_32x32, .anims = gDummySpriteAnimTable, .images = NULL, @@ -4352,7 +4352,7 @@ const struct SpriteTemplate gNeverEndingNightmareFocusEnergySpriteTemplate = const struct SpriteTemplate gNeverEndingNightmareHandSpriteTemplate = { .tileTag = ANIM_TAG_ASSURANCE_HAND, - .paletteTag ANIM_TAG_ASSURANCE_HAND, + .paletteTag = ANIM_TAG_ASSURANCE_HAND, .oam = &gOamData_AffineNormal_ObjNormal_32x32, .anims = gDummySpriteAnimTable, .images = NULL, @@ -4600,7 +4600,7 @@ const struct SpriteTemplate gBloomDoomPetalSpinSpriteTemplate = const struct SpriteTemplate gBloomDoomGreenChargeSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, - .paletteTag ANIM_TAG_RAZOR_LEAF, + .paletteTag = ANIM_TAG_RAZOR_LEAF, .oam = &gOamData_AffineNormal_ObjBlend_64x64, .anims = gDummySpriteAnimTable, .images = NULL, diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 3c80c3610..6c78e6ad8 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -59,6 +59,13 @@ static u8 GetZMoveScore(u8 battlerAtk, u8 battlerDef, u16 baseMove, u16 zMove); static const struct SignatureZMove sSignatureZMoves[] = { #ifdef POKEMON_EXPANSION + {SPECIES_PIKACHU_COSPLAY, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_PIKACHU_ROCK_STAR, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_PIKACHU_BELLE, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_PIKACHU_POP_STAR, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_PIKACHU_PH_D, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_PIKACHU_LIBRE, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_RAICHU_ALOLAN, ITEM_ALORAICHIUM_Z, MOVE_THUNDERBOLT, MOVE_STOKED_SPARKSURFER}, {SPECIES_DECIDUEYE, ITEM_DECIDIUM_Z, MOVE_SPIRIT_SHACKLE, MOVE_SINISTER_ARROW_RAID}, {SPECIES_INCINEROAR, ITEM_INCINIUM_Z, MOVE_DARKEST_LARIAT, MOVE_MALICIOUS_MOONSAULT}, @@ -79,6 +86,7 @@ static const struct SignatureZMove sSignatureZMoves[] = {SPECIES_PIKACHU_KALOS_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, {SPECIES_PIKACHU_ALOLA_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, {SPECIES_PIKACHU_PARTNER_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_WORLD_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, {SPECIES_PRIMARINA, ITEM_PRIMARIUM_Z, MOVE_SPARKLING_ARIA, MOVE_OCEANIC_OPERETTA}, {SPECIES_SOLGALEO, ITEM_SOLGANIUM_Z, MOVE_SUNSTEEL_STRIKE, MOVE_SEARING_SUNRAZE_SMASH}, {SPECIES_NECROZMA_DUSK_MANE, ITEM_SOLGANIUM_Z, MOVE_SUNSTEEL_STRIKE, MOVE_SEARING_SUNRAZE_SMASH}, From 5a094a30338639648a89b365419263761064ca86 Mon Sep 17 00:00:00 2001 From: Xhyzi Date: Tue, 15 Jun 2021 16:22:42 +0200 Subject: [PATCH 025/208] Snap Trap --- include/constants/battle_string_ids.h | 3 ++- src/battle_message.c | 5 ++++- src/battle_script_commands.c | 2 +- src/data/battle_moves.h | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index cda885694..cf26ef2ef 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -570,8 +570,9 @@ #define STRINGID_MICLEBERRYACTIVATES 566 #define STRINGID_PKMNSHOOKOFFTHETAUNT 567 #define STRINGID_PKMNGOTOVERITSINFATUATION 568 +#define STRINGID_PKMNINSNAPTRAP 569 -#define BATTLESTRINGS_COUNT 569 +#define BATTLESTRINGS_COUNT 570 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_message.c b/src/battle_message.c index c4f043e15..d8b0fc8f9 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -147,6 +147,7 @@ static const u8 sText_PkmnDugHole[] = _("{B_ATK_NAME_WITH_PREFIX} dug a hole!"); static const u8 sText_PkmnHidUnderwater[] = _("{B_ATK_NAME_WITH_PREFIX} hid\nunderwater!"); static const u8 sText_PkmnSprangUp[] = _("{B_ATK_NAME_WITH_PREFIX} sprang up!"); static const u8 sText_PkmnSqueezedByBind[] = _("{B_DEF_NAME_WITH_PREFIX} was squeezed by\n{B_ATK_NAME_WITH_PREFIX}'s BIND!"); +static const u8 sText_PkmnInSnapTrap[] = _("{B_DEF_NAME_WITH_PREFIX} got trapped\nby a snap trap!"); static const u8 sText_PkmnTrappedInVortex[] = _("{B_DEF_NAME_WITH_PREFIX} was trapped\nin the vortex!"); static const u8 sText_PkmnTrappedBySandTomb[] = _("{B_DEF_NAME_WITH_PREFIX} was trapped\nby SAND TOMB!"); static const u8 sText_PkmnWrappedBy[] = _("{B_DEF_NAME_WITH_PREFIX} was WRAPPED by\n{B_ATK_NAME_WITH_PREFIX}!"); @@ -699,6 +700,7 @@ static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_P const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_PKMNINSNAPTRAP - 12] = sText_PkmnInSnapTrap, [STRINGID_PKMNGOTOVERITSINFATUATION - 12] = sText_PkmnGotOverItsInfatuation, [STRINGID_PKMNSHOOKOFFTHETAUNT - 12] = sText_PkmnShookOffTheTaunt, [STRINGID_MICLEBERRYACTIVATES - 12] = sText_MicleBerryActivates, @@ -1463,6 +1465,7 @@ const u16 gWrappedStringIds[] = STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL STRINGID_PKMNTRAPPEDBYSANDTOMB,// MOVE_SAND_TOMB STRINGID_INFESTATION, // MOVE_INFESTATION + STRINGID_PKMNINSNAPTRAP, // MOVE_SNAPTRAP }; const u16 gMistUsedStringIds[] = @@ -1675,7 +1678,7 @@ const u16 gCaughtMonStringIds[] = const u16 gTrappingMoves[] = { - MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_INFESTATION, 0xFFFF + MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_INFESTATION, MOVE_SNAP_TRAP, 0xFFFF }; const u16 gRoomsStringIds[] = diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c8a393da3..014c3c3c8 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2895,7 +2895,7 @@ void SetMoveEffect(bool32 primary, u32 certain) for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++) { - if (gBattleCommunication[MULTISTRING_CHOOSER] > 5) + if (gBattleCommunication[MULTISTRING_CHOOSER] > 6) break; if (gTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) break; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index db02083b0..69b612e0c 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10968,7 +10968,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SNAP_TRAP] = { - .effect = EFFECT_TRAP, //TODO: add case/effect + .effect = EFFECT_TRAP, .power = 35, .type = TYPE_GRASS, .accuracy = 100, From 60ce39543e8c918110c23deec7826e237851e2a6 Mon Sep 17 00:00:00 2001 From: Xhyzi Date: Tue, 15 Jun 2021 16:25:59 +0200 Subject: [PATCH 026/208] Expanding Force --- data/battle_scripts_1.s | 2 ++ include/constants/battle_move_effects.h | 3 ++- src/battle_util.c | 4 ++++ src/data/battle_moves.h | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 11616e300..6e667ebfe 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -369,6 +369,7 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectSleepHit .4byte BattleScript_EffectAttackerDefenseDownHit .4byte BattleScript_EffectBodyPress + .4byte BattleScript_EffectExpandingForce BattleScript_EffectAttackerDefenseDownHit: setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN @@ -2059,6 +2060,7 @@ BattleScript_EffectFusionCombo: BattleScript_EffectRevelationDance: BattleScript_EffectBelch: BattleScript_EffectBodyPress: +BattleScript_EffectExpandingForce: BattleScript_HitFromAtkCanceler:: attackcanceler diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 6174ca496..cfd4ccdef 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -353,7 +353,8 @@ #define EFFECT_SLEEP_HIT 347 // Relic Song #define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 348 #define EFFECT_BODY_PRESS 349 +#define EFFECT_EXPANDING_FORCE 350 -#define NUM_BATTLE_MOVE_EFFECTS 350 +#define NUM_BATTLE_MOVE_EFFECTS 351 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/battle_util.c b/src/battle_util.c index 0c8f2c8d1..92662bb20 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7210,6 +7210,10 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) if (gBattleMoves[gLastUsedMove].effect == EFFECT_FUSION_COMBO && move != gLastUsedMove) basePower *= 2; break; + case EFFECT_EXPANDING_FORCE: + if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN) + basePower = 120; + break; } if (basePower == 0) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 69b612e0c..b556a0a5c 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11220,7 +11220,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_EXPANDING_FORCE] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_EXPANDING_FORCE, .power = 80, .type = TYPE_PSYCHIC, .accuracy = 100, From 62525516a4e59d32693383b9835ce07e4b4fcf27 Mon Sep 17 00:00:00 2001 From: Xhyzi Date: Tue, 15 Jun 2021 16:50:19 +0200 Subject: [PATCH 027/208] Scale Shot --- data/battle_scripts_1.s | 57 +++++++++++++++++++++++++ include/constants/battle.h | 3 +- include/constants/battle_move_effects.h | 3 +- src/data/battle_moves.h | 4 +- 4 files changed, 63 insertions(+), 4 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 6e667ebfe..d85b8cff8 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -370,6 +370,63 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectAttackerDefenseDownHit .4byte BattleScript_EffectBodyPress .4byte BattleScript_EffectExpandingForce + .4byte BattleScript_EffectScaleShot + +BattleScript_EffectScaleShot:: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + setmultihitcounter 0x0 + initmultihitstring + sethword sMULTIHIT_EFFECT, 0x0 +BattleScript_ScaleShotLoop:: + jumpifhasnohp BS_ATTACKER, BattleScript_ScaleShotEnd + jumpifhasnohp BS_TARGET, BattleScript_ScaleShotPrintStrings + jumpifhalfword CMP_EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_ScaleShotDoMultiHit + jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_ScaleShotPrintStrings +BattleScript_ScaleShotDoMultiHit:: + movevaluescleanup + copyhword sMOVE_EFFECT, sMULTIHIT_EFFECT + critcalc + damagecalc + jumpifmovehadnoeffect BattleScript_ScaleShotMultiHitNoMoreHits + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage 0x40 + multihitresultmessage + printstring STRINGID_EMPTYSTRING3 + waitmessage 0x1 + addbyte sMULTIHIT_STRING + 4, 0x1 + moveendto MOVEEND_NEXT_TARGET + jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_ScaleShotPrintStrings + decrementmultihit BattleScript_ScaleShotLoop + goto BattleScript_ScaleShotPrintStrings +BattleScript_ScaleShotMultiHitNoMoreHits:: + pause 0x20 +BattleScript_ScaleShotPrintStrings:: + resultmessage + waitmessage 0x40 + jumpifmovehadnoeffect BattleScript_ScaleShotEnd + copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6 + printstring STRINGID_HITXTIMES + waitmessage 0x40 +BattleScript_ScaleShotEnd:: + setmoveeffect MOVE_EFFECT_SPD_PLUS_1 | MOVE_EFFECT_AFFECTS_USER + seteffectwithchance + setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER + seteffectwithchance + tryfaintmon BS_TARGET, FALSE, NULL + moveendcase MOVEEND_SYNCHRONIZE_TARGET + moveendfrom MOVEEND_STATUS_IMMUNITY_ABILITIES + end BattleScript_EffectAttackerDefenseDownHit: setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN diff --git a/include/constants/battle.h b/include/constants/battle.h index b158076bd..b925904c2 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -346,7 +346,8 @@ #define MOVE_EFFECT_THROAT_CHOP 0x43 #define MOVE_EFFECT_INCINERATE 0x44 #define MOVE_EFFECT_BUG_BITE 0x45 -#define NUM_MOVE_EFFECTS 0x46 +#define MOVE_EFFECT_SPD_PLUS_1_DEF_MINUS_1 0x46 +#define NUM_MOVE_EFFECTS 0x47 #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index cfd4ccdef..fd26204a1 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -354,7 +354,8 @@ #define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 348 #define EFFECT_BODY_PRESS 349 #define EFFECT_EXPANDING_FORCE 350 +#define EFFECT_SCALE_SHOT 351 -#define NUM_BATTLE_MOVE_EFFECTS 351 +#define NUM_BATTLE_MOVE_EFFECTS 352 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index b556a0a5c..83ff193a3 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11248,12 +11248,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SCALE_SHOT] = { - .effect = EFFECT_PLACEHOLDER, //TODO (EFFECT_MULTI_HIT + ABILITY_WEAK_ARMOR, + .effect = EFFECT_SCALE_SHOT, .power = 25, .type = TYPE_DRAGON, .accuracy = 90, .pp = 20, - .secondaryEffectChance = 0, + .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, From ee3f3eb78f5a51b8cb81b282a04fc2771d945bb7 Mon Sep 17 00:00:00 2001 From: Xhyzi Date: Tue, 15 Jun 2021 17:06:21 +0200 Subject: [PATCH 028/208] Meteor Beam --- data/battle_scripts_1.s | 27 +++++++++++++++++++++++++ include/constants/battle_move_effects.h | 3 ++- include/constants/battle_string_ids.h | 6 ++++-- src/battle_message.c | 3 +++ src/data/battle_moves.h | 2 +- 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index d85b8cff8..cc6a37668 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -371,6 +371,33 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectBodyPress .4byte BattleScript_EffectExpandingForce .4byte BattleScript_EffectScaleShot + .4byte BattleScript_EffectMeteorBeam + +BattleScript_EffectMeteorBeam:: + @ DecideTurn + jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn + jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn + setbyte sTWOTURN_STRINGID, B_MSG_TURN1_METEOR_BEAM + call BattleScript_FirstChargingTurnMeteorBeam + jumpifnoholdeffect BS_ATTACKER, HOLD_EFFECT_POWER_HERB, BattleScript_MoveEnd + call BattleScript_PowerHerbActivation + goto BattleScript_TwoTurnMovesSecondTurn + +BattleScript_FirstChargingTurnMeteorBeam:: + attackcanceler + printstring STRINGID_EMPTYSTRING3 + ppreduce + attackanimation + waitanimation + orword gHitMarker, HITMARKER_CHARGING + setmoveeffect MOVE_EFFECT_CHARGING | MOVE_EFFECT_AFFECTS_USER + seteffectprimary + copybyte cMULTISTRING_CHOOSER, sTWOTURN_STRINGID + printfromtable gFirstTurnOfTwoStringIds + waitmessage 0x40 + setmoveeffect MOVE_EFFECT_SP_ATK_PLUS_1 | MOVE_EFFECT_AFFECTS_USER + seteffectsecondary + return BattleScript_EffectScaleShot:: attackcanceler diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index fd26204a1..47721e447 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -355,7 +355,8 @@ #define EFFECT_BODY_PRESS 349 #define EFFECT_EXPANDING_FORCE 350 #define EFFECT_SCALE_SHOT 351 +#define EFFECT_METEOR_BEAM 352 -#define NUM_BATTLE_MOVE_EFFECTS 352 +#define NUM_BATTLE_MOVE_EFFECTS 353 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index cf26ef2ef..c1e35a312 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -570,9 +570,10 @@ #define STRINGID_MICLEBERRYACTIVATES 566 #define STRINGID_PKMNSHOOKOFFTHETAUNT 567 #define STRINGID_PKMNGOTOVERITSINFATUATION 568 -#define STRINGID_PKMNINSNAPTRAP 569 +#define STRINGID_PKMNINSNAPTRAP 569 +#define STRINGID_METEORBEAMCHARGING 570 -#define BATTLESTRINGS_COUNT 570 +#define BATTLESTRINGS_COUNT 571 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. @@ -623,6 +624,7 @@ #define B_MSG_TURN1_PHANTOM_FORCE 8 #define B_MSG_TURN1_GEOMANCY 9 #define B_MSG_TURN1_FREEZE_SHOCK 10 +#define B_MSG_TURN1_METEOR_BEAM 11 // gMoveWeatherChangeStringIds #define B_MSG_STARTED_RAIN 0 diff --git a/src/battle_message.c b/src/battle_message.c index d8b0fc8f9..fd33527a2 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -697,9 +697,11 @@ static const u8 sText_CanActFaster[] = _("{B_ATK_NAME_WITH_PREFIX} can act faste static const u8 sText_MicleBerryActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted the accuracy of its\nnext move using {B_LAST_ITEM}!"); static const u8 sText_PkmnShookOffTheTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} shook off\nthe taunt!"); static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!"); +static const u8 sText_MeteorBeamCharging[] = _("{B_ATK_NAME_WITH_PREFIX} is overflowing\nwith space energy!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_METEORBEAMCHARGING - 12] = sText_MeteorBeamCharging, [STRINGID_PKMNINSNAPTRAP - 12] = sText_PkmnInSnapTrap, [STRINGID_PKMNGOTOVERITSINFATUATION - 12] = sText_PkmnGotOverItsInfatuation, [STRINGID_PKMNSHOOKOFFTHETAUNT - 12] = sText_PkmnShookOffTheTaunt, @@ -1453,6 +1455,7 @@ const u16 gFirstTurnOfTwoStringIds[] = [B_MSG_TURN1_PHANTOM_FORCE] = STRINGID_VANISHEDINSTANTLY, [B_MSG_TURN1_GEOMANCY] = STRINGID_PKNMABSORBINGPOWER, [B_MSG_TURN1_FREEZE_SHOCK] = STRINGID_CLOAKEDINAFREEZINGLIGHT, + [B_MSG_TURN1_METEOR_BEAM] = STRINGID_METEORBEAMCHARGING, }; // Index copied from move's index in gTrappingMoves diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 83ff193a3..680c008fd 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11262,7 +11262,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_METEOR_BEAM] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_METEOR_BEAM, .power = 120, .type = TYPE_ROCK, .accuracy = 90, From e7ec4df70bf89def1630b5e184b431d3e46eaf7a Mon Sep 17 00:00:00 2001 From: Xhyzi Date: Tue, 15 Jun 2021 17:36:50 +0200 Subject: [PATCH 029/208] Rising Voltage --- data/battle_scripts_1.s | 2 ++ include/constants/battle_move_effects.h | 3 ++- src/battle_util.c | 5 +++++ src/data/battle_moves.h | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index cc6a37668..2e5ad0253 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -372,6 +372,7 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectExpandingForce .4byte BattleScript_EffectScaleShot .4byte BattleScript_EffectMeteorBeam + .4byte BattleScript_EffectRisingVoltage BattleScript_EffectMeteorBeam:: @ DecideTurn @@ -2145,6 +2146,7 @@ BattleScript_EffectRevelationDance: BattleScript_EffectBelch: BattleScript_EffectBodyPress: BattleScript_EffectExpandingForce: +BattleScript_EffectRisingVoltage: BattleScript_HitFromAtkCanceler:: attackcanceler diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 47721e447..03ea11136 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -356,7 +356,8 @@ #define EFFECT_EXPANDING_FORCE 350 #define EFFECT_SCALE_SHOT 351 #define EFFECT_METEOR_BEAM 352 +#define EFFECT_RISING_VOLTAGE 353 -#define NUM_BATTLE_MOVE_EFFECTS 353 +#define NUM_BATTLE_MOVE_EFFECTS 354 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/battle_util.c b/src/battle_util.c index 92662bb20..4c46250dc 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7214,6 +7214,11 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN) basePower = 120; break; + case EFFECT_RISING_VOLTAGE: + if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && !IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING) + && gBattleMons[battlerDef].item != ITEM_AIR_BALLOON && gBattleMons[battlerDef].ability != ABILITY_LEVITATE) + basePower *= 2; + break; } if (basePower == 0) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 680c008fd..9e0c18298 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11318,7 +11318,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_RISING_VOLTAGE] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_RISING_VOLTAGE, .power = 70, .type = TYPE_ELECTRIC, .accuracy = 100, From 7799e49e3a3f5ef65a39c7acd392b05b3b61961e Mon Sep 17 00:00:00 2001 From: Xhyzi Date: Tue, 15 Jun 2021 19:44:38 +0200 Subject: [PATCH 030/208] Corrosive Gas --- asm/macros/battle_script.inc | 5 +++ data/battle_scripts_1.s | 19 ++++++++++ include/battle.h | 1 + include/battle_scripts.h | 1 + include/constants/battle.h | 1 + include/constants/battle_move_effects.h | 3 +- include/constants/battle_script_commands.h | 1 + include/constants/battle_string_ids.h | 3 +- src/battle_message.c | 2 + src/battle_script_commands.c | 43 ++++++++++++++++++++-- src/battle_util.c | 5 +++ src/data/battle_moves.h | 2 +- 12 files changed, 80 insertions(+), 6 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 9fa3fe0c3..9384a0f9d 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1769,6 +1769,11 @@ various \battler, VARIOUS_TRY_ACTIVATE_GRIM_NEIGH .endm + .macro trysetcorrosivegas battler:req, ptr:req + various \battler, VARIOUS_TRY_SET_CORROSIVE_GAS + .4byte \ptr + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 2e5ad0253..e1e7fbf9d 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -373,6 +373,25 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectScaleShot .4byte BattleScript_EffectMeteorBeam .4byte BattleScript_EffectRisingVoltage + .4byte BattleScript_EffectCorrosiveGas + +BattleScript_EffectCorrosiveGas:: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, NO_ACC_CALC_CHECK_LOCK_ON + attackstring + ppreduce + jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_PrintMoveMissed + trysetcorrosivegas BS_TARGET, BattleScript_ButItFailed + attackanimation + waitanimation + printstring STRINGID_ITEMMELTED + waitmessage 0x40 + goto BattleScript_MoveEnd + +BattleScript_MeltedItem:: + printstring STRINGID_ITEMMELTED + waitmessage 0x40 + return BattleScript_EffectMeteorBeam:: @ DecideTurn diff --git a/include/battle.h b/include/battle.h index f009cbe7f..7212c4084 100644 --- a/include/battle.h +++ b/include/battle.h @@ -229,6 +229,7 @@ struct WishFutureKnock u8 wishMonId[MAX_BATTLERS_COUNT]; u8 weatherDuration; u8 knockedOffMons[2]; // Each battler is represented by a bit. The array entry is dependent on the battler's side. + u8 meltedItemMons[2]; // Same as above }; struct AI_SavedBattleMon diff --git a/include/battle_scripts.h b/include/battle_scripts.h index f0712fc43..7ae55d01f 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -369,5 +369,6 @@ extern const u8 BattleScript_JabocaRowapBerryActivates[]; extern const u8 BattleScript_NotAffectedAbilityPopUp[]; extern const u8 BattleScript_BattlerShookOffTaunt[]; extern const u8 BattleScript_BattlerGotOverItsInfatuation[]; +extern const u8 BattleScript_MeltedItem[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle.h b/include/constants/battle.h index b925904c2..d7bae55c3 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -347,6 +347,7 @@ #define MOVE_EFFECT_INCINERATE 0x44 #define MOVE_EFFECT_BUG_BITE 0x45 #define MOVE_EFFECT_SPD_PLUS_1_DEF_MINUS_1 0x46 +#define MOVE_EFFECT_MELT_ITEM 0x4A #define NUM_MOVE_EFFECTS 0x47 #define MOVE_EFFECT_AFFECTS_USER 0x4000 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 03ea11136..d88b34a53 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -357,7 +357,8 @@ #define EFFECT_SCALE_SHOT 351 #define EFFECT_METEOR_BEAM 352 #define EFFECT_RISING_VOLTAGE 353 +#define EFFECT_CORROSIVE_GAS 354 -#define NUM_BATTLE_MOVE_EFFECTS 354 +#define NUM_BATTLE_MOVE_EFFECTS 355 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index faaf8f17e..f35dbe2e3 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -173,6 +173,7 @@ #define VARIOUS_DESTROY_ABILITY_POPUP 102 #define VARIOUS_TOTEM_BOOST 103 #define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 104 +#define VARIOUS_TRY_SET_CORROSIVE_GAS 105 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index c1e35a312..72f178de7 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -572,8 +572,9 @@ #define STRINGID_PKMNGOTOVERITSINFATUATION 568 #define STRINGID_PKMNINSNAPTRAP 569 #define STRINGID_METEORBEAMCHARGING 570 +#define STRINGID_ITEMMELTED 571 -#define BATTLESTRINGS_COUNT 571 +#define BATTLESTRINGS_COUNT 572 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_message.c b/src/battle_message.c index fd33527a2..4d1ae2ddb 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -698,9 +698,11 @@ static const u8 sText_MicleBerryActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} static const u8 sText_PkmnShookOffTheTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} shook off\nthe taunt!"); static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!"); static const u8 sText_MeteorBeamCharging[] = _("{B_ATK_NAME_WITH_PREFIX} is overflowing\nwith space energy!"); +static const u8 sText_PkmnItemMelted[] = _("{B_ATK_NAME_WITH_PREFIX} corroded\n{B_DEF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_ITEMMELTED - 12] = sText_PkmnItemMelted, [STRINGID_METEORBEAMCHARGING - 12] = sText_MeteorBeamCharging, [STRINGID_PKMNINSNAPTRAP - 12] = sText_PkmnInSnapTrap, [STRINGID_PKMNGOTOVERITSINFATUATION - 12] = sText_PkmnGotOverItsInfatuation, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 014c3c3c8..9915654c5 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3021,7 +3021,8 @@ void SetMoveEffect(bool32 primary, u32 certain) | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_SECRET_BASE)) - && (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) + && (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]] + || gWishFutureKnock.meltedItemMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) { gBattlescriptCurrInstr++; } @@ -5267,6 +5268,11 @@ static void Cmd_switchindataupdate(void) { gBattleMons[gActiveBattler].item = 0; } + // check melted items + if (gWishFutureKnock.meltedItemMons[i] & gBitTable[gBattlerPartyIndexes[gActiveBattler]]) + { + gBattleMons[gActiveBattler].item = 0; + } if (gBattleMoves[gCurrentMove].effect == EFFECT_BATON_PASS) { @@ -8422,6 +8428,35 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; // exit if loop failed (failsafe) } return; + case VARIOUS_TRY_SET_CORROSIVE_GAS: + if (gBattleMons[gActiveBattler].item != 0 + && CanBattlerGetOrLoseItem(gActiveBattler, gBattleMons[gActiveBattler].item) + && !NoAliveMonsForEitherParty()) + { + if (GetBattlerAbility(gActiveBattler) == ABILITY_STICKY_HOLD && IsBattlerAlive(gActiveBattler)) + { + gBattlerAbility = gActiveBattler; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_StickyHoldActivates; + } + else + { //Item is melted normally + u32 side = GetBattlerSide(gActiveBattler); + + gLastUsedItem = gBattleMons[gActiveBattler].item; + gBattleMons[gActiveBattler].item = 0; + gBattleStruct->choicedMove[gActiveBattler] = 0; + gWishFutureKnock.meltedItemMons[side] |= gBitTable[gBattlerPartyIndexes[gActiveBattler]]; + + CheckSetUnburden(gActiveBattler); + gBattlescriptCurrInstr += 7; + } + } + else + { + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + } + return; } gBattlescriptCurrInstr += 3; @@ -11206,14 +11241,16 @@ static void Cmd_tryswapitems(void) // trick u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = GetBattlerSide(gBattlerTarget); - // you can't swap items if they were knocked off in regular battles + // you can't swap items if they were knocked off or melted in regular battles if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_SECRET_BASE | BATTLE_TYPE_RECORDED_LINK)) && (gWishFutureKnock.knockedOffMons[sideAttacker] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]] - || gWishFutureKnock.knockedOffMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]])) + || gWishFutureKnock.knockedOffMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]] + || gWishFutureKnock.meltedItemMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]] + || gWishFutureKnock.meltedItemMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]])) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } diff --git a/src/battle_util.c b/src/battle_util.c index 4c46250dc..9d7453bab 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7215,8 +7215,13 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower = 120; break; case EFFECT_RISING_VOLTAGE: + #ifdef ITEM_EXPANSION //Air Baloon exception with item expansion branch if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && !IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING) && gBattleMons[battlerDef].item != ITEM_AIR_BALLOON && gBattleMons[battlerDef].ability != ABILITY_LEVITATE) + #else + if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && !IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING) + && gBattleMons[battlerDef].ability != ABILITY_LEVITATE) + #endif basePower *= 2; break; } diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 9e0c18298..20449e446 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11402,7 +11402,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_CORROSIVE_GAS] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_CORROSIVE_GAS, .power = 0, .type = TYPE_POISON, .accuracy = 100, From 0202b75822bbbc98787c28a6d19ce754b15ae5fb Mon Sep 17 00:00:00 2001 From: Xhyzi Date: Tue, 15 Jun 2021 19:57:21 +0200 Subject: [PATCH 031/208] Beak Blast --- asm/macros/battle_script.inc | 4 +++ data/battle_anim_scripts.s | 5 ++-- data/battle_scripts_1.s | 30 ++++++++++++++++++++++ include/battle.h | 1 + include/battle_scripts.h | 2 ++ include/constants/battle_anim.h | 1 + include/constants/battle_move_effects.h | 3 ++- include/constants/battle_script_commands.h | 1 + include/constants/battle_string_ids.h | 3 ++- src/battle_main.c | 14 +++++++--- src/battle_message.c | 2 ++ src/battle_script_commands.c | 10 ++++++++ src/data/battle_moves.h | 2 +- 13 files changed, 69 insertions(+), 9 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 9384a0f9d..1405dd258 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1774,6 +1774,10 @@ .4byte \ptr .endm + .macro setbeakblast battler:req + various \battler, VARIOUS_SET_BEAK_BLAST + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 65bac00d7..ee401010a 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -822,6 +822,7 @@ gBattleAnims_General:: .4byte General_SlideOffScreen @ B_ANIM_SLIDE_OFFSCREEN .4byte General_RestoreBg @ B_ANIM_RESTORE_BG .4byte General_TotemFlare @ B_ANIM_TOTEM_FLARE + .4byte General_BeakBlastSetUp @ B_ANIM_BEAK_BLAST_SETUP .align 2 gBattleAnims_Special:: @@ -11673,7 +11674,7 @@ Move_INSTRUCT:: blendoff end -Move_BEAK_BLAST:: +General_BeakBlastSetUp: loadspritegfx ANIM_TAG_SMALL_EMBER @Fire playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER delay 0x3 @@ -11681,7 +11682,7 @@ Move_BEAK_BLAST:: launchtemplate gFireSpiralOutwardSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x0 waitforvisualfinish end -BeakBlastUnleash: +Move_BEAK_BLAST:: loadspritegfx ANIM_TAG_IMPACT launchtask AnimTask_BlendBattleAnimPal 0xA 0x5 ANIM_PAL_ATK 0x2 0x0 0x9 0x1F waitforvisualfinish diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index e1e7fbf9d..02da8a3bb 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -374,7 +374,37 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectMeteorBeam .4byte BattleScript_EffectRisingVoltage .4byte BattleScript_EffectCorrosiveGas + .4byte BattleScript_EffectBeakBlast +BattleScript_EffectBeakBlast:: + attackcanceler + jumpifnodamage BattleScript_HitFromAccCheck + ppreduce + printstring STRINGID_PKMNLOSTFOCUS + waitmessage 0x40 + goto BattleScript_MoveEnd + +BattleScript_BeakBlastSetUp:: + setbeakblast BS_ATTACKER + printstring STRINGID_EMPTYSTRING3 + waitmessage 0x1 + playanimation BS_ATTACKER, B_ANIM_BEAK_BLAST_SETUP, NULL + printstring STRINGID_HEATUPBEAK + waitmessage 0x40 + end2 + +BattleScript_BeakBlastBurn:: + jumpifstatus BS_TARGET, STATUS1_BURN, BattleScript_AlreadyBurned + jumpiftype BS_TARGET, TYPE_FIRE, BattleScript_NotAffected + jumpifability BS_TARGET, ABILITY_WATER_VEIL, BattleScript_WaterVeilPrevents + jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects + jumpifflowerveil BattleScript_FlowerVeilProtects + jumpifleafguard BattleScript_LeafGuardProtects + jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_BeakBlastBurnReturn + setmoveeffect MOVE_EFFECT_BURN | MOVE_EFFECT_AFFECTS_USER + seteffectprimary +BattleScript_BeakBlastBurnReturn: + return BattleScript_EffectCorrosiveGas:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, NO_ACC_CALC_CHECK_LOCK_ON diff --git a/include/battle.h b/include/battle.h index 7212c4084..a86c6d34e 100644 --- a/include/battle.h +++ b/include/battle.h @@ -144,6 +144,7 @@ struct ProtectStruct u32 usedThroatChopPreventedMove:1; u32 micle:1; u32 custap:1; // also quick claw + u32 beakBlastCharge:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 7ae55d01f..ffb824f0b 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -370,5 +370,7 @@ extern const u8 BattleScript_NotAffectedAbilityPopUp[]; extern const u8 BattleScript_BattlerShookOffTaunt[]; extern const u8 BattleScript_BattlerGotOverItsInfatuation[]; extern const u8 BattleScript_MeltedItem[]; +extern const u8 BattleScript_BeakBlastSetUp[]; +extern const u8 BattleScript_BeakBlastBurn[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index c04bc14f7..cfccef926 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -523,6 +523,7 @@ #define B_ANIM_SLIDE_OFFSCREEN 26 // for Emergency Exit #define B_ANIM_RESTORE_BG 27 // for Terrain Endings #define B_ANIM_TOTEM_FLARE 28 // Totem boosts aura flare +#define B_ANIM_BEAK_BLAST_SETUP 29 // special animations table (gBattleAnims_Special) #define B_ANIM_LVL_UP 0 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index d88b34a53..1ccba4d43 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -358,7 +358,8 @@ #define EFFECT_METEOR_BEAM 352 #define EFFECT_RISING_VOLTAGE 353 #define EFFECT_CORROSIVE_GAS 354 +#define EFFECT_BEAK_BLAST 355 -#define NUM_BATTLE_MOVE_EFFECTS 355 +#define NUM_BATTLE_MOVE_EFFECTS 356 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index f35dbe2e3..ea96e6b4d 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -174,6 +174,7 @@ #define VARIOUS_TOTEM_BOOST 103 #define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 104 #define VARIOUS_TRY_SET_CORROSIVE_GAS 105 +#define VARIOUS_SET_BEAK_BLAST 106 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 72f178de7..698b7e595 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -573,8 +573,9 @@ #define STRINGID_PKMNINSNAPTRAP 569 #define STRINGID_METEORBEAMCHARGING 570 #define STRINGID_ITEMMELTED 571 +#define STRINGID_HEATUPBEAK 572 -#define BATTLESTRINGS_COUNT 572 +#define BATTLESTRINGS_COUNT 573 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_main.c b/src/battle_main.c index 9cf56abf7..f053c13ef 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4598,13 +4598,19 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void) { gActiveBattler = gBattlerAttacker = gBattleStruct->focusPunchBattlerId; gBattleStruct->focusPunchBattlerId++; - if (gChosenMoveByBattler[gActiveBattler] == MOVE_FOCUS_PUNCH - && !(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) + if (!(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) && !(gDisableStructs[gBattlerAttacker].truantCounter) && !(gProtectStructs[gActiveBattler].noValidMoves)) { - BattleScriptExecute(BattleScript_FocusPunchSetUp); - return; + switch(gChosenMoveByBattler[gActiveBattler]) + { + case MOVE_FOCUS_PUNCH: + BattleScriptExecute(BattleScript_FocusPunchSetUp); + return; + case MOVE_BEAK_BLAST: + BattleScriptExecute(BattleScript_BeakBlastSetUp); + return; + } } } } diff --git a/src/battle_message.c b/src/battle_message.c index 4d1ae2ddb..d2ae86e13 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -699,9 +699,11 @@ static const u8 sText_PkmnShookOffTheTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!"); static const u8 sText_MeteorBeamCharging[] = _("{B_ATK_NAME_WITH_PREFIX} is overflowing\nwith space energy!"); static const u8 sText_PkmnItemMelted[] = _("{B_ATK_NAME_WITH_PREFIX} corroded\n{B_DEF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}!"); +static const u8 sText_HeatingUpBeak[] = _("{B_ATK_NAME_WITH_PREFIX} started\nheating up its beak!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_HEATUPBEAK - 12] = sText_HeatingUpBeak, [STRINGID_ITEMMELTED - 12] = sText_PkmnItemMelted, [STRINGID_METEORBEAMCHARGING - 12] = sText_MeteorBeamCharging, [STRINGID_PKMNINSNAPTRAP - 12] = sText_PkmnInSnapTrap, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 9915654c5..0565f06d1 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4807,6 +4807,12 @@ static void Cmd_moveend(void) gBattlescriptCurrInstr = BattleScript_BanefulBunkerEffect; effect = 1; } + else if (gProtectStructs[gBattlerTarget].beakBlastCharge) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BeakBlastBurn; + effect = 1; + } } gBattleScripting.moveendState++; break; @@ -7867,6 +7873,7 @@ static void Cmd_various(void) case MOVE_MIRROR_COAT: case MOVE_METAL_BURST: case MOVE_ME_FIRST: + case MOVE_BEAK_BLAST: gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); break; default: @@ -8457,6 +8464,9 @@ static void Cmd_various(void) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); } return; + case VARIOUS_SET_BEAK_BLAST: + gProtectStructs[gActiveBattler].beakBlastCharge = 1; + break; } gBattlescriptCurrInstr += 3; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 20449e446..2455b90cd 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10127,7 +10127,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_BEAK_BLAST] = { - .effect = EFFECT_PLACEHOLDER, + .effect = EFFECT_BEAK_BLAST, .power = 100, .type = TYPE_FLYING, .accuracy = 100, From 271f19e6cb0ad7450ac127d20865aee6fb8c3f32 Mon Sep 17 00:00:00 2001 From: Xhyzi Date: Tue, 15 Jun 2021 20:01:57 +0200 Subject: [PATCH 032/208] Terrain Pulse --- data/battle_scripts_1.s | 2 ++ include/constants/battle_move_effects.h | 3 ++- src/battle_main.c | 11 +++++++++++ src/battle_util.c | 4 ++++ src/data/battle_moves.h | 2 +- 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 02da8a3bb..6f074b664 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -375,6 +375,7 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectRisingVoltage .4byte BattleScript_EffectCorrosiveGas .4byte BattleScript_EffectBeakBlast + .4byte BattleScript_EffectTerrainPulse BattleScript_EffectBeakBlast:: attackcanceler @@ -2196,6 +2197,7 @@ BattleScript_EffectBelch: BattleScript_EffectBodyPress: BattleScript_EffectExpandingForce: BattleScript_EffectRisingVoltage: +BattleScript_EffectTerrainPulse: BattleScript_HitFromAtkCanceler:: attackcanceler diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 1ccba4d43..d975da2fb 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -359,7 +359,8 @@ #define EFFECT_RISING_VOLTAGE 353 #define EFFECT_CORROSIVE_GAS 354 #define EFFECT_BEAK_BLAST 355 +#define EFFECT_TERRAIN_PULSE 356 -#define NUM_BATTLE_MOVE_EFFECTS 356 +#define NUM_BATTLE_MOVE_EFFECTS 357 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/battle_main.c b/src/battle_main.c index f053c13ef..9f5105151 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5070,6 +5070,17 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) if (ItemId_GetPocket(gBattleMons[battlerAtk].item) == POCKET_BERRIES) gBattleStruct->dynamicMoveType = gNaturalGiftTable[ITEM_TO_BERRY(gBattleMons[battlerAtk].item)].type; } + else if (gBattleMoves[move].effect == EFFECT_TERRAIN_PULSE) + { + if (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN) + gBattleStruct->dynamicMoveType = TYPE_FAIRY | 0x80; + else if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) + gBattleStruct->dynamicMoveType = TYPE_ELECTRIC | 0x80; + else if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN) + gBattleStruct->dynamicMoveType = TYPE_PSYCHIC | 0x80; + else if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN) + gBattleStruct->dynamicMoveType = TYPE_GRASS | 0x80; + } attackerAbility = GetBattlerAbility(battlerAtk); GET_MOVE_TYPE(move, moveType); diff --git a/src/battle_util.c b/src/battle_util.c index 9d7453bab..1f0ef56ae 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7224,6 +7224,10 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) #endif basePower *= 2; break; + case EFFECT_TERRAIN_PULSE: + if (gFieldStatuses & (STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN)) + basePower *= 2; + break; } if (basePower == 0) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 2455b90cd..8bcdccc85 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11332,7 +11332,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_TERRAIN_PULSE] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_TERRAIN_PULSE, .power = 50, .type = TYPE_NORMAL, .accuracy = 100, From 155e9b6332e505596e9308a71526d1a37c11ee62 Mon Sep 17 00:00:00 2001 From: Xhyzi Date: Tue, 15 Jun 2021 20:14:10 +0200 Subject: [PATCH 033/208] Court Change --- asm/macros/battle_script.inc | 4 + data/battle_scripts_1.s | 13 ++ include/constants/battle_move_effects.h | 3 +- include/constants/battle_script_commands.h | 1 + include/constants/battle_string_ids.h | 3 +- src/battle_message.c | 2 + src/battle_script_commands.c | 163 +++++++++++++++++++++ src/data/battle_moves.h | 2 +- 8 files changed, 188 insertions(+), 3 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 1405dd258..5cef3c769 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1778,6 +1778,10 @@ various \battler, VARIOUS_SET_BEAK_BLAST .endm + .macro swapsidestatuses + various BS_ATTACKER, VARIOUS_SWAP_SIDE_STATUSES + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 6f074b664..bf501678c 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -376,6 +376,19 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectCorrosiveGas .4byte BattleScript_EffectBeakBlast .4byte BattleScript_EffectTerrainPulse + .4byte BattleScript_EffectCourtChange + +BattleScript_EffectCourtChange:: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + swapsidestatuses + attackanimation + waitanimation + printstring STRINGID_COURTCHANGE + waitmessage 0x40 + goto BattleScript_MoveEnd BattleScript_EffectBeakBlast:: attackcanceler diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index d975da2fb..b6ad6e487 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -360,7 +360,8 @@ #define EFFECT_CORROSIVE_GAS 354 #define EFFECT_BEAK_BLAST 355 #define EFFECT_TERRAIN_PULSE 356 +#define EFFECT_COURT_CHANGE 357 -#define NUM_BATTLE_MOVE_EFFECTS 357 +#define NUM_BATTLE_MOVE_EFFECTS 358 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index ea96e6b4d..8ae661af3 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -175,6 +175,7 @@ #define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 104 #define VARIOUS_TRY_SET_CORROSIVE_GAS 105 #define VARIOUS_SET_BEAK_BLAST 106 +#define VARIOUS_SWAP_SIDE_STATUSES 107 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 698b7e595..cfe25be1b 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -574,8 +574,9 @@ #define STRINGID_METEORBEAMCHARGING 570 #define STRINGID_ITEMMELTED 571 #define STRINGID_HEATUPBEAK 572 +#define STRINGID_COURTCHANGE 573 -#define BATTLESTRINGS_COUNT 573 +#define BATTLESTRINGS_COUNT 574 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_message.c b/src/battle_message.c index d2ae86e13..2a9d80424 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -700,9 +700,11 @@ static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_P static const u8 sText_MeteorBeamCharging[] = _("{B_ATK_NAME_WITH_PREFIX} is overflowing\nwith space energy!"); static const u8 sText_PkmnItemMelted[] = _("{B_ATK_NAME_WITH_PREFIX} corroded\n{B_DEF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}!"); static const u8 sText_HeatingUpBeak[] = _("{B_ATK_NAME_WITH_PREFIX} started\nheating up its beak!"); +static const u8 sText_CourtChange[] = _("{B_ATK_NAME_WITH_PREFIX} swapped the battle\neffects affecting each side!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_COURTCHANGE - 12] = sText_CourtChange, [STRINGID_HEATUPBEAK - 12] = sText_HeatingUpBeak, [STRINGID_ITEMMELTED - 12] = sText_PkmnItemMelted, [STRINGID_METEORBEAMCHARGING - 12] = sText_MeteorBeamCharging, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 0565f06d1..3e91205ac 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8467,6 +8467,169 @@ static void Cmd_various(void) case VARIOUS_SET_BEAK_BLAST: gProtectStructs[gActiveBattler].beakBlastCharge = 1; break; + case VARIOUS_SWAP_SIDE_STATUSES: + /* This code is a mess, but idk how to do it better without changing how Side Statuses and + Side timers work. + The problem is that not all side statuses are affected by Court Change*/ + + //todo: add pledge related effects + //todo: add gigamax related effects + + //swap side status sides + bits = gSideStatuses[0]; //Stores sides status temp + + //Reflect + if (gSideStatuses[1] & SIDE_STATUS_REFLECT) + gSideStatuses[0] |= SIDE_STATUS_REFLECT; + else + gSideStatuses[0] &= ~(SIDE_STATUS_REFLECT); + + if (bits & SIDE_STATUS_REFLECT) + gSideStatuses[1] |= SIDE_STATUS_REFLECT; + else + gSideStatuses[1] &= ~(SIDE_STATUS_REFLECT); + + //Light screen + if (gSideStatuses[1] & SIDE_STATUS_LIGHTSCREEN) + gSideStatuses[0] |= SIDE_STATUS_LIGHTSCREEN; + else + gSideStatuses[0] &= ~(SIDE_STATUS_LIGHTSCREEN); + + if (bits & SIDE_STATUS_LIGHTSCREEN) + gSideStatuses[1] |= SIDE_STATUS_LIGHTSCREEN; + else + gSideStatuses[1] &= ~(SIDE_STATUS_LIGHTSCREEN); + + //Safeguard + if (gSideStatuses[1] & SIDE_STATUS_SAFEGUARD) + gSideStatuses[0] |= SIDE_STATUS_SAFEGUARD; + else + gSideStatuses[0] &= ~(SIDE_STATUS_SAFEGUARD); + + if (bits & SIDE_STATUS_SAFEGUARD) + gSideStatuses[1] |= SIDE_STATUS_SAFEGUARD; + else + gSideStatuses[1] &= ~(SIDE_STATUS_SAFEGUARD); + + //Mist + if (gSideStatuses[1] & SIDE_STATUS_MIST) + gSideStatuses[0] |= SIDE_STATUS_MIST; + else + gSideStatuses[0] &= ~(SIDE_STATUS_MIST); + + if (bits & SIDE_STATUS_MIST) + gSideStatuses[1] |= SIDE_STATUS_MIST; + else + gSideStatuses[1] &= ~(SIDE_STATUS_MIST); + + //AuroraVeil + if (gSideStatuses[1] & SIDE_STATUS_AURORA_VEIL) + gSideStatuses[0] |= SIDE_STATUS_AURORA_VEIL; + else + gSideStatuses[0] &= ~(SIDE_STATUS_AURORA_VEIL); + + if (bits & SIDE_STATUS_AURORA_VEIL) + gSideStatuses[1] |= SIDE_STATUS_AURORA_VEIL; + else + gSideStatuses[1] &= ~(SIDE_STATUS_AURORA_VEIL); + + //Sticky Web + if (gSideStatuses[1] & SIDE_STATUS_STICKY_WEB) + gSideStatuses[0] |= SIDE_STATUS_STICKY_WEB; + else + gSideStatuses[0] &= ~(SIDE_STATUS_STICKY_WEB); + + if (bits & SIDE_STATUS_STICKY_WEB) + gSideStatuses[1] |= SIDE_STATUS_STICKY_WEB; + else + gSideStatuses[1] &= ~(SIDE_STATUS_STICKY_WEB); + + //Spikes + if (gSideStatuses[1] & SIDE_STATUS_SPIKES) + gSideStatuses[0] |= SIDE_STATUS_SPIKES; + else + gSideStatuses[0] &= ~(SIDE_STATUS_SPIKES); + + if (bits & SIDE_STATUS_SPIKES) + gSideStatuses[1] |= SIDE_STATUS_SPIKES; + else + gSideStatuses[1] &= ~(SIDE_STATUS_SPIKES); + + //Toxic Spikes + if (gSideStatuses[1] & SIDE_STATUS_TOXIC_SPIKES) + gSideStatuses[0] |= SIDE_STATUS_TOXIC_SPIKES; + else + gSideStatuses[0] &= ~(SIDE_STATUS_TOXIC_SPIKES); + + if (bits & SIDE_STATUS_TOXIC_SPIKES) + gSideStatuses[1] |= SIDE_STATUS_TOXIC_SPIKES; + else + gSideStatuses[1] &= ~(SIDE_STATUS_TOXIC_SPIKES); + + //Stealth Rock + if (gSideStatuses[1] & SIDE_STATUS_STEALTH_ROCK) + gSideStatuses[0] |= SIDE_STATUS_STEALTH_ROCK; + else + gSideStatuses[0] &= ~(SIDE_STATUS_STEALTH_ROCK); + + if (bits & SIDE_STATUS_STEALTH_ROCK) + gSideStatuses[1] |= SIDE_STATUS_STEALTH_ROCK; + else + gSideStatuses[1] &= ~(SIDE_STATUS_STEALTH_ROCK); + + //Tailwind + if (gSideStatuses[1] & SIDE_STATUS_TAILWIND) + gSideStatuses[0] |= SIDE_STATUS_TAILWIND; + else + gSideStatuses[0] &= ~(SIDE_STATUS_TAILWIND); + + if (bits & SIDE_STATUS_TAILWIND) + gSideStatuses[1] |= SIDE_STATUS_TAILWIND; + else + gSideStatuses[1] &= ~(SIDE_STATUS_TAILWIND); + + + //Swap affected status timers + bits = gSideTimers[0].reflectTimer; + gSideTimers[0].reflectTimer = gSideTimers[1].reflectTimer; + gSideTimers[1].reflectTimer = bits; + + bits = gSideTimers[0].lightscreenTimer; + gSideTimers[0].lightscreenTimer = gSideTimers[1].lightscreenTimer; + gSideTimers[1].lightscreenTimer = bits; + + bits = gSideTimers[0].mistTimer; + gSideTimers[0].mistTimer = gSideTimers[1].mistTimer; + gSideTimers[1].mistTimer = bits; + + bits = gSideTimers[0].safeguardTimer; + gSideTimers[0].safeguardTimer = gSideTimers[1].safeguardTimer; + gSideTimers[1].safeguardTimer = bits; + + bits = gSideTimers[0].spikesAmount; + gSideTimers[0].spikesAmount = gSideTimers[1].spikesAmount; + gSideTimers[1].spikesAmount = bits; + + bits = gSideTimers[0].toxicSpikesAmount; + gSideTimers[0].toxicSpikesAmount = gSideTimers[1].toxicSpikesAmount; + gSideTimers[1].toxicSpikesAmount = bits; + + bits = gSideTimers[0].stealthRockAmount; + gSideTimers[0].stealthRockAmount = gSideTimers[1].stealthRockAmount; + gSideTimers[1].stealthRockAmount = bits; + + bits = gSideTimers[0].stickyWebAmount; + gSideTimers[0].stickyWebAmount = gSideTimers[1].stickyWebAmount; + gSideTimers[1].stickyWebAmount = bits; + + bits = gSideTimers[0].auroraVeilTimer; + gSideTimers[0].auroraVeilTimer = gSideTimers[1].auroraVeilTimer; + gSideTimers[1].auroraVeilTimer = bits; + + bits = gSideTimers[0].tailwindTimer; + gSideTimers[0].tailwindTimer = gSideTimers[1].tailwindTimer; + gSideTimers[1].tailwindTimer = bits; + break; } gBattlescriptCurrInstr += 3; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 8bcdccc85..6c8bdd7b7 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10898,7 +10898,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_COURT_CHANGE] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_COURT_CHANGE, .power = 0, .type = TYPE_NORMAL, .accuracy = 100, From c2bd046ea670c7abf4b5fd827887bbdf6495060a Mon Sep 17 00:00:00 2001 From: Xhyzi Date: Tue, 15 Jun 2021 20:22:50 +0200 Subject: [PATCH 034/208] Shell Trap --- asm/macros/battle_script.inc | 13 +++++++ data/battle_anim_scripts.s | 5 +-- data/battle_scripts_1.s | 41 ++++++++++++++++++++++ include/battle.h | 1 + include/battle_scripts.h | 3 ++ include/constants/battle_anim.h | 1 + include/constants/battle_move_effects.h | 3 +- include/constants/battle_script_commands.h | 3 ++ include/constants/battle_string_ids.h | 3 +- src/battle_main.c | 3 ++ src/battle_message.c | 2 ++ src/data/battle_moves.h | 4 +-- 12 files changed, 76 insertions(+), 6 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 5cef3c769..6ae9fce29 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1782,6 +1782,19 @@ various BS_ATTACKER, VARIOUS_SWAP_SIDE_STATUSES .endm + .macro setshelltrap battler:req + various \battler, VARIOUS_SET_SHELL_TRAP + .endm + + .macro clearshelltrap battler:req + various \battler, VARIOUS_CLEAR_SHELL_TRAP + .endm + + .macro checkshelltrap battler:req, ptr:req + various \battler, VARIOUS_CHECK_SHELL_TRAP + .4byte \ptr + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index ee401010a..96dae719f 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -823,6 +823,7 @@ gBattleAnims_General:: .4byte General_RestoreBg @ B_ANIM_RESTORE_BG .4byte General_TotemFlare @ B_ANIM_TOTEM_FLARE .4byte General_BeakBlastSetUp @ B_ANIM_BEAK_BLAST_SETUP + .4byte General_ShellTrapSetUp @ B_ANIM_SHELL_TRAP_SETUP .align 2 gBattleAnims_Special:: @@ -11831,8 +11832,7 @@ Move_AURORA_VEIL:: blendoff end -Move_SHELL_TRAP:: -ShellTrapChargeUp: +General_ShellTrapSetUp: loadspritegfx ANIM_TAG_SMALL_EMBER loadspritegfx ANIM_TAG_IMPACT monbg ANIM_TARGET @@ -11849,6 +11849,7 @@ ShellTrapChargeUp: clearmonbg ANIM_TARGET blendoff end +Move_SHELL_TRAP:: ShellTrapUnleash: loadspritegfx ANIM_TAG_IMPACT @pound loadspritegfx ANIM_TAG_SMALL_RED_EYE @red diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index bf501678c..f64b42e51 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -377,6 +377,47 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectBeakBlast .4byte BattleScript_EffectTerrainPulse .4byte BattleScript_EffectCourtChange + .4byte BattleScript_EffectShellTrap + +BattleScript_EffectShellTrap:: + checkshelltrap BS_ATTACKER, BattleScript_MoveEnd + clearshelltrap BS_ATTACKER + attackcanceler + attackstring + goto BattleScript_ButItFailed + +BattleScript_ShellTrapSetUp:: + setshelltrap BS_ATTACKER + printstring STRINGID_EMPTYSTRING3 + waitmessage 0x1 + playanimation BS_ATTACKER B_ANIM_SHELL_TRAP_SETUP, NULL + printstring STRINGID_PREPARESHELLTRAP + waitmessage 0x40 + end2 + +BattleScript_ShellTrapExplode:: + clearshelltrap BS_ATTACKER + attackcanceler + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage 0x40 + resultmessage + waitmessage 0x40 + seteffectwithchance + tryfaintmon BS_TARGET, FALSE, NULL + moveendall + end BattleScript_EffectCourtChange:: attackcanceler diff --git a/include/battle.h b/include/battle.h index a86c6d34e..18e12fc18 100644 --- a/include/battle.h +++ b/include/battle.h @@ -145,6 +145,7 @@ struct ProtectStruct u32 micle:1; u32 custap:1; // also quick claw u32 beakBlastCharge:1; + u32 shellTrap:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index ffb824f0b..71a8a50a4 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -372,5 +372,8 @@ extern const u8 BattleScript_BattlerGotOverItsInfatuation[]; extern const u8 BattleScript_MeltedItem[]; extern const u8 BattleScript_BeakBlastSetUp[]; extern const u8 BattleScript_BeakBlastBurn[]; +extern const u8 BattleScript_ShellTrapSetUp[]; +extern const u8 BattleScript_ShellTrapExplode[]; +extern const u8 BattleScript_EffectShellTrap[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index cfccef926..c98007127 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -524,6 +524,7 @@ #define B_ANIM_RESTORE_BG 27 // for Terrain Endings #define B_ANIM_TOTEM_FLARE 28 // Totem boosts aura flare #define B_ANIM_BEAK_BLAST_SETUP 29 +#define B_ANIM_SHELL_TRAP_SETUP 30 // special animations table (gBattleAnims_Special) #define B_ANIM_LVL_UP 0 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index b6ad6e487..cc5e94acd 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -361,7 +361,8 @@ #define EFFECT_BEAK_BLAST 355 #define EFFECT_TERRAIN_PULSE 356 #define EFFECT_COURT_CHANGE 357 +#define EFFECT_SHELL_TRAP 358 -#define NUM_BATTLE_MOVE_EFFECTS 358 +#define NUM_BATTLE_MOVE_EFFECTS 359 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 8ae661af3..6e67bd954 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -176,6 +176,9 @@ #define VARIOUS_TRY_SET_CORROSIVE_GAS 105 #define VARIOUS_SET_BEAK_BLAST 106 #define VARIOUS_SWAP_SIDE_STATUSES 107 +#define VARIOUS_SET_SHELL_TRAP 108 +#define VARIOUS_CLEAR_SHELL_TRAP 109 +#define VARIOUS_CHECK_SHELL_TRAP 110 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index cfe25be1b..823164717 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -575,8 +575,9 @@ #define STRINGID_ITEMMELTED 571 #define STRINGID_HEATUPBEAK 572 #define STRINGID_COURTCHANGE 573 +#define STRINGID_PREPARESHELLTRAP 574 -#define BATTLESTRINGS_COUNT 574 +#define BATTLESTRINGS_COUNT 575 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_main.c b/src/battle_main.c index 9f5105151..223188652 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4610,6 +4610,9 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void) case MOVE_BEAK_BLAST: BattleScriptExecute(BattleScript_BeakBlastSetUp); return; + case MOVE_SHELL_TRAP: + BattleScriptExecute(BattleScript_ShellTrapSetUp); + return; } } } diff --git a/src/battle_message.c b/src/battle_message.c index 2a9d80424..6d39cf84c 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -701,9 +701,11 @@ static const u8 sText_MeteorBeamCharging[] = _("{B_ATK_NAME_WITH_PREFIX} is over static const u8 sText_PkmnItemMelted[] = _("{B_ATK_NAME_WITH_PREFIX} corroded\n{B_DEF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}!"); static const u8 sText_HeatingUpBeak[] = _("{B_ATK_NAME_WITH_PREFIX} started\nheating up its beak!"); static const u8 sText_CourtChange[] = _("{B_ATK_NAME_WITH_PREFIX} swapped the battle\neffects affecting each side!"); +static const u8 sText_PrepareShellTrap[] = _("{B_ATK_NAME_WITH_PREFIX} set\n a shell trap!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_PREPARESHELLTRAP - 12] = sText_PrepareShellTrap, [STRINGID_COURTCHANGE - 12] = sText_CourtChange, [STRINGID_HEATUPBEAK - 12] = sText_HeatingUpBeak, [STRINGID_ITEMMELTED - 12] = sText_PkmnItemMelted, diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 6c8bdd7b7..abcd8a100 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10197,13 +10197,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SHELL_TRAP] = { - .effect = EFFECT_PLACEHOLDER, + .effect = EFFECT_SHELL_TRAP, .power = 150, .type = TYPE_FIRE, .accuracy = 100, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, + .target = MOVE_TARGET_OPPONENTS_FIELD, .priority = -3, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, From e0b53f87fca30e0666f5cf3ba9221b4e26e2d2fa Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Thu, 4 Nov 2021 10:56:14 -0300 Subject: [PATCH 035/208] Primal Reversion Tweaks -Fixed the inconsistent Primal Reversion activation in double battles. -Optimized the primal weather checks in attackcanceler a little. -Fixed the issue with multi-target fire/water moves during primal rain/sun. --- data/battle_scripts_1.s | 4 ++++ include/constants/battle.h | 1 + src/battle_script_commands.c | 30 +++++++++++++----------------- src/battle_util.c | 10 ++++------ 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 6d6c1dae8..6373a7750 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7697,8 +7697,10 @@ BattleScript_DesolateLandEvaporatesWaterTypeMoves:: attackstring pause B_WAIT_TIME_SHORT ppreduce + jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_STRING_PRINTED, BattleScript_MoveEnd printstring STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT waitmessage B_WAIT_TIME_LONG + orword gHitMarker, HITMARKER_STRING_PRINTED goto BattleScript_MoveEnd BattleScript_PrimordialSeaActivates:: @@ -7715,8 +7717,10 @@ BattleScript_PrimordialSeaFizzlesOutFireTypeMoves:: attackstring pause B_WAIT_TIME_SHORT ppreduce + jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_STRING_PRINTED, BattleScript_MoveEnd printstring STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN waitmessage B_WAIT_TIME_LONG + orword gHitMarker, HITMARKER_STRING_PRINTED goto BattleScript_MoveEnd BattleScript_DeltaStreamActivates:: diff --git a/include/constants/battle.h b/include/constants/battle.h index 918c3e7f0..8841a3c12 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -200,6 +200,7 @@ #define HITMARKER_CHARGING (1 << 27) #define HITMARKER_FAINTED(battler) (gBitTable[battler] << 28) #define HITMARKER_FAINTED2(battler) ((1 << 28) << battler) +#define HITMARKER_STRING_PRINTED (1 << 29) // Per-side statuses that affect an entire party #define SIDE_STATUS_REFLECT (1 << 0) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ee9379d8d..0fb2e5599 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1337,24 +1337,20 @@ static void Cmd_attackcanceler(void) GET_MOVE_TYPE(gCurrentMove, moveType); - if (moveType == TYPE_FIRE - && (gBattleWeather & WEATHER_RAIN_PRIMAL) - && WEATHER_HAS_EFFECT - && gBattleMoves[gCurrentMove].power) + if (WEATHER_HAS_EFFECT && gBattleMoves[gCurrentMove].power) { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_PrimordialSeaFizzlesOutFireTypeMoves; - return; - } - - if (moveType == TYPE_WATER - && (gBattleWeather & WEATHER_SUN_PRIMAL) - && WEATHER_HAS_EFFECT - && gBattleMoves[gCurrentMove].power) - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_DesolateLandEvaporatesWaterTypeMoves; - return; + if (moveType == TYPE_FIRE && (gBattleWeather & WEATHER_RAIN_PRIMAL)) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_PrimordialSeaFizzlesOutFireTypeMoves; + return; + } + else if (moveType == TYPE_WATER && (gBattleWeather & WEATHER_SUN_PRIMAL)) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_DesolateLandEvaporatesWaterTypeMoves; + return; + } } if (gBattleOutcome != 0) diff --git a/src/battle_util.c b/src/battle_util.c index f87e0a134..13908c209 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8884,12 +8884,10 @@ bool32 CanMegaEvolve(u8 battlerId) // Check if trainer already mega evolved a pokemon. if (mega->alreadyEvolved[battlerPosition]) return FALSE; - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - { - if (IsPartnerMonFromSameTrainer(battlerId) - && (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)]))) - return FALSE; - } + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE + && IsPartnerMonFromSameTrainer(battlerId) + && (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)]))) + return FALSE; // Gets mon data. if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT) From 86efd69370e9a646f89626c126c092017b71518e Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Fri, 19 Nov 2021 20:19:10 +1300 Subject: [PATCH 036/208] Finish/fix Beak Blast This was not working at all, but the basic framework was there; some small changes tidied it up and made it work. --- data/battle_scripts_1.s | 26 ++++++-------------------- src/battle_script_commands.c | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index c98b35b5e..8f898f1d2 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -403,12 +403,12 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectOctolock @ EFFECT_OCTOLOCK .4byte BattleScript_EffectClangorousSoul @ EFFECT_CLANGOROUS_SOUL .4byte BattleScript_EffectHit @ EFFECT_BOLT_BEAK - .4byte BattleScript_EffectHit @ EFFECT_EXPANDING_FORCE + .4byte BattleScript_EffectHit @ EFFECT_EXPANDING_FORCE .4byte BattleScript_EffectScaleShot @ EFFECT_SCALE_SHOT .4byte BattleScript_EffectMeteorBeam @ EFFECT_METEOR_BEAM .4byte BattleScript_EffectHit @ EFFECT_RISING_VOLTAGE .4byte BattleScript_EffectCorrosiveGas @ EFFECT_CORROSIVE_GAS - .4byte BattleScript_EffectBeakBlast @ EFFECT_BEAK_BLAST + .4byte BattleScript_EffectHit @ EFFECT_BEAK_BLAST .4byte BattleScript_EffectCourtChange @ EFFECT_COURT_CHANGE .4byte BattleScript_EffectShellTrap @ EFFECT_SHELL_TRAP @@ -464,14 +464,6 @@ BattleScript_EffectCourtChange:: waitmessage 0x40 goto BattleScript_MoveEnd -BattleScript_EffectBeakBlast:: - attackcanceler - jumpifnodamage BattleScript_HitFromAccCheck - ppreduce - printstring STRINGID_PKMNLOSTFOCUS - waitmessage 0x40 - goto BattleScript_MoveEnd - BattleScript_BeakBlastSetUp:: setbeakblast BS_ATTACKER printstring STRINGID_EMPTYSTRING3 @@ -482,17 +474,11 @@ BattleScript_BeakBlastSetUp:: end2 BattleScript_BeakBlastBurn:: - jumpifstatus BS_TARGET, STATUS1_BURN, BattleScript_AlreadyBurned - jumpiftype BS_TARGET, TYPE_FIRE, BattleScript_NotAffected - jumpifability BS_TARGET, ABILITY_WATER_VEIL, BattleScript_WaterVeilPrevents - jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects - jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects - jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_BeakBlastBurnReturn - setmoveeffect MOVE_EFFECT_BURN | MOVE_EFFECT_AFFECTS_USER - seteffectprimary -BattleScript_BeakBlastBurnReturn: + setbyte cMULTISTRING_CHOOSER, 0 + copybyte gEffectBattler, gBattlerAttacker + call BattleScript_MoveEffectBurn return + BattleScript_EffectCorrosiveGas:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, NO_ACC_CALC_CHECK_LOCK_ON diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b767b871e..232b97697 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1543,6 +1543,11 @@ static void Cmd_attackcanceler(void) gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; gBattlescriptCurrInstr++; } + else if (gProtectStructs[gBattlerTarget].beakBlastCharge && IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) + { + gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; + gBattlescriptCurrInstr++; + } else { gBattlescriptCurrInstr++; @@ -4964,7 +4969,7 @@ static void Cmd_moveend(void) } else if (gProtectStructs[gBattlerTarget].obstructed && gCurrentMove != MOVE_SUCKER_PUNCH) { - gProtectStructs[gBattlerAttacker].touchedProtectLike = 0; + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; i = gBattlerAttacker; gBattlerAttacker = gBattlerTarget; gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable @@ -4973,8 +4978,13 @@ static void Cmd_moveend(void) gBattlescriptCurrInstr = BattleScript_KingsShieldEffect; effect = 1; } - else if (gProtectStructs[gBattlerTarget].beakBlastCharge) + // Not strictly a protect effect, but works the same way + else if (gProtectStructs[gBattlerTarget].beakBlastCharge + && CanBeBurned(gBattlerAttacker) + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; + gBattleMons[gBattlerAttacker].status1 = STATUS1_BURN; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_BeakBlastBurn; effect = 1; @@ -9317,7 +9327,7 @@ static void Cmd_various(void) } } case VARIOUS_SET_BEAK_BLAST: - gProtectStructs[gActiveBattler].beakBlastCharge = 1; + gProtectStructs[gBattlerAttacker].beakBlastCharge = 1; break; case VARIOUS_SWAP_SIDE_STATUSES: { From 48c91d03cdfd5f9e742ef67b0be43fb1c8c2688a Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Fri, 19 Nov 2021 20:20:16 +1300 Subject: [PATCH 037/208] Fix terrain checks on DLC moves Expanding Force and Rising Voltage now boost damage correctly. Expanding Force doesn't hit both targets yet however. --- src/battle_util.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index cbc96ae56..e946fe8f0 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7262,6 +7262,9 @@ u32 GetMoveTarget(u16 move, u8 setTarget) // Special cases if (move == MOVE_CURSE && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST)) moveTarget = MOVE_TARGET_USER; + + if (gBattleMoves[move].effect == EFFECT_EXPANDING_FORCE && IsBattlerTerrainAffected(gBattlerAttacker, STATUS_FIELD_PSYCHIC_TERRAIN)) + moveTarget = MOVE_TARGET_BOTH; switch (moveTarget) { @@ -7991,18 +7994,12 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; break; case EFFECT_EXPANDING_FORCE: - if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN) - basePower = 120; + if (IsBattlerTerrainAffected(gBattlerAttacker, STATUS_FIELD_PSYCHIC_TERRAIN)) + MulModifier(&basePower, UQ_4_12(1.5)); break; case EFFECT_RISING_VOLTAGE: - #ifdef ITEM_EXPANSION //Air Balloon exception with item expansion branch - if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && !IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING) - && gBattleMons[battlerDef].item != ITEM_AIR_BALLOON && gBattleMons[battlerDef].ability != ABILITY_LEVITATE) - #else - if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && !IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING) - && gBattleMons[battlerDef].ability != ABILITY_LEVITATE) - #endif - basePower *= 2; + if (IsBattlerTerrainAffected(gBattlerTarget, STATUS_FIELD_ELECTRIC_TERRAIN)) + basePower *= 2; break; } From 14a2e863139d4726a24b9b32ef49e3e85743c628 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Fri, 19 Nov 2021 21:57:32 +1300 Subject: [PATCH 038/208] Fix Scale Shot Lowers defense and raises speed instead of just lowering defense now. Tested with Contrary and min/max speed/def. --- data/battle_scripts_1.s | 24 +++++++++++++++++++++--- include/battle_scripts.h | 1 + include/constants/battle.h | 4 ++-- src/battle_main.c | 4 ++-- src/battle_script_commands.c | 7 +++++++ 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 8f898f1d2..d5d5707ff 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -570,9 +570,7 @@ BattleScript_ScaleShotPrintStrings:: printstring STRINGID_HITXTIMES waitmessage 0x40 BattleScript_ScaleShotEnd:: - setmoveeffect MOVE_EFFECT_SPD_PLUS_1 | MOVE_EFFECT_AFFECTS_USER - seteffectwithchance - setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER + setmoveeffect MOVE_EFFECT_SCALE_SHOT | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL moveendcase MOVEEND_SYNCHRONIZE_TARGET @@ -7182,6 +7180,26 @@ BattleScript_DefSpDefDownTrySpDef:: BattleScript_DefSpDefDownRet:: return +BattleScript_DefDownSpeedUp:: + jumpifstat BS_ATTACKER, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_DefDownSpeedUpTryDef + jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPEED, MAX_STAT_STAGE, BattleScript_DefDownSpeedUpRet +BattleScript_DefDownSpeedUpTryDef:: + playstatchangeanimation BS_ATTACKER, BIT_DEF, STAT_CHANGE_NEGATIVE | STAT_CHANGE_CANT_PREVENT + setstatchanger STAT_DEF, 1, TRUE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR | MOVE_EFFECT_CERTAIN, BattleScript_DefDownSpeedUpTrySpeed + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DefDownSpeedUpTrySpeed + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_DefDownSpeedUpTrySpeed: + playstatchangeanimation BS_ATTACKER, BIT_SPEED, 0 + setstatchanger STAT_SPEED, 1, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR | MOVE_EFFECT_CERTAIN, BattleScript_DefDownSpeedUpRet + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DefDownSpeedUpRet + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_DefDownSpeedUpRet:: + return + BattleScript_KnockedOff:: playanimation BS_TARGET, B_ANIM_ITEM_KNOCKOFF, NULL printstring STRINGID_PKMNKNOCKEDOFF diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 1c130b90f..7dfc1a6da 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -421,5 +421,6 @@ extern const u8 BattleScript_BeakBlastBurn[]; extern const u8 BattleScript_ShellTrapSetUp[]; extern const u8 BattleScript_ShellTrapExplode[]; extern const u8 BattleScript_EffectShellTrap[]; +extern const u8 BattleScript_DefDownSpeedUp[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle.h b/include/constants/battle.h index 515d4ac02..46b6494b2 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -359,9 +359,9 @@ #define MOVE_EFFECT_RECOIL_HP_25 0x46 #define MOVE_EFFECT_RELIC_SONG 0x47 #define MOVE_EFFECT_TRAP_BOTH 0x48 -#define MOVE_EFFECT_SPD_PLUS_1_DEF_MINUS_1 0x49 +#define MOVE_EFFECT_SCALE_SHOT 0x49 #define MOVE_EFFECT_MELT_ITEM 0x4A -#define NUM_MOVE_EFFECTS 0x50 +#define NUM_MOVE_EFFECTS 0x4B #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/src/battle_main.c b/src/battle_main.c index c39407653..25ac66be5 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4715,8 +4715,8 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void) BattleScriptExecute(BattleScript_BeakBlastSetUp); return; case MOVE_SHELL_TRAP: - BattleScriptExecute(BattleScript_ShellTrapSetUp); - return; + BattleScriptExecute(BattleScript_ShellTrapSetUp); + return; } } } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 232b97697..0aa068a99 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3489,6 +3489,10 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattleMons[gBattlerTarget].status2 |= STATUS2_ESCAPE_PREVENTION; gBattleMons[gBattlerAttacker].status2 |= STATUS2_ESCAPE_PREVENTION; break; + case MOVE_EFFECT_SCALE_SHOT: + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_DefDownSpeedUp; + break; } } } @@ -9329,6 +9333,9 @@ static void Cmd_various(void) case VARIOUS_SET_BEAK_BLAST: gProtectStructs[gBattlerAttacker].beakBlastCharge = 1; break; + case VARIOUS_SET_SHELL_TRAP: + gProtectStructs[gBattlerAttacker].shellTrap = 1; + break; case VARIOUS_SWAP_SIDE_STATUSES: { /* This code is a mess, but idk how to do it better without changing how Side Statuses and From bcaa17ffb31182c17c7a56134f4380bf52c33562 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 21 Nov 2021 17:20:45 +1300 Subject: [PATCH 039/208] Finish/tidy up Court Change Use a macro to simplify timer and status updates, and swap things like reflectBattlerId to the opposing side - this is required for the effects to be properly swapped. --- include/battle.h | 7 +- src/battle_script_commands.c | 216 +++++++++-------------------------- 2 files changed, 59 insertions(+), 164 deletions(-) diff --git a/include/battle.h b/include/battle.h index 596130bfe..fbeb3ffb1 100644 --- a/include/battle.h +++ b/include/battle.h @@ -208,9 +208,6 @@ struct SideTimer u8 mistBattlerId; u8 safeguardTimer; u8 safeguardBattlerId; - u8 followmeTimer; - u8 followmeTarget:3; - u8 followmePowder:1; // Rage powder, does not affect grass type pokemon. u8 spikesAmount; u8 toxicSpikesAmount; u8 stealthRockAmount; @@ -221,6 +218,10 @@ struct SideTimer u8 tailwindBattlerId; u8 luckyChantTimer; u8 luckyChantBattlerId; + // Timers below this point are not swapped by Court Change + u8 followmeTimer; + u8 followmeTarget:3; + u8 followmePowder:1; // Rage powder, does not affect grass type pokemon. u8 retaliateTimer; }; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 0aa068a99..b17a7555b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7527,6 +7527,60 @@ static bool32 IsRototillerAffected(u32 battlerId) return TRUE; } +#define COURTCHANGE_SWAP(status, structField, temp) \ +{ \ + temp = gSideStatuses[0]; \ + if (gSideStatuses[1] & status) \ + gSideStatuses[0] |= status; \ + else \ + gSideStatuses[0] &= ~(status); \ + if (temp & status) \ + gSideStatuses[1] |= status; \ + else \ + gSideStatuses[1] &= ~(status); \ + SWAP(sideTimer0->structField, sideTimer1->structField, temp);\ +} \ + +#define UPDATE_COURTCHANGED_BATTLER(structField)\ +{ \ + sideTimer0->structField ^= BIT_SIDE; \ + sideTimer1->structField ^= BIT_SIDE; \ +} \ + +static bool32 CourtChangeSwapSideStatuses(void) +{ + struct SideTimer *sideTimer0 = &gSideTimers[0]; + struct SideTimer *sideTimer1 = &gSideTimers[1]; + u32 temp; + + // TODO: add Pledge-related effects + // TODO: add Gigantamax-related effects + + // Swap timers and statuses + COURTCHANGE_SWAP(SIDE_STATUS_REFLECT, reflectTimer, temp) + COURTCHANGE_SWAP(SIDE_STATUS_LIGHTSCREEN, lightscreenTimer, temp) + COURTCHANGE_SWAP(SIDE_STATUS_MIST, mistTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_SAFEGUARD, safeguardTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_AURORA_VEIL, auroraVeilTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_TAILWIND, tailwindTimer, temp); + // Lucky Chant doesn't exist in gen 8, but seems like it should be affected by Court Change + COURTCHANGE_SWAP(SIDE_STATUS_LUCKY_CHANT, luckyChantTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_SPIKES, spikesAmount, temp); + COURTCHANGE_SWAP(SIDE_STATUS_STEALTH_ROCK, stealthRockAmount, temp); + COURTCHANGE_SWAP(SIDE_STATUS_TOXIC_SPIKES, toxicSpikesAmount, temp); + COURTCHANGE_SWAP(SIDE_STATUS_STICKY_WEB, stickyWebAmount, temp); + + // Change battler IDs of swapped effects. Needed for the correct string when they expire + // E.g. "Foe's Reflect wore off!" + UPDATE_COURTCHANGED_BATTLER(reflectBattlerId); + UPDATE_COURTCHANGED_BATTLER(lightscreenBattlerId); + UPDATE_COURTCHANGED_BATTLER(mistBattlerId); + UPDATE_COURTCHANGED_BATTLER(safeguardBattlerId); + UPDATE_COURTCHANGED_BATTLER(auroraVeilBattlerId); + UPDATE_COURTCHANGED_BATTLER(tailwindBattlerId); + UPDATE_COURTCHANGED_BATTLER(luckyChantBattlerId); +} + static void Cmd_various(void) { struct Pokemon *mon; @@ -9338,167 +9392,7 @@ static void Cmd_various(void) break; case VARIOUS_SWAP_SIDE_STATUSES: { - /* This code is a mess, but idk how to do it better without changing how Side Statuses and - Side timers work. - The problem is that not all side statuses are affected by Court Change*/ - - //todo: add pledge related effects - //todo: add gigamax related effects - - //swap side status sides - bits = gSideStatuses[0]; //Stores sides status temp - - //Reflect - if (gSideStatuses[1] & SIDE_STATUS_REFLECT) - gSideStatuses[0] |= SIDE_STATUS_REFLECT; - else - gSideStatuses[0] &= ~(SIDE_STATUS_REFLECT); - - if (bits & SIDE_STATUS_REFLECT) - gSideStatuses[1] |= SIDE_STATUS_REFLECT; - else - gSideStatuses[1] &= ~(SIDE_STATUS_REFLECT); - - //Light screen - if (gSideStatuses[1] & SIDE_STATUS_LIGHTSCREEN) - gSideStatuses[0] |= SIDE_STATUS_LIGHTSCREEN; - else - gSideStatuses[0] &= ~(SIDE_STATUS_LIGHTSCREEN); - - if (bits & SIDE_STATUS_LIGHTSCREEN) - gSideStatuses[1] |= SIDE_STATUS_LIGHTSCREEN; - else - gSideStatuses[1] &= ~(SIDE_STATUS_LIGHTSCREEN); - - //Safeguard - if (gSideStatuses[1] & SIDE_STATUS_SAFEGUARD) - gSideStatuses[0] |= SIDE_STATUS_SAFEGUARD; - else - gSideStatuses[0] &= ~(SIDE_STATUS_SAFEGUARD); - - if (bits & SIDE_STATUS_SAFEGUARD) - gSideStatuses[1] |= SIDE_STATUS_SAFEGUARD; - else - gSideStatuses[1] &= ~(SIDE_STATUS_SAFEGUARD); - - //Mist - if (gSideStatuses[1] & SIDE_STATUS_MIST) - gSideStatuses[0] |= SIDE_STATUS_MIST; - else - gSideStatuses[0] &= ~(SIDE_STATUS_MIST); - - if (bits & SIDE_STATUS_MIST) - gSideStatuses[1] |= SIDE_STATUS_MIST; - else - gSideStatuses[1] &= ~(SIDE_STATUS_MIST); - - //AuroraVeil - if (gSideStatuses[1] & SIDE_STATUS_AURORA_VEIL) - gSideStatuses[0] |= SIDE_STATUS_AURORA_VEIL; - else - gSideStatuses[0] &= ~(SIDE_STATUS_AURORA_VEIL); - - if (bits & SIDE_STATUS_AURORA_VEIL) - gSideStatuses[1] |= SIDE_STATUS_AURORA_VEIL; - else - gSideStatuses[1] &= ~(SIDE_STATUS_AURORA_VEIL); - - //Sticky Web - if (gSideStatuses[1] & SIDE_STATUS_STICKY_WEB) - gSideStatuses[0] |= SIDE_STATUS_STICKY_WEB; - else - gSideStatuses[0] &= ~(SIDE_STATUS_STICKY_WEB); - - if (bits & SIDE_STATUS_STICKY_WEB) - gSideStatuses[1] |= SIDE_STATUS_STICKY_WEB; - else - gSideStatuses[1] &= ~(SIDE_STATUS_STICKY_WEB); - - //Spikes - if (gSideStatuses[1] & SIDE_STATUS_SPIKES) - gSideStatuses[0] |= SIDE_STATUS_SPIKES; - else - gSideStatuses[0] &= ~(SIDE_STATUS_SPIKES); - - if (bits & SIDE_STATUS_SPIKES) - gSideStatuses[1] |= SIDE_STATUS_SPIKES; - else - gSideStatuses[1] &= ~(SIDE_STATUS_SPIKES); - - //Toxic Spikes - if (gSideStatuses[1] & SIDE_STATUS_TOXIC_SPIKES) - gSideStatuses[0] |= SIDE_STATUS_TOXIC_SPIKES; - else - gSideStatuses[0] &= ~(SIDE_STATUS_TOXIC_SPIKES); - - if (bits & SIDE_STATUS_TOXIC_SPIKES) - gSideStatuses[1] |= SIDE_STATUS_TOXIC_SPIKES; - else - gSideStatuses[1] &= ~(SIDE_STATUS_TOXIC_SPIKES); - - //Stealth Rock - if (gSideStatuses[1] & SIDE_STATUS_STEALTH_ROCK) - gSideStatuses[0] |= SIDE_STATUS_STEALTH_ROCK; - else - gSideStatuses[0] &= ~(SIDE_STATUS_STEALTH_ROCK); - - if (bits & SIDE_STATUS_STEALTH_ROCK) - gSideStatuses[1] |= SIDE_STATUS_STEALTH_ROCK; - else - gSideStatuses[1] &= ~(SIDE_STATUS_STEALTH_ROCK); - - //Tailwind - if (gSideStatuses[1] & SIDE_STATUS_TAILWIND) - gSideStatuses[0] |= SIDE_STATUS_TAILWIND; - else - gSideStatuses[0] &= ~(SIDE_STATUS_TAILWIND); - - if (bits & SIDE_STATUS_TAILWIND) - gSideStatuses[1] |= SIDE_STATUS_TAILWIND; - else - gSideStatuses[1] &= ~(SIDE_STATUS_TAILWIND); - - - //Swap affected status timers - bits = gSideTimers[0].reflectTimer; - gSideTimers[0].reflectTimer = gSideTimers[1].reflectTimer; - gSideTimers[1].reflectTimer = bits; - - bits = gSideTimers[0].lightscreenTimer; - gSideTimers[0].lightscreenTimer = gSideTimers[1].lightscreenTimer; - gSideTimers[1].lightscreenTimer = bits; - - bits = gSideTimers[0].mistTimer; - gSideTimers[0].mistTimer = gSideTimers[1].mistTimer; - gSideTimers[1].mistTimer = bits; - - bits = gSideTimers[0].safeguardTimer; - gSideTimers[0].safeguardTimer = gSideTimers[1].safeguardTimer; - gSideTimers[1].safeguardTimer = bits; - - bits = gSideTimers[0].spikesAmount; - gSideTimers[0].spikesAmount = gSideTimers[1].spikesAmount; - gSideTimers[1].spikesAmount = bits; - - bits = gSideTimers[0].toxicSpikesAmount; - gSideTimers[0].toxicSpikesAmount = gSideTimers[1].toxicSpikesAmount; - gSideTimers[1].toxicSpikesAmount = bits; - - bits = gSideTimers[0].stealthRockAmount; - gSideTimers[0].stealthRockAmount = gSideTimers[1].stealthRockAmount; - gSideTimers[1].stealthRockAmount = bits; - - bits = gSideTimers[0].stickyWebAmount; - gSideTimers[0].stickyWebAmount = gSideTimers[1].stickyWebAmount; - gSideTimers[1].stickyWebAmount = bits; - - bits = gSideTimers[0].auroraVeilTimer; - gSideTimers[0].auroraVeilTimer = gSideTimers[1].auroraVeilTimer; - gSideTimers[1].auroraVeilTimer = bits; - - bits = gSideTimers[0].tailwindTimer; - gSideTimers[0].tailwindTimer = gSideTimers[1].tailwindTimer; - gSideTimers[1].tailwindTimer = bits; + CourtChangeSwapSideStatuses(); break; } } // End of switch (gBattlescriptCurrInstr[2]) From abb67e96e8b6de05b9364bc02cd71b8a33abe6b3 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 21 Nov 2021 21:49:47 +1300 Subject: [PATCH 040/208] Finish Expanding Force Hits both foes if the user is affected by Psychic Terrain. Modified targeting is also shown in the move selection screen. --- src/battle_controller_player.c | 7 +++++++ src/battle_script_commands.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index e1cb2f54f..a970c38b7 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -609,6 +609,13 @@ static void HandleInputChooseMove(void) else moveTarget = MOVE_TARGET_SELECTED; } + else if (moveInfo->moves[gMoveSelectionCursor[gActiveBattler]] == MOVE_EXPANDING_FORCE) + { + if (IsBattlerTerrainAffected(gActiveBattler, STATUS_FIELD_PSYCHIC_TERRAIN)) + moveTarget = MOVE_TARGET_BOTH; + else + moveTarget = MOVE_TARGET_SELECTED; + } else { moveTarget = gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].target; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b17a7555b..31a2d4fc6 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5246,7 +5246,9 @@ static void Cmd_moveend(void) if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !gProtectStructs[gBattlerAttacker].chargingTurn - && (gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH || gBattleMoves[gCurrentMove].target == MOVE_TARGET_FOES_AND_ALLY) + && (gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH + || gBattleMoves[gCurrentMove].target == MOVE_TARGET_FOES_AND_ALLY + || (gBattleMoves[gCurrentMove].effect == EFFECT_EXPANDING_FORCE && IsBattlerTerrainAffected(gBattlerAttacker, STATUS_FIELD_PSYCHIC_TERRAIN))) && !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) { u8 battlerId; From 70f0018c08c1ad9028e65b13ae1bc178177b460d Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Mon, 22 Nov 2021 14:14:41 +1300 Subject: [PATCH 041/208] Partially implement Shell Trap Doesn't play the animation when the trap triggers, but kinda works? May also be incredibly buggy, but I'm not interested in working on this move any further. --- asm/macros/battle_script.inc | 5 +++-- data/battle_scripts_1.s | 2 +- include/battle.h | 13 ++++++------ src/battle_script_commands.c | 38 ++++++++++++++++++++++++++++++++---- src/data/battle_moves.h | 2 +- 5 files changed, 46 insertions(+), 14 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index cf2045eb6..2498bce64 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1946,9 +1946,10 @@ various \battler, VARIOUS_CLEAR_SHELL_TRAP .endm - .macro checkshelltrap battler:req, ptr:req + .macro checkshelltrap battler:req, ptr1:req, ptr2:req various \battler, VARIOUS_CHECK_SHELL_TRAP - .4byte \ptr + .4byte \ptr1 + .4byte \ptr2 .endm @ helpful macros diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index d5d5707ff..e453e3705 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -413,7 +413,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectShellTrap @ EFFECT_SHELL_TRAP BattleScript_EffectShellTrap:: - checkshelltrap BS_ATTACKER, BattleScript_MoveEnd + checkshelltrap BS_ATTACKER, BattleScript_ShellTrapExplode, BattleScript_MoveEnd clearshelltrap BS_ATTACKER attackcanceler attackstring diff --git a/include/battle.h b/include/battle.h index fbeb3ffb1..ad7924017 100644 --- a/include/battle.h +++ b/include/battle.h @@ -153,12 +153,13 @@ struct ProtectStruct u32 usedCustapBerry:1; // also quick claw u32 touchedProtectLike:1; // End of 32-bit bitfield - u8 disableEjectPack:1; - u8 statFell:1; - u8 pranksterElevated:1; - u8 quickDraw:1; - u8 beakBlastCharge:1; - u8 shellTrap:1; + u16 disableEjectPack:1; + u16 statFell:1; + u16 pranksterElevated:1; + u16 quickDraw:1; + u16 beakBlastCharge:1; + u16 shellTrapSet:1; + u16 shellTrapTriggered:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 31a2d4fc6..aa3c85375 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1543,7 +1543,8 @@ static void Cmd_attackcanceler(void) gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; gBattlescriptCurrInstr++; } - else if (gProtectStructs[gBattlerTarget].beakBlastCharge && IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) + else if ((gProtectStructs[gBattlerTarget].beakBlastCharge || gProtectStructs[gBattlerTarget].shellTrapSet) + && IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) { gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; gBattlescriptCurrInstr++; @@ -4983,7 +4984,7 @@ static void Cmd_moveend(void) effect = 1; } // Not strictly a protect effect, but works the same way - else if (gProtectStructs[gBattlerTarget].beakBlastCharge + else if (gProtectStructs[gBattlerTarget].beakBlastCharge && CanBeBurned(gBattlerAttacker) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { @@ -4993,6 +4994,21 @@ static void Cmd_moveend(void) gBattlescriptCurrInstr = BattleScript_BeakBlastBurn; effect = 1; } + else if (gProtectStructs[gBattlerTarget].shellTrapSet + && !TestSheerForceFlag(gBattlerAttacker, gCurrentMove) + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + { + u32 temp; + gProtectStructs[gBattlerTarget].shellTrapTriggered = TRUE; + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; + // Swap battlers so target attacks attacker with Shell Trap + SWAP(gBattlerAttacker, gBattlerTarget, temp); + // Set current move to Shell Trap + gCurrentMove = MOVE_SHELL_TRAP; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_EffectShellTrap; + effect = TRUE; + } } gBattleScripting.moveendState++; break; @@ -9387,10 +9403,24 @@ static void Cmd_various(void) } } case VARIOUS_SET_BEAK_BLAST: - gProtectStructs[gBattlerAttacker].beakBlastCharge = 1; + gProtectStructs[gBattlerAttacker].beakBlastCharge = TRUE; break; case VARIOUS_SET_SHELL_TRAP: - gProtectStructs[gBattlerAttacker].shellTrap = 1; + gProtectStructs[gBattlerAttacker].shellTrapSet = TRUE; + break; + case VARIOUS_CLEAR_SHELL_TRAP: + gProtectStructs[gBattlerAttacker].shellTrapSet = FALSE; + break; + case VARIOUS_CHECK_SHELL_TRAP: + // Attack with Shell Trap + if (gProtectStructs[gBattlerAttacker].shellTrapSet == TRUE && gProtectStructs[gBattlerAttacker].shellTrapTriggered == TRUE) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + // Attacked with Shell Trap, go to move end + else if (gProtectStructs[gBattlerAttacker].shellTrapSet == FALSE && gProtectStructs[gBattlerAttacker].shellTrapTriggered == TRUE) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 7); + // Shell Trap failed + else + gBattlescriptCurrInstr += 11; break; case VARIOUS_SWAP_SIDE_STATUSES: { diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index bf591dac4..62c0595a6 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10218,7 +10218,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 100, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_OPPONENTS_FIELD, + .target = MOVE_TARGET_BOTH, .priority = -3, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, From 42b8f18cb1fa9a1d29e8ecd9844b6a6bf54acf6b Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Mon, 22 Nov 2021 14:35:01 +1300 Subject: [PATCH 042/208] Remove Corrosive Gas code This was not working at all in testing, so it can be done by a separate PR later. --- asm/macros/battle_script.inc | 5 ----- data/battle_scripts_1.s | 19 ------------------ include/constants/battle_move_effects.h | 9 ++++----- src/battle_script_commands.c | 26 ------------------------- src/data/battle_moves.h | 2 +- 5 files changed, 5 insertions(+), 56 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 2498bce64..500ec0919 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1925,11 +1925,6 @@ various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK .endm - .macro trysetcorrosivegas battler:req, ptr:req - various \battler, VARIOUS_TRY_SET_CORROSIVE_GAS - .4byte \ptr - .endm - .macro setbeakblast battler:req various \battler, VARIOUS_SET_BEAK_BLAST .endm diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index e453e3705..99e3ad462 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -407,7 +407,6 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectScaleShot @ EFFECT_SCALE_SHOT .4byte BattleScript_EffectMeteorBeam @ EFFECT_METEOR_BEAM .4byte BattleScript_EffectHit @ EFFECT_RISING_VOLTAGE - .4byte BattleScript_EffectCorrosiveGas @ EFFECT_CORROSIVE_GAS .4byte BattleScript_EffectHit @ EFFECT_BEAK_BLAST .4byte BattleScript_EffectCourtChange @ EFFECT_COURT_CHANGE .4byte BattleScript_EffectShellTrap @ EFFECT_SHELL_TRAP @@ -479,24 +478,6 @@ BattleScript_BeakBlastBurn:: call BattleScript_MoveEffectBurn return -BattleScript_EffectCorrosiveGas:: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, NO_ACC_CALC_CHECK_LOCK_ON - attackstring - ppreduce - jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_PrintMoveMissed - trysetcorrosivegas BS_TARGET, BattleScript_ButItFailed - attackanimation - waitanimation - printstring STRINGID_ITEMMELTED - waitmessage 0x40 - goto BattleScript_MoveEnd - -BattleScript_MeltedItem:: - printstring STRINGID_ITEMMELTED - waitmessage 0x40 - return - BattleScript_EffectMeteorBeam:: @ DecideTurn jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 5c6826394..0df43c060 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -390,11 +390,10 @@ #define EFFECT_SCALE_SHOT 384 #define EFFECT_METEOR_BEAM 385 #define EFFECT_RISING_VOLTAGE 386 -#define EFFECT_CORROSIVE_GAS 387 -#define EFFECT_BEAK_BLAST 388 -#define EFFECT_COURT_CHANGE 389 -#define EFFECT_SHELL_TRAP 390 +#define EFFECT_BEAK_BLAST 387 +#define EFFECT_COURT_CHANGE 388 +#define EFFECT_SHELL_TRAP 389 -#define NUM_BATTLE_MOVE_EFFECTS 391 +#define NUM_BATTLE_MOVE_EFFECTS 390 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index aa3c85375..6d65bbd62 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9376,32 +9376,6 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; return; } - case VARIOUS_TRY_SET_CORROSIVE_GAS: - { - if (gBattleMons[gActiveBattler].item != 0 - && CanBattlerGetOrLoseItem(gActiveBattler, gBattleMons[gActiveBattler].item) - && !NoAliveMonsForEitherParty()) - { - if (GetBattlerAbility(gActiveBattler) == ABILITY_STICKY_HOLD && IsBattlerAlive(gActiveBattler)) - { - gBattlerAbility = gActiveBattler; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_StickyHoldActivates; - } - else - { // Item is melted normally - u32 side = GetBattlerSide(gActiveBattler); - - gLastUsedItem = gBattleMons[gActiveBattler].item; - gBattleMons[gActiveBattler].item = 0; - gBattleStruct->choicedMove[gActiveBattler] = 0; - gWishFutureKnock.meltedItemMons[side] |= gBitTable[gBattlerPartyIndexes[gActiveBattler]]; - - CheckSetUnburden(gActiveBattler); - gBattlescriptCurrInstr += 7; - } - } - } case VARIOUS_SET_BEAK_BLAST: gProtectStructs[gBattlerAttacker].beakBlastCharge = TRUE; break; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 62c0595a6..57b9bce4f 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11417,7 +11417,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_CORROSIVE_GAS] = { - .effect = EFFECT_CORROSIVE_GAS, + .effect = EFFECT_PLACEHOLDER, // EFFECT_CORROSIVE_GAS, TODO .power = 0, .type = TYPE_POISON, .accuracy = 100, From d2eb5f0e6191645a677ae2c8ebcdde3937237c68 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Mon, 22 Nov 2021 14:46:47 +1300 Subject: [PATCH 043/208] Remove shell trap effect code Left strings and animations as those were fine, but code was non-functional and fixing it was not trivial. --- asm/macros/battle_script.inc | 14 -------- data/battle_scripts_1.s | 41 ---------------------- include/battle.h | 2 -- include/battle_scripts.h | 3 -- include/constants/battle_move_effects.h | 1 - include/constants/battle_script_commands.h | 3 -- src/battle_main.c | 3 -- src/battle_script_commands.c | 35 +----------------- src/data/battle_moves.h | 2 +- 9 files changed, 2 insertions(+), 102 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 500ec0919..a65ccaf44 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1933,20 +1933,6 @@ various BS_ATTACKER, VARIOUS_SWAP_SIDE_STATUSES .endm - .macro setshelltrap battler:req - various \battler, VARIOUS_SET_SHELL_TRAP - .endm - - .macro clearshelltrap battler:req - various \battler, VARIOUS_CLEAR_SHELL_TRAP - .endm - - .macro checkshelltrap battler:req, ptr1:req, ptr2:req - various \battler, VARIOUS_CHECK_SHELL_TRAP - .4byte \ptr1 - .4byte \ptr2 - .endm - @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 99e3ad462..eeeba7cf7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -409,47 +409,6 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_RISING_VOLTAGE .4byte BattleScript_EffectHit @ EFFECT_BEAK_BLAST .4byte BattleScript_EffectCourtChange @ EFFECT_COURT_CHANGE - .4byte BattleScript_EffectShellTrap @ EFFECT_SHELL_TRAP - -BattleScript_EffectShellTrap:: - checkshelltrap BS_ATTACKER, BattleScript_ShellTrapExplode, BattleScript_MoveEnd - clearshelltrap BS_ATTACKER - attackcanceler - attackstring - goto BattleScript_ButItFailed - -BattleScript_ShellTrapSetUp:: - setshelltrap BS_ATTACKER - printstring STRINGID_EMPTYSTRING3 - waitmessage 0x1 - playanimation BS_ATTACKER B_ANIM_SHELL_TRAP_SETUP, NULL - printstring STRINGID_PREPARESHELLTRAP - waitmessage 0x40 - end2 - -BattleScript_ShellTrapExplode:: - clearshelltrap BS_ATTACKER - attackcanceler - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage 0x40 - resultmessage - waitmessage 0x40 - seteffectwithchance - tryfaintmon BS_TARGET, FALSE, NULL - moveendall - end BattleScript_EffectCourtChange:: attackcanceler diff --git a/include/battle.h b/include/battle.h index ad7924017..69161ba6f 100644 --- a/include/battle.h +++ b/include/battle.h @@ -158,8 +158,6 @@ struct ProtectStruct u16 pranksterElevated:1; u16 quickDraw:1; u16 beakBlastCharge:1; - u16 shellTrapSet:1; - u16 shellTrapTriggered:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 7dfc1a6da..ec1dbb23c 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -418,9 +418,6 @@ extern const u8 BattleScript_NeutralizingGasExits[]; extern const u8 BattleScript_MeltedItem[]; extern const u8 BattleScript_BeakBlastSetUp[]; extern const u8 BattleScript_BeakBlastBurn[]; -extern const u8 BattleScript_ShellTrapSetUp[]; -extern const u8 BattleScript_ShellTrapExplode[]; -extern const u8 BattleScript_EffectShellTrap[]; extern const u8 BattleScript_DefDownSpeedUp[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 0df43c060..c6afed12c 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -392,7 +392,6 @@ #define EFFECT_RISING_VOLTAGE 386 #define EFFECT_BEAK_BLAST 387 #define EFFECT_COURT_CHANGE 388 -#define EFFECT_SHELL_TRAP 389 #define NUM_BATTLE_MOVE_EFFECTS 390 diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 977a69dbf..897bf35fb 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -211,9 +211,6 @@ #define VARIOUS_TRY_SET_CORROSIVE_GAS 138 #define VARIOUS_SET_BEAK_BLAST 139 #define VARIOUS_SWAP_SIDE_STATUSES 140 -#define VARIOUS_SET_SHELL_TRAP 141 -#define VARIOUS_CLEAR_SHELL_TRAP 142 -#define VARIOUS_CHECK_SHELL_TRAP 143 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_main.c b/src/battle_main.c index 25ac66be5..1c2d37dbc 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4714,9 +4714,6 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void) case MOVE_BEAK_BLAST: BattleScriptExecute(BattleScript_BeakBlastSetUp); return; - case MOVE_SHELL_TRAP: - BattleScriptExecute(BattleScript_ShellTrapSetUp); - return; } } } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6d65bbd62..a58aeed64 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1543,8 +1543,7 @@ static void Cmd_attackcanceler(void) gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; gBattlescriptCurrInstr++; } - else if ((gProtectStructs[gBattlerTarget].beakBlastCharge || gProtectStructs[gBattlerTarget].shellTrapSet) - && IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) + else if (gProtectStructs[gBattlerTarget].beakBlastCharge && IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) { gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; gBattlescriptCurrInstr++; @@ -4994,21 +4993,6 @@ static void Cmd_moveend(void) gBattlescriptCurrInstr = BattleScript_BeakBlastBurn; effect = 1; } - else if (gProtectStructs[gBattlerTarget].shellTrapSet - && !TestSheerForceFlag(gBattlerAttacker, gCurrentMove) - && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) - { - u32 temp; - gProtectStructs[gBattlerTarget].shellTrapTriggered = TRUE; - gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; - // Swap battlers so target attacks attacker with Shell Trap - SWAP(gBattlerAttacker, gBattlerTarget, temp); - // Set current move to Shell Trap - gCurrentMove = MOVE_SHELL_TRAP; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_EffectShellTrap; - effect = TRUE; - } } gBattleScripting.moveendState++; break; @@ -9379,23 +9363,6 @@ static void Cmd_various(void) case VARIOUS_SET_BEAK_BLAST: gProtectStructs[gBattlerAttacker].beakBlastCharge = TRUE; break; - case VARIOUS_SET_SHELL_TRAP: - gProtectStructs[gBattlerAttacker].shellTrapSet = TRUE; - break; - case VARIOUS_CLEAR_SHELL_TRAP: - gProtectStructs[gBattlerAttacker].shellTrapSet = FALSE; - break; - case VARIOUS_CHECK_SHELL_TRAP: - // Attack with Shell Trap - if (gProtectStructs[gBattlerAttacker].shellTrapSet == TRUE && gProtectStructs[gBattlerAttacker].shellTrapTriggered == TRUE) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); - // Attacked with Shell Trap, go to move end - else if (gProtectStructs[gBattlerAttacker].shellTrapSet == FALSE && gProtectStructs[gBattlerAttacker].shellTrapTriggered == TRUE) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 7); - // Shell Trap failed - else - gBattlescriptCurrInstr += 11; - break; case VARIOUS_SWAP_SIDE_STATUSES: { CourtChangeSwapSideStatuses(); diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 57b9bce4f..26c77a8e3 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10212,7 +10212,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SHELL_TRAP] = { - .effect = EFFECT_SHELL_TRAP, + .effect = EFFECT_PLACEHOLDER, // EFFECT_SHELL_TRAP, .power = 150, .type = TYPE_FIRE, .accuracy = 100, From 50d0cd52e8992869adb1cd5be680d9a90825e9d2 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Mon, 22 Nov 2021 15:13:54 +1300 Subject: [PATCH 044/208] Clean up Corrosive Gas Remove code and unused move effect. --- include/battle.h | 1 - include/battle_scripts.h | 1 - include/constants/battle.h | 3 +-- src/battle_script_commands.c | 14 +++----------- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/include/battle.h b/include/battle.h index 69161ba6f..9192d4ed3 100644 --- a/include/battle.h +++ b/include/battle.h @@ -245,7 +245,6 @@ struct WishFutureKnock u8 wishMonId[MAX_BATTLERS_COUNT]; u8 weatherDuration; u8 knockedOffMons[2]; // Each battler is represented by a bit. The array entry is dependent on the battler's side. - u8 meltedItemMons[2]; // Same as above }; struct AI_SavedBattleMon diff --git a/include/battle_scripts.h b/include/battle_scripts.h index ec1dbb23c..2f98ef7a1 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -415,7 +415,6 @@ extern const u8 BattleScript_AttackerFormChangeMoveEffect[]; extern const u8 BattleScript_BothCanNoLongerEscape[]; extern const u8 BattleScript_OctolockEndTurn[]; extern const u8 BattleScript_NeutralizingGasExits[]; -extern const u8 BattleScript_MeltedItem[]; extern const u8 BattleScript_BeakBlastSetUp[]; extern const u8 BattleScript_BeakBlastBurn[]; extern const u8 BattleScript_DefDownSpeedUp[]; diff --git a/include/constants/battle.h b/include/constants/battle.h index 46b6494b2..f615be05f 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -360,8 +360,7 @@ #define MOVE_EFFECT_RELIC_SONG 0x47 #define MOVE_EFFECT_TRAP_BOTH 0x48 #define MOVE_EFFECT_SCALE_SHOT 0x49 -#define MOVE_EFFECT_MELT_ITEM 0x4A -#define NUM_MOVE_EFFECTS 0x4B +#define NUM_MOVE_EFFECTS 0x4A #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a58aeed64..8e2c59d8a 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3160,8 +3160,7 @@ void SetMoveEffect(bool32 primary, u32 certain) | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_SECRET_BASE)) - && (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]] - || gWishFutureKnock.meltedItemMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) + && (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) { gBattlescriptCurrInstr++; } @@ -5583,11 +5582,6 @@ static void Cmd_switchindataupdate(void) { gBattleMons[gActiveBattler].item = 0; } - // check melted items - if (gWishFutureKnock.meltedItemMons[i] & gBitTable[gBattlerPartyIndexes[gActiveBattler]]) - { - gBattleMons[gActiveBattler].item = 0; - } if (gBattleMoves[gCurrentMove].effect == EFFECT_BATON_PASS) { @@ -12305,16 +12299,14 @@ static void Cmd_tryswapitems(void) // trick u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = GetBattlerSide(gBattlerTarget); - // you can't swap items if they were knocked off or melted in regular battles + // You can't swap items if they were knocked off in regular battles if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_SECRET_BASE | BATTLE_TYPE_RECORDED_LINK)) && (gWishFutureKnock.knockedOffMons[sideAttacker] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]] - || gWishFutureKnock.knockedOffMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]] - || gWishFutureKnock.meltedItemMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]] - || gWishFutureKnock.meltedItemMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]])) + || gWishFutureKnock.knockedOffMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]])) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } From ff60882b29de2aa1a7d390adc3d1cc2f8bb21010 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 23 Nov 2021 11:04:39 +1300 Subject: [PATCH 045/208] Requested changes --- include/constants/battle_move_effects.h | 2 +- include/constants/battle_script_commands.h | 5 ++--- include/constants/battle_string_ids.h | 8 +++----- src/battle_message.c | 4 ---- src/battle_script_commands.c | 19 ++++++++++--------- 5 files changed, 16 insertions(+), 22 deletions(-) diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index c6afed12c..9baabde5c 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -393,6 +393,6 @@ #define EFFECT_BEAK_BLAST 387 #define EFFECT_COURT_CHANGE 388 -#define NUM_BATTLE_MOVE_EFFECTS 390 +#define NUM_BATTLE_MOVE_EFFECTS 389 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 897bf35fb..96796ea2d 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -208,9 +208,8 @@ #define VARIOUS_SET_OCTOLOCK 135 #define VARIOUS_CUT_1_3_HP_RAISE_STATS 136 #define VARIOUS_TRY_END_NEUTRALIZING_GAS 137 -#define VARIOUS_TRY_SET_CORROSIVE_GAS 138 -#define VARIOUS_SET_BEAK_BLAST 139 -#define VARIOUS_SWAP_SIDE_STATUSES 140 +#define VARIOUS_SET_BEAK_BLAST 138 +#define VARIOUS_SWAP_SIDE_STATUSES 139 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index ee4b25115..ccbc5a536 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -611,12 +611,10 @@ #define STRINGID_NEUTRALIZINGGASOVER 608 #define STRINGID_PKMNINSNAPTRAP 609 #define STRINGID_METEORBEAMCHARGING 610 -#define STRINGID_ITEMMELTED 611 -#define STRINGID_HEATUPBEAK 612 -#define STRINGID_COURTCHANGE 613 -#define STRINGID_PREPARESHELLTRAP 614 +#define STRINGID_HEATUPBEAK 611 +#define STRINGID_COURTCHANGE 612 -#define BATTLESTRINGS_COUNT 615 +#define BATTLESTRINGS_COUNT 613 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_message.c b/src/battle_message.c index 18364849a..4ac9ef9b4 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -737,17 +737,13 @@ static const u8 sText_CantEscapeBecauseOfCurrentMove[] = _("{B_DEF_NAME_WITH_PRE static const u8 sText_NeutralizingGasEnters[] = _("Neutralizing Gas filled the area!"); static const u8 sText_NeutralizingGasOver[] = _("The effects of Neutralizing\nGas wore off!"); static const u8 sText_MeteorBeamCharging[] = _("{B_ATK_NAME_WITH_PREFIX} is overflowing\nwith space energy!"); -static const u8 sText_PkmnItemMelted[] = _("{B_ATK_NAME_WITH_PREFIX} corroded\n{B_DEF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}!"); static const u8 sText_HeatingUpBeak[] = _("{B_ATK_NAME_WITH_PREFIX} started\nheating up its beak!"); static const u8 sText_CourtChange[] = _("{B_ATK_NAME_WITH_PREFIX} swapped the battle\neffects affecting each side!"); -static const u8 sText_PrepareShellTrap[] = _("{B_ATK_NAME_WITH_PREFIX} set\n a shell trap!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { - [STRINGID_PREPARESHELLTRAP - 12] = sText_PrepareShellTrap, [STRINGID_COURTCHANGE - 12] = sText_CourtChange, [STRINGID_HEATUPBEAK - 12] = sText_HeatingUpBeak, - [STRINGID_ITEMMELTED - 12] = sText_PkmnItemMelted, [STRINGID_METEORBEAMCHARGING - 12] = sText_MeteorBeamCharging, [STRINGID_PKMNINSNAPTRAP - 12] = sText_PkmnInSnapTrap, [STRINGID_NEUTRALIZINGGASOVER - 12] = sText_NeutralizingGasOver, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 8e2c59d8a..21150f833 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7525,15 +7525,15 @@ static bool32 IsRototillerAffected(u32 battlerId) #define COURTCHANGE_SWAP(status, structField, temp) \ { \ - temp = gSideStatuses[0]; \ - if (gSideStatuses[1] & status) \ - gSideStatuses[0] |= status; \ + temp = gSideStatuses[B_SIDE_PLAYER]; \ + if (gSideStatuses[B_SIDE_OPPONENT] & status) \ + gSideStatuses[B_SIDE_PLAYER] |= status; \ else \ - gSideStatuses[0] &= ~(status); \ + gSideStatuses[B_SIDE_PLAYER] &= ~(status); \ if (temp & status) \ - gSideStatuses[1] |= status; \ + gSideStatuses[B_SIDE_OPPONENT] |= status; \ else \ - gSideStatuses[1] &= ~(status); \ + gSideStatuses[B_SIDE_OPPONENT] &= ~(status); \ SWAP(sideTimer0->structField, sideTimer1->structField, temp);\ } \ @@ -7545,8 +7545,8 @@ static bool32 IsRototillerAffected(u32 battlerId) static bool32 CourtChangeSwapSideStatuses(void) { - struct SideTimer *sideTimer0 = &gSideTimers[0]; - struct SideTimer *sideTimer1 = &gSideTimers[1]; + struct SideTimer *sideTimer0 = &gSideTimers[B_SIDE_PLAYER]; + struct SideTimer *sideTimer1 = &gSideTimers[B_SIDE_OPPONENT]; u32 temp; // TODO: add Pledge-related effects @@ -11290,7 +11290,8 @@ static bool8 IsTwoTurnsMove(u16 move) || gBattleMoves[move].effect == EFFECT_TWO_TURNS_ATTACK || gBattleMoves[move].effect == EFFECT_SOLARBEAM || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE - || gBattleMoves[move].effect == EFFECT_BIDE) + || gBattleMoves[move].effect == EFFECT_BIDE + || gBattleMoves[move].effect == EFFECT_METEOR_BEAM) return TRUE; else return FALSE; From 6b8f86c276ee87bf6246bcfc2149fcffcb233833 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 23 Nov 2021 11:05:36 +1300 Subject: [PATCH 046/208] Snap Trap placeholder anims Set up animation data for Snap Trap so it can be easily replaced with a proper animation later. --- data/battle_anim_scripts.s | 8 ++++++-- include/constants/battle_anim.h | 1 + src/battle_anim_throw.c | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 8dbdcea73..bc3821563 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -13601,8 +13601,8 @@ Move_DRUM_BEATING:: blendoff end -Move_SNAP_TRAP:: - end @ to do: +Move_SNAP_TRAP:: @ placeholder + goto Move_BITE Move_PYRO_BALL:: loadspritegfx ANIM_TAG_FLAT_ROCK @@ -24209,6 +24209,7 @@ General_TurnTrap: jumpargeq 0, TRAP_ANIM_SAND_TOMB, Status_SandTomb jumpargeq 0, TRAP_ANIM_MAGMA_STORM, Status_MagmaStorm jumpargeq 0, TRAP_ANIM_INFESTATION, Status_Infestation + jumpargeq 0, TRAP_ANIM_SNAP_TRAP, Status_Snap_Trap goto Status_BindWrap Status_BindWrap: loadspritegfx ANIM_TAG_TENDRILS @@ -24295,6 +24296,9 @@ Status_Clamp: waitforvisualfinish end +Status_Snap_Trap: @ placeholder + goto Move_BITE + Status_SandTomb: loadspritegfx ANIM_TAG_MUD_SAND createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 0, 7, RGB(19, 17, 0) diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 8b0e81264..d11bc797c 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -569,6 +569,7 @@ #define TRAP_ANIM_SAND_TOMB 4 #define TRAP_ANIM_MAGMA_STORM 5 #define TRAP_ANIM_INFESTATION 6 +#define TRAP_ANIM_SNAP_TRAP 7 // Weather defines for battle animation scripts. #define ANIM_WEATHER_NONE 0 diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c index f325cba07..4413a4674 100755 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -2500,6 +2500,8 @@ void AnimTask_GetTrappedMoveAnimId(u8 taskId) gBattleAnimArgs[0] = TRAP_ANIM_MAGMA_STORM; else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_INFESTATION) gBattleAnimArgs[0] = TRAP_ANIM_INFESTATION; + else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_SNAP_TRAP) + gBattleAnimArgs[0] = TRAP_ANIM_SNAP_TRAP; else gBattleAnimArgs[0] = TRAP_ANIM_BIND; From fa0b5188bb1ecbc31ad2e604dc1a8adc488abcb7 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 23 Nov 2021 16:56:11 +1300 Subject: [PATCH 047/208] Dynamic move targeting Properly implement Expanding Force by replacing all instances that read move target from gBattleMoves with a function. --- include/battle_util.h | 2 +- src/battle_ai_main.c | 24 ++++++------- src/battle_ai_util.c | 3 +- src/battle_anim.c | 2 +- src/battle_controller_opponent.c | 6 ++-- src/battle_controller_player.c | 18 ++++------ src/battle_controller_player_partner.c | 4 +-- src/battle_gfx_sfx_util.c | 18 +++++----- src/battle_script_commands.c | 33 +++++++++-------- src/battle_util.c | 50 ++++++++++++++++---------- src/contest.c | 2 +- 11 files changed, 87 insertions(+), 75 deletions(-) diff --git a/include/battle_util.h b/include/battle_util.h index b1a2a1534..47bc2cc56 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -163,7 +163,7 @@ bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags); void TryToApplyMimicry(u8 battlerId, bool8 various); void TryToRevertMimicry(void); void RestoreBattlerOriginalTypes(u8 battlerId); - +u32 GetMoveTargetType(u8 battlerId, u16 move); // Ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability); bool32 IsRolePlayBannedAbility(u16 ability); diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index e3b8e8d5d..dda1ff9cc 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -521,7 +521,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) u8 atkPriority = GetMovePriority(battlerAtk, move); u16 moveEffect = gBattleMoves[move].effect; s32 moveType; - u16 moveTarget = gBattleMoves[move].target; + u16 moveTarget = GetMoveTargetType(battlerAtk, move); u16 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect, move); u8 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); @@ -537,7 +537,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) GET_MOVE_TYPE(move, moveType); // check non-user target - if (!(gBattleMoves[move].target & MOVE_TARGET_USER)) + if (moveTarget & MOVE_TARGET_USER) { // handle negative checks on non-user target // check powder moves @@ -2336,7 +2336,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else { - if (gBattleMoves[instructedMove].target & (MOVE_TARGET_SELECTED + if (GetMoveTargetType(battlerDef, instructedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_DEPENDS | MOVE_TARGET_RANDOM | MOVE_TARGET_BOTH @@ -2533,7 +2533,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // move data u8 moveType = gBattleMoves[move].type; u16 effect = gBattleMoves[move].effect; - u16 target = gBattleMoves[move].target; + u16 moveTarget = GetMoveTargetType(battlerAtk, move); // ally data u8 battlerAtkPartner = AI_DATA->battlerAtkPartner; u16 atkPartnerAbility = AI_DATA->atkPartnerAbility; @@ -2572,7 +2572,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (IsAttackBoostMoveEffect(effect)) score -= 3; // encourage moves hitting multiple opponents - if (!IS_MOVE_STATUS(move) && (gBattleMoves[move].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) + if (!IS_MOVE_STATUS(move) && (moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) score += 3; } } @@ -2640,7 +2640,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (GetMoveDamageResult(move) == MOVE_POWER_OTHER) { // partner ability checks - if (!partnerProtecting && gBattleMoves[move].target != MOVE_TARGET_BOTH && !DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move)) + if (!partnerProtecting && moveTarget != MOVE_TARGET_BOTH && !DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move)) { switch (atkPartnerAbility) { @@ -2840,7 +2840,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (instructedMove != MOVE_NONE && !IS_MOVE_STATUS(instructedMove) - && gBattleMoves[instructedMove].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) //Use instruct on multi-target moves + && (GetMoveTargetType(battlerAtkPartner, instructedMove) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) // Use instruct on multi-target moves { RETURN_SCORE_PLUS(1); } @@ -3631,24 +3631,24 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); break; case MOVE_WIDE_GUARD: - if (predictedMove != MOVE_NONE && gBattleMoves[predictedMove].target & (MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_BOTH)) + if (predictedMove != MOVE_NONE && GetMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_BOTH)) { ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); } - else if (isDoubleBattle && gBattleMoves[AI_DATA->partnerMove].target & MOVE_TARGET_FOES_AND_ALLY) + else if (isDoubleBattle && GetMoveTargetType(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) & MOVE_TARGET_FOES_AND_ALLY) { if (AI_DATA->atkAbility != ABILITY_TELEPATHY) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); } break; case MOVE_CRAFTY_SHIELD: - if (predictedMove != MOVE_NONE && IS_MOVE_STATUS(predictedMove) && !(gBattleMoves[predictedMove].target & MOVE_TARGET_USER)) + if (predictedMove != MOVE_NONE && IS_MOVE_STATUS(predictedMove) && !(GetMoveTargetType(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) && !(gBattleMoves[predictedMove].target & MOVE_TARGET_USER)) + && !IS_MOVE_STATUS(predictedMove) && !(GetMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER)) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); break; case MOVE_KINGS_SHIELD: @@ -4093,7 +4093,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 10; break; case EFFECT_MAGIC_COAT: - if (IS_MOVE_STATUS(predictedMove) && gBattleMoves[predictedMove].target & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH)) + if (IS_MOVE_STATUS(predictedMove) && GetMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH)) score += 3; break; case EFFECT_RECYCLE: diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 47561c765..ef6b0679f 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1919,9 +1919,8 @@ bool32 HasMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef, u8 accCheck, bool32 if (ignoreStatus && IS_MOVE_STATUS(moves[i])) continue; else if ((!IS_MOVE_STATUS(moves[i]) && gBattleMoves[moves[i]].accuracy == 0) - || gBattleMoves[moves[i]].target & (MOVE_TARGET_USER | MOVE_TARGET_OPPONENTS_FIELD)) + || GetMoveTargetType(battlerAtk, moves[i]) & (MOVE_TARGET_USER | MOVE_TARGET_OPPONENTS_FIELD)) continue; - if (AI_GetMoveAccuracy(battlerAtk, battlerDef, atkAbility, defAbility, atkHoldEffect, defHoldEffect, moves[i]) <= accCheck) return TRUE; } diff --git a/src/battle_anim.c b/src/battle_anim.c index e6152a7cf..d6761eae6 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -2195,7 +2195,7 @@ void DoMoveAnim(u16 move) gBattleAnimAttacker = gBattlerAttacker; gBattleAnimTarget = gBattlerTarget; // Make sure the anim target of moves hitting everyone is at the opposite side. - if (gBattleMoves[move].target & MOVE_TARGET_FOES_AND_ALLY && IsDoubleBattle()) + if (GetMoveTargetType(gBattlerAttacker, move) & MOVE_TARGET_FOES_AND_ALLY && IsDoubleBattle()) { while (GET_BATTLER_SIDE(gBattleAnimAttacker) == GET_BATTLER_SIDE(gBattleAnimTarget)) { diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index b43e80225..ff253730f 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1586,9 +1586,9 @@ static void OpponentHandleChooseMove(void) BtlController_EmitTwoReturnValues(1, 15, gBattlerTarget); break; default: - if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + if (GetMoveTargetType(gActiveBattler, moveInfo->moves[chosenMoveId]) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) gBattlerTarget = gActiveBattler; - if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH) + if (GetMoveTargetType(gActiveBattler, moveInfo->moves[chosenMoveId]) & MOVE_TARGET_BOTH) { gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) @@ -1611,7 +1611,7 @@ static void OpponentHandleChooseMove(void) move = moveInfo->moves[chosenMoveId]; } while (move == MOVE_NONE); - if (gBattleMoves[move].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + if (GetMoveTargetType(gActiveBattler, move) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (gActiveBattler << 8)); else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8)); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index a970c38b7..05ad19170 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -360,6 +360,7 @@ static void HandleInputChooseTarget(void) s32 i; static const u8 identities[MAX_BATTLERS_COUNT] = {B_POSITION_PLAYER_LEFT, B_POSITION_PLAYER_RIGHT, B_POSITION_OPPONENT_RIGHT, B_POSITION_OPPONENT_LEFT}; u16 move = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBattler]); + u16 moveTarget = GetMoveTargetType(gActiveBattler, move); DoBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX, 15, 1); for (i = 0; i < gBattlersCount; i++) @@ -400,7 +401,7 @@ static void HandleInputChooseTarget(void) PlaySE(SE_SELECT); gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget; - if (gBattleMoves[move].target == (MOVE_TARGET_USER | MOVE_TARGET_ALLY)) + if (moveTarget == (MOVE_TARGET_USER | MOVE_TARGET_ALLY)) { gMultiUsePlayerCursor ^= BIT_FLANK; } @@ -429,7 +430,7 @@ static void HandleInputChooseTarget(void) case B_POSITION_PLAYER_RIGHT: if (gActiveBattler != gMultiUsePlayerCursor) i++; - else if (gBattleMoves[move].target & MOVE_TARGET_USER_OR_SELECTED) + else if (moveTarget & MOVE_TARGET_USER_OR_SELECTED) i++; break; case B_POSITION_OPPONENT_LEFT: @@ -449,7 +450,7 @@ static void HandleInputChooseTarget(void) PlaySE(SE_SELECT); gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget; - if (gBattleMoves[move].target == (MOVE_TARGET_USER | MOVE_TARGET_ALLY)) + if (moveTarget == (MOVE_TARGET_USER | MOVE_TARGET_ALLY)) { gMultiUsePlayerCursor ^= BIT_FLANK; } @@ -478,7 +479,7 @@ static void HandleInputChooseTarget(void) case B_POSITION_PLAYER_RIGHT: if (gActiveBattler != gMultiUsePlayerCursor) i++; - else if (gBattleMoves[move].target & MOVE_TARGET_USER_OR_SELECTED) + else if (moveTarget & MOVE_TARGET_USER_OR_SELECTED) i++; break; case B_POSITION_OPPONENT_LEFT: @@ -609,16 +610,9 @@ static void HandleInputChooseMove(void) else moveTarget = MOVE_TARGET_SELECTED; } - else if (moveInfo->moves[gMoveSelectionCursor[gActiveBattler]] == MOVE_EXPANDING_FORCE) - { - if (IsBattlerTerrainAffected(gActiveBattler, STATUS_FIELD_PSYCHIC_TERRAIN)) - moveTarget = MOVE_TARGET_BOTH; - else - moveTarget = MOVE_TARGET_SELECTED; - } else { - moveTarget = gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].target; + moveTarget = GetMoveTargetType(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); } if (moveTarget & MOVE_TARGET_USER) diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index f0540e65f..a72f1029b 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1526,9 +1526,9 @@ static void PlayerPartnerHandleChooseMove(void) BattleAI_SetupAIData(0xF); chosenMoveId = BattleAI_ChooseMoveOrAction(); - if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED)) + if (GetMoveTargetType(gActiveBattler, moveInfo->moves[chosenMoveId]) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) gBattlerTarget = gActiveBattler; - if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH) + if (GetMoveTargetType(gActiveBattler, moveInfo->moves[chosenMoveId]) & MOVE_TARGET_BOTH) { gBattlerTarget = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 482a135c5..11e41ebd4 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -38,7 +38,7 @@ extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow; extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow; // this file's functions -static u8 GetBattlePalaceMoveGroup(u16 move); +static u8 GetBattlePalaceMoveGroup(u8 battlerId, u16 move); static u16 GetBattlePalaceTarget(void); static void SpriteCB_TrainerSlideVertical(struct Sprite *sprite); static bool8 ShouldAnimBeDoneRegardlessOfSubstitute(u8 animId); @@ -155,7 +155,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) { if (moveInfo->moves[i] == MOVE_NONE) break; - if (selectedGroup == GetBattlePalaceMoveGroup(moveInfo->moves[i]) && moveInfo->currentPp[i] != 0) + if (selectedGroup == GetBattlePalaceMoveGroup(gActiveBattler, moveInfo->moves[i]) && moveInfo->currentPp[i] != 0) selectedMoves |= gBitTable[i]; } @@ -181,11 +181,11 @@ u16 ChooseMoveAndTargetInBattlePalace(void) { // validMoveFlags is used here as a bitfield for which moves can be used for each move group type // first 4 bits are for attack (1 for each move), then 4 bits for defense, and 4 for support - if (GetBattlePalaceMoveGroup(moveInfo->moves[i]) == PALACE_MOVE_GROUP_ATTACK && !(gBitTable[i] & unusableMovesBits)) + if (GetBattlePalaceMoveGroup(gActiveBattler, moveInfo->moves[i]) == PALACE_MOVE_GROUP_ATTACK && !(gBitTable[i] & unusableMovesBits)) validMoveFlags += (1 << 0); - if (GetBattlePalaceMoveGroup(moveInfo->moves[i]) == PALACE_MOVE_GROUP_DEFENSE && !(gBitTable[i] & unusableMovesBits)) + if (GetBattlePalaceMoveGroup(gActiveBattler, moveInfo->moves[i]) == PALACE_MOVE_GROUP_DEFENSE && !(gBitTable[i] & unusableMovesBits)) validMoveFlags += (1 << 4); - if (GetBattlePalaceMoveGroup(moveInfo->moves[i]) == PALACE_MOVE_GROUP_SUPPORT && !(gBitTable[i] & unusableMovesBits)) + if (GetBattlePalaceMoveGroup(gActiveBattler, moveInfo->moves[i]) == PALACE_MOVE_GROUP_SUPPORT && !(gBitTable[i] & unusableMovesBits)) validMoveFlags += (1 << 8); } @@ -222,7 +222,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) do { i = Random() % MAX_MON_MOVES; - if (!(gBitTable[i] & unusableMovesBits) && validMoveGroup == GetBattlePalaceMoveGroup(moveInfo->moves[i])) + if (!(gBitTable[i] & unusableMovesBits) && validMoveGroup == GetBattlePalaceMoveGroup(gActiveBattler, moveInfo->moves[i])) chosenMoveId = i; } while (chosenMoveId == -1); } @@ -251,7 +251,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) } else { - moveTarget = gBattleMoves[moveInfo->moves[chosenMoveId]].target; + moveTarget = GetMoveTargetType(gActiveBattler, moveInfo->moves[chosenMoveId]); } if (moveTarget & MOVE_TARGET_USER) @@ -273,9 +273,9 @@ u16 ChooseMoveAndTargetInBattlePalace(void) #undef numValidMoveGroups #undef validMoveGroup -static u8 GetBattlePalaceMoveGroup(u16 move) +static u8 GetBattlePalaceMoveGroup(u8 battlerId, u16 move) { - switch (gBattleMoves[move].target) + switch (GetMoveTargetType(battlerId, move)) { case MOVE_TARGET_SELECTED: case MOVE_TARGET_USER_OR_SELECTED: diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 21150f833..437733f1e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1313,12 +1313,12 @@ static const u8 sBattlePalaceNatureToFlavorTextId[NUM_NATURES] = [NATURE_QUIRKY] = B_MSG_EAGER_FOR_MORE, }; -static bool32 NoTargetPresent(u32 move) +static bool32 NoTargetPresent(u8 battlerId, u32 move) { if (!IsBattlerAlive(gBattlerTarget)) gBattlerTarget = GetMoveTarget(move, 0); - switch (gBattleMoves[move].target) + switch (GetMoveTargetType(battlerId, move)) { case MOVE_TARGET_SELECTED: case MOVE_TARGET_DEPENDS: @@ -1459,7 +1459,7 @@ static void Cmd_attackcanceler(void) } gHitMarker |= HITMARKER_OBEYS; - if (NoTargetPresent(gCurrentMove) && (!IsTwoTurnsMove(gCurrentMove) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))) + if (NoTargetPresent(gBattlerAttacker, gCurrentMove) && (!IsTwoTurnsMove(gCurrentMove) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))) { gBattlescriptCurrInstr = BattleScript_ButItFailedAtkStringPpReduce; if (!IsTwoTurnsMove(gCurrentMove) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) @@ -1741,6 +1741,7 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move) static void Cmd_accuracycheck(void) { u16 type, move = T2_READ_16(gBattlescriptCurrInstr + 5); + u16 moveTarget = GetMoveTargetType(gBattlerAttacker, move); if (move == ACC_CURR_MOVE) move = gCurrentMove; @@ -1770,7 +1771,7 @@ static void Cmd_accuracycheck(void) gBattleStruct->blunderPolicy = TRUE; // Only activates from missing through acc/evasion checks if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && - (gBattleMoves[move].target == MOVE_TARGET_BOTH || gBattleMoves[move].target == MOVE_TARGET_FOES_AND_ALLY)) + (moveTarget == MOVE_TARGET_BOTH || moveTarget == MOVE_TARGET_FOES_AND_ALLY)) gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_ATK; else gBattleCommunication[MISS_TYPE] = B_MSG_MISSED; @@ -1804,7 +1805,7 @@ static void Cmd_ppreduce(void) if (!gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure) { - switch (gBattleMoves[gCurrentMove].target) + switch (GetMoveTargetType(gBattlerAttacker, gCurrentMove)) { case MOVE_TARGET_FOES_AND_ALLY: for (i = 0; i < gBattlersCount; i++) @@ -2103,6 +2104,8 @@ static void Cmd_multihitresultmessage(void) static void Cmd_attackanimation(void) { + u16 moveTarget = GetMoveTargetType(gBattlerAttacker, gCurrentMove); + if (gBattleControllerExecFlags) return; @@ -2119,9 +2122,9 @@ static void Cmd_attackanimation(void) } else { - if ((gBattleMoves[gCurrentMove].target & MOVE_TARGET_BOTH - || gBattleMoves[gCurrentMove].target & MOVE_TARGET_FOES_AND_ALLY - || gBattleMoves[gCurrentMove].target & MOVE_TARGET_DEPENDS) + if ((moveTarget & MOVE_TARGET_BOTH + || moveTarget & MOVE_TARGET_FOES_AND_ALLY + || moveTarget & MOVE_TARGET_DEPENDS) && gBattleScripting.animTargetsHit) { gBattlescriptCurrInstr++; @@ -5237,6 +5240,8 @@ static void Cmd_moveend(void) gBattleScripting.moveendState++; break; case MOVEEND_NEXT_TARGET: // For moves hitting two opposing Pokemon. + { + u16 moveTarget = GetMoveTargetType(gBattlerAttacker, gCurrentMove); // Set a flag if move hits either target (for throat spray that can't check damage) if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) @@ -5245,14 +5250,13 @@ static void Cmd_moveend(void) if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !gProtectStructs[gBattlerAttacker].chargingTurn - && (gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH - || gBattleMoves[gCurrentMove].target == MOVE_TARGET_FOES_AND_ALLY - || (gBattleMoves[gCurrentMove].effect == EFFECT_EXPANDING_FORCE && IsBattlerTerrainAffected(gBattlerAttacker, STATUS_FIELD_PSYCHIC_TERRAIN))) + && (moveTarget == MOVE_TARGET_BOTH + || moveTarget == MOVE_TARGET_FOES_AND_ALLY) && !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) { u8 battlerId; - if (gBattleMoves[gCurrentMove].target == MOVE_TARGET_FOES_AND_ALLY) + if (moveTarget == MOVE_TARGET_FOES_AND_ALLY) { gHitMarker |= HITMARKER_NO_PPDEDUCT; for (battlerId = gBattlerTarget + 1; battlerId < gBattlersCount; battlerId++) @@ -5288,6 +5292,7 @@ static void Cmd_moveend(void) RecordLastUsedMoveBy(gBattlerAttacker, gCurrentMove); gBattleScripting.moveendState++; break; + } case MOVEEND_EJECT_BUTTON: if (gCurrentMove != MOVE_DRAGON_TAIL && gCurrentMove != MOVE_CIRCLE_THROW @@ -9506,7 +9511,7 @@ static void Cmd_jumpifnexttargetvalid(void) for (gBattlerTarget++; gBattlerTarget < gBattlersCount; gBattlerTarget++) { - if (gBattlerTarget == gBattlerAttacker && !(gBattleMoves[gCurrentMove].target & MOVE_TARGET_USER)) + if (gBattlerTarget == gBattlerAttacker && !(GetMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER)) continue; if (IsBattlerAlive(gBattlerTarget)) break; @@ -12000,7 +12005,7 @@ static void Cmd_selectfirstvalidtarget(void) { for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) { - if (gBattlerTarget == gBattlerAttacker && !(gBattleMoves[gCurrentMove].target & MOVE_TARGET_USER)) + if (gBattlerTarget == gBattlerAttacker && !(GetMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER)) continue; if (IsBattlerAlive(gBattlerTarget)) break; diff --git a/src/battle_util.c b/src/battle_util.c index e946fe8f0..dcde7b8ce 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -237,6 +237,7 @@ bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move) void HandleAction_UseMove(void) { u32 i, side, moveType, var = 4; + u16 moveTarget = GetMoveTargetType(gBattlerAttacker, gCurrentMove); gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber]; if (gBattleStruct->field_91 & gBitTable[gBattlerAttacker] || !IsBattlerAlive(gBattlerAttacker)) @@ -309,14 +310,14 @@ void HandleAction_UseMove(void) // choose target side = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE; if (IsAffectedByFollowMe(gBattlerAttacker, side, gCurrentMove) - && gBattleMoves[gCurrentMove].target == MOVE_TARGET_SELECTED + && moveTarget == MOVE_TARGET_SELECTED && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gSideTimers[side].followmeTarget)) { gBattlerTarget = gSideTimers[side].followmeTarget; } else if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gSideTimers[side].followmeTimer == 0 - && (gBattleMoves[gCurrentMove].power != 0 || gBattleMoves[gCurrentMove].target != MOVE_TARGET_USER) + && (gBattleMoves[gCurrentMove].power != 0 || moveTarget != MOVE_TARGET_USER) && ((GetBattlerAbility(*(gBattleStruct->moveTarget + gBattlerAttacker)) != ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC) || (GetBattlerAbility(*(gBattleStruct->moveTarget + gBattlerAttacker)) != ABILITY_STORM_DRAIN && moveType == TYPE_WATER))) { @@ -337,7 +338,7 @@ void HandleAction_UseMove(void) } if (var == 4) { - if (gBattleMoves[gChosenMove].target & MOVE_TARGET_RANDOM) + if (moveTarget & MOVE_TARGET_RANDOM) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) { @@ -354,7 +355,7 @@ void HandleAction_UseMove(void) gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); } } - else if (gBattleMoves[gChosenMove].target & MOVE_TARGET_FOES_AND_ALLY) + else if (moveTarget & MOVE_TARGET_FOES_AND_ALLY) { for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) { @@ -395,7 +396,7 @@ void HandleAction_UseMove(void) } } else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && gBattleMoves[gChosenMove].target & MOVE_TARGET_RANDOM) + && moveTarget & MOVE_TARGET_RANDOM) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) { @@ -418,7 +419,7 @@ void HandleAction_UseMove(void) gBattlerTarget = GetBattlerAtPosition(GetBattlerPosition(gBattlerTarget) ^ BIT_FLANK); } } - else if (gBattleMoves[gChosenMove].target == MOVE_TARGET_ALLY) + else if (moveTarget == MOVE_TARGET_ALLY) { if (IsBattlerAlive(BATTLE_PARTNER(gBattlerAttacker))) gBattlerTarget = BATTLE_PARTNER(gBattlerAttacker); @@ -426,7 +427,7 @@ void HandleAction_UseMove(void) gBattlerTarget = gBattlerAttacker; } else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && gBattleMoves[gChosenMove].target == MOVE_TARGET_FOES_AND_ALLY) + && moveTarget == MOVE_TARGET_FOES_AND_ALLY) { for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) { @@ -4668,7 +4669,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITYEFFECT_MOVES_BLOCK: // 2 - if ((gLastUsedAbility == ABILITY_SOUNDPROOF && gBattleMoves[move].flags & FLAG_SOUND && !(gBattleMoves[move].target & MOVE_TARGET_USER)) + { + u16 moveTarget = GetMoveTargetType(battler, move); + + if ((gLastUsedAbility == ABILITY_SOUNDPROOF && gBattleMoves[move].flags & FLAG_SOUND && !(moveTarget & MOVE_TARGET_USER)) || (gLastUsedAbility == ABILITY_BULLETPROOF && gBattleMoves[move].flags & FLAG_BALLISTIC)) { if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS) @@ -4691,14 +4695,14 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move else if (BlocksPrankster(move, gBattlerAttacker, gBattlerTarget, TRUE) && !(IS_MOVE_STATUS(move) && GetBattlerAbility(gBattlerTarget) == ABILITY_MAGIC_BOUNCE)) { - if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE) || !(gBattleMoves[move].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) + if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE) || !(moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) CancelMultiTurnMoves(gBattlerAttacker); // Don't cancel moves that can hit two targets bc one target might not be protected gBattleScripting.battler = gBattlerAbility = gBattlerTarget; gBattlescriptCurrInstr = BattleScript_DarkTypePreventsPrankster; effect = 1; } - break; + } case ABILITYEFFECT_ABSORBING: // 3 if (move != MOVE_NONE) { @@ -7257,15 +7261,12 @@ u32 GetMoveTarget(u16 move, u8 setTarget) if (setTarget) moveTarget = setTarget - 1; else - moveTarget = gBattleMoves[move].target; - + moveTarget = GetMoveTargetType(gBattlerAttacker, move); + // Special cases if (move == MOVE_CURSE && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST)) moveTarget = MOVE_TARGET_USER; - if (gBattleMoves[move].effect == EFFECT_EXPANDING_FORCE && IsBattlerTerrainAffected(gBattlerAttacker, STATUS_FIELD_PSYCHIC_TERRAIN)) - moveTarget = MOVE_TARGET_BOTH; - switch (moveTarget) { case MOVE_TARGET_SELECTED: @@ -7528,7 +7529,7 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) else if (gProtectStructs[battlerId].protected) return TRUE; else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_WIDE_GUARD - && gBattleMoves[move].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) + && GetMoveTargetType(gBattlerAttacker, move) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) return TRUE; else if (gProtectStructs[battlerId].banefulBunkered) return TRUE; @@ -7654,7 +7655,7 @@ u32 CountBattlerStatIncreases(u8 battlerId, bool32 countEvasionAcc) u32 GetMoveTargetCount(u16 move, u8 battlerAtk, u8 battlerDef) { - switch (gBattleMoves[move].target) + switch (GetMoveTargetType(gBattlerAttacker, move)) { case MOVE_TARGET_BOTH: return IsBattlerAlive(battlerDef) @@ -9818,7 +9819,7 @@ bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 chec return FALSE; if (GetBattlerSide(battlerPrankster) == GetBattlerSide(battlerDef)) return FALSE; - if (checkTarget && (gBattleMoves[move].target & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_DEPENDS))) + if (checkTarget && (GetMoveTargetType(battlerPrankster, move) & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_DEPENDS))) return FALSE; if (!IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK)) return FALSE; @@ -9850,3 +9851,16 @@ bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags) } return FALSE; } + +// Gets move target before redirection effects etc. are applied +// Possible return values are defined in battle.h following MOVE_TARGET_SELECTED +u32 GetMoveTargetType(u8 battlerId, u16 move) +{ + u32 target; + + if (gBattleMoves[move].effect == EFFECT_EXPANDING_FORCE + && IsBattlerTerrainAffected(gActiveBattler, STATUS_FIELD_PSYCHIC_TERRAIN)) + return MOVE_TARGET_BOTH; + else + return gBattleMoves[move].target; +} diff --git a/src/contest.c b/src/contest.c index 46fa0efed..c876f02cc 100644 --- a/src/contest.c +++ b/src/contest.c @@ -5388,7 +5388,7 @@ static void SetBattleTargetSpritePosition(void) static void SetMoveTargetPosition(u16 move) { - switch (gBattleMoves[move].target) + switch (GetMoveTargetType(gBattlerAttacker, move)) { case MOVE_TARGET_USER_OR_SELECTED: case MOVE_TARGET_USER: From a89ce0c38abf74470a78091152c8f5900cdde792 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 23 Nov 2021 22:54:30 +1300 Subject: [PATCH 048/208] Swapped webs don't trigger Defiant Track the side that originally set Sticky Web, and if it matches the side the target of the speed drop is on, don't activate Defiant. Hard to tell if this is a bug or a feature in gen 8 - maybe the swapped webs are considered a "friendly" effect? Also, fix Sticky Web not activating Defiant. --- data/battle_scripts_1.s | 1 + include/battle.h | 2 ++ include/constants/battle_script_commands.h | 1 + src/battle_script_commands.c | 39 ++++++++++++---------- src/battle_util.c | 5 ++- 5 files changed, 30 insertions(+), 18 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index eeeba7cf7..dabdf1383 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -6712,6 +6712,7 @@ BattleScript_ToxicSpikesPoisoned:: BattleScript_StickyWebOnSwitchIn:: savetarget copybyte gBattlerTarget, sBATTLER + setbyte sSTICKY_WEB_STAT_DROP, 1 printstring STRINGID_STICKYWEBSWITCHIN waitmessage B_WAIT_TIME_LONG jumpifability BS_TARGET, ABILITY_MIRROR_ARMOR, BattleScript_MirrorArmorReflectStickyWeb diff --git a/include/battle.h b/include/battle.h index f534f416b..7ccb492a6 100644 --- a/include/battle.h +++ b/include/battle.h @@ -211,6 +211,7 @@ struct SideTimer u8 toxicSpikesAmount; u8 stealthRockAmount; u8 stickyWebAmount; + u8 stickyWebBattlerSide; // Used for Court Change u8 auroraVeilTimer; u8 auroraVeilBattlerId; u8 tailwindTimer; @@ -704,6 +705,7 @@ struct BattleScripting u16 abilityPopupOverwrite; u8 switchCase; // Special switching conditions, eg. red card u8 overrideBerryRequirements; + u8 stickyWebStatDrop; // To prevent Defiant activating on a Court Change'd Sticky Web }; // rom_80A5C6C diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 96796ea2d..331794816 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -39,6 +39,7 @@ #define sABILITY_OVERWRITE gBattleScripting + 0x34 #define sSWITCH_CASE gBattleScripting + 0x36 #define sBERRY_OVERRIDE gBattleScripting + 0x37 +#define sSTICKY_WEB_STAT_DROP gBattleScripting + 0x38 #define cMULTISTRING_CHOOSER gBattleCommunication + 5 #define cMISS_TYPE gBattleCommunication + 6 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index db3a030ae..672aa92a1 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7536,30 +7536,30 @@ static bool32 IsRototillerAffected(u32 battlerId) return TRUE; } -#define COURTCHANGE_SWAP(status, structField, temp) \ -{ \ - temp = gSideStatuses[B_SIDE_PLAYER]; \ - if (gSideStatuses[B_SIDE_OPPONENT] & status) \ - gSideStatuses[B_SIDE_PLAYER] |= status; \ - else \ - gSideStatuses[B_SIDE_PLAYER] &= ~(status); \ - if (temp & status) \ - gSideStatuses[B_SIDE_OPPONENT] |= status; \ - else \ - gSideStatuses[B_SIDE_OPPONENT] &= ~(status); \ - SWAP(sideTimer0->structField, sideTimer1->structField, temp);\ -} \ +#define COURTCHANGE_SWAP(status, structField, temp) \ +{ \ + temp = gSideStatuses[B_SIDE_PLAYER]; \ + if (gSideStatuses[B_SIDE_OPPONENT] & status) \ + gSideStatuses[B_SIDE_PLAYER] |= status; \ + else \ + gSideStatuses[B_SIDE_PLAYER] &= ~(status); \ + if (temp & status) \ + gSideStatuses[B_SIDE_OPPONENT] |= status; \ + else \ + gSideStatuses[B_SIDE_OPPONENT] &= ~(status); \ + SWAP(sideTimerPlayer->structField, sideTimerOpp->structField, temp);\ +} \ #define UPDATE_COURTCHANGED_BATTLER(structField)\ { \ - sideTimer0->structField ^= BIT_SIDE; \ - sideTimer1->structField ^= BIT_SIDE; \ + sideTimerPlayer->structField ^= BIT_SIDE; \ + sideTimerOpp->structField ^= BIT_SIDE; \ } \ static bool32 CourtChangeSwapSideStatuses(void) { - struct SideTimer *sideTimer0 = &gSideTimers[B_SIDE_PLAYER]; - struct SideTimer *sideTimer1 = &gSideTimers[B_SIDE_OPPONENT]; + struct SideTimer *sideTimerPlayer = &gSideTimers[B_SIDE_PLAYER]; + struct SideTimer *sideTimerOpp = &gSideTimers[B_SIDE_OPPONENT]; u32 temp; // TODO: add Pledge-related effects @@ -7588,6 +7588,9 @@ static bool32 CourtChangeSwapSideStatuses(void) UPDATE_COURTCHANGED_BATTLER(auroraVeilBattlerId); UPDATE_COURTCHANGED_BATTLER(tailwindBattlerId); UPDATE_COURTCHANGED_BATTLER(luckyChantBattlerId); + + // Track which side originally set the Sticky Web + SWAP(sideTimerPlayer->stickyWebBattlerSide, sideTimerOpp->stickyWebBattlerSide, temp); } static void Cmd_various(void) @@ -11996,6 +11999,7 @@ static void Cmd_recoverbasedonsunlight(void) static void Cmd_setstickyweb(void) { u8 targetSide = GetBattlerSide(gBattlerTarget); + if (gSideStatuses[targetSide] & SIDE_STATUS_STICKY_WEB) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -12003,6 +12007,7 @@ static void Cmd_setstickyweb(void) else { gSideStatuses[targetSide] |= SIDE_STATUS_STICKY_WEB; + gSideTimers[targetSide].stickyWebBattlerSide = GetBattlerSide(gBattlerAttacker); // For Court Change/Defiant - set this to the user's side gSideTimers[targetSide].stickyWebAmount = 1; gBattleStruct->stickyWebUser = gBattlerAttacker; // For Mirror Armor gBattlescriptCurrInstr += 5; diff --git a/src/battle_util.c b/src/battle_util.c index 0ddff3483..7aba05fc1 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1453,6 +1453,7 @@ bool8 WasUnableToUseMove(u8 battler) void PrepareStringBattle(u16 stringId, u8 battler) { + u32 targetSide = GetBattlerSide(gBattlerTarget); // Support for Contrary ability. // If a move attempted to raise stat - print "won't increase". // If a move attempted to lower stat - print "won't decrease". @@ -1471,8 +1472,10 @@ void PrepareStringBattle(u16 stringId, u8 battler) && ((GetBattlerAbility(gBattlerTarget) == ABILITY_DEFIANT && CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) || (GetBattlerAbility(gBattlerTarget) == ABILITY_COMPETITIVE && CompareStat(gBattlerTarget, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN))) && gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != BATTLE_PARTNER(gBattlerTarget) - && gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != gBattlerTarget) + // && gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != gBattlerTarget) // Why was this here? Needs investigating + && !(gBattleScripting.stickyWebStatDrop == 1 && gSideTimers[targetSide].stickyWebBattlerSide == targetSide)) // Sticky Web must have been set by the foe { + gBattleScripting.stickyWebStatDrop = 0; gBattlerAbility = gBattlerTarget; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_DefiantActivates; From fd4414fe627eb4efcb42362d18fe68872d27b478 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 23 Nov 2021 23:01:43 +1300 Subject: [PATCH 049/208] Spaces instead of tabs --- data/battle_anim_scripts.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index bc3821563..be8dfb9a4 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -827,8 +827,8 @@ gBattleAnims_General:: .4byte General_GulpMissile @ B_ANIM_GULP_MISSILE .4byte General_StrongWinds @ B_ANIM_STRONG_WINDS .4byte General_PrimalReversion @ B_ANIM_PRIMAL_REVERSION - .4byte General_BeakBlastSetUp @ B_ANIM_BEAK_BLAST_SETUP - .4byte General_ShellTrapSetUp @ B_ANIM_SHELL_TRAP_SETUP + .4byte General_BeakBlastSetUp @ B_ANIM_BEAK_BLAST_SETUP + .4byte General_ShellTrapSetUp @ B_ANIM_SHELL_TRAP_SETUP .align 2 gBattleAnims_Special:: From cca7ec8c58d0becd96fb9ea6cd067d676ffafcd6 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 24 Nov 2021 12:09:54 +1300 Subject: [PATCH 050/208] Fix and rename GetMoveTargetType Change name to GetBattlerMoveTargetType and make it actually use the battlerId argument. --- include/battle_util.h | 2 +- src/battle_ai_main.c | 18 +++++++++--------- src/battle_ai_util.c | 2 +- src/battle_anim.c | 2 +- src/battle_controller_opponent.c | 6 +++--- src/battle_controller_player.c | 4 ++-- src/battle_gfx_sfx_util.c | 4 ++-- src/battle_script_commands.c | 14 +++++++------- src/battle_util.c | 16 ++++++++-------- src/contest.c | 2 +- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/include/battle_util.h b/include/battle_util.h index 47bc2cc56..35eea7da1 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -163,7 +163,7 @@ bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags); void TryToApplyMimicry(u8 battlerId, bool8 various); void TryToRevertMimicry(void); void RestoreBattlerOriginalTypes(u8 battlerId); -u32 GetMoveTargetType(u8 battlerId, u16 move); +u32 GetBattlerMoveTargetType(u8 battlerId, u16 move); // Ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability); bool32 IsRolePlayBannedAbility(u16 ability); diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 3b6716485..25265b973 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -484,7 +484,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) u8 atkPriority = GetMovePriority(battlerAtk, move); u16 moveEffect = gBattleMoves[move].effect; s32 moveType; - u16 moveTarget = GetMoveTargetType(battlerAtk, move); + u16 moveTarget = GetBattlerMoveTargetType(battlerAtk, move); u16 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect, move); u8 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); @@ -2299,7 +2299,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else { - if (GetMoveTargetType(battlerDef, instructedMove) & (MOVE_TARGET_SELECTED + if (GetBattlerMoveTargetType(battlerDef, instructedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_DEPENDS | MOVE_TARGET_RANDOM | MOVE_TARGET_BOTH @@ -2496,7 +2496,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // move data u8 moveType = gBattleMoves[move].type; u16 effect = gBattleMoves[move].effect; - u16 moveTarget = GetMoveTargetType(battlerAtk, move); + u16 moveTarget = GetBattlerMoveTargetType(battlerAtk, move); // ally data u8 battlerAtkPartner = AI_DATA->battlerAtkPartner; u16 atkPartnerAbility = AI_DATA->atkPartnerAbility; @@ -2803,7 +2803,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (instructedMove != MOVE_NONE && !IS_MOVE_STATUS(instructedMove) - && (GetMoveTargetType(battlerAtkPartner, instructedMove) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) // Use instruct on multi-target moves + && (GetBattlerMoveTargetType(battlerAtkPartner, instructedMove) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) // Use instruct on multi-target moves { RETURN_SCORE_PLUS(1); } @@ -3603,24 +3603,24 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); break; case MOVE_WIDE_GUARD: - if (predictedMove != MOVE_NONE && GetMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_BOTH)) + if (predictedMove != MOVE_NONE && GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_BOTH)) { ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); } - else if (isDoubleBattle && GetMoveTargetType(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) & MOVE_TARGET_FOES_AND_ALLY) + else if (isDoubleBattle && GetBattlerMoveTargetType(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) & MOVE_TARGET_FOES_AND_ALLY) { if (AI_DATA->atkAbility != ABILITY_TELEPATHY) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); } break; case MOVE_CRAFTY_SHIELD: - if (predictedMove != MOVE_NONE && IS_MOVE_STATUS(predictedMove) && !(GetMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER)) + if (predictedMove != MOVE_NONE && IS_MOVE_STATUS(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) && !(GetMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER)) + && !IS_MOVE_STATUS(predictedMove) && !(GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER)) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); break; case MOVE_KINGS_SHIELD: @@ -4065,7 +4065,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 10; break; case EFFECT_MAGIC_COAT: - if (IS_MOVE_STATUS(predictedMove) && GetMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH)) + if (IS_MOVE_STATUS(predictedMove) && GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH)) score += 3; break; case EFFECT_RECYCLE: diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 664078e55..7f30862d1 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1921,7 +1921,7 @@ bool32 HasMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef, u8 accCheck, bool32 if (ignoreStatus && IS_MOVE_STATUS(moves[i])) continue; else if ((!IS_MOVE_STATUS(moves[i]) && gBattleMoves[moves[i]].accuracy == 0) - || GetMoveTargetType(battlerAtk, moves[i]) & (MOVE_TARGET_USER | MOVE_TARGET_OPPONENTS_FIELD)) + || GetBattlerMoveTargetType(battlerAtk, moves[i]) & (MOVE_TARGET_USER | MOVE_TARGET_OPPONENTS_FIELD)) continue; if (AI_GetMoveAccuracy(battlerAtk, battlerDef, atkAbility, defAbility, atkHoldEffect, defHoldEffect, moves[i]) <= accCheck) return TRUE; diff --git a/src/battle_anim.c b/src/battle_anim.c index d6761eae6..fba5cbcd8 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -2195,7 +2195,7 @@ void DoMoveAnim(u16 move) gBattleAnimAttacker = gBattlerAttacker; gBattleAnimTarget = gBattlerTarget; // Make sure the anim target of moves hitting everyone is at the opposite side. - if (GetMoveTargetType(gBattlerAttacker, move) & MOVE_TARGET_FOES_AND_ALLY && IsDoubleBattle()) + if (GetBattlerMoveTargetType(gBattlerAttacker, move) & MOVE_TARGET_FOES_AND_ALLY && IsDoubleBattle()) { while (GET_BATTLER_SIDE(gBattleAnimAttacker) == GET_BATTLER_SIDE(gBattleAnimTarget)) { diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 4482c175d..448c9b480 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1574,9 +1574,9 @@ static void OpponentHandleChooseAction(void) BtlController_EmitTwoReturnValues(1, B_ACTION_RUN, 0); break; default: - if (GetMoveTargetType(gActiveBattler, moveInfo.moves[chosenMoveId]) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + if (GetBattlerMoveTargetType(gActiveBattler, moveInfo.moves[chosenMoveId]) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) gBattlerTarget = gActiveBattler; - if (GetMoveTargetType(gActiveBattler, moveInfo.moves[chosenMoveId]) & MOVE_TARGET_BOTH) + if (GetBattlerMoveTargetType(gActiveBattler, moveInfo.moves[chosenMoveId]) & MOVE_TARGET_BOTH) { gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) @@ -1600,7 +1600,7 @@ static void OpponentHandleChooseAction(void) move = moveInfo.moves[chosenMoveId]; } while (move == MOVE_NONE); - if (GetMoveTargetType(gActiveBattler, move) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + if (GetBattlerMoveTargetType(gActiveBattler, move) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) BtlController_EmitTwoReturnValues(1, B_ACTION_USE_MOVE, (chosenMoveId) | (gActiveBattler << 8)); else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) BtlController_EmitTwoReturnValues(1, B_ACTION_USE_MOVE, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8)); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 05ad19170..caa3b0689 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -360,7 +360,7 @@ static void HandleInputChooseTarget(void) s32 i; static const u8 identities[MAX_BATTLERS_COUNT] = {B_POSITION_PLAYER_LEFT, B_POSITION_PLAYER_RIGHT, B_POSITION_OPPONENT_RIGHT, B_POSITION_OPPONENT_LEFT}; u16 move = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBattler]); - u16 moveTarget = GetMoveTargetType(gActiveBattler, move); + u16 moveTarget = GetBattlerMoveTargetType(gActiveBattler, move); DoBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX, 15, 1); for (i = 0; i < gBattlersCount; i++) @@ -612,7 +612,7 @@ static void HandleInputChooseMove(void) } else { - moveTarget = GetMoveTargetType(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); + moveTarget = GetBattlerMoveTargetType(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); } if (moveTarget & MOVE_TARGET_USER) diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 11e41ebd4..73adc442b 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -251,7 +251,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) } else { - moveTarget = GetMoveTargetType(gActiveBattler, moveInfo->moves[chosenMoveId]); + moveTarget = GetBattlerMoveTargetType(gActiveBattler, moveInfo->moves[chosenMoveId]); } if (moveTarget & MOVE_TARGET_USER) @@ -275,7 +275,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) static u8 GetBattlePalaceMoveGroup(u8 battlerId, u16 move) { - switch (GetMoveTargetType(battlerId, move)) + switch (GetBattlerMoveTargetType(battlerId, move)) { case MOVE_TARGET_SELECTED: case MOVE_TARGET_USER_OR_SELECTED: diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 672aa92a1..8b6b31738 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1318,7 +1318,7 @@ static bool32 NoTargetPresent(u8 battlerId, u32 move) if (!IsBattlerAlive(gBattlerTarget)) gBattlerTarget = GetMoveTarget(move, 0); - switch (GetMoveTargetType(battlerId, move)) + switch (GetBattlerMoveTargetType(battlerId, move)) { case MOVE_TARGET_SELECTED: case MOVE_TARGET_DEPENDS: @@ -1741,7 +1741,7 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move) static void Cmd_accuracycheck(void) { u16 type, move = T2_READ_16(gBattlescriptCurrInstr + 5); - u16 moveTarget = GetMoveTargetType(gBattlerAttacker, move); + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, move); if (move == ACC_CURR_MOVE) move = gCurrentMove; @@ -1805,7 +1805,7 @@ static void Cmd_ppreduce(void) if (!gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure) { - switch (GetMoveTargetType(gBattlerAttacker, gCurrentMove)) + switch (GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove)) { case MOVE_TARGET_FOES_AND_ALLY: for (i = 0; i < gBattlersCount; i++) @@ -2104,7 +2104,7 @@ static void Cmd_multihitresultmessage(void) static void Cmd_attackanimation(void) { - u16 moveTarget = GetMoveTargetType(gBattlerAttacker, gCurrentMove); + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); if (gBattleControllerExecFlags) return; @@ -5241,7 +5241,7 @@ static void Cmd_moveend(void) break; case MOVEEND_NEXT_TARGET: // For moves hitting two opposing Pokemon. { - u16 moveTarget = GetMoveTargetType(gBattlerAttacker, gCurrentMove); + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); // Set a flag if move hits either target (for throat spray that can't check damage) if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) @@ -9522,7 +9522,7 @@ static void Cmd_jumpifnexttargetvalid(void) for (gBattlerTarget++; gBattlerTarget < gBattlersCount; gBattlerTarget++) { - if (gBattlerTarget == gBattlerAttacker && !(GetMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER)) + if (gBattlerTarget == gBattlerAttacker && !(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER)) continue; if (IsBattlerAlive(gBattlerTarget)) break; @@ -12018,7 +12018,7 @@ static void Cmd_selectfirstvalidtarget(void) { for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) { - if (gBattlerTarget == gBattlerAttacker && !(GetMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER)) + if (gBattlerTarget == gBattlerAttacker && !(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER)) continue; if (IsBattlerAlive(gBattlerTarget)) break; diff --git a/src/battle_util.c b/src/battle_util.c index 7aba05fc1..3cb6b6d86 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -237,7 +237,7 @@ bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move) void HandleAction_UseMove(void) { u32 i, side, moveType, var = 4; - u16 moveTarget = GetMoveTargetType(gBattlerAttacker, gCurrentMove); + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber]; if (gBattleStruct->field_91 & gBitTable[gBattlerAttacker] || !IsBattlerAlive(gBattlerAttacker)) @@ -4674,7 +4674,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move break; case ABILITYEFFECT_MOVES_BLOCK: // 2 { - u16 moveTarget = GetMoveTargetType(battler, move); + u16 moveTarget = GetBattlerMoveTargetType(battler, move); if ((gLastUsedAbility == ABILITY_SOUNDPROOF && gBattleMoves[move].flags & FLAG_SOUND && !(moveTarget & MOVE_TARGET_USER)) || (gLastUsedAbility == ABILITY_BULLETPROOF && gBattleMoves[move].flags & FLAG_BALLISTIC)) @@ -7265,7 +7265,7 @@ u32 GetMoveTarget(u16 move, u8 setTarget) if (setTarget) moveTarget = setTarget - 1; else - moveTarget = GetMoveTargetType(gBattlerAttacker, move); + moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, move); // Special cases if (move == MOVE_CURSE && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST)) @@ -7538,7 +7538,7 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) else if (gProtectStructs[battlerId].protected) return TRUE; else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_WIDE_GUARD - && GetMoveTargetType(gBattlerAttacker, move) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) + && GetBattlerMoveTargetType(gBattlerAttacker, move) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) return TRUE; else if (gProtectStructs[battlerId].banefulBunkered) return TRUE; @@ -7664,7 +7664,7 @@ u32 CountBattlerStatIncreases(u8 battlerId, bool32 countEvasionAcc) u32 GetMoveTargetCount(u16 move, u8 battlerAtk, u8 battlerDef) { - switch (GetMoveTargetType(gBattlerAttacker, move)) + switch (GetBattlerMoveTargetType(gBattlerAttacker, move)) { case MOVE_TARGET_BOTH: return IsBattlerAlive(battlerDef) @@ -9828,7 +9828,7 @@ bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 chec return FALSE; if (GetBattlerSide(battlerPrankster) == GetBattlerSide(battlerDef)) return FALSE; - if (checkTarget && (GetMoveTargetType(battlerPrankster, move) & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_DEPENDS))) + if (checkTarget && (GetBattlerMoveTargetType(battlerPrankster, move) & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_DEPENDS))) return FALSE; if (!IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK)) return FALSE; @@ -9863,12 +9863,12 @@ bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags) // Gets move target before redirection effects etc. are applied // Possible return values are defined in battle.h following MOVE_TARGET_SELECTED -u32 GetMoveTargetType(u8 battlerId, u16 move) +u32 GetBattlerMoveTargetType(u8 battlerId, u16 move) { u32 target; if (gBattleMoves[move].effect == EFFECT_EXPANDING_FORCE - && IsBattlerTerrainAffected(gActiveBattler, STATUS_FIELD_PSYCHIC_TERRAIN)) + && IsBattlerTerrainAffected(battlerId, STATUS_FIELD_PSYCHIC_TERRAIN)) return MOVE_TARGET_BOTH; else return gBattleMoves[move].target; diff --git a/src/contest.c b/src/contest.c index c876f02cc..f8e6be3ef 100644 --- a/src/contest.c +++ b/src/contest.c @@ -5388,7 +5388,7 @@ static void SetBattleTargetSpritePosition(void) static void SetMoveTargetPosition(u16 move) { - switch (GetMoveTargetType(gBattlerAttacker, move)) + switch (GetBattlerMoveTargetType(gBattlerAttacker, move)) { case MOVE_TARGET_USER_OR_SELECTED: case MOVE_TARGET_USER: From 19af517bbb4c8887e036bdf1e9ef7bf2355d9f04 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Tue, 30 Nov 2021 20:45:21 -0300 Subject: [PATCH 051/208] Edited pointless or useless Primal Reversion code Also added an equivalent to GetMegaEvolutionSpecies and GetWishMegaEvolutionSpecies for Primal Reversion. Also also modified how CanBattlerGetOrLoseItem checks for Primal Reversion. Also also also rewrote the check that triggers Primal Reversion in TryDoEventsBeforeFirstTurn. --- include/battle.h | 1 - include/battle_util.h | 1 + src/battle_main.c | 18 +++++++++++++----- src/battle_script_commands.c | 2 +- src/battle_util.c | 29 ++++++++++++++++------------- 5 files changed, 31 insertions(+), 20 deletions(-) diff --git a/include/battle.h b/include/battle.h index 5658f603c..930578a50 100644 --- a/include/battle.h +++ b/include/battle.h @@ -475,7 +475,6 @@ struct MegaEvolutionData bool8 playerSelect; u8 triggerSpriteId; bool8 isWishMegaEvo; - bool8 isPrimalReversion; }; struct Illusion diff --git a/include/battle_util.h b/include/battle_util.h index b1a2a1534..ba4f20336 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -127,6 +127,7 @@ u16 CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 abilit u16 GetTypeModifier(u8 atkType, u8 defType); s32 GetStealthHazardDamage(u8 hazardType, u8 battlerId); u16 GetMegaEvolutionSpecies(u16 preEvoSpecies, u16 heldItemId); +u16 GetPrimalReversionSpecies(u16 preEvoSpecies, u16 heldItemId); u16 GetWishMegaEvolutionSpecies(u16 preEvoSpecies, u16 moveId1, u16 moveId2, u16 moveId3, u16 moveId4); bool32 CanMegaEvolve(u8 battlerId); void UndoMegaEvolution(u32 monId); diff --git a/src/battle_main.c b/src/battle_main.c index 766736048..028237aa4 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -64,6 +64,8 @@ #include "constants/trainers.h" #include "cable_club.h" +extern struct Evolution gEvolutionTable[][EVOS_PER_MON]; + extern struct MusicPlayerInfo gMPlayInfo_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE2; @@ -3541,12 +3543,18 @@ static void TryDoEventsBeforeFirstTurn(void) // Primal Reversion for (i = 0; i < gBattlersCount; i++) { - if (CanMegaEvolve(i) - && GetBattlerHoldEffect(i, TRUE) == HOLD_EFFECT_PRIMAL_ORB) + if (GetBattlerHoldEffect(i, TRUE) == HOLD_EFFECT_PRIMAL_ORB) { - gBattlerAttacker = i; - BattleScriptExecute(BattleScript_PrimalReversion); - return; + for (j = 0; j < EVOS_PER_MON; j++) + { + if (gEvolutionTable[gBattleMons[i].species][j].targetSpecies != SPECIES_NONE + && gEvolutionTable[gBattleMons[i].species][j].method == EVO_PRIMAL_REVERSION) + { + gBattlerAttacker = i; + BattleScriptExecute(BattleScript_PrimalReversion); + return; + } + } } } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 8c328926d..640e75ed8 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8331,7 +8331,7 @@ static void Cmd_various(void) gBattleStruct->mega.playerPrimalRevertedSpecies = gBattleStruct->mega.primalRevertedSpecies[gActiveBattler]; } // Checks Primal Reversion - primalSpecies = GetMegaEvolutionSpecies(gBattleStruct->mega.primalRevertedSpecies[gActiveBattler], gBattleMons[gActiveBattler].item); + primalSpecies = GetPrimalReversionSpecies(gBattleStruct->mega.primalRevertedSpecies[gActiveBattler], gBattleMons[gActiveBattler].item); gBattleMons[gActiveBattler].species = primalSpecies; PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].species); diff --git a/src/battle_util.c b/src/battle_util.c index 725814a0d..3b95bb84c 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -9081,8 +9081,20 @@ u16 GetMegaEvolutionSpecies(u16 preEvoSpecies, u16 heldItemId) for (i = 0; i < EVOS_PER_MON; i++) { - if ((gEvolutionTable[preEvoSpecies][i].method == EVO_MEGA_EVOLUTION - || gEvolutionTable[preEvoSpecies][i].method == EVO_PRIMAL_REVERSION) + if (gEvolutionTable[preEvoSpecies][i].method == EVO_MEGA_EVOLUTION + && gEvolutionTable[preEvoSpecies][i].param == heldItemId) + return gEvolutionTable[preEvoSpecies][i].targetSpecies; + } + return SPECIES_NONE; +} + +u16 GetPrimalReversionSpecies(u16 preEvoSpecies, u16 heldItemId) +{ + u32 i; + + for (i = 0; i < EVOS_PER_MON; i++) + { + if (gEvolutionTable[preEvoSpecies][i].method == EVO_PRIMAL_REVERSION && gEvolutionTable[preEvoSpecies][i].param == heldItemId) return gEvolutionTable[preEvoSpecies][i].targetSpecies; } @@ -9153,14 +9165,6 @@ bool32 CanMegaEvolve(u8 battlerId) gBattleStruct->mega.isWishMegaEvo = FALSE; return TRUE; } - - // Can undergo Primal Reversion. - if (holdEffect == HOLD_EFFECT_PRIMAL_ORB) - { - gBattleStruct->mega.isWishMegaEvo = FALSE; - gBattleStruct->mega.isPrimalReversion = TRUE; - return TRUE; - } } // Check if there is an entry in the evolution table for Wish Mega Evolution. @@ -9264,9 +9268,8 @@ bool32 CanBattlerGetOrLoseItem(u8 battlerId, u16 itemId) // Mail can be stolen now if (itemId == ITEM_ENIGMA_BERRY) return FALSE; - else if (GET_BASE_SPECIES_ID(species) == SPECIES_KYOGRE && itemId == ITEM_BLUE_ORB) // includes primal - return FALSE; - else if (GET_BASE_SPECIES_ID(species) == SPECIES_GROUDON && itemId == ITEM_RED_ORB) // includes primal + // Primal Reversion inducing items cannot be lost if pokemon's base species can undergo primal reversion with it. + else if (holdEffect == HOLD_EFFECT_PRIMAL_ORB && (GetPrimalReversionSpecies(GET_BASE_SPECIES_ID(species), itemId) != SPECIES_NONE)) return FALSE; // Mega stone cannot be lost if pokemon's base species can mega evolve with it. else if (holdEffect == HOLD_EFFECT_MEGA_STONE && (GetMegaEvolutionSpecies(GET_BASE_SPECIES_ID(species), itemId) != SPECIES_NONE)) From bbf7b62ceb5d4a45b489719a074bf2218b3950fd Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 11 Dec 2021 23:03:50 -0300 Subject: [PATCH 052/208] Config for lost money after losing a battle --- data/battle_scripts_1.s | 18 ++++++++++++ include/constants/battle_config.h | 1 + include/constants/battle_string_ids.h | 4 ++- src/battle_message.c | 8 +++++ src/battle_script_commands.c | 42 +++++++++++++++++++++++---- src/overworld.c | 2 ++ 6 files changed, 69 insertions(+), 6 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 24a3d16ed..a0e5577aa 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -5936,12 +5936,30 @@ BattleScript_LocalBattleLost:: jumpifbattletype BATTLE_TYPE_EREADER_TRAINER, BattleScript_LocalBattleLostEnd jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, TRAINER_SECRET_BASE, BattleScript_LocalBattleLostEnd BattleScript_LocalBattleLostPrintWhiteOut:: +.if B_WHITEOUT_MONEY >= GEN_4 + jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_LocalBattleLostEnd + printstring STRINGID_PLAYERWHITEOUT + waitmessage B_WAIT_TIME_LONG + getmoneyreward + printstring STRINGID_PLAYERWHITEOUT2 + waitmessage B_WAIT_TIME_LONG + end2 +BattleScript_LocalBattleLostEnd:: + printstring STRINGID_PLAYERLOSTTOENEMYTRAINER + waitmessage B_WAIT_TIME_LONG + getmoneyreward + printstring STRINGID_PLAYERPAIDPRIZEMONEY + waitmessage B_WAIT_TIME_LONG + end2 +.else printstring STRINGID_PLAYERWHITEOUT waitmessage B_WAIT_TIME_LONG printstring STRINGID_PLAYERWHITEOUT2 waitmessage B_WAIT_TIME_LONG BattleScript_LocalBattleLostEnd:: end2 +.endif + BattleScript_CheckDomeDrew:: jumpifbyte CMP_EQUAL, gBattleOutcome, B_OUTCOME_DREW, BattleScript_LocalBattleLostEnd_ BattleScript_LocalBattleLostPrintTrainersWinText:: diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 8f8d30b56..05357b3bc 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -101,6 +101,7 @@ #define B_PARALYSIS_SPEED GEN_7 // In Gen7+, Speed is decreased by 50% instead of 75%. #define B_CONFUSION_SELF_DMG_CHANCE GEN_7 // In Gen7+, confusion has a 33.3% of self-damage, instead of 50%. #define B_MULTI_HIT_CHANCE GEN_7 // In Gen5+, multi-hit moves have different %. See Cmd_setmultihitcounter for values. +#define B_WHITEOUT_MONEY GEN_7 // In Gen4+, the amount of money lost by losing a battle is determined by the amount of badges earned. Previously, it would cut the current money by half. (While this change was also in FRLG, for the sake of simplicity, setting this to GEN_3 will result in RSE behavior.) // Exp and stat settings #define B_EXP_CATCH GEN_7 // In Gen6+, Pokémon get experience from catching. diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 7846fa521..48352bf34 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -609,8 +609,10 @@ #define STRINGID_CANTESCAPEBECAUSEOFCURRENTMOVE 606 #define STRINGID_NEUTRALIZINGGASENTERS 607 #define STRINGID_NEUTRALIZINGGASOVER 608 +#define STRINGID_PLAYERLOSTTOENEMYTRAINER 609 +#define STRINGID_PLAYERPAIDPRIZEMONEY 610 -#define BATTLESTRINGS_COUNT 609 +#define BATTLESTRINGS_COUNT 611 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_message.c b/src/battle_message.c index 2f9fccaaf..ec9b66451 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -76,8 +76,14 @@ static const u8 sText_ItDoesntAffect[] = _("It doesn't affect\n{B_DEF_NAME_WITH_ static const u8 sText_AttackerFainted[] = _("{B_ATK_NAME_WITH_PREFIX}\nfainted!\p"); static const u8 sText_TargetFainted[] = _("{B_DEF_NAME_WITH_PREFIX}\nfainted!\p"); static const u8 sText_PlayerGotMoney[] = _("{B_PLAYER_NAME} got ¥{B_BUFF1}\nfor winning!\p"); +static const u8 sText_PlayerLostToEnemyTrainer[] = _("{B_PLAYER_NAME} is out of\nusable POKéMON!\pPlayer lost against\n{B_TRAINER1_CLASS} {B_TRAINER1_NAME}!{PAUSE_UNTIL_PRESS}"); +static const u8 sText_PlayerPaidPrizeMoney[] = _("{B_PLAYER_NAME} paid ¥{B_BUFF1} as the prize\nmoney…\p… … … …\p{B_PLAYER_NAME} whited out!{PAUSE_UNTIL_PRESS}"); static const u8 sText_PlayerWhiteout[] = _("{B_PLAYER_NAME} is out of\nusable POKéMON!\p"); +#if B_WHITEOUT_MONEY >= GEN_4 +static const u8 sText_PlayerWhiteout2[] = _("{B_PLAYER_NAME} panicked and lost ¥{B_BUFF1}…\p… … … …\p{B_PLAYER_NAME} whited out!{PAUSE_UNTIL_PRESS}"); +#else static const u8 sText_PlayerWhiteout2[] = _("{B_PLAYER_NAME} whited out!{PAUSE_UNTIL_PRESS}"); +#endif static const u8 sText_PreventsEscape[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} prevents\nescape with {B_SCR_ACTIVE_ABILITY}!\p"); static const u8 sText_CantEscape2[] = _("Can't escape!\p"); static const u8 sText_AttackerCantEscape[] = _("{B_ATK_NAME_WITH_PREFIX} can't escape!"); @@ -827,6 +833,8 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_ATTACKERFAINTED - 12] = sText_AttackerFainted, [STRINGID_TARGETFAINTED - 12] = sText_TargetFainted, [STRINGID_PLAYERGOTMONEY - 12] = sText_PlayerGotMoney, + [STRINGID_PLAYERLOSTTOENEMYTRAINER - 12] = sText_PlayerLostToEnemyTrainer, + [STRINGID_PLAYERPAIDPRIZEMONEY - 12] = sText_PlayerPaidPrizeMoney, [STRINGID_PLAYERWHITEOUT - 12] = sText_PlayerWhiteout, [STRINGID_PLAYERWHITEOUT2 - 12] = sText_PlayerWhiteout2, [STRINGID_PREVENTSESCAPE - 12] = sText_PreventsEscape, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b46331be1..d888cdfe1 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -284,6 +284,13 @@ static const u16 sTrappingMoves[] = MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_MAGMA_STORM, MOVE_INFESTATION, 0xFFFF }; +static const u16 sBadgeFlags[8] = { + FLAG_BADGE01_GET, FLAG_BADGE02_GET, FLAG_BADGE03_GET, FLAG_BADGE04_GET, + FLAG_BADGE05_GET, FLAG_BADGE06_GET, FLAG_BADGE07_GET, FLAG_BADGE08_GET, +}; + +static const u16 sWhiteOutBadgeMoney[9] = { 8, 16, 24, 36, 48, 64, 80, 100, 120 }; + #define STAT_CHANGE_WORKED 0 #define STAT_CHANGE_DIDNT_WORK 1 @@ -6648,13 +6655,38 @@ static u32 GetTrainerMoneyToGive(u16 trainerId) static void Cmd_getmoneyreward(void) { - u32 moneyReward = GetTrainerMoneyToGive(gTrainerBattleOpponent_A); - if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) - moneyReward += GetTrainerMoneyToGive(gTrainerBattleOpponent_B); + u32 money; + u8 sPartyLevel = 1; - AddMoney(&gSaveBlock1Ptr->money, moneyReward); - PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, 5, moneyReward); + if (gBattleOutcome == B_OUTCOME_WON) + { + money = GetTrainerMoneyToGive(gTrainerBattleOpponent_A); + if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + money += GetTrainerMoneyToGive(gTrainerBattleOpponent_B); + AddMoney(&gSaveBlock1Ptr->money, money); + } + else + { + s32 i, count; + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_NONE + && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) > sPartyLevel) + sPartyLevel = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL); + } + } + for (count = 0, i = 0; i < ARRAY_COUNT(sBadgeFlags); i++) + { + if (FlagGet(sBadgeFlags[i]) == TRUE) + ++count; + } + money = sWhiteOutBadgeMoney[count] * sPartyLevel; + RemoveMoney(&gSaveBlock1Ptr->money, money); + } + PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, 5, money); gBattlescriptCurrInstr++; } diff --git a/src/overworld.c b/src/overworld.c index ee4c660bd..114674886 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -361,7 +361,9 @@ static void (*const gMovementStatusHandler[])(struct LinkPlayerObjectEvent *, st void DoWhiteOut(void) { ScriptContext2_RunNewScript(EventScript_WhiteOut); + #if B_WHITEOUT_MONEY == GEN_3 SetMoney(&gSaveBlock1Ptr->money, GetMoney(&gSaveBlock1Ptr->money) / 2); + #endif HealPlayerParty(); Overworld_ResetStateAfterWhiteOut(); SetWarpDestinationToLastHealLocation(); From 65186b8c3aaf22436775e0c5792d6bc800c31153 Mon Sep 17 00:00:00 2001 From: ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> Date: Thu, 16 Dec 2021 21:57:30 -0600 Subject: [PATCH 053/208] Fix some style issues --- data/battle_anim_scripts.s | 38 +++++++++++++------------- src/battle_controller_player.c | 2 +- src/battle_controller_player_partner.c | 2 +- src/battle_script_commands.c | 4 +-- src/battle_util.c | 8 +++--- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 5e126c25b..45a36c0fc 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -24738,7 +24738,7 @@ RainbowEndureEffect: delay 0x3 launchtemplate gYellowEndureEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 delay 0x3 - return + return General_GulpMissile: @ Tackle anim (placeholder) loadspritegfx ANIM_TAG_IMPACT @@ -25162,10 +25162,10 @@ FinishSupersonicSkystrike: launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0x10 0xffda 0xfff6 0x18 @ 16, -16, -10, 24 launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xe 0xffec 0xffee 0x18 @ 14, -52, -18, 24 launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xc 0xffdc 0xfff0 0x18 @ 12, -32, -16, 24 - launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0xc 0xffd0 0xfff0 0x18 @ 12, -24, -16, 24 - launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0x10 0xfff0 0xfff6 0x18 @ 16, -38, -10, 24 - launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xe 0xffcc 0xffee 0x18 @ 14, -20, -18, 24 - launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xc 0xffe0 0xfff0 0x18 @ 12, -36, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0xc 0xffd0 0xfff0 0x18 @ 12, -24, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0x10 0xfff0 0xfff6 0x18 @ 16, -38, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xe 0xffcc 0xffee 0x18 @ 14, -20, -18, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xc 0xffe0 0xfff0 0x18 @ 12, -36, -16, 24 delay 0x30 clearmonbg ANIM_DEF_PARTNER blendoff @@ -25466,13 +25466,13 @@ FinishContinentalCrush: playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0x15 0x0 0x4 launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0xc 0xffe8 0xfff0 0x18 @ 12, -48, -16, 24 - launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0x10 0xffda 0xfff6 0x18 @ 16, -16, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0x10 0xffda 0xfff6 0x18 @ 16, -16, -10, 24 launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xe 0xffec 0xffee 0x18 @ 14, -52, -18, 24 launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xc 0xffdc 0xfff0 0x18 @ 12, -32, -16, 24 - launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0xc 0xffd0 0xfff0 0x18 @ 12, -24, -16, 24 - launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0x10 0xfff0 0xfff6 0x18 @ 16, -38, -10, 24 - launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xe 0xffcc 0xffee 0x18 @ 14, -20, -18, 24 - launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xc 0xffe0 0xfff0 0x18 @ 12, -36, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0xc 0xffd0 0xfff0 0x18 @ 12, -24, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0x10 0xfff0 0xfff6 0x18 @ 16, -38, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xe 0xffcc 0xffee 0x18 @ 14, -20, -18, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xc 0xffe0 0xfff0 0x18 @ 12, -36, -16, 24 delay 0x5 launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x7 0x0 0x0000 @undo pal change on tgt delay 0x10 @@ -25499,25 +25499,25 @@ ContinentalCrashBuffEffect: launchtemplate gContinentalCrushFocusEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 return ContinentalCrushStockpileRocks: - launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x0 0xffc0 0x20 @ 0,-32 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x0 0xffc0 0x20 @ 0,-32 delay 0x2 - launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x2c 0xffd4 0x20 @ +44,-44 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x2c 0xffd4 0x20 @ +44,-44 delay 0x2 - launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x3c 0x0 0x20 @ +60,0 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x3c 0x0 0x20 @ +60,0 delay 0x2 - launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x28 0x28 0x20 @ +40,+40 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x28 0x28 0x20 @ +40,+40 delay 0x2 - launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x0 0x38 0x20 @ +0,+56 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x0 0x38 0x20 @ +0,+56 delay 0x2 - launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0xffda 0x26 0x20 @ -38,+38 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0xffda 0x26 0x20 @ -38,+38 delay 0x2 - launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0xffca 0x0 0x20 @ -54, +0 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0xffca 0x0 0x20 @ -54, +0 delay 0x2 launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0xffdc 0xffdc 0x20 @ -36, -36 delay 0x2 - launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x0 0xffce 0x20 @ 0, -50 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x0 0xffce 0x20 @ 0, -50 delay 0x2 - launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x22 0xffde 0x20 @ +34, -34 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x22 0xffde 0x20 @ +34, -34 delay 0x2 launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x2e 0x0 0x20 @ +46, +0 delay 0x2 diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 1237090c7..63a6c5b53 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -591,7 +591,7 @@ static void HandleInputChooseMove(void) u16 moveTarget; u32 canSelectTarget = 0; struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]); - + if (gMain.heldKeys & DPAD_ANY && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A) gPlayerDpadHoldFrames++; else diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 03cf9bd76..19e0c70ee 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1525,7 +1525,7 @@ static void PlayerPartnerHandleChooseMove(void) BattleAI_SetupAIData(0xF); chosenMoveId = BattleAI_ChooseMoveOrAction(); - + if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED)) gBattlerTarget = gActiveBattler; if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 868764f9a..f00d27a98 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1813,7 +1813,7 @@ static void Cmd_ppreduce(void) if (gBattleControllerExecFlags) return; - + if (!gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure) { switch (gBattleMoves[gCurrentMove].target) @@ -7366,7 +7366,7 @@ static void HandleTerrainMove(u16 move) { u32 statusFlag = 0; u8 *timer = NULL; - + switch (gBattleMoves[move].effect) { case EFFECT_MISTY_TERRAIN: diff --git a/src/battle_util.c b/src/battle_util.c index 5c14e3ecd..6bcc8805f 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1813,7 +1813,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check) s32 i; gPotentialItemEffectBattler = battlerId; - + for (i = 0; i < MAX_MON_MOVES; i++) { // No move @@ -2436,7 +2436,7 @@ u8 DoFieldEndTurnEffects(void) break; } } while (effect == 0); - + return (gBattleMainFunc != BattleTurnPassed); } @@ -9172,7 +9172,7 @@ bool32 CanMegaEvolve(u8 battlerId) if (mega->alreadyEvolved[battlerPosition]) return FALSE; if (gBattleStruct->zmove.toBeUsed[battlerId]) - return FALSE; //cannot use z move and mega evolve on same turn + return FALSE; // cannot use z move and mega evolve on same turn if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { @@ -9470,7 +9470,7 @@ static bool32 IsUnnerveAbilityOnOpposingSide(u8 battlerId) return FALSE; } -//photon geyser & light that burns the sky +// photon geyser & light that burns the sky u8 GetSplitBasedOnStats(u8 battlerId) { u32 attack = gBattleMons[battlerId].attack; From 035b2332af37c2357534b8d9c35aa492ddbc4203 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 13 Jan 2022 11:28:27 -0500 Subject: [PATCH 054/208] cache ai damage, effectiveness calcs --- include/battle.h | 36 +- include/battle_ai_main.h | 1 + include/battle_ai_util.h | 8 +- include/battle_script_commands.h | 2 +- include/battle_util.h | 1 + src/battle_ai_main.c | 1061 +++++++++++++++--------------- src/battle_ai_util.c | 290 ++++---- src/battle_debug.c | 7 +- src/battle_main.c | 3 + src/battle_script_commands.c | 17 +- src/battle_util.c | 21 +- src/battle_util2.c | 2 + 12 files changed, 690 insertions(+), 759 deletions(-) diff --git a/include/battle.h b/include/battle.h index feb22eaa5..e1981f0a6 100644 --- a/include/battle.h +++ b/include/battle.h @@ -243,33 +243,20 @@ struct AI_SavedBattleMon struct AiLogicData { - //attacker data - u16 atkAbility; - u16 atkItem; - u16 atkHoldEffect; - u8 atkParam; - u16 atkSpecies; - // target data - u16 defAbility; - u16 defItem; - u16 defHoldEffect; - u8 defParam; - u16 defSpecies; - // attacker partner data - u8 battlerAtkPartner; + u16 abilities[MAX_BATTLERS_COUNT]; + u16 items[MAX_BATTLERS_COUNT]; + u16 holdEffects[MAX_BATTLERS_COUNT]; + u8 holdEffectParams[MAX_BATTLERS_COUNT]; + u16 predictedMoves[MAX_BATTLERS_COUNT]; + u8 hpPercents[MAX_BATTLERS_COUNT]; u16 partnerMove; - u16 atkPartnerAbility; - u16 atkPartnerHoldEffect; - bool32 targetSameSide; - // target partner data - u8 battlerDefPartner; - u16 defPartnerAbility; - u16 defPartnerHoldEffect; + s32 simulatedDmg[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // attacker, target, moveIndex + u8 effectiveness[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // attacker, target, moveIndex + u8 moveLimitations[MAX_BATTLERS_COUNT]; }; struct AI_ThinkingStruct { - struct AiLogicData data; u8 aiState; u8 movesetIndex; u16 moveConsidered; @@ -278,7 +265,6 @@ struct AI_ThinkingStruct u32 aiFlags; u8 aiAction; u8 aiLogicId; - s32 simulatedDmg[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // attacker, target, move struct AI_SavedBattleMon saved[4]; bool8 switchMon; // Because all available moves have no/little effect. }; @@ -321,13 +307,14 @@ struct BattleResources struct BattleCallbacksStack* battleCallbackStack; struct StatsArray* beforeLvlUp; struct AI_ThinkingStruct *ai; + struct AiLogicData *aiData; struct BattleHistory *battleHistory; u8 bufferA[MAX_BATTLERS_COUNT][0x200]; u8 bufferB[MAX_BATTLERS_COUNT][0x200]; }; #define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(gBattleResources->ai)) -#define AI_DATA ((struct AiLogicData *)(&gBattleResources->ai->data)) +#define AI_DATA ((struct AiLogicData *)(gBattleResources->aiData)) #define BATTLE_HISTORY ((struct BattleHistory *)(gBattleResources->battleHistory)) struct BattleResults @@ -593,7 +580,6 @@ struct BattleStruct bool8 spriteIgnore0Hp; struct Illusion illusion[MAX_BATTLERS_COUNT]; s8 aiFinalScore[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // AI, target, moves to make debugging easier - s32 aiSimulatedDamage[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // attacker, target, move to make debugging easier u8 soulheartBattlerId; u8 friskedBattler; // Frisk needs to identify 2 battlers in double battles. bool8 friskedAbility; // If identifies two mons, show the ability pop-up only once. diff --git a/include/battle_ai_main.h b/include/battle_ai_main.h index 66c614f78..185281749 100644 --- a/include/battle_ai_main.h +++ b/include/battle_ai_main.h @@ -24,6 +24,7 @@ void BattleAI_SetupItems(void); void BattleAI_SetupFlags(void); void BattleAI_SetupAIData(u8 defaultScoreMoves); u8 BattleAI_ChooseMoveOrAction(void); +void GetAiLogicData(void); extern u8 sBattler_AI; diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index 5ccf68c58..42374c1af 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -33,7 +33,7 @@ bool32 CanMoveFaintBattler(u16 move, u8 battlerDef, u8 battlerAtk, u8 nHits); bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgMod); s32 AI_GetAbility(u32 battlerId); u16 AI_GetHoldEffect(u32 battlerId); -u32 AI_GetMoveAccuracy(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u8 atkHoldEffect, u8 defHoldEffect, u16 move); +u32 AI_GetMoveAccuracy(u8 battlerAtk, u8 battlerDef, u16 move); bool32 DoesBattlerIgnoreAbilityChecks(u16 atkAbility, u16 move); bool32 AI_WeatherHasEffect(void); bool32 CanAIFaintTarget(u8 battlerAtk, u8 battlerDef, u8 numHits); @@ -45,7 +45,7 @@ bool32 HasDamagingMoveOfType(u8 battlerId, u8 type); u32 GetBattlerSecondaryDamage(u8 battlerId); bool32 BattlerWillFaintFromWeather(u8 battler, u16 ability); bool32 BattlerWillFaintFromSecondaryDamage(u8 battler, u16 ability); -bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u32 accuracy, u16 move); +bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u16 move); bool32 ShouldUseRecoilMove(u8 battlerAtk, u8 battlerDef, u32 recoilDmg, u8 moveIndex); u16 GetBattlerSideSpeedAverage(u8 battler); bool32 ShouldAbsorb(u8 battlerAtk, u8 battlerDef, u16 move, s32 damage); @@ -80,7 +80,7 @@ bool32 ShouldLowerEvasion(u8 battlerAtk, u8 battlerDef, u16 defAbility); // move checks bool32 IsAffectedByPowder(u8 battler, u16 ability, u16 holdEffect); bool32 MovesWithSplitUnusable(u32 attacker, u32 target, u32 split); -s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef); +s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *effectiveness); u8 GetMoveDamageResult(u16 move); u32 GetCurrDamageHpPercent(u8 battlerAtk, u8 battlerDef); u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); @@ -143,7 +143,7 @@ bool32 ShouldTrap(u8 battlerAtk, u8 battlerDef, u16 move); bool32 IsWakeupTurn(u8 battler); // partner logic -u16 GetAllyChosenMove(void); +u16 GetAllyChosenMove(u8 battlerId); bool32 IsValidDoubleBattle(u8 battlerAtk); bool32 IsTargetingPartner(u8 battlerAtk, u8 battlerDef); bool32 DoesPartnerHaveSameMoveEffect(u8 battlerAtkPartner, u8 battlerDef, u16 move, u16 partnerMove); diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index dfa81e767..f5215fdc8 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -16,7 +16,7 @@ struct StatFractions s32 CalcCritChanceStage(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbility); s8 GetInverseCritChance(u8 battlerAtk, u8 battlerDef, u32 move); -u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move); +u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u32 defAbility, u32 atkHoldEffect, u32 defHoldEffect); u8 GetBattlerTurnOrderNum(u8 battlerId); bool32 NoAliveMonsForEitherParty(void); void SetMoveEffect(bool32 primary, u32 certain); diff --git a/include/battle_util.h b/include/battle_util.h index 1c5216c73..53d899c9d 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -129,6 +129,7 @@ bool32 IsBattlerAlive(u8 battlerId); u8 GetBattleMonMoveSlot(struct BattlePokemon *battleMon, u16 move); u32 GetBattlerWeight(u8 battlerId); s32 CalculateMoveDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 fixedBasePower, bool32 isCrit, bool32 randomFactor, bool32 updateFlags); +s32 CalculateMoveDamageAndEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, u16 *typeEffectivenessModifier); u16 CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 battlerDef, bool32 recordAbilities); u16 CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 abilityDef); u16 GetTypeModifier(u8 atkType, u8 defType); diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index d5815ad70..7ee638ddb 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -194,7 +194,7 @@ void BattleAI_SetupAIData(u8 defaultScoreMoves) defaultScoreMoves >>= 1; } - moveLimitations = CheckMoveLimitations(gActiveBattler, 0, MOVE_LIMITATIONS_ALL); + moveLimitations = AI_DATA->moveLimitations[gActiveBattler]; // Ignore moves that aren't possible to use. for (i = 0; i < MAX_MON_MOVES; i++) @@ -204,26 +204,6 @@ void BattleAI_SetupAIData(u8 defaultScoreMoves) } sBattler_AI = gActiveBattler; - // Simulate dmg for all AI moves against all other targets - for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) - { - if (sBattler_AI == gBattlerTarget) - continue; - for (i = 0; i < MAX_MON_MOVES; i++) - { - dmg = 0; - move = gBattleMons[sBattler_AI].moves[i]; - if (gBattleMoves[move].power != 0 && !(moveLimitations & gBitTable[i])) - { - dmg = AI_CalcDamage(move, sBattler_AI, gBattlerTarget); - if (dmg == 0) - dmg = 1; - } - - AI_THINKING_STRUCT->simulatedDmg[sBattler_AI][gBattlerTarget][i] = dmg; - } - } - gBattlerTarget = SetRandomTarget(sBattler_AI); } @@ -245,29 +225,56 @@ u8 BattleAI_ChooseMoveOrAction(void) return ret; } -static void GetAiLogicData(u8 battlerAtk, u8 battlerDef) +void GetAiLogicData(void) { - // attacker data - AI_DATA->atkAbility = AI_GetAbility(battlerAtk); - AI_DATA->atkItem = gBattleMons[battlerAtk].item; - AI_DATA->atkHoldEffect = AI_GetHoldEffect(battlerAtk); - AI_DATA->atkParam = GetBattlerHoldEffectParam(battlerAtk); - AI_DATA->atkSpecies = gBattleMons[battlerAtk].species; - // target data - AI_DATA->defAbility = AI_GetAbility(battlerDef); - AI_DATA->defItem = (AI_GetHoldEffect(battlerDef) == HOLD_EFFECT_NONE) ? ITEM_NONE : gBattleMons[battlerDef].item; - AI_DATA->defHoldEffect = AI_GetHoldEffect(battlerDef); - AI_DATA->defParam = GetBattlerHoldEffectParam(battlerDef); - AI_DATA->defSpecies = gBattleMons[battlerDef].species; - // attacker partner data - AI_DATA->battlerAtkPartner = BATTLE_PARTNER(battlerAtk); - AI_DATA->partnerMove = GetAllyChosenMove(); - AI_DATA->atkPartnerAbility = AI_GetAbility(AI_DATA->battlerAtkPartner); - AI_DATA->atkPartnerHoldEffect = AI_GetHoldEffect(AI_DATA->battlerAtkPartner); - // target partner data - AI_DATA->battlerDefPartner = BATTLE_PARTNER(battlerDef); - AI_DATA->defPartnerAbility = AI_GetAbility(AI_DATA->battlerDefPartner); - AI_DATA->defPartnerHoldEffect = AI_GetHoldEffect(AI_DATA->battlerDefPartner); + u32 battlerAtk, battlerDef, i, move; + u8 effectiveness; + s32 dmg; + + if (!(gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER) + && !IsWildMonSmart())) + return; + + memset(AI_DATA, 0, sizeof(struct AiLogicData)); + for (battlerAtk = 0; battlerAtk < MAX_BATTLERS_COUNT; battlerAtk++) + { + if (IsBattlerAlive(battlerAtk)) { + AI_DATA->abilities[battlerAtk] = AI_GetAbility(battlerAtk); + AI_DATA->items[battlerAtk] = gBattleMons[battlerAtk].item; + AI_DATA->holdEffects[battlerAtk] = AI_GetHoldEffect(battlerAtk); + AI_DATA->holdEffectParams[battlerAtk] = GetBattlerHoldEffectParam(battlerAtk); + AI_DATA->predictedMoves[battlerAtk] = gLastMoves[battlerAtk]; + AI_DATA->hpPercents[battlerAtk] = GetHealthPercentage(battlerAtk); + AI_DATA->moveLimitations[battlerAtk] = CheckMoveLimitations(battlerAtk, 0, MOVE_LIMITATIONS_ALL); + + // Simulate dmg for all AI moves against all other targets + for (battlerDef = 0; battlerDef < gBattlersCount; battlerDef++) + { + if (battlerAtk == battlerDef) + continue; + + RecordKnownMove(battlerDef, gLastMoves[battlerDef]); + for (i = 0; i < MAX_MON_MOVES; i++) + { + dmg = 0; + effectiveness = AI_EFFECTIVENESS_x0; + move = gBattleMons[battlerAtk].moves[i]; + if (move != 0 + && move != 0xFFFF + && gBattleMoves[move].power != 0 + && !(AI_DATA->moveLimitations[battlerAtk] & gBitTable[i])) + { + dmg = AI_CalcDamage(move, battlerAtk, battlerDef, &effectiveness); + if (dmg == 0) + dmg = 1; + } + + AI_DATA->simulatedDmg[battlerAtk][battlerDef][i] = dmg; + AI_DATA->effectiveness[battlerAtk][battlerDef][i] = effectiveness; + } + } + } + } } static u8 ChooseMoveOrAction_Singles(void) @@ -278,9 +285,7 @@ static u8 ChooseMoveOrAction_Singles(void) s32 i, id; u32 flags = AI_THINKING_STRUCT->aiFlags; - RecordLastUsedMoveByTarget(); - GetAiLogicData(sBattler_AI, gBattlerTarget); - + AI_DATA->partnerMove = 0; // no ally while (flags != 0) { if (flags & 1) @@ -295,7 +300,6 @@ static u8 ChooseMoveOrAction_Singles(void) for (i = 0; i < MAX_MON_MOVES; i++) { gBattleStruct->aiFinalScore[sBattler_AI][gBattlerTarget][i] = AI_THINKING_STRUCT->score[i]; - gBattleStruct->aiSimulatedDamage[sBattler_AI][gBattlerTarget][i] = AI_THINKING_STRUCT->simulatedDmg[sBattler_AI][gBattlerTarget][i]; } // Check special AI actions. @@ -400,11 +404,10 @@ static u8 ChooseMoveOrAction_Doubles(void) BattleAI_SetupAIData(0xF); gBattlerTarget = i; - GetAiLogicData(sBattler_AI, gBattlerTarget); - if ((i & BIT_SIDE) != (sBattler_AI & BIT_SIDE)) RecordLastUsedMoveByTarget(); + AI_DATA->partnerMove = GetAllyChosenMove(i); AI_THINKING_STRUCT->aiLogicId = 0; AI_THINKING_STRUCT->movesetIndex = 0; flags = AI_THINKING_STRUCT->aiFlags; @@ -464,7 +467,6 @@ static u8 ChooseMoveOrAction_Doubles(void) for (j = 0; j < MAX_MON_MOVES; j++) { gBattleStruct->aiFinalScore[sBattler_AI][gBattlerTarget][j] = AI_THINKING_STRUCT->score[j]; - gBattleStruct->aiSimulatedDamage[sBattler_AI][gBattlerTarget][j] = AI_THINKING_STRUCT->simulatedDmg[sBattler_AI][gBattlerTarget][j]; } } } @@ -550,11 +552,10 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) u16 moveEffect = gBattleMoves[move].effect; s32 moveType; u16 moveTarget = gBattleMoves[move].target; - u16 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect, move); - u8 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); + u8 effectiveness = AI_DATA->effectiveness[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); u32 i; - u16 predictedMove = gLastMoves[battlerDef]; // TODO better move prediction + u16 predictedMove = AI_DATA->predictedMoves[battlerDef]; SetTypeBeforeUsingMove(move, battlerAtk); GET_MOVE_TYPE(move, moveType); @@ -569,7 +570,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { // handle negative checks on non-user target // check powder moves - if (TestMoveFlags(move, FLAG_POWDER) && !IsAffectedByPowder(battlerDef, AI_DATA->defAbility, AI_DATA->defHoldEffect)) + if (TestMoveFlags(move, FLAG_POWDER) && !IsAffectedByPowder(battlerDef, AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerDef])) { RETURN_SCORE_MINUS(20); } @@ -577,9 +578,9 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // check ground immunities if (moveType == TYPE_GROUND && !IsBattlerGrounded(battlerDef) - && ((AI_DATA->defAbility == ABILITY_LEVITATE - && DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move)) - || AI_DATA->defHoldEffect == HOLD_EFFECT_AIR_BALLOON + && ((AI_DATA->abilities[battlerDef] == ABILITY_LEVITATE + && DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move)) + || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_AIR_BALLOON || (gStatuses3[battlerDef] & (STATUS3_MAGNET_RISE | STATUS3_TELEKINESIS))) && move != MOVE_THOUSAND_ARROWS) { @@ -602,9 +603,9 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } // target ability checks - if (!DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move)) + if (!DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move)) { - switch (AI_DATA->defAbility) + switch (AI_DATA->abilities[battlerDef]) { case ABILITY_MAGIC_GUARD: switch (moveEffect) @@ -719,13 +720,9 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (IsShieldsDownProtected(battlerAtk) && IsNonVolatileStatusMoveEffect(moveEffect)) RETURN_SCORE_MINUS(10); break; - case ABILITY_WONDER_SKIN: - if (IS_MOVE_STATUS(move)) - accuracy = 50; - break; case ABILITY_LEAF_GUARD: if (AI_WeatherHasEffect() && (gBattleWeather & B_WEATHER_SUN) - && AI_DATA->defHoldEffect != HOLD_EFFECT_UTILITY_UMBRELLA + && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_UTILITY_UMBRELLA && IsNonVolatileStatusMoveEffect(moveEffect)) RETURN_SCORE_MINUS(10); break; @@ -734,14 +731,14 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // target partner ability checks & not attacking partner if (isDoubleBattle) { - switch (AI_DATA->defPartnerAbility) + switch (AI_DATA->abilities[BATTLE_PARTNER(battlerDef)]) { case ABILITY_LIGHTNING_ROD: - if (moveType == TYPE_ELECTRIC && !IsMoveRedirectionPrevented(move, AI_DATA->atkAbility)) + if (moveType == TYPE_ELECTRIC && !IsMoveRedirectionPrevented(move, AI_DATA->abilities[battlerAtk])) RETURN_SCORE_MINUS(20); break; case ABILITY_STORM_DRAIN: - if (moveType == TYPE_WATER && !IsMoveRedirectionPrevented(move, AI_DATA->atkAbility)) + if (moveType == TYPE_WATER && !IsMoveRedirectionPrevented(move, AI_DATA->abilities[battlerAtk])) RETURN_SCORE_MINUS(20); break; case ABILITY_MAGIC_BOUNCE: @@ -771,7 +768,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // gen7+ dark type mons immune to priority->elevated moves from prankster #if B_PRANKSTER >= GEN_7 - if (AI_DATA->atkAbility == ABILITY_PRANKSTER && IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK) && IS_MOVE_STATUS(move) + if (AI_DATA->abilities[battlerAtk] == ABILITY_PRANKSTER && IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK) && IS_MOVE_STATUS(move) && !(moveTarget & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_USER))) RETURN_SCORE_MINUS(10); #endif @@ -840,7 +837,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) default: break; // check move damage case EFFECT_SLEEP: - if (!AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (!AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_EXPLOSION: @@ -851,7 +848,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { score -= 10; } - else if (IsAbilityOnField(ABILITY_DAMP) && !DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move)) + else if (IsAbilityOnField(ABILITY_DAMP) && !DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move)) { score -= 10; } @@ -864,7 +861,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_DREAM_EATER: - if (!(gBattleMons[battlerDef].status1 & STATUS1_SLEEP) || AI_DATA->defAbility == ABILITY_COMATOSE) + if (!(gBattleMons[battlerDef].status1 & STATUS1_SLEEP) || AI_DATA->abilities[battlerDef] == ABILITY_COMATOSE) score -= 8; else if (effectiveness == AI_EFFECTIVENESS_x0) score -= 10; @@ -872,7 +869,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // stat raising effects case EFFECT_ATTACK_UP: case EFFECT_ATTACK_UP_2: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; break; case EFFECT_STUFF_CHEEKS: @@ -883,65 +880,65 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_DEFENSE_UP_2: case EFFECT_DEFENSE_UP_3: case EFFECT_DEFENSE_CURL: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 10; break; case EFFECT_SPECIAL_ATTACK_UP: case EFFECT_SPECIAL_ATTACK_UP_2: case EFFECT_SPECIAL_ATTACK_UP_3: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) score -= 10; break; case EFFECT_SPECIAL_DEFENSE_UP: case EFFECT_SPECIAL_DEFENSE_UP_2: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 10; break; case EFFECT_ACCURACY_UP: case EFFECT_ACCURACY_UP_2: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ACC)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ACC)) score -= 10; break; case EFFECT_EVASION_UP: case EFFECT_EVASION_UP_2: case EFFECT_MINIMIZE: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_EVASION)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_EVASION)) score -= 10; break; case EFFECT_COSMIC_POWER: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 8; break; case EFFECT_BULK_UP: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 8; break; case EFFECT_CALM_MIND: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 8; break; case EFFECT_DRAGON_DANCE: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPEED)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPEED)) score -= 8; break; case EFFECT_COIL: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ACC)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ACC)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 8; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 6; break; case EFFECT_ATTACK_ACCURACY_UP: //hone claws - if (AI_DATA->atkAbility != ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] != ABILITY_CONTRARY) { if (gBattleMons[battlerAtk].statStages[STAT_ATK] >= MAX_STAT_STAGE && (gBattleMons[battlerAtk].statStages[STAT_ACC] >= MAX_STAT_STAGE || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL))) @@ -958,47 +955,47 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 20; else if (!HasMoveWithType(battlerAtk, TYPE_ELECTRIC)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 5; break; case EFFECT_QUIVER_DANCE: case EFFECT_GEOMANCY: if (gBattleMons[battlerAtk].statStages[STAT_SPATK] >= MAX_STAT_STAGE || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPEED)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPEED)) score -= 8; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 6; break; case EFFECT_SHIFT_GEAR: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPEED)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPEED)) score -= 8; break; case EFFECT_SHELL_SMASH: - if (AI_DATA->atkAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) { - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 8; } else { - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) score -= 8; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPEED)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPEED)) score -= 6; } break; case EFFECT_GROWTH: case EFFECT_ATTACK_SPATK_UP: // work up - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) score -= 8; break; case EFFECT_ROTOTILLER: @@ -1006,30 +1003,30 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { if (!(IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GRASS) && AI_IsBattlerGrounded(battlerAtk) - && (BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK))) - && !(IS_BATTLER_OF_TYPE(AI_DATA->battlerAtkPartner, TYPE_GRASS) - && AI_IsBattlerGrounded(AI_DATA->battlerAtkPartner) - && AI_DATA->atkPartnerAbility != ABILITY_CONTRARY - && (BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_ATK) - || BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_SPATK)))) + && (BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK))) + && !(IS_BATTLER_OF_TYPE(BATTLE_PARTNER(battlerAtk), TYPE_GRASS) + && AI_IsBattlerGrounded(BATTLE_PARTNER(battlerAtk)) + && AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] != ABILITY_CONTRARY + && (BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_ATK) + || BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_SPATK)))) { score -= 10; } } else if (!(IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GRASS) && AI_IsBattlerGrounded(battlerAtk) - && (BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK)))) + && (BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK)))) { score -= 10; } break; case EFFECT_GEAR_UP: - if (AI_DATA->atkAbility == ABILITY_PLUS || AI_DATA->atkAbility == ABILITY_MINUS) + if (AI_DATA->abilities[battlerAtk] == ABILITY_PLUS || AI_DATA->abilities[battlerAtk] == ABILITY_MINUS) { // same as growth, work up - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) score -= 8; break; } @@ -1040,13 +1037,13 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (isDoubleBattle) { - if (AI_DATA->atkPartnerAbility == ABILITY_PLUS || AI_DATA->atkPartnerAbility == ABILITY_MINUS) + if (AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_PLUS || AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_MINUS) { - if ((!BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) - && (!BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL))) + if ((!BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + && (!BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL))) score -= 10; } - else if (AI_DATA->atkAbility != ABILITY_PLUS && AI_DATA->atkAbility != ABILITY_MINUS) + else if (AI_DATA->abilities[battlerAtk] != ABILITY_PLUS && AI_DATA->abilities[battlerAtk] != ABILITY_MINUS) { score -= 10; // nor our or our partner's ability is plus/minus } @@ -1057,11 +1054,11 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_MAGNETIC_FLUX: - if (AI_DATA->atkAbility == ABILITY_PLUS || AI_DATA->atkAbility == ABILITY_MINUS) + if (AI_DATA->abilities[battlerAtk] == ABILITY_PLUS || AI_DATA->abilities[battlerAtk] == ABILITY_MINUS) { - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 8; } else if (!isDoubleBattle) @@ -1071,14 +1068,14 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (isDoubleBattle) { - if (AI_DATA->atkPartnerAbility == ABILITY_PLUS || AI_DATA->atkPartnerAbility == ABILITY_MINUS) + if (AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_PLUS || AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_MINUS) { - if (!BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_DEF)) + if (!BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_DEF)) score -= 10; - else if (!BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_SPDEF)) score -= 8; } - else if (AI_DATA->atkAbility != ABILITY_PLUS && AI_DATA->atkAbility != ABILITY_MINUS) + else if (AI_DATA->abilities[battlerAtk] != ABILITY_PLUS && AI_DATA->abilities[battlerAtk] != ABILITY_MINUS) { score -= 10; // nor our or our partner's ability is plus/minus } @@ -1087,49 +1084,49 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // stat lowering effects case EFFECT_ATTACK_DOWN: case EFFECT_ATTACK_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_ATK)) //|| !HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_ATK)) //|| !HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)) score -= 10; - else if (AI_DATA->defAbility == ABILITY_HYPER_CUTTER) + else if (AI_DATA->abilities[battlerDef] == ABILITY_HYPER_CUTTER) score -= 10; break; case EFFECT_DEFENSE_DOWN: case EFFECT_DEFENSE_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_DEF)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_DEF)) score -= 10; break; case EFFECT_SPEED_DOWN: case EFFECT_SPEED_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPEED)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPEED)) score -= 10; - else if (AI_DATA->defAbility == ABILITY_SPEED_BOOST) + else if (AI_DATA->abilities[battlerDef] == ABILITY_SPEED_BOOST) score -= 10; break; case EFFECT_SPECIAL_ATTACK_DOWN: case EFFECT_SPECIAL_ATTACK_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPATK)) //|| !HasMoveWithSplit(battlerDef, SPLIT_SPECIAL)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPATK)) //|| !HasMoveWithSplit(battlerDef, SPLIT_SPECIAL)) score -= 10; break; case EFFECT_SPECIAL_DEFENSE_DOWN: case EFFECT_SPECIAL_DEFENSE_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPDEF)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPDEF)) score -= 10; break; case EFFECT_ACCURACY_DOWN: case EFFECT_ACCURACY_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_ACC)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_ACC)) score -= 10; - else if (AI_DATA->defAbility == ABILITY_KEEN_EYE) + else if (AI_DATA->abilities[battlerDef] == ABILITY_KEEN_EYE) score -= 8; break; case EFFECT_EVASION_DOWN: case EFFECT_EVASION_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_EVASION)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_EVASION)) score -= 10; break; case EFFECT_TICKLE: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_ATK)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_ATK)) score -= 10; - else if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_DEF)) + else if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_DEF)) score -= 8; break; case EFFECT_VENOM_DRENCH: @@ -1139,18 +1136,18 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else { - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPEED)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPEED)) score -= 10; - else if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPATK)) + else if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPATK)) score -= 8; - else if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_ATK)) + else if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_ATK)) score -= 6; } break; case EFFECT_NOBLE_ROAR: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPATK)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPATK)) score -= 10; - else if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_ATK)) + else if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_ATK)) score -= 8; break; case EFFECT_CAPTIVATE: @@ -1163,7 +1160,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; // other case EFFECT_HAZE: - if (PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) { score -= 10; // partner already using haze } @@ -1171,12 +1168,12 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) { - if (gBattleMons[battlerAtk].statStages[i] > DEFAULT_STAT_STAGE || gBattleMons[AI_DATA->battlerAtkPartner].statStages[i] > DEFAULT_STAT_STAGE) + if (gBattleMons[battlerAtk].statStages[i] > DEFAULT_STAT_STAGE || gBattleMons[BATTLE_PARTNER(battlerAtk)].statStages[i] > DEFAULT_STAT_STAGE) score -= 10; // Don't want to reset our boosted stats } for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) { - if (gBattleMons[battlerDef].statStages[i] < DEFAULT_STAT_STAGE || gBattleMons[AI_DATA->battlerDefPartner].statStages[i] < DEFAULT_STAT_STAGE) + if (gBattleMons[battlerDef].statStages[i] < DEFAULT_STAT_STAGE || gBattleMons[BATTLE_PARTNER(battlerDef)].statStages[i] < DEFAULT_STAT_STAGE) score -= 10; //Don't want to reset enemy lowered stats } } @@ -1199,46 +1196,46 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) //case EFFECT_ENDEAVOR: case EFFECT_LOW_KICK: // AI_CBM_HighRiskForDamage - if (AI_DATA->defAbility == ABILITY_WONDER_GUARD && effectiveness < AI_EFFECTIVENESS_x2) + if (AI_DATA->abilities[battlerDef] == ABILITY_WONDER_GUARD && effectiveness < AI_EFFECTIVENESS_x2) score -= 10; break; case EFFECT_COUNTER: case EFFECT_MIRROR_COAT: - if (IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility) || gBattleMons[battlerDef].status2 & (STATUS2_INFATUATION | STATUS2_CONFUSION)) + if (IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]) || gBattleMons[battlerDef].status2 & (STATUS2_INFATUATION | STATUS2_CONFUSION)) score--; if (predictedMove == MOVE_NONE || GetBattleMoveSplit(predictedMove) == SPLIT_STATUS - || DoesSubstituteBlockMove(battlerAtk, AI_DATA->battlerDefPartner, predictedMove)) + || DoesSubstituteBlockMove(battlerAtk, BATTLE_PARTNER(battlerDef), predictedMove)) score -= 10; break; case EFFECT_ROAR: if (CountUsablePartyMons(battlerDef) == 0) score -= 10; - else if (AI_DATA->defAbility == ABILITY_SUCTION_CUPS) + else if (AI_DATA->abilities[battlerDef] == ABILITY_SUCTION_CUPS) score -= 10; break; case EFFECT_TOXIC_THREAD: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPEED)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPEED)) score--; // may still want to just poison //fallthrough case EFFECT_POISON: case EFFECT_TOXIC: - if (!AI_CanPoison(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (!AI_CanPoison(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_LIGHT_SCREEN: if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_LIGHTSCREEN - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_REFLECT: if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_REFLECT - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_AURORA_VEIL: if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_AURORA_VEIL - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) || !(gBattleWeather & B_WEATHER_HAIL)) score -= 10; break; @@ -1247,12 +1244,12 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) && move == MOVE_SHEER_COLD && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE)) return 0; - if (!ShouldTryOHKO(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, accuracy, move)) + if (!ShouldTryOHKO(battlerAtk, battlerDef, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], move)) score -= 10; break; case EFFECT_MIST: if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_MIST - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_FOCUS_ENERGY: @@ -1262,17 +1259,17 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_CONFUSE: case EFFECT_SWAGGER: case EFFECT_FLATTER: - if (!AI_CanConfuse(battlerAtk, battlerDef, AI_DATA->defAbility, AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (!AI_CanConfuse(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_PARALYZE: - if (!AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (!AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_SUBSTITUTE: - if (gBattleMons[battlerAtk].status2 & STATUS2_SUBSTITUTE || AI_DATA->defAbility == ABILITY_INFILTRATOR) + if (gBattleMons[battlerAtk].status2 & STATUS2_SUBSTITUTE || AI_DATA->abilities[battlerDef] == ABILITY_INFILTRATOR) score -= 8; - else if (GetHealthPercentage(battlerAtk) <= 25) + else if (AI_DATA->hpPercents[battlerAtk] <= 25) score -= 10; else if (B_SOUND_SUBSTITUTE >= GEN_6 && TestMoveFlagsInMoveset(battlerDef, FLAG_SOUND)) score -= 8; @@ -1280,15 +1277,15 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_LEECH_SEED: if (gStatuses3[battlerDef] & STATUS3_LEECHSEED || IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; - else if (AI_DATA->defAbility == ABILITY_LIQUID_OOZE) + else if (AI_DATA->abilities[battlerDef] == ABILITY_LIQUID_OOZE) score -= 3; break; case EFFECT_DISABLE: if (gDisableStructs[battlerDef].disableTimer == 0 - && (B_MENTAL_HERB >= GEN_5 && AI_DATA->defHoldEffect != HOLD_EFFECT_MENTAL_HERB) - && !PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + && (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB) + && !PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) { if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker should go first { @@ -1307,8 +1304,8 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_ENCORE: if (gDisableStructs[battlerDef].encoreTimer == 0 - && (B_MENTAL_HERB >= GEN_5 && AI_DATA->defHoldEffect != HOLD_EFFECT_MENTAL_HERB) - && !DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + && (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB) + && !DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) { if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker should go first { @@ -1327,60 +1324,60 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_SNORE: case EFFECT_SLEEP_TALK: - if (IsWakeupTurn(battlerAtk) || (!(gBattleMons[battlerAtk].status1 & STATUS1_SLEEP) || AI_DATA->atkAbility != ABILITY_COMATOSE)) + if (IsWakeupTurn(battlerAtk) || (!(gBattleMons[battlerAtk].status1 & STATUS1_SLEEP) || AI_DATA->abilities[battlerAtk] != ABILITY_COMATOSE)) score -= 10; // if mon will wake up, is not asleep, or is not comatose break; case EFFECT_MEAN_LOOK: - if (IsBattlerTrapped(battlerDef, TRUE) || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (IsBattlerTrapped(battlerDef, TRUE) || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_NIGHTMARE: if (gBattleMons[battlerDef].status2 & STATUS2_NIGHTMARE) score -= 10; - else if (!(gBattleMons[battlerDef].status1 & STATUS1_SLEEP) || AI_DATA->defAbility == ABILITY_COMATOSE) + else if (!(gBattleMons[battlerDef].status1 & STATUS1_SLEEP) || AI_DATA->abilities[battlerDef] == ABILITY_COMATOSE) score -= 8; - else if (DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + else if (DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_CURSE: if (IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GHOST)) { if (gBattleMons[battlerDef].status2 & STATUS2_CURSED - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; - else if (GetHealthPercentage(battlerAtk) <= 50) + else if (AI_DATA->hpPercents[battlerAtk] <= 50) score -= 6; } else // regular curse { - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 8; } break; case EFFECT_SPIKES: if (gSideTimers[GetBattlerSide(battlerDef)].spikesAmount >= 3) score -= 10; - else if (PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove) + else if (PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].spikesAmount == 2) score -= 10; // only one mon needs to set up the last layer of Spikes break; case EFFECT_STEALTH_ROCK: if (gSideTimers[GetBattlerSide(battlerDef)].stealthRockAmount > 0 - || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) //Only one mon needs to set up Stealth Rocks + || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) //Only one mon needs to set up Stealth Rocks score -= 10; break; case EFFECT_TOXIC_SPIKES: if (gSideTimers[GetBattlerSide(battlerDef)].toxicSpikesAmount >= 2) score -= 10; - else if (PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].toxicSpikesAmount == 1) + else if (PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].toxicSpikesAmount == 1) score -= 10; // only one mon needs to set up the last layer of Toxic Spikes break; case EFFECT_STICKY_WEB: if (gSideTimers[GetBattlerSide(battlerDef)].stickyWebAmount) score -= 10; - else if (PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].stickyWebAmount) + else if (PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].stickyWebAmount) score -= 10; // only one mon needs to set up Sticky Web break; case EFFECT_FORESIGHT: @@ -1388,74 +1385,74 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; else if (gBattleMons[battlerDef].statStages[STAT_EVASION] <= 4 || !(IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)) - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 9; break; case EFFECT_PERISH_SONG: if (isDoubleBattle) { if (CountUsablePartyMons(battlerAtk) == 0 - && AI_DATA->atkAbility != ABILITY_SOUNDPROOF - && AI_DATA->atkPartnerAbility != ABILITY_SOUNDPROOF + && AI_DATA->abilities[battlerAtk] != ABILITY_SOUNDPROOF + && AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] != ABILITY_SOUNDPROOF && CountUsablePartyMons(FOE(battlerAtk)) >= 1) { score -= 10; //Don't wipe your team if you're going to lose } - else if ((!IsBattlerAlive(FOE(battlerAtk)) || AI_GetAbility(FOE(battlerAtk)) == ABILITY_SOUNDPROOF + else if ((!IsBattlerAlive(FOE(battlerAtk)) || AI_DATA->abilities[FOE(battlerAtk)] == ABILITY_SOUNDPROOF || gStatuses3[FOE(battlerAtk)] & STATUS3_PERISH_SONG) - && (!IsBattlerAlive(BATTLE_PARTNER(FOE(battlerAtk))) || AI_GetAbility(BATTLE_PARTNER(FOE(battlerAtk))) == ABILITY_SOUNDPROOF + && (!IsBattlerAlive(BATTLE_PARTNER(FOE(battlerAtk))) || AI_DATA->abilities[BATTLE_PARTNER(FOE(battlerAtk))] == ABILITY_SOUNDPROOF || gStatuses3[BATTLE_PARTNER(FOE(battlerAtk))] & STATUS3_PERISH_SONG)) { score -= 10; //Both enemies are perish songed } - else if (DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + else if (DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) { score -= 10; } } else { - if (CountUsablePartyMons(battlerAtk) == 0 && AI_DATA->atkAbility != ABILITY_SOUNDPROOF + if (CountUsablePartyMons(battlerAtk) == 0 && AI_DATA->abilities[battlerAtk] != ABILITY_SOUNDPROOF && CountUsablePartyMons(battlerDef) >= 1) score -= 10; - if (gStatuses3[FOE(battlerAtk)] & STATUS3_PERISH_SONG || AI_GetAbility(FOE(battlerAtk)) == ABILITY_SOUNDPROOF) + if (gStatuses3[FOE(battlerAtk)] & STATUS3_PERISH_SONG || AI_DATA->abilities[FOE(battlerAtk)] == ABILITY_SOUNDPROOF) score -= 10; } break; case EFFECT_SANDSTORM: if (gBattleWeather & (B_WEATHER_SANDSTORM | B_WEATHER_PRIMAL_ANY) - || PartnerMoveEffectIsWeather(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove)) + || PartnerMoveEffectIsWeather(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove)) score -= 8; break; case EFFECT_SUNNY_DAY: if (gBattleWeather & (B_WEATHER_SUN | B_WEATHER_PRIMAL_ANY) - || PartnerMoveEffectIsWeather(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove)) + || PartnerMoveEffectIsWeather(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove)) score -= 8; break; case EFFECT_RAIN_DANCE: if (gBattleWeather & (B_WEATHER_RAIN | B_WEATHER_PRIMAL_ANY) - || PartnerMoveEffectIsWeather(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove)) + || PartnerMoveEffectIsWeather(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove)) score -= 8; break; case EFFECT_HAIL: if (gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_PRIMAL_ANY) - || PartnerMoveEffectIsWeather(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove)) + || PartnerMoveEffectIsWeather(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove)) score -= 8; break; case EFFECT_ATTRACT: - if (!AI_CanBeInfatuated(battlerAtk, battlerDef, AI_DATA->defAbility, + if (!AI_CanBeInfatuated(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], GetGenderFromSpeciesAndPersonality(gBattleMons[battlerAtk].species, gBattleMons[battlerAtk].personality), GetGenderFromSpeciesAndPersonality(gBattleMons[battlerDef].species, gBattleMons[battlerDef].personality))) score -= 10; break; case EFFECT_SAFEGUARD: if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_SAFEGUARD - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_MAGNITUDE: - if (AI_DATA->defAbility == ABILITY_LEVITATE) + if (AI_DATA->abilities[battlerDef] == ABILITY_LEVITATE) score -= 10; break; case EFFECT_PARTING_SHOT: @@ -1482,9 +1479,9 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 6; break; case EFFECT_BELLY_DRUM: - if (AI_DATA->atkAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) score -= 10; - else if (GetHealthPercentage(battlerAtk) <= 60) + else if (AI_DATA->hpPercents[battlerAtk] <= 60) score -= 10; break; case EFFECT_FUTURE_SIGHT: @@ -1504,7 +1501,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else if (move == MOVE_FAKE_OUT) // filter out first impression { - if ((AI_DATA->atkHoldEffect == HOLD_EFFECT_CHOICE_BAND || AI_DATA->atkAbility == ABILITY_GORILLA_TACTICS) + if ((AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CHOICE_BAND || AI_DATA->abilities[battlerAtk] == ABILITY_GORILLA_TACTICS) && (CountUsablePartyMons(battlerDef) > 0 || !CanIndexMoveFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex, 0))) { if (CountUsablePartyMons(battlerAtk) == 0) @@ -1529,27 +1526,27 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { if (AtMaxHp(battlerAtk)) score -= 10; - else if (GetHealthPercentage(battlerAtk) >= 80) + else if (AI_DATA->hpPercents[battlerAtk] >= 80) score -= 5; // do it if nothing better } break; case EFFECT_TORMENT: if (gBattleMons[battlerDef].status2 & STATUS2_TORMENT - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) { score -= 10; break; } - if (B_MENTAL_HERB >= GEN_5 && AI_DATA->defHoldEffect == HOLD_EFFECT_MENTAL_HERB) + if (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_MENTAL_HERB) score -= 6; break; case EFFECT_WILL_O_WISP: - if (!AI_CanBurn(battlerAtk, battlerDef, AI_DATA->defAbility, AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (!AI_CanBurn(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_MEMENTO: - if (CountUsablePartyMons(battlerAtk) == 0 || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (CountUsablePartyMons(battlerAtk) == 0 || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; else if (gBattleMons[battlerDef].statStages[STAT_ATK] == MIN_STAT_STAGE && gBattleMons[battlerDef].statStages[STAT_SPATK] == MIN_STAT_STAGE) score -= 10; @@ -1557,15 +1554,15 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_FOLLOW_ME: case EFFECT_HELPING_HAND: if (!isDoubleBattle - || !IsBattlerAlive(AI_DATA->battlerAtkPartner) - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove) + || !IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) || (AI_DATA->partnerMove != MOVE_NONE && IS_MOVE_STATUS(AI_DATA->partnerMove)) - || *(gBattleStruct->monToSwitchIntoId + AI_DATA->battlerAtkPartner) != PARTY_SIZE) //Partner is switching out. + || *(gBattleStruct->monToSwitchIntoId + BATTLE_PARTNER(battlerAtk)) != PARTY_SIZE) //Partner is switching out. score -= 10; break; case EFFECT_TRICK: case EFFECT_KNOCK_OFF: - if (AI_DATA->defAbility == ABILITY_STICKY_HOLD) + if (AI_DATA->abilities[battlerDef] == ABILITY_STICKY_HOLD) score -= 10; break; case EFFECT_INGRAIN: @@ -1589,14 +1586,14 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_PSYCHO_SHIFT: - if (gBattleMons[battlerAtk].status1 & STATUS1_PSN_ANY && !AI_CanPoison(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (gBattleMons[battlerAtk].status1 & STATUS1_PSN_ANY && !AI_CanPoison(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; else if (gBattleMons[battlerAtk].status1 & STATUS1_BURN && !AI_CanBurn(battlerAtk, battlerDef, - AI_DATA->defAbility, AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; - else if (gBattleMons[battlerAtk].status1 & STATUS1_PARALYSIS && !AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + else if (gBattleMons[battlerAtk].status1 & STATUS1_PARALYSIS && !AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; - else if (gBattleMons[battlerAtk].status1 & STATUS1_SLEEP && !AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + else if (gBattleMons[battlerAtk].status1 & STATUS1_SLEEP && !AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; else score -= 10; // attacker has no status to transmit @@ -1604,23 +1601,23 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_MUD_SPORT: if (gFieldStatuses & STATUS_FIELD_MUDSPORT || gStatuses4[battlerAtk] & STATUS4_MUD_SPORT - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_WATER_SPORT: if (gFieldStatuses & STATUS_FIELD_WATERSPORT || gStatuses4[battlerAtk] & STATUS4_WATER_SPORT - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_ABSORB: - if (AI_DATA->defAbility == ABILITY_LIQUID_OOZE) + if (AI_DATA->abilities[battlerDef] == ABILITY_LIQUID_OOZE) score -= 6; break; case EFFECT_STRENGTH_SAP: - if (AI_DATA->defAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerDef] == ABILITY_CONTRARY) score -= 10; - else if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_ATK)) + else if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_ATK)) score -= 10; break; case EFFECT_COPYCAT: @@ -1628,23 +1625,23 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) return AI_CheckBadMove(battlerAtk, battlerDef, predictedMove, score); case EFFECT_FLOWER_SHIELD: if (!IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GRASS) - && !(isDoubleBattle && IS_BATTLER_OF_TYPE(AI_DATA->battlerAtkPartner, TYPE_GRASS))) + && !(isDoubleBattle && IS_BATTLER_OF_TYPE(BATTLE_PARTNER(battlerAtk), TYPE_GRASS))) score -= 10; break; case EFFECT_AROMATIC_MIST: - if (!isDoubleBattle || gBattleMons[AI_DATA->battlerAtkPartner].hp == 0 || !BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_SPDEF)) + if (!isDoubleBattle || gBattleMons[BATTLE_PARTNER(battlerAtk)].hp == 0 || !BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_SPDEF)) score -= 10; break; case EFFECT_BIDE: if (!HasDamagingMove(battlerDef) - || GetHealthPercentage(battlerAtk) < 30 //Close to death + || AI_DATA->hpPercents[battlerAtk] < 30 //Close to death || gBattleMons[battlerDef].status1 & (STATUS1_SLEEP | STATUS1_FREEZE)) //No point in biding if can't take damage score -= 10; break; case EFFECT_HIT_SWITCH_TARGET: - if (DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; // don't scare away pokemon twice - else if (GetHealthPercentage(battlerDef) < 10 && GetBattlerSecondaryDamage(battlerDef)) + else if (AI_DATA->hpPercents[battlerDef] < 10 && GetBattlerSecondaryDamage(battlerDef)) score -= 10; // don't blow away mon that will faint soon else if (gStatuses3[battlerDef] & STATUS3_PERISH_SONG) score -= 10; @@ -1655,7 +1652,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_REST: - if (!AI_CanSleep(battlerAtk, AI_DATA->atkAbility)) + if (!AI_CanSleep(battlerAtk, AI_DATA->abilities[battlerAtk])) score -= 10; //fallthrough case EFFECT_RESTORE_HP: @@ -1663,7 +1660,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_ROOST: if (AtMaxHp(battlerAtk)) score -= 10; - else if (GetHealthPercentage(battlerAtk) >= 90) + else if (AI_DATA->hpPercents[battlerAtk] >= 90) score -= 9; //No point in healing, but should at least do it if nothing better break; case EFFECT_MORNING_SUN: @@ -1673,31 +1670,31 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 3; else if (AtMaxHp(battlerAtk)) score -= 10; - else if (GetHealthPercentage(battlerAtk) >= 90) + else if (AI_DATA->hpPercents[battlerAtk] >= 90) score -= 9; //No point in healing, but should at least do it if nothing better break; case EFFECT_PURIFY: if (!(gBattleMons[battlerDef].status1 & STATUS1_ANY)) score -= 10; - else if (battlerDef == AI_DATA->battlerAtkPartner) + else if (battlerDef == BATTLE_PARTNER(battlerAtk)) break; //Always heal your ally else if (AtMaxHp(battlerAtk)) score -= 10; - else if (GetHealthPercentage(battlerAtk) >= 90) + else if (AI_DATA->hpPercents[battlerAtk] >= 90) score -= 8; //No point in healing, but should at least do it if nothing better break; case EFFECT_SUPER_FANG: - if (GetHealthPercentage(battlerDef) < 50) + if (AI_DATA->hpPercents[battlerDef] < 50) score -= 4; break; case EFFECT_RECOIL_IF_MISS: - if (AI_DATA->atkAbility != ABILITY_MAGIC_GUARD && accuracy < 75) + if (AI_DATA->abilities[battlerAtk] != ABILITY_MAGIC_GUARD && AI_GetMoveAccuracy(battlerAtk, battlerDef, move) < 75) score -= 6; break; case EFFECT_RECOIL_25: - if (AI_DATA->atkAbility != ABILITY_MAGIC_GUARD && AI_DATA->atkAbility != ABILITY_ROCK_HEAD) + if (AI_DATA->abilities[battlerAtk] != ABILITY_MAGIC_GUARD && AI_DATA->abilities[battlerAtk] != ABILITY_ROCK_HEAD) { - u32 recoilDmg = max(1, AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 4); + u32 recoilDmg = max(1, AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 4); if (!ShouldUseRecoilMove(battlerAtk, battlerDef, recoilDmg, AI_THINKING_STRUCT->movesetIndex)) score -= 10; break; @@ -1705,18 +1702,18 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_RECOIL_33: case EFFECT_RECOIL_33_STATUS: - if (AI_DATA->atkAbility != ABILITY_MAGIC_GUARD && AI_DATA->atkAbility != ABILITY_ROCK_HEAD) + if (AI_DATA->abilities[battlerAtk] != ABILITY_MAGIC_GUARD && AI_DATA->abilities[battlerAtk] != ABILITY_ROCK_HEAD) { - u32 recoilDmg = max(1, AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 3); + u32 recoilDmg = max(1, AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 3); if (!ShouldUseRecoilMove(battlerAtk, battlerDef, recoilDmg, AI_THINKING_STRUCT->movesetIndex)) score -= 10; break; } break; case EFFECT_RECOIL_50: - if (AI_DATA->atkAbility != ABILITY_MAGIC_GUARD && AI_DATA->atkAbility != ABILITY_ROCK_HEAD) + if (AI_DATA->abilities[battlerAtk] != ABILITY_MAGIC_GUARD && AI_DATA->abilities[battlerAtk] != ABILITY_ROCK_HEAD) { - u32 recoilDmg = max(1, AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 2); + u32 recoilDmg = max(1, AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 2); if (!ShouldUseRecoilMove(battlerAtk, battlerDef, recoilDmg, AI_THINKING_STRUCT->movesetIndex)) score -= 10; break; @@ -1724,13 +1721,13 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_TEETER_DANCE: if (((gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) - || (!DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move) && AI_DATA->defAbility == ABILITY_OWN_TEMPO) + || (!DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move) && AI_DATA->abilities[battlerDef] == ABILITY_OWN_TEMPO) || (IsBattlerGrounded(battlerDef) && AI_IsTerrainAffected(battlerDef, STATUS_FIELD_MISTY_TERRAIN)) || (DoesSubstituteBlockMove(battlerAtk, battlerDef, move))) - && ((gBattleMons[AI_DATA->battlerDefPartner].status2 & STATUS2_CONFUSION) - || (!DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move) && AI_DATA->defPartnerAbility == ABILITY_OWN_TEMPO) - || (IsBattlerGrounded(AI_DATA->battlerDefPartner) && AI_IsTerrainAffected(AI_DATA->battlerDefPartner, STATUS_FIELD_MISTY_TERRAIN)) - || (DoesSubstituteBlockMove(battlerAtk, AI_DATA->battlerDefPartner, move)))) + && ((gBattleMons[BATTLE_PARTNER(battlerDef)].status2 & STATUS2_CONFUSION) + || (!DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move) && AI_DATA->abilities[BATTLE_PARTNER(battlerDef)] == ABILITY_OWN_TEMPO) + || (IsBattlerGrounded(BATTLE_PARTNER(battlerDef)) && AI_IsTerrainAffected(BATTLE_PARTNER(battlerDef), STATUS_FIELD_MISTY_TERRAIN)) + || (DoesSubstituteBlockMove(battlerAtk, BATTLE_PARTNER(battlerDef), move)))) { score -= 10; } @@ -1741,13 +1738,13 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_TWO_TURNS_ATTACK: - if (AI_DATA->atkHoldEffect != HOLD_EFFECT_POWER_HERB && CanTargetFaintAi(battlerDef, battlerAtk)) + if (AI_DATA->holdEffects[battlerAtk] != HOLD_EFFECT_POWER_HERB && CanTargetFaintAi(battlerDef, battlerAtk)) score -= 6; break; case EFFECT_RECHARGE: - if (AI_DATA->defAbility == ABILITY_WONDER_GUARD && effectiveness < AI_EFFECTIVENESS_x2) + if (AI_DATA->abilities[battlerDef] == ABILITY_WONDER_GUARD && effectiveness < AI_EFFECTIVENESS_x2) score -= 10; - else if (AI_DATA->atkAbility != ABILITY_TRUANT + else if (AI_DATA->abilities[battlerAtk] != ABILITY_TRUANT && !CanIndexMoveFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex, 0)) score -= 2; break; @@ -1778,15 +1775,15 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_LOCK_ON: if (gStatuses3[battlerDef] & STATUS3_ALWAYS_HITS - || AI_DATA->atkAbility == ABILITY_NO_GUARD - || AI_DATA->defAbility == ABILITY_NO_GUARD - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || AI_DATA->abilities[battlerAtk] == ABILITY_NO_GUARD + || AI_DATA->abilities[battlerDef] == ABILITY_NO_GUARD + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_LASER_FOCUS: if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS) score -= 10; - else if (AI_DATA->defAbility == ABILITY_SHELL_ARMOR || AI_DATA->defAbility == ABILITY_BATTLE_ARMOR) + else if (AI_DATA->abilities[battlerDef] == ABILITY_SHELL_ARMOR || AI_DATA->abilities[battlerDef] == ABILITY_BATTLE_ARMOR) score -= 8; break; case EFFECT_SKETCH: @@ -1801,7 +1798,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // TODO break; case EFFECT_HEAL_BELL: - if (!AnyPartyMemberStatused(battlerAtk, TestMoveFlags(move, FLAG_SOUND)) || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (!AnyPartyMemberStatused(battlerAtk, TestMoveFlags(move, FLAG_SOUND)) || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_HIT_PREVENT_ESCAPE: @@ -1835,7 +1832,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (decreased) break; - if (IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility)) + if (IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef])) { score -= 10; break; @@ -1846,8 +1843,8 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) && move != MOVE_CRAFTY_SHIELD) //These moves have infinite usage { if (GetBattlerSecondaryDamage(battlerAtk) >= gBattleMons[battlerAtk].hp - && AI_DATA->defAbility != ABILITY_MOXIE - && AI_DATA->defAbility != ABILITY_BEAST_BOOST) + && AI_DATA->abilities[battlerDef] != ABILITY_MOXIE + && AI_DATA->abilities[battlerDef] != ABILITY_BEAST_BOOST) { score -= 10; //Don't protect if you're going to faint after protecting } @@ -1881,7 +1878,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (gBattleMons[battlerDef].statStages[STAT_EVASION] <= 4 || !(IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK)) - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 9; break; case EFFECT_BURN_UP: @@ -1894,7 +1891,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || gSideTimers[GetBattlerSide(battlerDef)].auroraVeilTimer != 0 || gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_HAZARDS_ANY) { - if (PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) { score -= 10; //Only need one hazards removal break; @@ -1910,7 +1907,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (isDoubleBattle) { if (IsHazardMoveEffect(gBattleMoves[AI_DATA->partnerMove].effect) // partner is going to set up hazards - && AI_WhoStrikesFirst(AI_DATA->battlerAtkPartner, battlerAtk) == AI_IS_FASTER) // partner is going to set up before the potential Defog + && AI_WhoStrikesFirst(BATTLE_PARTNER(battlerAtk), battlerAtk) == AI_IS_FASTER) // partner is going to set up before the potential Defog { score -= 10; break; // Don't use Defog if partner is going to set up hazards @@ -1919,7 +1916,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // evasion check if (gBattleMons[battlerDef].statStages[STAT_EVASION] == MIN_STAT_STAGE - || ((AI_DATA->defAbility == ABILITY_CONTRARY) && !IsTargetingPartner(battlerAtk, battlerDef))) // don't want to raise target stats unless its your partner + || ((AI_DATA->abilities[battlerDef] == ABILITY_CONTRARY) && !IsTargetingPartner(battlerAtk, battlerDef))) // don't want to raise target stats unless its your partner score -= 10; break; @@ -1927,12 +1924,12 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) { - if (gBattleMons[battlerAtk].statStages[i] > DEFAULT_STAT_STAGE || gBattleMons[AI_DATA->battlerAtkPartner].statStages[i] > DEFAULT_STAT_STAGE) + if (gBattleMons[battlerAtk].statStages[i] > DEFAULT_STAT_STAGE || gBattleMons[BATTLE_PARTNER(battlerAtk)].statStages[i] > DEFAULT_STAT_STAGE) score -= 10; // Don't want to reset our boosted stats } for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) { - if (gBattleMons[battlerDef].statStages[i] < DEFAULT_STAT_STAGE || gBattleMons[AI_DATA->battlerDefPartner].statStages[i] < DEFAULT_STAT_STAGE) + if (gBattleMons[battlerDef].statStages[i] < DEFAULT_STAT_STAGE || gBattleMons[BATTLE_PARTNER(battlerDef)].statStages[i] < DEFAULT_STAT_STAGE) score -= 10; //Don't want to copy enemy lowered stats } } @@ -1940,8 +1937,8 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_SPECTRAL_THIEF: break; case EFFECT_SOLAR_BEAM: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_POWER_HERB - || (AI_WeatherHasEffect() && gBattleWeather & B_WEATHER_SUN && AI_DATA->atkHoldEffect != HOLD_EFFECT_UTILITY_UMBRELLA)) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_POWER_HERB + || (AI_WeatherHasEffect() && gBattleWeather & B_WEATHER_SUN && AI_DATA->holdEffects[battlerAtk] != HOLD_EFFECT_UTILITY_UMBRELLA)) break; if (CanTargetFaintAi(battlerDef, battlerAtk)) //Attacker can be knocked out score -= 4; @@ -1952,39 +1949,39 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) && gBattleMoves[predictedMove].effect == EFFECT_SEMI_INVULNERABLE) score -= 10; // Don't Fly/dig/etc if opponent is going to fly/dig/etc after you - if (BattlerWillFaintFromWeather(battlerAtk, AI_DATA->atkAbility) + if (BattlerWillFaintFromWeather(battlerAtk, AI_DATA->abilities[battlerAtk]) && (move == MOVE_FLY || move == MOVE_BOUNCE)) score -= 10; // Attacker will faint while in the air break; case EFFECT_HEALING_WISH: //healing wish, lunar dance - if (CountUsablePartyMons(battlerAtk) == 0 || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (CountUsablePartyMons(battlerAtk) == 0 || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; else if (IsPartyFullyHealedExceptBattler(battlerAtk)) score -= 10; break; case EFFECT_FINAL_GAMBIT: - if (CountUsablePartyMons(battlerAtk) == 0 || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (CountUsablePartyMons(battlerAtk) == 0 || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_NATURE_POWER: return AI_CheckBadMove(battlerAtk, battlerDef, GetNaturePowerMove(), score); case EFFECT_TAUNT: if (gDisableStructs[battlerDef].tauntTimer > 0 - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score--; break; case EFFECT_BESTOW: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_NONE + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_NONE || !CanBattlerGetOrLoseItem(battlerAtk, gBattleMons[battlerAtk].item)) // AI knows its own item score -= 10; break; case EFFECT_ROLE_PLAY: - if (AI_DATA->atkAbility == AI_DATA->defAbility - || AI_DATA->defAbility == ABILITY_NONE - || IsRolePlayBannedAbilityAtk(AI_DATA->atkAbility) - || IsRolePlayBannedAbility(AI_DATA->defAbility)) + if (AI_DATA->abilities[battlerAtk] == AI_DATA->abilities[battlerDef] + || AI_DATA->abilities[battlerDef] == ABILITY_NONE + || IsRolePlayBannedAbilityAtk(AI_DATA->abilities[battlerAtk]) + || IsRolePlayBannedAbility(AI_DATA->abilities[battlerDef])) score -= 10; - else if (IsAbilityOfRating(AI_DATA->atkAbility, 5)) + else if (IsAbilityOfRating(AI_DATA->abilities[battlerAtk], 5)) score -= 4; break; case EFFECT_WISH: @@ -2006,40 +2003,40 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_YAWN: if (gStatuses3[battlerDef] & STATUS3_YAWN) score -= 10; - else if (!AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + else if (!AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_SKILL_SWAP: - if (AI_DATA->atkAbility == ABILITY_NONE || AI_DATA->defAbility == ABILITY_NONE - || IsSkillSwapBannedAbility(AI_DATA->atkAbility) || IsSkillSwapBannedAbility(AI_DATA->defAbility)) + if (AI_DATA->abilities[battlerAtk] == ABILITY_NONE || AI_DATA->abilities[battlerDef] == ABILITY_NONE + || IsSkillSwapBannedAbility(AI_DATA->abilities[battlerAtk]) || IsSkillSwapBannedAbility(AI_DATA->abilities[battlerDef])) score -= 10; break; case EFFECT_WORRY_SEED: - if (AI_DATA->defAbility == ABILITY_INSOMNIA - || IsWorrySeedBannedAbility(AI_DATA->defAbility)) + if (AI_DATA->abilities[battlerDef] == ABILITY_INSOMNIA + || IsWorrySeedBannedAbility(AI_DATA->abilities[battlerDef])) score -= 10; break; case EFFECT_GASTRO_ACID: if (gStatuses3[battlerDef] & STATUS3_GASTRO_ACID - || IsGastroAcidBannedAbility(AI_DATA->defAbility)) + || IsGastroAcidBannedAbility(AI_DATA->abilities[battlerDef])) score -= 10; break; case EFFECT_ENTRAINMENT: - if (AI_DATA->atkAbility == ABILITY_NONE - || IsEntrainmentBannedAbilityAttacker(AI_DATA->atkAbility) - || IsEntrainmentTargetOrSimpleBeamBannedAbility(AI_DATA->defAbility)) + if (AI_DATA->abilities[battlerAtk] == ABILITY_NONE + || IsEntrainmentBannedAbilityAttacker(AI_DATA->abilities[battlerAtk]) + || IsEntrainmentTargetOrSimpleBeamBannedAbility(AI_DATA->abilities[battlerDef])) score -= 10; break; case EFFECT_CORE_ENFORCER: break; case EFFECT_SIMPLE_BEAM: - if (AI_DATA->defAbility == ABILITY_SIMPLE - || IsEntrainmentTargetOrSimpleBeamBannedAbility(AI_DATA->defAbility)) + if (AI_DATA->abilities[battlerDef] == ABILITY_SIMPLE + || IsEntrainmentTargetOrSimpleBeamBannedAbility(AI_DATA->abilities[battlerDef])) score -= 10; break; case EFFECT_SNATCH: if (!TestMoveFlagsInMoveset(battlerDef, FLAG_SNATCH_AFFECTED) - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_POWER_TRICK: @@ -2140,42 +2137,42 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_NATURAL_GIFT: - if (AI_DATA->atkAbility == ABILITY_KLUTZ + if (AI_DATA->abilities[battlerAtk] == ABILITY_KLUTZ || gFieldStatuses & STATUS_FIELD_MAGIC_ROOM || GetPocketByItemId(gBattleMons[battlerAtk].item) != POCKET_BERRIES) score -= 10; break; case EFFECT_GRASSY_TERRAIN: - if (PartnerMoveEffectIsTerrain(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN) + if (PartnerMoveEffectIsTerrain(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN) score -= 10; break; case EFFECT_ELECTRIC_TERRAIN: - if (PartnerMoveEffectIsTerrain(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) + if (PartnerMoveEffectIsTerrain(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) score -= 10; break; case EFFECT_PSYCHIC_TERRAIN: - if (PartnerMoveEffectIsTerrain(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN) + if (PartnerMoveEffectIsTerrain(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN) score -= 10; break; case EFFECT_MISTY_TERRAIN: - if (PartnerMoveEffectIsTerrain(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN) + if (PartnerMoveEffectIsTerrain(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN) score -= 10; break; case EFFECT_PLEDGE: - if (isDoubleBattle && gBattleMons[AI_DATA->battlerAtkPartner].hp > 0) + if (isDoubleBattle && gBattleMons[BATTLE_PARTNER(battlerAtk)].hp > 0) { if (AI_DATA->partnerMove != MOVE_NONE && gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_PLEDGE && move != AI_DATA->partnerMove) // Different pledge moves { - if (gBattleMons[AI_DATA->battlerAtkPartner].status1 & (STATUS1_SLEEP | STATUS1_FREEZE)) - // && gBattleMons[AI_DATA->battlerAtkPartner].status1 != 1) // Will wake up this turn - how would AI know + if (gBattleMons[BATTLE_PARTNER(battlerAtk)].status1 & (STATUS1_SLEEP | STATUS1_FREEZE)) + // && gBattleMons[BATTLE_PARTNER(battlerAtk)].status1 != 1) // Will wake up this turn - how would AI know score -= 10; // Don't use combo move if your partner will cause failure } } break; case EFFECT_TRICK_ROOM: - if (PartnerMoveIs(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove, MOVE_TRICK_ROOM)) + if (PartnerMoveIs(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove, MOVE_TRICK_ROOM)) { score -= 10; } @@ -2191,23 +2188,23 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_MAGIC_ROOM: - if (gFieldStatuses & STATUS_FIELD_MAGIC_ROOM || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (gFieldStatuses & STATUS_FIELD_MAGIC_ROOM || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_WONDER_ROOM: - if (gFieldStatuses & STATUS_FIELD_WONDER_ROOM || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (gFieldStatuses & STATUS_FIELD_WONDER_ROOM || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_GRAVITY: if ((gFieldStatuses & STATUS_FIELD_GRAVITY && !IS_BATTLER_OF_TYPE(battlerAtk, TYPE_FLYING) - && AI_DATA->atkHoldEffect != HOLD_EFFECT_AIR_BALLOON) // Should revert Gravity in this case - || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + && AI_DATA->holdEffects[battlerAtk] != HOLD_EFFECT_AIR_BALLOON) // Should revert Gravity in this case + || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_ION_DELUGE: if (gFieldStatuses & STATUS_FIELD_ION_DELUGE - || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_FLING: @@ -2222,19 +2219,19 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) switch (effect) { case MOVE_EFFECT_BURN: - if (!AI_CanBurn(battlerAtk, battlerDef, AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (!AI_CanBurn(battlerAtk, battlerDef, BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case MOVE_EFFECT_PARALYSIS: - if (!AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (!AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case MOVE_EFFECT_POISON: - if (!AI_CanPoison(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (!AI_CanPoison(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case MOVE_EFFECT_TOXIC: - if (!AI_CanPoison(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (!AI_CanPoison(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case MOVE_EFFECT_FREEZE: @@ -2246,34 +2243,34 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_EMBARGO: - if (AI_DATA->defAbility == ABILITY_KLUTZ + if (AI_DATA->abilities[battlerDef] == ABILITY_KLUTZ || gFieldStatuses & STATUS_FIELD_MAGIC_ROOM || gDisableStructs[battlerDef].embargoTimer != 0 - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_POWDER: if (!HasMoveWithType(battlerDef, TYPE_FIRE) - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_TELEKINESIS: if (gStatuses3[battlerDef] & (STATUS3_TELEKINESIS | STATUS3_ROOTED | STATUS3_SMACKED_DOWN) || gFieldStatuses & STATUS_FIELD_GRAVITY - || AI_DATA->defHoldEffect == HOLD_EFFECT_IRON_BALL + || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_IRON_BALL || IsTelekinesisBannedSpecies(gBattleMons[battlerDef].species) - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_THROAT_CHOP: break; case EFFECT_HEAL_BLOCK: if (gDisableStructs[battlerDef].healBlockTimer != 0 - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_SOAK: - if (PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove) + if (PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove) || (gBattleMons[battlerDef].type1 == TYPE_WATER && gBattleMons[battlerDef].type2 == TYPE_WATER && gBattleMons[battlerDef].type3 == TYPE_MYSTERY)) @@ -2283,11 +2280,11 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) switch (move) { case MOVE_TRICK_OR_TREAT: - if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST) || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST) || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case MOVE_FORESTS_CURSE: - if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; } @@ -2318,7 +2315,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_ELECTRIFY: if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER //|| GetMoveTypeSpecial(battlerDef, predictedMove) == TYPE_ELECTRIC // Move will already be electric type - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_TOPSY_TURVY: @@ -2328,7 +2325,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) u8 targetNegativeStages = CountNegativeStatStages(battlerDef); if (targetPositiveStages == 0 //No good stat changes to make bad - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; else if (targetNegativeStages < targetPositiveStages) @@ -2336,7 +2333,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_FAIRY_LOCK: - if ((gFieldStatuses & STATUS_FIELD_FAIRY_LOCK) || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if ((gFieldStatuses & STATUS_FIELD_FAIRY_LOCK) || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_DO_NOTHING: @@ -2359,7 +2356,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) #endif || (gLockedMoves[battlerDef] != 0 && gLockedMoves[battlerDef] != 0xFFFF) || gBattleMons[battlerDef].status2 & STATUS2_MULTIPLETURNS - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) { score -= 10; } @@ -2386,14 +2383,14 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_QUASH: if (!isDoubleBattle || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_AFTER_YOU: if (!IsTargetingPartner(battlerAtk, battlerDef) || !isDoubleBattle || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_SUCKER_PUNCH: @@ -2405,19 +2402,19 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_TAILWIND: if (gSideTimers[GetBattlerSide(battlerAtk)].tailwindTimer != 0 - || PartnerMoveIs(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove, MOVE_TAILWIND) + || PartnerMoveIs(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove, MOVE_TAILWIND) || (gFieldStatuses & STATUS_FIELD_TRICK_ROOM && gFieldTimers.trickRoomTimer > 1)) // Trick Room active and not ending this turn score -= 10; break; case EFFECT_LUCKY_CHANT: if (gSideTimers[GET_BATTLER_SIDE(battlerAtk)].luckyChantTimer != 0 - || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_MAGNET_RISE: if (gFieldStatuses & STATUS_FIELD_GRAVITY || gDisableStructs[battlerAtk].magnetRiseTimer != 0 - || AI_DATA->atkHoldEffect == HOLD_EFFECT_IRON_BALL + || AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_IRON_BALL || gStatuses3[battlerAtk] & (STATUS3_ROOTED | STATUS3_MAGNET_RISE | STATUS3_SMACKED_DOWN) || !IsBattlerGrounded(battlerAtk)) score -= 10; @@ -2432,7 +2429,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_SYNCHRONOISE: //Check holding ring target or is of same type - if (AI_DATA->defHoldEffect == HOLD_EFFECT_RING_TARGET + if (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_RING_TARGET || IS_BATTLER_OF_TYPE(battlerDef, gBattleMons[battlerAtk].type1) || IS_BATTLER_OF_TYPE(battlerDef, gBattleMons[battlerAtk].type2) || IS_BATTLER_OF_TYPE(battlerDef, gBattleMons[battlerAtk].type3)) @@ -2443,16 +2440,16 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_ERUPTION: if (effectiveness <= AI_EFFECTIVENESS_x0_5) score--; - if (GetHealthPercentage(battlerDef) < 50) + if (AI_DATA->hpPercents[battlerDef] < 50) score--; break; case EFFECT_VITAL_THROW: - if (WillAIStrikeFirst() && GetHealthPercentage(battlerAtk) < 40) + if (WillAIStrikeFirst() && AI_DATA->hpPercents[battlerAtk] < 40) score--; // don't want to move last break; case EFFECT_FLAIL: if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER // Opponent should go first - || GetHealthPercentage(battlerAtk) > 50) + || AI_DATA->hpPercents[battlerAtk] > 50) score -= 4; break; //TODO @@ -2467,7 +2464,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; if (WillFaintFromWeather(battlerAtk) || MoveBlockedBySubstitute(move, battlerAtk, battlerDef) - || GetSpeciesWeight(gBattleMons[battlerDef].species, AI_DATA->defAbility, AI_DATA->defHoldEffect, battlerDef, TRUE) >= 2000) //200.0 kg + || GetSpeciesWeight(gBattleMons[battlerDef].species, AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerDef], battlerDef, TRUE) >= 2000) //200.0 kg score -= 10; break; */ @@ -2516,7 +2513,7 @@ static s16 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (GetMoveDamageResult(move) == MOVE_POWER_OTHER) score--; - switch (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef)) + switch (AI_DATA->effectiveness[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]) { case AI_EFFECTIVENESS_x4: if (WEATHER_HAS_EFFECT @@ -2569,13 +2566,13 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) u16 effect = gBattleMoves[move].effect; u16 target = gBattleMoves[move].target; // ally data - u8 battlerAtkPartner = AI_DATA->battlerAtkPartner; - u16 atkPartnerAbility = AI_DATA->atkPartnerAbility; - u16 atkPartnerHoldEffect = AI_DATA->atkPartnerHoldEffect; + u8 battlerAtkPartner = BATTLE_PARTNER(battlerAtk); + u16 atkPartnerAbility = AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)]; + u16 atkPartnerHoldEffect = AI_DATA->holdEffects[BATTLE_PARTNER(battlerAtk)]; bool32 partnerProtecting = (gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_PROTECT); - bool32 attackerHasBadAbility = (GetAbilityRating(AI_DATA->atkAbility) < 0); + bool32 attackerHasBadAbility = (GetAbilityRating(AI_DATA->abilities[battlerAtk]) < 0); bool32 partnerHasBadAbility = (GetAbilityRating(atkPartnerAbility) < 0); - u16 predictedMove = gLastMoves[battlerDef]; //for now + u16 predictedMove = AI_DATA->predictedMoves[battlerDef]; SetTypeBeforeUsingMove(move, battlerAtk); GET_MOVE_TYPE(move, moveType); @@ -2598,7 +2595,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_ALWAYS_CRIT: // Ally decided to use Frost Breath on us. we must have Anger Point as our ability - if (AI_DATA->atkAbility == ABILITY_ANGER_POINT) + if (AI_DATA->abilities[battlerAtk] == ABILITY_ANGER_POINT) { if (AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner) == AI_IS_SLOWER) // Partner moving first { @@ -2674,7 +2671,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (GetMoveDamageResult(move) == MOVE_POWER_OTHER) { // partner ability checks - if (!partnerProtecting && gBattleMoves[move].target != MOVE_TARGET_BOTH && !DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move)) + if (!partnerProtecting && gBattleMoves[move].target != MOVE_TARGET_BOTH && !DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move)) { switch (atkPartnerAbility) { @@ -2822,14 +2819,14 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_SKILL_SWAP: - if (AI_DATA->atkAbility != AI_DATA->atkPartnerAbility && !attackerHasBadAbility) + if (AI_DATA->abilities[battlerAtk] != AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] && !attackerHasBadAbility) { - if (AI_DATA->atkPartnerAbility == ABILITY_TRUANT) + if (AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_TRUANT) { RETURN_SCORE_PLUS(10); } - else if (AI_DATA->atkAbility == ABILITY_COMPOUND_EYES - && HasMoveWithLowAccuracy(battlerAtkPartner, FOE(battlerAtkPartner), 90, TRUE, atkPartnerAbility, AI_GetAbility(FOE(battlerAtkPartner)), atkPartnerHoldEffect, AI_GetHoldEffect(FOE(battlerAtkPartner)))) + else if (AI_DATA->abilities[battlerAtk] == ABILITY_COMPOUND_EYES + && HasMoveWithLowAccuracy(battlerAtkPartner, FOE(battlerAtkPartner), 90, TRUE, atkPartnerAbility, AI_DATA->abilities[FOE(battlerAtkPartner)], atkPartnerHoldEffect, AI_DATA->holdEffects[FOE(battlerAtkPartner)])) { RETURN_SCORE_PLUS(3); } @@ -2850,7 +2847,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_ENTRAINMENT: - if (partnerHasBadAbility && IsAbilityOfRating(AI_DATA->atkAbility, 0)) + if (partnerHasBadAbility && IsAbilityOfRating(AI_DATA->abilities[battlerAtk], 0)) { RETURN_SCORE_PLUS(1); } @@ -2900,9 +2897,9 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) switch (effect) { case EFFECT_SKILL_SWAP: - if (AI_DATA->atkAbility == ABILITY_TRUANT) + if (AI_DATA->abilities[battlerAtk] == ABILITY_TRUANT) score += 5; - else if (IsAbilityOfRating(AI_DATA->atkAbility, 0) || IsAbilityOfRating(AI_DATA->defAbility, 10)) + else if (IsAbilityOfRating(AI_DATA->abilities[battlerAtk], 0) || IsAbilityOfRating(AI_DATA->abilities[battlerDef], 10)) score += 2; // we want to transfer our bad ability or take their awesome ability break; case EFFECT_EARTHQUAKE: @@ -2933,13 +2930,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { // move data u16 moveEffect = gBattleMoves[move].effect; - u8 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); + u8 effectiveness = AI_DATA->effectiveness[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; u8 atkPriority = GetMovePriority(battlerAtk, move); - u16 predictedMove = gLastMoves[battlerDef]; //for now + u16 predictedMove = AI_DATA->predictedMoves[battlerDef]; bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); u32 i; - u8 atkHpPercent = GetHealthPercentage(battlerAtk); - u8 defHpPercent = GetHealthPercentage(battlerDef); // Targeting partner, check benefits of doing that instead if (IsTargetingPartner(battlerAtk, battlerDef)) @@ -2959,7 +2954,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; // check already dead - if (!IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility) + if (!IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]) && CanTargetFaintAi(battlerAtk, battlerDef) && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Opponent should go first { @@ -2984,7 +2979,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // check burn if (gBattleMons[battlerAtk].status1 & STATUS1_BURN) { - switch (AI_DATA->atkAbility) + switch (AI_DATA->abilities[battlerAtk]) { case ABILITY_GUTS: break; @@ -3001,7 +2996,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } // attacker ability checks - switch (AI_DATA->atkAbility) + switch (AI_DATA->abilities[battlerAtk]) { case ABILITY_MOXIE: case ABILITY_BEAST_BOOST: @@ -3028,7 +3023,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) IncreaseSleepScore(battlerAtk, battlerDef, move, &score); break; case EFFECT_ABSORB: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_BIG_ROOT) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_BIG_ROOT) score++; if (effectiveness <= AI_EFFECTIVENESS_x0_5 && AI_RandLessThan(50)) score -= 3; @@ -3037,7 +3032,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_MEMENTO: if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_WILL_SUICIDE && gBattleMons[battlerDef].statStages[STAT_EVASION] < 7) { - if (atkHpPercent < 50 && AI_RandLessThan(128)) + if (AI_DATA->hpPercents[battlerAtk] < 50 && AI_RandLessThan(128)) score++; } break; @@ -3055,7 +3050,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else if (gBattleMons[battlerAtk].statStages[STAT_ATK] < 9) { - if (atkHpPercent > 90 && AI_RandLessThan(128)) + if (AI_DATA->hpPercents[battlerAtk] > 90 && AI_RandLessThan(128)) { score += 2; break; @@ -3072,11 +3067,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_DEFENSE_UP_3: if (!HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)) score -= 2; - if (atkHpPercent > 90 && AI_RandLessThan(128)) + if (AI_DATA->hpPercents[battlerAtk] > 90 && AI_RandLessThan(128)) score += 2; - else if (atkHpPercent > 70 && AI_RandLessThan(200)) + else if (AI_DATA->hpPercents[battlerAtk] > 70 && AI_RandLessThan(200)) break; - else if (atkHpPercent < 40) + else if (AI_DATA->hpPercents[battlerAtk] < 40) score -= 2; break; case EFFECT_SPEED_UP: @@ -3101,7 +3096,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else if (gBattleMons[battlerAtk].statStages[STAT_SPATK] < 9) { - if (atkHpPercent > 90 && AI_RandLessThan(128)) + if (AI_DATA->hpPercents[battlerAtk] > 90 && AI_RandLessThan(128)) { score += 2; break; @@ -3117,29 +3112,29 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_SPECIAL_DEFENSE_UP_2: if (!HasMoveWithSplit(battlerDef, SPLIT_SPECIAL)) score -= 2; - if (atkHpPercent > 90 && AI_RandLessThan(128)) + if (AI_DATA->hpPercents[battlerAtk] > 90 && AI_RandLessThan(128)) score += 2; - else if (GetHealthPercentage(battlerAtk) > 70 && AI_RandLessThan(200)) + else if (AI_DATA->hpPercents[battlerAtk] > 70 && AI_RandLessThan(200)) break; - else if (GetHealthPercentage(battlerAtk) < 40) + else if (AI_DATA->hpPercents[battlerAtk] < 40) score -= 2; break; case EFFECT_ACCURACY_UP: case EFFECT_ACCURACY_UP_2: if (gBattleMons[battlerAtk].statStages[STAT_ACC] >= 9 && !AI_RandLessThan(50)) score -= 2; - else if (atkHpPercent <= 70) + else if (AI_DATA->hpPercents[battlerAtk] <= 70) score -= 2; else score++; break; case EFFECT_EVASION_UP: case EFFECT_EVASION_UP_2: - if (atkHpPercent > 90 && !AI_RandLessThan(100)) + if (AI_DATA->hpPercents[battlerAtk] > 90 && !AI_RandLessThan(100)) score += 3; if (gBattleMons[battlerAtk].statStages[STAT_EVASION] > 9 && AI_RandLessThan(128)) score--; - if ((gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY) && atkHpPercent >= 50 && !AI_RandLessThan(80)) + if ((gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY) && AI_DATA->hpPercents[battlerAtk] >= 50 && !AI_RandLessThan(80)) score += 3; if (gStatuses3[battlerDef] & STATUS3_LEECHSEED && !AI_RandLessThan(70)) score += 3; @@ -3147,9 +3142,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 2; if (gBattleMons[battlerDef].status2 & STATUS2_CURSED && !AI_RandLessThan(70)) score += 3; - if (atkHpPercent < 70 || gBattleMons[battlerAtk].statStages[STAT_EVASION] == DEFAULT_STAT_STAGE) + if (AI_DATA->hpPercents[battlerAtk] < 70 || gBattleMons[battlerAtk].statStages[STAT_EVASION] == DEFAULT_STAT_STAGE) break; - else if (atkHpPercent < 40 || defHpPercent < 40) + else if (AI_DATA->hpPercents[battlerAtk] < 40 || AI_DATA->hpPercents[battlerDef] < 40) score -= 2; else if (!AI_RandLessThan(70)) score -= 2; @@ -3157,24 +3152,24 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // stat lowering effects case EFFECT_ATTACK_DOWN: case EFFECT_ATTACK_DOWN_2: - if (!ShouldLowerAttack(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (!ShouldLowerAttack(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) score -= 2; if (gBattleMons[battlerDef].statStages[STAT_ATK] < DEFAULT_STAT_STAGE) score--; - else if (atkHpPercent <= 90) + else if (AI_DATA->hpPercents[battlerAtk] <= 90) score--; if (gBattleMons[battlerDef].statStages[STAT_ATK] > 3 && !AI_RandLessThan(50)) score -= 2; - else if (defHpPercent < 70) + else if (AI_DATA->hpPercents[battlerDef] < 70) score -= 2; break; case EFFECT_DEFENSE_DOWN: case EFFECT_DEFENSE_DOWN_2: - if (!ShouldLowerDefense(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (!ShouldLowerDefense(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) score -= 2; - if ((atkHpPercent < 70 && !AI_RandLessThan(50)) || (gBattleMons[battlerDef].statStages[STAT_DEF] <= 3 && !AI_RandLessThan(50))) + if ((AI_DATA->hpPercents[battlerAtk] < 70 && !AI_RandLessThan(50)) || (gBattleMons[battlerDef].statStages[STAT_DEF] <= 3 && !AI_RandLessThan(50))) score -= 2; - if (defHpPercent <= 70) + if (AI_DATA->hpPercents[battlerDef] <= 70) score -= 2; break; case EFFECT_SPEED_DOWN: @@ -3186,32 +3181,32 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_SPECIAL_ATTACK_DOWN: case EFFECT_SPECIAL_ATTACK_DOWN_2: - if (!ShouldLowerSpAtk(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (!ShouldLowerSpAtk(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) score -= 2; if (gBattleMons[battlerDef].statStages[STAT_SPATK] < DEFAULT_STAT_STAGE) score--; - else if (atkHpPercent <= 90) + else if (AI_DATA->hpPercents[battlerAtk] <= 90) score--; if (gBattleMons[battlerDef].statStages[STAT_SPATK] > 3 && !AI_RandLessThan(50)) score -= 2; - else if (defHpPercent < 70) + else if (AI_DATA->hpPercents[battlerDef] < 70) score -= 2; break; case EFFECT_SPECIAL_DEFENSE_DOWN: case EFFECT_SPECIAL_DEFENSE_DOWN_2: - if (!ShouldLowerSpDef(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (!ShouldLowerSpDef(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) score -= 2; - if ((atkHpPercent < 70 && !AI_RandLessThan(50)) + if ((AI_DATA->hpPercents[battlerAtk] < 70 && !AI_RandLessThan(50)) || (gBattleMons[battlerDef].statStages[STAT_SPDEF] <= 3 && !AI_RandLessThan(50))) score -= 2; - if (defHpPercent <= 70) + if (AI_DATA->hpPercents[battlerDef] <= 70) score -= 2; break; case EFFECT_ACCURACY_DOWN: case EFFECT_ACCURACY_DOWN_2: - if (ShouldLowerAccuracy(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (ShouldLowerAccuracy(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) score -= 2; - if ((atkHpPercent < 70 || defHpPercent < 70) && AI_RandLessThan(100)) + if ((AI_DATA->hpPercents[battlerAtk] < 70 || AI_DATA->hpPercents[battlerDef] < 70) && AI_RandLessThan(100)) score--; if (gBattleMons[battlerDef].statStages[STAT_ACC] <= 4 && !AI_RandLessThan(80)) score -= 2; @@ -3223,26 +3218,26 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; if (gBattleMons[battlerDef].status2 & STATUS2_CURSED && !AI_RandLessThan(70)) score += 2; - if (atkHpPercent > 70 || gBattleMons[battlerDef].statStages[STAT_ACC] < DEFAULT_STAT_STAGE) + if (AI_DATA->hpPercents[battlerAtk] > 70 || gBattleMons[battlerDef].statStages[STAT_ACC] < DEFAULT_STAT_STAGE) break; - else if (atkHpPercent < 40 || defHpPercent < 40 || !AI_RandLessThan(70)) + else if (AI_DATA->hpPercents[battlerAtk] < 40 || AI_DATA->hpPercents[battlerDef] < 40 || !AI_RandLessThan(70)) score -= 2; break; case EFFECT_EVASION_DOWN: case EFFECT_EVASION_DOWN_2: - if (!ShouldLowerEvasion(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (!ShouldLowerEvasion(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) score -= 2; - if ((atkHpPercent < 70 || gBattleMons[battlerDef].statStages[STAT_EVASION] <= 3) && !AI_RandLessThan(50)) + if ((AI_DATA->hpPercents[battlerAtk] < 70 || gBattleMons[battlerDef].statStages[STAT_EVASION] <= 3) && !AI_RandLessThan(50)) score -= 2; - if (defHpPercent <= 70) + if (AI_DATA->hpPercents[battlerDef] <= 70) score -= 2; if (gBattleMons[battlerAtk].statStages[STAT_ACC] < DEFAULT_STAT_STAGE) score++; - if (gBattleMons[battlerDef].statStages[STAT_EVASION] < 7 || AI_DATA->atkAbility == ABILITY_NO_GUARD) + if (gBattleMons[battlerDef].statStages[STAT_EVASION] < 7 || AI_DATA->abilities[battlerAtk] == ABILITY_NO_GUARD) score -= 2; break; case EFFECT_BIDE: - if (atkHpPercent < 90) + if (AI_DATA->hpPercents[battlerAtk] < 90) score -= 2; break; case EFFECT_DREAM_EATER: @@ -3258,7 +3253,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_GROWTH: case EFFECT_ATTACK_SPATK_UP: // work up - if (GetHealthPercentage(battlerAtk) <= 40 || AI_DATA->atkAbility == ABILITY_CONTRARY) + if (AI_DATA->hpPercents[battlerAtk] <= 40 || AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) break; if (HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) @@ -3267,24 +3262,24 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPATK, &score); break; case EFFECT_HAZE: - if (AnyStatIsRaised(AI_DATA->battlerAtkPartner) - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (AnyStatIsRaised(BATTLE_PARTNER(battlerAtk)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 3; break; // fallthrough case EFFECT_ROAR: case EFFECT_CLEAR_SMOG: if (isDoubleBattle) - score += min(CountPositiveStatStages(battlerDef) + CountPositiveStatStages(AI_DATA->battlerDefPartner), 7); + score += min(CountPositiveStatStages(battlerDef) + CountPositiveStatStages(BATTLE_PARTNER(battlerDef)), 7); else score += min(CountPositiveStatStages(battlerDef), 4); break; case EFFECT_MULTI_HIT: case EFFECT_DOUBLE_HIT: case EFFECT_TRIPLE_KICK: - if (AI_MoveMakesContact(AI_DATA->atkAbility, AI_DATA->atkHoldEffect, move) - && AI_DATA->atkAbility != ABILITY_MAGIC_GUARD - && AI_DATA->defHoldEffect == HOLD_EFFECT_ROCKY_HELMET) + if (AI_MoveMakesContact(AI_DATA->abilities[battlerAtk], AI_DATA->holdEffects[battlerAtk], move) + && AI_DATA->abilities[battlerAtk] != ABILITY_MAGIC_GUARD + && AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_ROCKY_HELMET) score -= 2; break; case EFFECT_CONVERSION: @@ -3292,7 +3287,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; break; case EFFECT_FLINCH_HIT: - score += ShouldTryToFlinch(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, move); + score += ShouldTryToFlinch(battlerAtk, battlerDef, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], move); break; case EFFECT_SWALLOW: if (gDisableStructs[battlerAtk].stockpileCounter == 0) @@ -3329,7 +3324,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_MOONLIGHT: if (ShouldRecover(battlerAtk, battlerDef, move, 50)) score += 3; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_BIG_ROOT) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_BIG_ROOT) score++; break; case EFFECT_TOXIC: @@ -3342,26 +3337,26 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (ShouldSetScreen(battlerAtk, battlerDef, moveEffect)) { score += 5; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_LIGHT_CLAY) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_LIGHT_CLAY) score += 2; if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_SCREENER) score += 2; } break; case EFFECT_REST: - if (!(AI_CanSleep(battlerAtk, AI_DATA->atkAbility))) + if (!(AI_CanSleep(battlerAtk, AI_DATA->abilities[battlerAtk]))) { break; } else if (ShouldRecover(battlerAtk, battlerDef, move, 100)) { - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_CURE_SLP - || AI_DATA->atkHoldEffect == HOLD_EFFECT_CURE_STATUS + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CURE_SLP + || AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CURE_STATUS || HasMoveEffect(EFFECT_SLEEP_TALK, battlerAtk) || HasMoveEffect(EFFECT_SNORE, battlerAtk) - || AI_DATA->atkAbility == ABILITY_SHED_SKIN - || AI_DATA->atkAbility == ABILITY_EARLY_BIRD - || (gBattleWeather & B_WEATHER_RAIN && gWishFutureKnock.weatherDuration != 1 && AI_DATA->atkAbility == ABILITY_HYDRATION && AI_DATA->atkHoldEffect != HOLD_EFFECT_UTILITY_UMBRELLA)) + || AI_DATA->abilities[battlerAtk] == ABILITY_SHED_SKIN + || AI_DATA->abilities[battlerAtk] == ABILITY_EARLY_BIRD + || (gBattleWeather & B_WEATHER_RAIN && gWishFutureKnock.weatherDuration != 1 && AI_DATA->abilities[battlerAtk] == ABILITY_HYDRATION && AI_DATA->holdEffects[battlerAtk] != HOLD_EFFECT_UTILITY_UMBRELLA)) { score += 2; } @@ -3394,14 +3389,14 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_FOCUS_ENERGY: case EFFECT_LASER_FOCUS: - if (AI_DATA->atkAbility == ABILITY_SUPER_LUCK - || AI_DATA->atkAbility == ABILITY_SNIPER - || AI_DATA->atkHoldEffect == HOLD_EFFECT_SCOPE_LENS + if (AI_DATA->abilities[battlerAtk] == ABILITY_SUPER_LUCK + || AI_DATA->abilities[battlerAtk] == ABILITY_SNIPER + || AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_SCOPE_LENS || TestMoveFlagsInMoveset(battlerAtk, FLAG_HIGH_CRIT)) score += 2; break; case EFFECT_CONFUSE_HIT: - if (AI_DATA->atkAbility == ABILITY_SERENE_GRACE) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE) score++; //fallthrough case EFFECT_CONFUSE: @@ -3420,7 +3415,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_SPECIAL_DEFENSE_DOWN_HIT: case EFFECT_ACCURACY_DOWN_HIT: case EFFECT_EVASION_DOWN_HIT: - if (AI_DATA->atkAbility == ABILITY_SERENE_GRACE && AI_DATA->defAbility != ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && AI_DATA->abilities[battlerDef] != ABILITY_CONTRARY) score += 2; break; case EFFECT_SPEED_DOWN_HIT: @@ -3428,12 +3423,12 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 2; else if (!AI_RandLessThan(70)) score++; - if (AI_DATA->atkAbility == ABILITY_SERENE_GRACE && AI_DATA->defAbility != ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && AI_DATA->abilities[battlerDef] != ABILITY_CONTRARY) score++; break; - if (ShouldLowerSpeed(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (ShouldLowerSpeed(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) { - if (AI_DATA->atkAbility == ABILITY_SERENE_GRACE && AI_DATA->defAbility != ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && AI_DATA->abilities[battlerDef] != ABILITY_CONTRARY) score += 4; else score += 2; @@ -3452,7 +3447,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || HasMoveEffect(battlerDef, EFFECT_CONFUSE) || HasMoveEffect(battlerDef, EFFECT_LEECH_SEED)) score += 2; - if (!gBattleMons[battlerDef].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION && GetHealthPercentage(battlerAtk) > 70)) + if (!gBattleMons[battlerDef].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION && AI_DATA->hpPercents[battlerAtk] > 70)) score++; break; case EFFECT_MIMIC: @@ -3466,8 +3461,8 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) || gStatuses3[battlerDef] & STATUS3_LEECHSEED || HasMoveEffect(battlerDef, EFFECT_RAPID_SPIN) - || AI_DATA->defAbility == ABILITY_LIQUID_OOZE - || AI_DATA->defAbility == ABILITY_MAGIC_GUARD) + || AI_DATA->abilities[battlerDef] == ABILITY_LIQUID_OOZE + || AI_DATA->abilities[battlerDef] == ABILITY_MAGIC_GUARD) break; score += 3; if (!HasDamagingMove(battlerDef) || IsBattlerTrapped(battlerDef, FALSE)) @@ -3484,7 +3479,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_PARTING_SHOT: if (!IsDoubleBattle()) { - switch (ShouldPivot(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_THINKING_STRUCT->movesetIndex)) + switch (ShouldPivot(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_THINKING_STRUCT->movesetIndex)) { case 0: // no score -= 10; // technically should go in CheckBadMove, but this is easier/less computationally demanding @@ -3513,7 +3508,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_DISABLE: if (gDisableStructs[battlerDef].disableTimer == 0 - && (B_MENTAL_HERB >= GEN_5 && AI_DATA->defHoldEffect != HOLD_EFFECT_MENTAL_HERB)) // mental herb + && (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB)) // mental herb { if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // AI goes first { @@ -3535,7 +3530,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_ENCORE: if (gDisableStructs[battlerDef].encoreTimer == 0 - && (B_MENTAL_HERB >= GEN_5 && AI_DATA->defHoldEffect != HOLD_EFFECT_MENTAL_HERB)) // mental herb + && (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB)) // mental herb { if (IsEncoreEncouragedEffect(gBattleMoves[gLastMoves[battlerDef]].effect)) score += 3; @@ -3545,7 +3540,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { u16 newHp = (gBattleMons[battlerAtk].hp + gBattleMons[battlerDef].hp) / 2; u16 healthBenchmark = (gBattleMons[battlerAtk].hp * 12) / 10; - if (newHp > healthBenchmark && ShouldAbsorb(battlerAtk, battlerDef, move, AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex])) + if (newHp > healthBenchmark && ShouldAbsorb(battlerAtk, battlerDef, move, AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex])) score += 2; } break; @@ -3557,15 +3552,15 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_LOCK_ON: if (HasMoveEffect(battlerAtk, EFFECT_OHKO)) score += 3; - else if (AI_DATA->atkAbility == ABILITY_COMPOUND_EYES && HasMoveWithLowAccuracy(battlerAtk, battlerDef, 80, TRUE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + else if (AI_DATA->abilities[battlerAtk] == ABILITY_COMPOUND_EYES && HasMoveWithLowAccuracy(battlerAtk, battlerDef, 80, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) score += 3; - else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 85, TRUE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 85, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) score += 3; - else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) score++; break; case EFFECT_SPEED_UP_HIT: - if (AI_DATA->atkAbility == ABILITY_SERENE_GRACE && AI_DATA->defAbility != ABILITY_CONTRARY && !WillAIStrikeFirst()) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && AI_DATA->abilities[battlerDef] != ABILITY_CONTRARY && !WillAIStrikeFirst()) score += 3; break; case EFFECT_DESTINY_BOND: @@ -3590,14 +3585,14 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER || GetBattlerSide(battlerAtk) == B_SIDE_PLAYER) canSteal = TRUE; - if (canSteal && AI_DATA->atkItem == ITEM_NONE - && AI_DATA->defItem != ITEM_NONE - && CanBattlerGetOrLoseItem(battlerDef, AI_DATA->defItem) - && CanBattlerGetOrLoseItem(battlerAtk, AI_DATA->defItem) + if (canSteal && AI_DATA->items[battlerAtk] == ITEM_NONE + && AI_DATA->items[battlerDef] != ITEM_NONE + && CanBattlerGetOrLoseItem(battlerDef, AI_DATA->items[battlerDef]) + && CanBattlerGetOrLoseItem(battlerAtk, AI_DATA->items[battlerDef]) && !HasMoveEffect(battlerAtk, EFFECT_ACROBATICS) - && AI_DATA->defAbility != ABILITY_STICKY_HOLD) + && AI_DATA->abilities[battlerDef] != ABILITY_STICKY_HOLD) { - switch (AI_DATA->defHoldEffect) + switch (AI_DATA->holdEffects[battlerDef]) { case HOLD_EFFECT_NONE: break; @@ -3607,11 +3602,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 2; break; case HOLD_EFFECT_TOXIC_ORB: - if (ShouldPoisonSelf(battlerAtk, AI_DATA->atkAbility)) + if (ShouldPoisonSelf(battlerAtk, AI_DATA->abilities[battlerAtk])) score += 2; break; case HOLD_EFFECT_FLAME_ORB: - if (ShouldBurnSelf(battlerAtk, AI_DATA->atkAbility)) + if (ShouldBurnSelf(battlerAtk, AI_DATA->abilities[battlerAtk])) score += 2; break; case HOLD_EFFECT_BLACK_SLUDGE: @@ -3634,9 +3629,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_NIGHTMARE: - if (AI_DATA->defAbility != ABILITY_MAGIC_GUARD + if (AI_DATA->abilities[battlerDef] != ABILITY_MAGIC_GUARD && !(gBattleMons[battlerDef].status2 & STATUS2_NIGHTMARE) - && (AI_DATA->defAbility == ABILITY_COMATOSE || gBattleMons[battlerDef].status1 & STATUS1_SLEEP)) + && (AI_DATA->abilities[battlerDef] == ABILITY_COMATOSE || gBattleMons[battlerDef].status1 & STATUS1_SLEEP)) { score += 5; if (IsBattlerTrapped(battlerDef, TRUE)) @@ -3654,7 +3649,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else { - if (AI_DATA->atkAbility == ABILITY_CONTRARY || AI_DATA->defAbility == ABILITY_MAGIC_GUARD) + if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY || AI_DATA->abilities[battlerDef] == ABILITY_MAGIC_GUARD) break; else if (gBattleMons[battlerAtk].statStages[STAT_ATK] < 8) score += (8 - gBattleMons[battlerAtk].statStages[STAT_ATK]); @@ -3680,7 +3675,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else if (isDoubleBattle && gBattleMoves[AI_DATA->partnerMove].target & MOVE_TARGET_FOES_AND_ALLY) { - if (AI_DATA->atkAbility != ABILITY_TELEPATHY) + if (AI_DATA->abilities[battlerAtk] != ABILITY_TELEPATHY) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); } break; @@ -3696,9 +3691,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case MOVE_KINGS_SHIELD: #if (defined SPECIES_AEGISLASH && defined SPECIES_AEGISLASH_BLADE) - if (AI_DATA->atkAbility == ABILITY_STANCE_CHANGE //Special logic for Aegislash - && AI_DATA->atkSpecies == SPECIES_AEGISLASH_BLADE - && !IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility)) + if (AI_DATA->abilities[battlerAtk] == ABILITY_STANCE_CHANGE //Special logic for Aegislash + && gBattleMons[battlerAtk].species == SPECIES_AEGISLASH_BLADE + && !IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef])) { score += 3; break; @@ -3714,7 +3709,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (CanTargetFaintAi(battlerDef, battlerAtk)) { if (gBattleMons[battlerAtk].hp > gBattleMons[battlerAtk].maxHP / 4 // Pinch berry couldn't have activated yet - && IsPinchBerryItemEffect(AI_DATA->atkHoldEffect)) + && IsPinchBerryItemEffect(AI_DATA->holdEffects[battlerAtk])) { score += 3; } @@ -3730,14 +3725,14 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_STEALTH_ROCK: case EFFECT_STICKY_WEB: case EFFECT_TOXIC_SPIKES: - if (AI_DATA->defAbility == ABILITY_MAGIC_BOUNCE || CountUsablePartyMons(battlerDef) == 0) + if (AI_DATA->abilities[battlerDef] == ABILITY_MAGIC_BOUNCE || CountUsablePartyMons(battlerDef) == 0) break; if (gDisableStructs[battlerAtk].isFirstTurn) score += 2; //TODO - track entire opponent party data to determine hazard effectiveness break; case EFFECT_FORESIGHT: - if (AI_DATA->atkAbility == ABILITY_SCRAPPY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SCRAPPY) break; else if (gBattleMons[battlerDef].statStages[STAT_EVASION] > DEFAULT_STAT_STAGE || (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST) @@ -3755,10 +3750,10 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 3; break; case EFFECT_SANDSTORM: - if (ShouldSetSandstorm(battlerAtk, AI_DATA->atkHoldEffect, AI_DATA->atkHoldEffect)) + if (ShouldSetSandstorm(battlerAtk, AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerAtk])) { score++; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_SMOOTH_ROCK) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_SMOOTH_ROCK) score++; if (HasMoveEffect(battlerDef, EFFECT_MORNING_SUN) || HasMoveEffect(battlerDef, EFFECT_SYNTHESIS) @@ -3767,14 +3762,14 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_HAIL: - if (ShouldSetHail(battlerAtk, AI_DATA->atkAbility, AI_DATA->atkHoldEffect)) + if (ShouldSetHail(battlerAtk, AI_DATA->abilities[battlerAtk], AI_DATA->holdEffects[battlerAtk])) { - if ((HasMoveEffect(battlerAtk, EFFECT_AURORA_VEIL) || HasMoveEffect(AI_DATA->battlerAtkPartner, EFFECT_AURORA_VEIL)) + if ((HasMoveEffect(battlerAtk, EFFECT_AURORA_VEIL) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_AURORA_VEIL)) && ShouldSetScreen(battlerAtk, battlerDef, EFFECT_AURORA_VEIL)) score += 3; score++; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_ICY_ROCK) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_ICY_ROCK) score++; if (HasMoveEffect(battlerDef, EFFECT_MORNING_SUN) || HasMoveEffect(battlerDef, EFFECT_SYNTHESIS) @@ -3783,38 +3778,38 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_RAIN_DANCE: - if (ShouldSetRain(battlerAtk, AI_DATA->atkAbility, AI_DATA->atkHoldEffect)) + if (ShouldSetRain(battlerAtk, AI_DATA->abilities[battlerAtk], AI_DATA->holdEffects[battlerAtk])) { score++; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_DAMP_ROCK) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_DAMP_ROCK) score++; if (HasMoveEffect(battlerDef, EFFECT_MORNING_SUN) || HasMoveEffect(battlerDef, EFFECT_SYNTHESIS) || HasMoveEffect(battlerDef, EFFECT_MOONLIGHT)) score += 2; - if (HasMoveWithType(battlerDef, TYPE_FIRE) || HasMoveWithType(AI_DATA->battlerDefPartner, TYPE_FIRE)) + if (HasMoveWithType(battlerDef, TYPE_FIRE) || HasMoveWithType(BATTLE_PARTNER(battlerDef), TYPE_FIRE)) score++; } break; case EFFECT_SUNNY_DAY: - if (ShouldSetSun(battlerAtk, AI_DATA->atkAbility, AI_DATA->atkHoldEffect)) + if (ShouldSetSun(battlerAtk, AI_DATA->abilities[battlerAtk], AI_DATA->holdEffects[battlerAtk])) { score++; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_HEAT_ROCK) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_HEAT_ROCK) score++; - if (HasMoveWithType(battlerDef, TYPE_WATER) || HasMoveWithType(AI_DATA->battlerDefPartner, TYPE_WATER)) + if (HasMoveWithType(battlerDef, TYPE_WATER) || HasMoveWithType(BATTLE_PARTNER(battlerDef), TYPE_WATER)) score++; - if (HasMoveEffect(battlerDef, EFFECT_THUNDER) || HasMoveEffect(AI_DATA->battlerDefPartner, EFFECT_THUNDER)) + if (HasMoveEffect(battlerDef, EFFECT_THUNDER) || HasMoveEffect(BATTLE_PARTNER(battlerDef), EFFECT_THUNDER)) score++; } break; case EFFECT_ATTACK_UP_HIT: - if (AI_DATA->atkAbility == ABILITY_SERENE_GRACE) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE) IncreaseStatUpScore(battlerAtk, battlerDef, STAT_ATK, &score); break; case EFFECT_FELL_STINGER: if (gBattleMons[battlerAtk].statStages[STAT_ATK] < MAX_STAT_STAGE - && AI_DATA->atkAbility != ABILITY_CONTRARY + && AI_DATA->abilities[battlerAtk] != ABILITY_CONTRARY && CanIndexMoveFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex, 0)) { if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker goes first @@ -3824,7 +3819,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_BELLY_DRUM: - if (!CanTargetFaintAi(battlerDef, battlerAtk) && HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL) && AI_DATA->atkAbility != ABILITY_CONTRARY) + if (!CanTargetFaintAi(battlerDef, battlerAtk) && HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL) && AI_DATA->abilities[battlerAtk] != ABILITY_CONTRARY) score += (MAX_STAT_STAGE - gBattleMons[battlerAtk].statStages[STAT_ATK]); break; case EFFECT_PSYCH_UP: @@ -3885,7 +3880,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 8; break; case EFFECT_STOCKPILE: - if (AI_DATA->atkAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) break; if (HasMoveEffect(battlerAtk, EFFECT_SWALLOW) || HasMoveEffect(battlerAtk, EFFECT_SPIT_UP)) @@ -3908,7 +3903,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || HasMoveEffect(battlerAtk, EFFECT_SPECTRAL_THIEF)) score++; - if (AI_DATA->defAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerDef] == ABILITY_CONTRARY) score += 2; IncreaseConfusionScore(battlerAtk, battlerDef, move, &score); @@ -3918,17 +3913,17 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || HasMoveEffect(battlerAtk, EFFECT_SPECTRAL_THIEF)) score += 2; - if (AI_DATA->defAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerDef] == ABILITY_CONTRARY) score += 2; IncreaseConfusionScore(battlerAtk, battlerDef, move, &score); break; case EFFECT_FURY_CUTTER: - if (!isDoubleBattle && AI_DATA->atkHoldEffect == HOLD_EFFECT_METRONOME) + if (!isDoubleBattle && AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_METRONOME) score += 3; break; case EFFECT_ATTRACT: - if (!isDoubleBattle && BattlerWillFaintFromSecondaryDamage(battlerDef, AI_DATA->defAbility) + if (!isDoubleBattle && BattlerWillFaintFromSecondaryDamage(battlerDef, AI_DATA->abilities[battlerDef]) && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Target goes first break; // Don't use if the attract won't have a change to activate @@ -3974,15 +3969,15 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (isDoubleBattle) { if (IsHazardMoveEffect(gBattleMoves[AI_DATA->partnerMove].effect) // Partner is going to set up hazards - && AI_WhoStrikesFirst(battlerAtk, AI_DATA->battlerAtkPartner) == AI_IS_SLOWER) // Partner going first + && AI_WhoStrikesFirst(battlerAtk, BATTLE_PARTNER(battlerAtk)) == AI_IS_SLOWER) // Partner going first break; // Don't use Defog if partner is going to set up hazards } // check defog lowering evasion - if (ShouldLowerEvasion(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (ShouldLowerEvasion(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) { if (gBattleMons[battlerDef].statStages[STAT_EVASION] > 7 - || HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + || HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) score += 2; // encourage lowering evasion if they are evasive or we have a move with low accuracy else score++; @@ -4003,11 +3998,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_FOLLOW_ME: if (isDoubleBattle && move != MOVE_SPOTLIGHT - && !IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility) - && (move != MOVE_RAGE_POWDER || IsAffectedByPowder(battlerDef, AI_DATA->defAbility, AI_DATA->defHoldEffect)) // Rage Powder doesn't affect powder immunities - && IsBattlerAlive(AI_DATA->battlerAtkPartner)) + && !IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]) + && (move != MOVE_RAGE_POWDER || IsAffectedByPowder(battlerDef, AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerDef])) // Rage Powder doesn't affect powder immunities + && IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) { - u16 predictedMoveOnPartner = gLastMoves[AI_DATA->battlerAtkPartner]; + u16 predictedMoveOnPartner = gLastMoves[BATTLE_PARTNER(battlerAtk)]; if (predictedMoveOnPartner != MOVE_NONE && !IS_MOVE_STATUS(predictedMoveOnPartner)) score += 3; } @@ -4028,7 +4023,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_TRICK: case EFFECT_BESTOW: - switch (AI_DATA->atkHoldEffect) + switch (AI_DATA->holdEffects[battlerAtk]) { case HOLD_EFFECT_CHOICE_SCARF: score += 2; // assume its beneficial @@ -4042,15 +4037,15 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 2; break; case HOLD_EFFECT_TOXIC_ORB: - if (!ShouldPoisonSelf(battlerAtk, AI_DATA->atkAbility)) + if (!ShouldPoisonSelf(battlerAtk, AI_DATA->abilities[battlerAtk])) score += 2; break; case HOLD_EFFECT_FLAME_ORB: - if (!ShouldBurnSelf(battlerAtk, AI_DATA->atkAbility) && AI_CanBeBurned(battlerAtk, AI_DATA->defAbility)) + if (!ShouldBurnSelf(battlerAtk, AI_DATA->abilities[battlerAtk]) && AI_CanBeBurned(battlerAtk, AI_DATA->abilities[battlerDef])) score += 2; break; case HOLD_EFFECT_BLACK_SLUDGE: - if (!IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON) && AI_DATA->defAbility != ABILITY_MAGIC_GUARD) + if (!IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON) && AI_DATA->abilities[battlerDef] != ABILITY_MAGIC_GUARD) score += 3; break; case HOLD_EFFECT_IRON_BALL: @@ -4062,9 +4057,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 3; break; case HOLD_EFFECT_UTILITY_UMBRELLA: - if (AI_DATA->atkAbility != ABILITY_SOLAR_POWER && AI_DATA->atkAbility != ABILITY_DRY_SKIN && AI_WeatherHasEffect()) + if (AI_DATA->abilities[battlerAtk] != ABILITY_SOLAR_POWER && AI_DATA->abilities[battlerAtk] != ABILITY_DRY_SKIN && AI_WeatherHasEffect()) { - switch (AI_DATA->defAbility) + switch (AI_DATA->abilities[battlerDef]) { case ABILITY_SWIFT_SWIM: if (gBattleWeather & B_WEATHER_RAIN) @@ -4081,26 +4076,26 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case HOLD_EFFECT_EJECT_BUTTON: //if (!IsRaidBattle() && IsDynamaxed(battlerDef) && gNewBS->dynamaxData.timer[battlerDef] > 1 && if (HasDamagingMove(battlerAtk) - || (isDoubleBattle && IsBattlerAlive(AI_DATA->battlerAtkPartner) && HasDamagingMove(AI_DATA->battlerAtkPartner))) + || (isDoubleBattle && IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) && HasDamagingMove(BATTLE_PARTNER(battlerAtk)))) score += 2; // Force 'em out next turn break; default: - if (move != MOVE_BESTOW && AI_DATA->atkItem == ITEM_NONE) + if (move != MOVE_BESTOW && AI_DATA->items[battlerAtk] == ITEM_NONE) { - switch (AI_DATA->defHoldEffect) + switch (AI_DATA->holdEffects[battlerDef]) { case HOLD_EFFECT_CHOICE_BAND: break; case HOLD_EFFECT_TOXIC_ORB: - if (ShouldPoisonSelf(battlerAtk, AI_DATA->atkAbility)) + if (ShouldPoisonSelf(battlerAtk, AI_DATA->abilities[battlerAtk])) score += 2; break; case HOLD_EFFECT_FLAME_ORB: - if (ShouldBurnSelf(battlerAtk, AI_DATA->atkAbility)) + if (ShouldBurnSelf(battlerAtk, AI_DATA->abilities[battlerAtk])) score += 2; break; case HOLD_EFFECT_BLACK_SLUDGE: - if (IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON) || AI_DATA->atkAbility == ABILITY_MAGIC_GUARD) + if (IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON) || AI_DATA->abilities[battlerAtk] == ABILITY_MAGIC_GUARD) score += 3; break; case HOLD_EFFECT_IRON_BALL: @@ -4118,21 +4113,21 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_ROLE_PLAY: - if (!IsRolePlayBannedAbilityAtk(AI_DATA->atkAbility) - && !IsRolePlayBannedAbility(AI_DATA->defAbility) - && !IsAbilityOfRating(AI_DATA->atkAbility, 5) - && IsAbilityOfRating(AI_DATA->defAbility, 5)) + if (!IsRolePlayBannedAbilityAtk(AI_DATA->abilities[battlerAtk]) + && !IsRolePlayBannedAbility(AI_DATA->abilities[battlerDef]) + && !IsAbilityOfRating(AI_DATA->abilities[battlerAtk], 5) + && IsAbilityOfRating(AI_DATA->abilities[battlerDef], 5)) score += 2; break; case EFFECT_INGRAIN: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_BIG_ROOT) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_BIG_ROOT) score += 3; else score++; break; case EFFECT_SUPERPOWER: case EFFECT_OVERHEAT: - if (AI_DATA->atkAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) score += 10; break; case EFFECT_MAGIC_COAT: @@ -4144,12 +4139,12 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; if (IsRecycleEncouragedItem(GetUsedHeldItem(battlerAtk))) score++; - if (AI_DATA->atkAbility == ABILITY_RIPEN) + if (AI_DATA->abilities[battlerAtk] == ABILITY_RIPEN) { u16 item = GetUsedHeldItem(battlerAtk); u16 toHeal = (ItemId_GetHoldEffectParam(item) == 10) ? 10 : gBattleMons[battlerAtk].maxHP / ItemId_GetHoldEffectParam(item); - if (IsStatBoostingBerry(item) && atkHpPercent > 60) + if (IsStatBoostingBerry(item) && AI_DATA->hpPercents[battlerAtk] > 60) score++; else if (ShouldRestoreHpBerry(battlerAtk, item) && !CanAIFaintTarget(battlerAtk, battlerDef, 0) && ((GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 0 && CanTargetFaintAiWithMod(battlerDef, battlerAtk, 0, 0)) @@ -4166,9 +4161,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; break; case EFFECT_KNOCK_OFF: - if (CanKnockOffItem(battlerDef, AI_DATA->defItem)) + if (CanKnockOffItem(battlerDef, AI_DATA->items[battlerDef])) { - switch (AI_DATA->defHoldEffect) + switch (AI_DATA->holdEffects[battlerDef]) { case HOLD_EFFECT_IRON_BALL: if (HasMoveEffect(battlerDef, EFFECT_FLING)) @@ -4184,19 +4179,19 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_SKILL_SWAP: - if (GetAbilityRating(AI_DATA->defAbility) > GetAbilityRating(AI_DATA->atkAbility)) + if (GetAbilityRating(AI_DATA->abilities[battlerDef]) > GetAbilityRating(AI_DATA->abilities[battlerAtk])) score++; break; case EFFECT_WORRY_SEED: case EFFECT_GASTRO_ACID: case EFFECT_SIMPLE_BEAM: - if (IsAbilityOfRating(AI_DATA->defAbility, 5)) + if (IsAbilityOfRating(AI_DATA->abilities[battlerDef], 5)) score += 2; break; case EFFECT_ENTRAINMENT: - if (IsAbilityOfRating(AI_DATA->defAbility, 5) || GetAbilityRating(AI_DATA->atkAbility) <= 0) + if (IsAbilityOfRating(AI_DATA->abilities[battlerDef], 5) || GetAbilityRating(AI_DATA->abilities[battlerAtk]) <= 0) { - if (AI_DATA->defAbility != AI_DATA->atkAbility && !(gStatuses3[battlerDef] & STATUS3_GASTRO_ACID)) + if (AI_DATA->abilities[battlerDef] != AI_DATA->abilities[battlerAtk] && !(gStatuses3[battlerDef] & STATUS3_GASTRO_ACID)) score += 2; } break; @@ -4236,11 +4231,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_TICKLE: if (gBattleMons[battlerDef].statStages[STAT_DEF] > 4 && HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL) - && AI_DATA->defAbility != ABILITY_CONTRARY && ShouldLowerDefense(battlerAtk, battlerDef, AI_DATA->defAbility)) + && AI_DATA->abilities[battlerDef] != ABILITY_CONTRARY && ShouldLowerDefense(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) { score += 2; } - else if (ShouldLowerAttack(battlerAtk, battlerDef, AI_DATA->defAbility)) + else if (ShouldLowerAttack(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) { score += 2; } @@ -4258,7 +4253,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPDEF, &score); break; case EFFECT_GEOMANCY: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_POWER_HERB) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_POWER_HERB) score += 3; //fallthrough case EFFECT_QUIVER_DANCE: @@ -4267,7 +4262,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPDEF, &score); break; case EFFECT_SHELL_SMASH: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_POWER_HERB) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_POWER_HERB) score += 3; IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPEED, &score); @@ -4345,15 +4340,15 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_BUG_BITE: // And pluck - if (gBattleMons[battlerDef].status2 & STATUS2_SUBSTITUTE || AI_DATA->defAbility == ABILITY_STICKY_HOLD) + if (gBattleMons[battlerDef].status2 & STATUS2_SUBSTITUTE || AI_DATA->abilities[battlerDef] == ABILITY_STICKY_HOLD) break; - else if (ItemId_GetPocket(AI_DATA->defItem) == POCKET_BERRIES) + else if (ItemId_GetPocket(AI_DATA->items[battlerDef]) == POCKET_BERRIES) score += 3; break; case EFFECT_INCINERATE: - if (gBattleMons[battlerDef].status2 & STATUS2_SUBSTITUTE || AI_DATA->defAbility == ABILITY_STICKY_HOLD) + if (gBattleMons[battlerDef].status2 & STATUS2_SUBSTITUTE || AI_DATA->abilities[battlerDef] == ABILITY_STICKY_HOLD) break; - else if (ItemId_GetPocket(AI_DATA->defItem) == POCKET_BERRIES || AI_DATA->defHoldEffect == HOLD_EFFECT_GEMS) + else if (ItemId_GetPocket(AI_DATA->items[battlerDef]) == POCKET_BERRIES || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_GEMS) score += 3; break; case EFFECT_SMACK_DOWN: @@ -4362,9 +4357,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_RELIC_SONG: #if (defined SPECIES_MELOETTA && defined SPECIES_MELOETTA_PIROUETTE) - if (AI_DATA->atkSpecies == SPECIES_MELOETTA && gBattleMons[battlerDef].defense < gBattleMons[battlerDef].spDefense) + if (gBattleMons[battlerAtk].species == SPECIES_MELOETTA && gBattleMons[battlerDef].defense < gBattleMons[battlerDef].spDefense) score += 3; // Change to pirouette if can do more damage - else if (AI_DATA->atkSpecies == SPECIES_MELOETTA_PIROUETTE && gBattleMons[battlerDef].spDefense < gBattleMons[battlerDef].defense) + else if (gBattleMons[battlerAtk].species == SPECIES_MELOETTA_PIROUETTE && gBattleMons[battlerDef].spDefense < gBattleMons[battlerDef].defense) score += 3; // Change to Aria if can do more damage #endif break; @@ -4376,13 +4371,13 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_GRASSY_TERRAIN: case EFFECT_PSYCHIC_TERRAIN: score += 2; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_TERRAIN_EXTENDER) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_TERRAIN_EXTENDER) score += 2; break; case EFFECT_PLEDGE: if (isDoubleBattle) { - if (HasMoveEffect(AI_DATA->battlerAtkPartner, EFFECT_PLEDGE)) + if (HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_PLEDGE)) score += 3; // Partner might use pledge move } break; @@ -4394,9 +4389,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_MAGIC_ROOM: score++; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_NONE && AI_DATA->defHoldEffect != HOLD_EFFECT_NONE) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_NONE && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_NONE) score++; - if (isDoubleBattle && AI_DATA->atkPartnerHoldEffect == HOLD_EFFECT_NONE && AI_DATA->defPartnerHoldEffect != HOLD_EFFECT_NONE) + if (isDoubleBattle && AI_DATA->holdEffects[BATTLE_PARTNER(battlerAtk)] == HOLD_EFFECT_NONE && AI_DATA->holdEffects[BATTLE_PARTNER(battlerDef)] != HOLD_EFFECT_NONE) score++; break; case EFFECT_WONDER_ROOM: @@ -4409,28 +4404,28 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { if (HasSleepMoveWithLowAccuracy(battlerAtk, battlerDef)) // Has Gravity for a move like Hypnosis IncreaseSleepScore(battlerAtk, battlerDef, move, &score); - else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, FALSE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, FALSE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) score += 2; else score++; } break; case EFFECT_ION_DELUGE: - if ((AI_DATA->atkAbility == ABILITY_VOLT_ABSORB - || AI_DATA->atkAbility == ABILITY_MOTOR_DRIVE - || AI_DATA->atkAbility == ABILITY_LIGHTNING_ROD) + if ((AI_DATA->abilities[battlerAtk] == ABILITY_VOLT_ABSORB + || AI_DATA->abilities[battlerAtk] == ABILITY_MOTOR_DRIVE + || AI_DATA->abilities[battlerAtk] == ABILITY_LIGHTNING_ROD) && gBattleMoves[predictedMove].type == TYPE_NORMAL) score += 2; break; case EFFECT_FLING: /* TODO - switch (gFlingTable[AI_DATA->atkItem].effect) + switch (gFlingTable[AI_DATA->items[battlerAtk]].effect) { case MOVE_EFFECT_BURN: IncreaseBurnScore(battlerAtk, battlerDef, move, &score); break; case MOVE_EFFECT_FLINCH: - score += ShouldTryToFlinch(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, move); + score += ShouldTryToFlinch(battlerAtk, battlerDef, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], move); break; case MOVE_EFFECT_PARALYSIS: IncreaseParalyzeScore(battlerAtk, battlerDef, move, &score); @@ -4450,7 +4445,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 3; break; case EFFECT_EMBARGO: - if (AI_DATA->defHoldEffect != HOLD_EFFECT_NONE) + if (AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_NONE) score++; break; case EFFECT_POWDER: @@ -4458,7 +4453,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 3; break; case EFFECT_TELEKINESIS: - if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, FALSE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect) + if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, FALSE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef]) || !IsBattlerGrounded(battlerDef)) score++; break; @@ -4471,8 +4466,8 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_HEAL_BLOCK: if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER && predictedMove != MOVE_NONE && IsHealingMoveEffect(gBattleMoves[predictedMove].effect)) score += 3; // Try to cancel healing move - else if (HasHealingEffect(battlerDef) || AI_DATA->defHoldEffect == HOLD_EFFECT_LEFTOVERS - || (AI_DATA->defHoldEffect == HOLD_EFFECT_BLACK_SLUDGE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON))) + else if (HasHealingEffect(battlerDef) || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_LEFTOVERS + || (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_BLACK_SLUDGE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON))) score += 2; break; case EFFECT_SOAK: @@ -4480,14 +4475,14 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 2; // Get some super effective moves break; case EFFECT_THIRD_TYPE: - if (AI_DATA->defAbility == ABILITY_WONDER_GUARD) + if (AI_DATA->abilities[battlerDef] == ABILITY_WONDER_GUARD) score += 2; // Give target more weaknesses break; case EFFECT_ELECTRIFY: if (predictedMove != MOVE_NONE && gBattleMoves[predictedMove].type == TYPE_NORMAL - && (AI_DATA->atkAbility == ABILITY_VOLT_ABSORB - || AI_DATA->atkAbility == ABILITY_MOTOR_DRIVE - || AI_DATA->atkAbility == ABILITY_LIGHTNING_ROD)) + && (AI_DATA->abilities[battlerAtk] == ABILITY_VOLT_ABSORB + || AI_DATA->abilities[battlerAtk] == ABILITY_MOTOR_DRIVE + || AI_DATA->abilities[battlerAtk] == ABILITY_LIGHTNING_ROD)) { score += 3; } @@ -4505,7 +4500,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_QUASH: if (isDoubleBattle - && AI_WhoStrikesFirst(AI_DATA->battlerAtkPartner, battlerDef) == AI_IS_SLOWER) // Attacker partner wouldn't go before target + && AI_WhoStrikesFirst(BATTLE_PARTNER(battlerAtk), battlerDef) == AI_IS_SLOWER) // Attacker partner wouldn't go before target score++; break; case EFFECT_TAILWIND: @@ -4549,10 +4544,10 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_FLAME_BURST: if (isDoubleBattle) { - if (IsBattlerAlive(AI_DATA->battlerDefPartner) - && GetHealthPercentage(AI_DATA->battlerDefPartner) < 12 - && AI_DATA->defPartnerAbility != ABILITY_MAGIC_GUARD - && !IS_BATTLER_OF_TYPE(AI_DATA->battlerDefPartner, TYPE_FIRE)) + if (IsBattlerAlive(BATTLE_PARTNER(battlerDef)) + && AI_DATA->hpPercents[BATTLE_PARTNER(battlerDef)] < 12 + && AI_DATA->abilities[BATTLE_PARTNER(battlerDef)] != ABILITY_MAGIC_GUARD + && !IS_BATTLER_OF_TYPE(BATTLE_PARTNER(battlerDef), TYPE_FIRE)) score++; } break; @@ -4563,11 +4558,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_TWO_TURNS_ATTACK: case EFFECT_SKULL_BASH: case EFFECT_SOLAR_BEAM: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_POWER_HERB) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_POWER_HERB) score += 2; break; case EFFECT_COUNTER: - if (!IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility) && predictedMove != MOVE_NONE) + if (!IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]) && predictedMove != MOVE_NONE) { if (gDisableStructs[battlerDef].tauntTimer != 0) score++; // target must use damaging move @@ -4576,7 +4571,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_MIRROR_COAT: - if (!IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility) && predictedMove != MOVE_NONE) + if (!IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]) && predictedMove != MOVE_NONE) { if (gDisableStructs[battlerDef].tauntTimer != 0) score++; // target must use damaging move @@ -4587,9 +4582,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_FLAIL: if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Ai goes first { - if (GetHealthPercentage(battlerAtk) < 20) + if (AI_DATA->hpPercents[battlerAtk] < 20) score++; - else if (GetHealthPercentage(battlerAtk) < 8) + else if (AI_DATA->hpPercents[battlerAtk] < 8) score += 2; } break; @@ -4607,7 +4602,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_FOCUS_PUNCH: if (!isDoubleBattle && effectiveness > AI_EFFECTIVENESS_x0_5) { - if (IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility)) + if (IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef])) score += 2; else if (gBattleMons[battlerDef].status2 & (STATUS2_INFATUATION | STATUS2_CONFUSION)) score++; @@ -4629,10 +4624,10 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_ENDEAVOR: if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Opponent faster { - if (GetHealthPercentage(battlerAtk) < 40) + if (AI_DATA->hpPercents[battlerAtk] < 40) score++; } - else if (GetHealthPercentage(battlerAtk) < 50) + else if (AI_DATA->hpPercents[battlerAtk] < 50) { score++; } @@ -4824,7 +4819,7 @@ static s16 AI_PreferBatonPass(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { if (gBattleResults.battleTurnCounter == 0) score += 5; - else if (GetHealthPercentage(battlerAtk) < 60) + else if (AI_DATA->hpPercents[battlerAtk] < 60) score -= 10; else score++; @@ -4875,21 +4870,21 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (IsTargetingPartner(battlerAtk, battlerDef)) { if ((effect == EFFECT_HEAL_PULSE || effect == EFFECT_HIT_ENEMY_HEAL_ALLY) - || (moveType == TYPE_ELECTRIC && AI_DATA->atkPartnerAbility == ABILITY_VOLT_ABSORB) - || (moveType == TYPE_WATER && (AI_DATA->atkPartnerAbility == ABILITY_DRY_SKIN || AI_DATA->atkPartnerAbility == ABILITY_WATER_ABSORB))) + || (moveType == TYPE_ELECTRIC && AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_VOLT_ABSORB) + || (moveType == TYPE_WATER && (AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_DRY_SKIN || AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_WATER_ABSORB))) { - if (CanTargetFaintAi(FOE(battlerAtk), AI_DATA->battlerAtkPartner) - || (CanTargetFaintAi(BATTLE_PARTNER(FOE(battlerAtk)), AI_DATA->battlerAtkPartner))) + if (CanTargetFaintAi(FOE(battlerAtk), BATTLE_PARTNER(battlerAtk)) + || (CanTargetFaintAi(BATTLE_PARTNER(FOE(battlerAtk)), BATTLE_PARTNER(battlerAtk)))) score--; - if (GetHealthPercentage(battlerDef) <= 50) + if (AI_DATA->hpPercents[battlerDef] <= 50) score++; } } else { // Consider AI HP - if (GetHealthPercentage(battlerAtk) > 70) + if (AI_DATA->hpPercents[battlerAtk] > 70) { // high hp switch (effect) @@ -4915,7 +4910,7 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; } } - else if (GetHealthPercentage(battlerAtk) > 30) + else if (AI_DATA->hpPercents[battlerAtk] > 30) { // med hp if (IsStatRaisingEffect(effect) || IsStatLoweringEffect(effect)) @@ -4984,12 +4979,12 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else { - if (GetHealthPercentage(battlerDef) > 70) + if (AI_DATA->hpPercents[battlerDef] > 70) { // high HP ; // nothing yet } - else if (GetHealthPercentage(battlerDef) > 30) + else if (AI_DATA->hpPercents[battlerDef] > 30) { // med HP - check discouraged effects switch (effect) @@ -5088,7 +5083,7 @@ static s16 AI_Safari(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // First battle logic static s16 AI_FirstBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { - if (GetHealthPercentage(battlerDef) <= 20) + if (AI_DATA->hpPercents[battlerDef] <= 20) AI_Flee(); return score; diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index fb53bb801..54b368729 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -20,6 +20,8 @@ #include "constants/moves.h" #include "constants/items.h" +static u8 AI_GetEffectiveness(u16 multiplier); + // Const Data static const s8 sAiAbilityRatings[ABILITIES_COUNT] = { @@ -590,14 +592,14 @@ u32 GetHealthPercentage(u8 battlerId) bool32 AtMaxHp(u8 battlerId) { - if (GetHealthPercentage(battlerId) == 100) + if (AI_DATA->hpPercents[battlerId] == 100) return TRUE; return FALSE; } bool32 IsBattlerTrapped(u8 battler, bool8 checkSwitch) { - u8 holdEffect = AI_GetHoldEffect(battler); + u8 holdEffect = AI_DATA->holdEffects[battler]; if (IS_BATTLER_OF_TYPE(battler, TYPE_GHOST) || (checkSwitch && holdEffect == HOLD_EFFECT_SHED_SHELL) || (!checkSwitch && GetBattlerAbility(battler) == ABILITY_RUN_AWAY) @@ -658,7 +660,7 @@ bool32 MovesWithSplitUnusable(u32 attacker, u32 target, u32 split) { s32 i, moveType; u32 usable = 0; - u32 unusable = CheckMoveLimitations(attacker, 0, MOVE_LIMITATIONS_ALL); + u32 unusable = AI_DATA->moveLimitations[attacker]; u16 *moves = GetMovesArray(attacker); for (i = 0; i < MAX_MON_MOVES; i++) @@ -713,10 +715,11 @@ static bool32 AI_GetIfCrit(u32 move, u8 battlerAtk, u8 battlerDef) return isCrit; } -s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) +s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness) { s32 dmg, moveType, critDmg, normalDmg; s8 critChance; + u16 effectivenessMultiplier; SaveBattlerData(battlerAtk); SaveBattlerData(battlerDef); @@ -729,7 +732,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) GET_MOVE_TYPE(move, moveType); critChance = GetInverseCritChance(battlerAtk, battlerDef, move); - normalDmg = CalculateMoveDamage(move, battlerAtk, battlerDef, moveType, 0, FALSE, FALSE, FALSE); + normalDmg = CalculateMoveDamageAndEffectiveness(move, battlerAtk, battlerDef, moveType, &effectivenessMultiplier); critDmg = CalculateMoveDamage(move, battlerAtk, battlerDef, moveType, 0, TRUE, FALSE, FALSE); if(critChance == -1) @@ -742,26 +745,26 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) { case EFFECT_LEVEL_DAMAGE: case EFFECT_PSYWAVE: - dmg = gBattleMons[battlerAtk].level * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1); + dmg = gBattleMons[battlerAtk].level * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); break; case EFFECT_DRAGON_RAGE: - dmg = 40 * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1); + dmg = 40 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); break; case EFFECT_SONICBOOM: - dmg = 20 * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1); + dmg = 20 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); break; case EFFECT_MULTI_HIT: - dmg *= (AI_DATA->atkAbility == ABILITY_SKILL_LINK ? 5 : 3); + dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 5 : 3); break; case EFFECT_TRIPLE_KICK: - dmg *= (AI_DATA->atkAbility == ABILITY_SKILL_LINK ? 6 : 5); + dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 6 : 5); break; case EFFECT_ENDEAVOR: // If target has less HP than user, Endeavor does no damage dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp); break; case EFFECT_SUPER_FANG: - dmg = (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND + dmg = (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? max(2, gBattleMons[battlerDef].hp * 3 / 4) : max(1, gBattleMons[battlerDef].hp / 2)); break; @@ -778,6 +781,9 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) RestoreBattlerData(battlerAtk); RestoreBattlerData(battlerDef); + + // convert multiper to AI_EFFECTIVENESS_xX + *typeEffectiveness = AI_GetEffectiveness(effectivenessMultiplier); return dmg; } @@ -785,10 +791,10 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) // Checks if one of the moves has side effects or perks static u32 WhichMoveBetter(u32 move1, u32 move2) { - s32 defAbility = AI_GetAbility(gBattlerTarget); + s32 defAbility = AI_DATA->abilities[gBattlerTarget]; // Check if physical moves hurt. - if (AI_GetHoldEffect(sBattler_AI) != HOLD_EFFECT_PROTECTIVE_PADS + if (AI_DATA->holdEffects[sBattler_AI] != HOLD_EFFECT_PROTECTIVE_PADS && (BATTLE_HISTORY->itemEffects[gBattlerTarget] == HOLD_EFFECT_ROCKY_HELMET || defAbility == ABILITY_IRON_BARBS || defAbility == ABILITY_ROUGH_SKIN)) { @@ -868,7 +874,7 @@ u8 GetMoveDamageResult(u16 move) && sIgnoredPowerfulMoveEffects[i] == IGNORED_MOVES_END && gBattleMoves[gBattleMons[sBattler_AI].moves[checkedMove]].power != 0) { - moveDmgs[checkedMove] = AI_THINKING_STRUCT->simulatedDmg[sBattler_AI][gBattlerTarget][checkedMove]; + moveDmgs[checkedMove] = AI_DATA->simulatedDmg[sBattler_AI][gBattlerTarget][checkedMove]; } else { @@ -924,7 +930,7 @@ u8 GetMoveDamageResult(u16 move) u32 GetCurrDamageHpPercent(u8 battlerAtk, u8 battlerDef) { - int bestDmg = AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; + int bestDmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; return (bestDmg * 100) / gBattleMons[battlerDef].maxHP; } @@ -952,37 +958,28 @@ u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) u8 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) { - u8 damageVar; - u32 effectivenessMultiplier; - gMoveResultFlags = 0; - gCurrentMove = move; - effectivenessMultiplier = AI_GetTypeEffectiveness(gCurrentMove, battlerAtk, battlerDef); + return AI_GetEffectiveness(AI_GetTypeEffectiveness(move, battlerAtk, battlerDef)); +} - switch (effectivenessMultiplier) +static u8 AI_GetEffectiveness(u16 multiplier) +{ + switch (multiplier) { case UQ_4_12(0.0): default: - damageVar = AI_EFFECTIVENESS_x0; - break; + return AI_EFFECTIVENESS_x0; case UQ_4_12(0.25): - damageVar = AI_EFFECTIVENESS_x0_25; - break; + return AI_EFFECTIVENESS_x0_25; case UQ_4_12(0.5): - damageVar = AI_EFFECTIVENESS_x0_5; - break; + return AI_EFFECTIVENESS_x0_5; case UQ_4_12(1.0): - damageVar = AI_EFFECTIVENESS_x1; - break; + return AI_EFFECTIVENESS_x1; case UQ_4_12(2.0): - damageVar = AI_EFFECTIVENESS_x2; - break; + return AI_EFFECTIVENESS_x2; case UQ_4_12(4.0): - damageVar = AI_EFFECTIVENESS_x4; - break; + return AI_EFFECTIVENESS_x4; } - - return damageVar; } /* Checks to see if AI will move ahead of another battler @@ -1032,13 +1029,13 @@ u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2) bool32 CanTargetFaintAi(u8 battlerDef, u8 battlerAtk) { s32 i, dmg; - u32 unusable = CheckMoveLimitations(battlerDef, 0, MOVE_LIMITATIONS_ALL); + u32 unusable = AI_DATA->moveLimitations[battlerDef]; u16 *moves = gBattleResources->battleHistory->usedMoves[battlerDef]; for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && !(unusable & gBitTable[i]) - && AI_CalcDamage(moves[i], battlerDef, battlerAtk) >= gBattleMons[battlerAtk].hp) + && AI_DATA->simulatedDmg[battlerDef][battlerAtk][moves[i]] >= gBattleMons[battlerAtk].hp) { return TRUE; } @@ -1052,7 +1049,7 @@ bool32 CanTargetFaintAi(u8 battlerDef, u8 battlerAtk) bool32 CanAIFaintTarget(u8 battlerAtk, u8 battlerDef, u8 numHits) { s32 i, dmg; - u32 moveLimitations = CheckMoveLimitations(battlerAtk, 0, MOVE_LIMITATIONS_ALL); + u32 moveLimitations = AI_DATA->moveLimitations[battlerAtk]; u16 *moves = gBattleMons[battlerAtk].moves; for (i = 0; i < MAX_MON_MOVES; i++) @@ -1060,7 +1057,7 @@ bool32 CanAIFaintTarget(u8 battlerAtk, u8 battlerDef, u8 numHits) if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && !(moveLimitations & gBitTable[i])) { // Use the pre-calculated value in simulatedDmg instead of re-calculating it - dmg = AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][i]; + dmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][i]; if (numHits) dmg *= numHits; @@ -1076,9 +1073,13 @@ bool32 CanAIFaintTarget(u8 battlerAtk, u8 battlerDef, u8 numHits) bool32 CanMoveFaintBattler(u16 move, u8 battlerDef, u8 battlerAtk, u8 nHits) { s32 i, dmg; - u32 unusable = CheckMoveLimitations(battlerDef, 0, MOVE_LIMITATIONS_ALL); + u8 effectiveness; + u32 unusable = AI_DATA->moveLimitations[battlerDef]; - if (move != MOVE_NONE && move != 0xFFFF && !(unusable & gBitTable[i]) && AI_CalcDamage(move, battlerDef, battlerAtk) >= gBattleMons[battlerAtk].hp) + if (move != MOVE_NONE + && move != 0xFFFF + && !(unusable & gBitTable[i]) + && AI_CalcDamage(move, battlerDef, battlerAtk, &effectiveness) >= gBattleMons[battlerAtk].hp) return TRUE; return FALSE; @@ -1088,7 +1089,7 @@ bool32 CanMoveFaintBattler(u16 move, u8 battlerDef, u8 battlerAtk, u8 nHits) bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgMod) { u32 i; - u32 unusable = CheckMoveLimitations(battlerDef, 0, MOVE_LIMITATIONS_ALL); + u32 unusable = AI_DATA->moveLimitations[battlerDef]; s32 dmg; u16 *moves = gBattleResources->battleHistory->usedMoves[battlerDef]; u32 hpCheck = gBattleMons[battlerAtk].hp + hpMod; @@ -1098,7 +1099,7 @@ bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgM for (i = 0; i < MAX_MON_MOVES; i++) { - dmg = AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][i]; + dmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][i]; if (dmgMod) dmg *= dmgMod; @@ -1113,9 +1114,9 @@ bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgM bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability) { - if (IsBattlerAlive(battlerId) && AI_GetAbility(battlerId) == ability) + if (IsBattlerAlive(battlerId) && AI_DATA->abilities[battlerId] == ability) return TRUE; - else if (IsBattlerAlive(BATTLE_PARTNER(battlerId)) && AI_GetAbility(BATTLE_PARTNER(battlerId)) == ability) + else if (IsBattlerAlive(BATTLE_PARTNER(battlerId)) && AI_DATA->abilities[BATTLE_PARTNER(battlerId)] == ability) return TRUE; else return FALSE; @@ -1172,7 +1173,7 @@ u16 AI_GetHoldEffect(u32 battlerId) return HOLD_EFFECT_NONE; if (gFieldStatuses & STATUS_FIELD_MAGIC_ROOM) return HOLD_EFFECT_NONE; - if (AI_GetAbility(battlerId) == ABILITY_KLUTZ && !(gStatuses3[battlerId] & STATUS3_GASTRO_ACID)) + if (AI_DATA->abilities[battlerId] == ABILITY_KLUTZ && !(gStatuses3[battlerId] & STATUS3_GASTRO_ACID)) return HOLD_EFFECT_NONE; return holdEffect; @@ -1190,7 +1191,7 @@ bool32 AI_IsTerrainAffected(u8 battlerId, u32 flags) // different from IsBattlerGrounded in that we don't always know battler's hold effect or ability bool32 AI_IsBattlerGrounded(u8 battlerId) { - u32 holdEffect = AI_GetHoldEffect(battlerId); + u32 holdEffect = AI_DATA->holdEffects[battlerId]; if (holdEffect == HOLD_EFFECT_IRON_BALL) return TRUE; @@ -1206,7 +1207,7 @@ bool32 AI_IsBattlerGrounded(u8 battlerId) return FALSE; else if (holdEffect == HOLD_EFFECT_AIR_BALLOON) return FALSE; - else if (AI_GetAbility(battlerId) == ABILITY_LEVITATE) + else if (AI_DATA->abilities[battlerId] == ABILITY_LEVITATE) return FALSE; else if (IS_BATTLER_OF_TYPE(battlerId, TYPE_FLYING)) return FALSE; @@ -1241,14 +1242,7 @@ bool32 AI_WeatherHasEffect(void) if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_UNAWARE) return TRUE; // AI doesn't understand weather supression (handicap) - // need to manually check since we don't necessarily know opponent ability - for (i = 0; i < gBattlersCount; i++) - { - if (IsBattlerAlive(i) - && (AI_GetAbility(i) == ABILITY_AIR_LOCK || AI_GetAbility(i) == ABILITY_CLOUD_NINE)) - return FALSE; - } - return TRUE; + return WEATHER_HAS_EFFECT; // weather damping abilities are announced } bool32 IsAromaVeilProtectedMove(u16 move) @@ -1350,70 +1344,10 @@ bool32 IsMoveRedirectionPrevented(u16 move, u16 atkAbility) return FALSE; } -// differs from GetTotalAccuracy in that we need to check AI history for item, ability, etc -u32 AI_GetMoveAccuracy(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u8 atkHoldEffect, u8 defHoldEffect, u16 move) +u32 AI_GetMoveAccuracy(u8 battlerAtk, u8 battlerDef, u16 move) { - u32 calc, moveAcc, atkParam, defParam; - s8 buff, accStage, evasionStage; - - gPotentialItemEffectBattler = battlerDef; - accStage = gBattleMons[battlerAtk].statStages[STAT_ACC]; - evasionStage = gBattleMons[battlerDef].statStages[STAT_EVASION]; - if (atkAbility == ABILITY_UNAWARE) - evasionStage = DEFAULT_STAT_STAGE; - if (gBattleMoves[move].flags & FLAG_STAT_STAGES_IGNORED) - evasionStage = DEFAULT_STAT_STAGE; - if (defAbility == ABILITY_UNAWARE) - accStage = DEFAULT_STAT_STAGE; - - if (gBattleMons[battlerDef].status2 & STATUS2_FORESIGHT || gStatuses3[battlerDef] & STATUS3_MIRACLE_EYED) - buff = accStage; - else - buff = accStage + DEFAULT_STAT_STAGE - evasionStage; - - if (buff < MIN_STAT_STAGE) - buff = MIN_STAT_STAGE; - if (buff > MAX_STAT_STAGE) - buff = MAX_STAT_STAGE; - - moveAcc = gBattleMoves[move].accuracy; - // Check Thunder and Hurricane on sunny weather. - if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SUN - && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) - moveAcc = 50; - // Check Wonder Skin. - if (defAbility == ABILITY_WONDER_SKIN && gBattleMoves[move].power == 0) - moveAcc = 50; - - calc = gAccuracyStageRatios[buff].dividend * moveAcc; - calc /= gAccuracyStageRatios[buff].divisor; - - if (atkAbility == ABILITY_COMPOUND_EYES) - calc = (calc * 130) / 100; // 1.3 compound eyes boost - else if (atkAbility == ABILITY_VICTORY_STAR) - calc = (calc * 110) / 100; // 1.1 victory star boost - if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) && GetBattlerAbility(BATTLE_PARTNER(battlerAtk)) == ABILITY_VICTORY_STAR) - calc = (calc * 110) / 100; // 1.1 ally's victory star boost - - if (defAbility == ABILITY_SAND_VEIL && WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SANDSTORM) - calc = (calc * 80) / 100; // 1.2 sand veil loss - else if (defAbility == ABILITY_SNOW_CLOAK && WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_HAIL) - calc = (calc * 80) / 100; // 1.2 snow cloak loss - else if (defAbility == ABILITY_TANGLED_FEET && gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) - calc = (calc * 50) / 100; // 1.5 tangled feet loss - - if (atkAbility == ABILITY_HUSTLE && IS_MOVE_PHYSICAL(move)) - calc = (calc * 80) / 100; // 1.2 hustle loss - - if (defHoldEffect == HOLD_EFFECT_EVASION_UP) - calc = (calc * (100 - defParam)) / 100; - - if (atkHoldEffect == HOLD_EFFECT_WIDE_LENS) - calc = (calc * (100 + atkParam)) / 100; - else if (atkHoldEffect == HOLD_EFFECT_ZOOM_LENS && GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef)); - calc = (calc * (100 + atkParam)) / 100; - - return calc; + return GetTotalAccuracy(battlerAtk, battlerDef, move, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], + AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef]); } bool32 IsSemiInvulnerable(u8 battlerDef, u16 move) @@ -1441,7 +1375,7 @@ bool32 IsMoveEncouragedToHit(u8 battlerAtk, u8 battlerDef, u16 move) if (gStatuses3[battlerDef] & STATUS3_ALWAYS_HITS || gDisableStructs[battlerDef].battlerWithSureHit == battlerAtk) return TRUE; - if (AI_GetAbility(battlerDef) == ABILITY_NO_GUARD || AI_GetAbility(battlerAtk) == ABILITY_NO_GUARD) + if (AI_DATA->abilities[battlerDef] == ABILITY_NO_GUARD || AI_DATA->abilities[battlerAtk] == ABILITY_NO_GUARD) return TRUE; if (B_TOXIC_NEVER_MISS >= GEN_6 && gBattleMoves[move].effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON)) @@ -1466,12 +1400,13 @@ bool32 IsMoveEncouragedToHit(u8 battlerAtk, u8 battlerDef, u16 move) return FALSE; } -bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u32 accuracy, u16 move) +bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u16 move) { - u32 holdEffect = AI_GetHoldEffect(battlerDef); + u32 holdEffect = AI_DATA->holdEffects[battlerDef]; + u32 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, move); gPotentialItemEffectBattler = battlerDef; - if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < GetBattlerHoldEffectParam(battlerDef)) + if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < AI_DATA->holdEffectParams[battlerDef]) return FALSE; //probabilistically speaking, focus band should activate so dont OHKO else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && AtMaxHp(battlerDef)) return FALSE; @@ -1599,7 +1534,7 @@ void ProtectChecks(u8 battlerAtk, u8 battlerDef, u16 move, u16 predictedMove, s1 { // TODO more sophisticated logic u16 predictedEffect = gBattleMoves[predictedMove].effect; - u8 defAbility = AI_GetAbility(battlerDef); + u8 defAbility = AI_DATA->abilities[battlerDef]; u32 uses = gDisableStructs[battlerAtk].protectUses; /*if (GetMoveResultFlags(predictedMove) & (MOVE_RESULT_NO_EFFECT | MOVE_RESULT_MISSED)) @@ -1814,7 +1749,7 @@ bool32 ShouldLowerEvasion(u8 battlerAtk, u8 battlerDef, u16 defAbility) bool32 CanIndexMoveFaintTarget(u8 battlerAtk, u8 battlerDef, u8 index, u8 numHits) { - s32 dmg = AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][index]; + s32 dmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][index]; if (numHits) dmg *= numHits; @@ -1908,7 +1843,7 @@ bool32 HasMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef, u8 accCheck, bool32 { s32 i; u16 *moves = GetMovesArray(battlerAtk); - u8 moveLimitations = CheckMoveLimitations(battlerAtk, 0, MOVE_LIMITATIONS_ALL); + u8 moveLimitations = AI_DATA->moveLimitations[battlerAtk]; for (i = 0; i < MAX_MON_MOVES; i++) { @@ -1923,7 +1858,7 @@ bool32 HasMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef, u8 accCheck, bool32 || gBattleMoves[moves[i]].target & (MOVE_TARGET_USER | MOVE_TARGET_OPPONENTS_FIELD)) continue; - if (AI_GetMoveAccuracy(battlerAtk, battlerDef, atkAbility, defAbility, atkHoldEffect, defHoldEffect, moves[i]) <= accCheck) + if (AI_GetMoveAccuracy(battlerAtk, battlerDef, moves[i]) <= accCheck) return TRUE; } } @@ -1933,7 +1868,7 @@ bool32 HasMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef, u8 accCheck, bool32 bool32 HasSleepMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef) { - u8 moveLimitations = CheckMoveLimitations(battlerAtk, 0, MOVE_LIMITATIONS_ALL); + u8 moveLimitations = AI_DATA->moveLimitations[battlerAtk]; u32 i; u16 *moves = GetMovesArray(battlerAtk); @@ -1944,7 +1879,7 @@ bool32 HasSleepMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef) if (!(gBitTable[i] & moveLimitations)) { if (gBattleMoves[moves[i]].effect == EFFECT_SLEEP - && AI_GetMoveAccuracy(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect, moves[i]) < 85) + && AI_GetMoveAccuracy(battlerAtk, battlerDef, moves[i]) < 85) return TRUE; } } @@ -2259,7 +2194,7 @@ static u32 GetTrapDamage(u8 battlerId) { // ai has no knowledge about turns remaining u32 damage = 0; - u32 holdEffect = AI_GetHoldEffect(gBattleStruct->wrappedBy[battlerId]); + u32 holdEffect = AI_DATA->holdEffects[gBattleStruct->wrappedBy[battlerId]]; if (gBattleMons[battlerId].status2 & STATUS2_WRAPPED) { if (holdEffect == HOLD_EFFECT_BINDING_BAND) @@ -2277,7 +2212,7 @@ static u32 GetPoisonDamage(u8 battlerId) { u32 damage = 0; - if (AI_GetAbility(battlerId) == ABILITY_POISON_HEAL) + if (AI_DATA->abilities[battlerId] == ABILITY_POISON_HEAL) return damage; if (gBattleMons[battlerId].status1 & STATUS1_POISON) @@ -2323,8 +2258,8 @@ static bool32 BattlerAffectedByHail(u8 battlerId, u16 ability) static u32 GetWeatherDamage(u8 battlerId) { - u32 ability = AI_GetAbility(battlerId); - u32 holdEffect = AI_GetHoldEffect(battlerId); + u32 ability = AI_DATA->abilities[battlerId]; + u32 holdEffect = AI_DATA->holdEffects[battlerId]; u32 damage = 0; if (!AI_WeatherHasEffect()) return 0; @@ -2358,7 +2293,7 @@ u32 GetBattlerSecondaryDamage(u8 battlerId) { u32 secondaryDamage; - if (AI_GetAbility(battlerId) == ABILITY_MAGIC_GUARD) + if (AI_DATA->abilities[battlerId] == ABILITY_MAGIC_GUARD) return FALSE; secondaryDamage = GetLeechSeedDamage(battlerId) @@ -2485,13 +2420,13 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo return PIVOT; // Won't get the two turns, pivot if (!IS_MOVE_STATUS(move) && (shouldSwitch - || (AtMaxHp(battlerDef) && (AI_DATA->defHoldEffect == HOLD_EFFECT_FOCUS_SASH + || (AtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH || defAbility == ABILITY_STURDY || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD)))) return PIVOT; // pivot to break sash/sturdy/multiscale } else if (!hasStatBoost) { - if (!IS_MOVE_STATUS(move) && (AtMaxHp(battlerDef) && (AI_DATA->defHoldEffect == HOLD_EFFECT_FOCUS_SASH + if (!IS_MOVE_STATUS(move) && (AtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH || defAbility == ABILITY_STURDY || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD))) return PIVOT; // pivot to break sash/sturdy/multiscale @@ -2502,7 +2437,7 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo if (gSideStatuses[battlerAtk] & SIDE_STATUS_SPIKES && switchScore >= SWITCHING_INCREASE_CAN_REMOVE_HAZARDS) return PIVOT;*/ - /*if (BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->atkAbility) && switchScore >= SWITCHING_INCREASE_WALLS_FOE) + /*if (BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->abilities[battlerAtk]) && switchScore >= SWITCHING_INCREASE_WALLS_FOE) return PIVOT;*/ /*if (IsClassDamager(class) && switchScore >= SWITCHING_INCREASE_HAS_SUPER_EFFECTIVE_MOVE) @@ -2545,7 +2480,7 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo { if (CanAIFaintTarget(battlerAtk, battlerDef, 0)) { - if (!BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->atkAbility)) + if (!BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->abilities[battlerAtk])) return CAN_TRY_PIVOT; // Use this move to KO if you must } else // Can't KO the foe @@ -2557,7 +2492,7 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo { if (CanAIFaintTarget(battlerAtk, battlerDef, 0)) { - if (!BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->atkAbility) // This is the only move that can KO + if (!BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->abilities[battlerAtk]) // This is the only move that can KO && !hasStatBoost) //You're not wasting a valuable stat boost { return CAN_TRY_PIVOT; @@ -2568,7 +2503,7 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo // can knock out foe in 2 hits if (IS_MOVE_STATUS(move) && (shouldSwitch //Damaging move //&& (switchScore >= SWITCHING_INCREASE_RESIST_ALL_MOVES + SWITCHING_INCREASE_KO_FOE //remove hazards - || (AI_DATA->defHoldEffect == HOLD_EFFECT_FOCUS_SASH && AtMaxHp(battlerDef)))) + || (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH && AtMaxHp(battlerDef)))) return DONT_PIVOT; // Pivot to break the sash else return CAN_TRY_PIVOT; @@ -2637,7 +2572,7 @@ bool32 CanKnockOffItem(u8 battler, u16 item) )) && GetBattlerSide(battler) == B_SIDE_PLAYER) return FALSE; - if (AI_GetAbility(battler) == ABILITY_STICKY_HOLD) + if (AI_DATA->abilities[battler] == ABILITY_STICKY_HOLD) return FALSE; if (!CanBattlerGetOrLoseItem(battler, item)) @@ -2684,13 +2619,13 @@ bool32 AI_CanPutToSleep(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, static bool32 AI_CanPoisonType(u8 battlerAttacker, u8 battlerTarget) { - return ((AI_GetAbility(battlerAttacker) == ABILITY_CORROSION && gBattleMoves[gCurrentMove].split == SPLIT_STATUS) + return ((AI_DATA->abilities[battlerAttacker] == ABILITY_CORROSION && gBattleMoves[gCurrentMove].split == SPLIT_STATUS) || !(IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON) || IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL))); } static bool32 AI_CanBePoisoned(u8 battlerAtk, u8 battlerDef) { - u16 ability = AI_GetAbility(battlerDef); + u16 ability = AI_DATA->abilities[battlerDef]; if (!(AI_CanPoisonType(battlerAtk, battlerDef)) || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD @@ -2729,7 +2664,7 @@ bool32 AI_CanPoison(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 return FALSE; else if (defAbility != ABILITY_CORROSION && (IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON) || IS_BATTLER_OF_TYPE(battlerDef, TYPE_STEEL))) return FALSE; - else if (IsValidDoubleBattle(battlerAtk) && AI_GetAbility(BATTLE_PARTNER(battlerDef)) == ABILITY_PASTEL_VEIL) + else if (IsValidDoubleBattle(battlerAtk) && AI_DATA->abilities[BATTLE_PARTNER(battlerDef)] == ABILITY_PASTEL_VEIL) return FALSE; return TRUE; @@ -2854,7 +2789,7 @@ u32 ShouldTryToFlinch(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbili bool32 ShouldTrap(u8 battlerAtk, u8 battlerDef, u16 move) { - if (BattlerWillFaintFromSecondaryDamage(battlerDef, AI_DATA->defAbility)) + if (BattlerWillFaintFromSecondaryDamage(battlerDef, AI_DATA->abilities[battlerDef])) return TRUE; // battler is taking secondary damage with low HP if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_STALL) @@ -2868,11 +2803,11 @@ bool32 ShouldTrap(u8 battlerAtk, u8 battlerDef, u16 move) bool32 ShouldFakeOut(u8 battlerAtk, u8 battlerDef, u16 move) { - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_CHOICE_BAND && CountUsablePartyMons(battlerAtk) == 0) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CHOICE_BAND && CountUsablePartyMons(battlerAtk) == 0) return FALSE; // don't lock attacker into fake out if can't switch out if (gDisableStructs[battlerAtk].isFirstTurn - && ShouldTryToFlinch(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, move) + && ShouldTryToFlinch(battlerAtk, battlerDef, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], move) && !DoesSubstituteBlockMove(battlerAtk, battlerDef, move)) return TRUE; @@ -2970,7 +2905,7 @@ bool32 ShouldAbsorb(u8 battlerAtk, u8 battlerDef, u16 move, s32 damage) if (CanTargetFaintAi(battlerDef, battlerAtk) && !CanTargetFaintAiWithMod(battlerDef, battlerAtk, healDmg, 0)) return TRUE; // target can faint attacker unless they heal - else if (!CanTargetFaintAi(battlerDef, battlerAtk) && GetHealthPercentage(battlerAtk) < 60 && (Random() % 3)) + else if (!CanTargetFaintAi(battlerDef, battlerAtk) && AI_DATA->hpPercents[battlerAtk] < 60 && (Random() % 3)) return TRUE; // target can't faint attacker at all, attacker health is about half, 2/3rds rate of encouraging healing } else @@ -2988,7 +2923,7 @@ bool32 ShouldRecover(u8 battlerAtk, u8 battlerDef, u16 move, u8 healPercent) if (move == 0xFFFF || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) { // using item or user going first - s32 damage = AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; + s32 damage = AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; s32 healAmount = (healPercent * damage) / 100; if (gStatuses3[battlerAtk] & STATUS3_HEAL_BLOCK) healAmount = 0; @@ -2996,7 +2931,7 @@ bool32 ShouldRecover(u8 battlerAtk, u8 battlerDef, u16 move, u8 healPercent) if (CanTargetFaintAi(battlerDef, battlerAtk) && !CanTargetFaintAiWithMod(battlerDef, battlerAtk, healAmount, 0)) return TRUE; // target can faint attacker unless they heal - else if (!CanTargetFaintAi(battlerDef, battlerAtk) && GetHealthPercentage(battlerAtk) < 60 && (Random() % 3)) + else if (!CanTargetFaintAi(battlerDef, battlerAtk) && AI_DATA->hpPercents[battlerAtk] < 60 && (Random() % 3)) return TRUE; // target can't faint attacker at all, attacker health is about half, 2/3rds rate of encouraging healing } return FALSE; @@ -3039,14 +2974,14 @@ bool32 IsValidDoubleBattle(u8 battlerAtk) return FALSE; } -u16 GetAllyChosenMove(void) +u16 GetAllyChosenMove(u8 battlerId) { - u8 partnerBattler = BATTLE_PARTNER(sBattler_AI); - + u8 partnerBattler = BATTLE_PARTNER(battlerId); + if (!IsBattlerAlive(partnerBattler) || !IsBattlerAIControlled(partnerBattler)) - return MOVE_NONE; // TODO: prediction? - else if (partnerBattler > sBattler_AI) // Battler with the lower id chooses the move first. return MOVE_NONE; + else if (partnerBattler > battlerId) // Battler with the lower id chooses the move first. + return gLastMoves[partnerBattler]; else return gBattleMons[partnerBattler].moves[gBattleStruct->chosenMovePositions[partnerBattler]]; } @@ -3184,7 +3119,7 @@ bool32 ShouldUseWishAromatherapy(u8 battlerAtk, u8 battlerDef, u16 move) party = gEnemyParty; if (CountUsablePartyMons(battlerAtk) == 0 - && (CanTargetFaintAi(battlerDef, battlerAtk) || BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->atkAbility))) + && (CanTargetFaintAi(battlerDef, battlerAtk) || BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->abilities[battlerAtk]))) return FALSE; // Don't heal if last mon and will faint for (i = 0; i < PARTY_SIZE; i++) @@ -3241,13 +3176,14 @@ s32 AI_CalcPartyMonDamage(u16 move, u8 battlerAtk, u8 battlerDef, struct Pokemon { s32 dmg; u32 i; + u8 effectiveness; struct BattlePokemon *battleMons = Alloc(sizeof(struct BattlePokemon) * MAX_BATTLERS_COUNT); for (i = 0; i < MAX_BATTLERS_COUNT; i++) battleMons[i] = gBattleMons[i]; PokemonToBattleMon(mon, &gBattleMons[battlerAtk]); - dmg = AI_CalcDamage(move, battlerAtk, battlerDef); + dmg = AI_CalcDamage(move, battlerAtk, battlerDef, &effectiveness); for (i = 0; i < MAX_BATTLERS_COUNT; i++) gBattleMons[i] = battleMons[i]; @@ -3442,10 +3378,10 @@ bool32 IsRecycleEncouragedItem(u16 item) #define STAT_UP_STAGE 10 void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) { - if (AI_DATA->atkAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) return; - if (GetHealthPercentage(battlerAtk) < 80 && AI_RandLessThan(128)) + if (AI_DATA->hpPercents[battlerAtk] < 80 && AI_RandLessThan(128)) return; if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) @@ -3454,7 +3390,7 @@ void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) switch (statId) { case STAT_ATK: - if (HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL) && GetHealthPercentage(battlerAtk) > 40) + if (HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL) && AI_DATA->hpPercents[battlerAtk] > 40) { if (gBattleMons[battlerAtk].statStages[STAT_ATK] < STAT_UP_2_STAGE) *score += 2; @@ -3466,7 +3402,7 @@ void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) break; case STAT_DEF: if ((HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)|| IS_MOVE_PHYSICAL(gLastMoves[battlerDef])) - && GetHealthPercentage(battlerAtk) > 70) + && AI_DATA->hpPercents[battlerAtk] > 70) { if (gBattleMons[battlerAtk].statStages[STAT_DEF] < STAT_UP_2_STAGE) *score += 2; // seems better to raise def at higher HP @@ -3484,7 +3420,7 @@ void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) } break; case STAT_SPATK: - if (HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL) && GetHealthPercentage(battlerAtk) > 40) + if (HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL) && AI_DATA->hpPercents[battlerAtk] > 40) { if (gBattleMons[battlerAtk].statStages[STAT_SPATK] < STAT_UP_2_STAGE) *score += 2; @@ -3494,7 +3430,7 @@ void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) break; case STAT_SPDEF: if ((HasMoveWithSplit(battlerDef, SPLIT_SPECIAL) || IS_MOVE_SPECIAL(gLastMoves[battlerDef])) - && GetHealthPercentage(battlerAtk) > 70) + && AI_DATA->hpPercents[battlerAtk] > 70) { if (gBattleMons[battlerAtk].statStages[STAT_SPDEF] < STAT_UP_2_STAGE) *score += 2; // seems better to raise spdef at higher HP @@ -3503,13 +3439,13 @@ void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) } break; case STAT_ACC: - if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 80, TRUE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 80, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) *score += 2; // has moves with less than 80% accuracy - else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) *(score)++; break; case STAT_EVASION: - if (!BattlerWillFaintFromWeather(battlerAtk, AI_DATA->atkAbility)) + if (!BattlerWillFaintFromWeather(battlerAtk, AI_DATA->abilities[battlerAtk])) { if (!GetBattlerSecondaryDamage(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_ROOTED)) *score += 2; @@ -3525,7 +3461,7 @@ void IncreasePoisonScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - if (AI_CanPoison(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove) && GetHealthPercentage(battlerDef) > 20) + if (AI_CanPoison(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove) && AI_DATA->hpPercents[battlerDef] > 20) { if (!HasDamagingMove(battlerDef)) *score += 2; @@ -3536,7 +3472,7 @@ void IncreasePoisonScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) if (HasMoveEffect(battlerAtk, EFFECT_VENOSHOCK) || HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(battlerAtk, EFFECT_VENOM_DRENCH) - || AI_DATA->atkAbility == ABILITY_MERCILESS) + || AI_DATA->abilities[battlerAtk] == ABILITY_MERCILESS) *(score) += 2; else *(score)++; @@ -3548,7 +3484,7 @@ void IncreaseBurnScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - if (AI_CanBurn(battlerAtk, battlerDef, AI_DATA->defAbility, AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (AI_CanBurn(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) { (*score)++; // burning is good if (HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)) @@ -3557,7 +3493,7 @@ void IncreaseBurnScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) *score += 2; // burning the target to stay alive is cool } - if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(AI_DATA->battlerAtkPartner, EFFECT_HEX)) + if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_HEX)) (*score)++; } } @@ -3567,7 +3503,7 @@ void IncreaseParalyzeScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - if (AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) { u8 atkSpeed = GetBattlerTotalSpeedStat(battlerAtk); u8 defSpeed = GetBattlerTotalSpeedStat(battlerDef); @@ -3588,7 +3524,7 @@ void IncreaseSleepScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - if (AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) *score += 2; else return; @@ -3597,7 +3533,7 @@ void IncreaseSleepScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) && !(HasMoveEffect(battlerDef, EFFECT_SNORE) || HasMoveEffect(battlerDef, EFFECT_SLEEP_TALK))) (*score)++; - if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(AI_DATA->battlerAtkPartner, EFFECT_HEX)) + if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_HEX)) (*score)++; } @@ -3606,13 +3542,13 @@ void IncreaseConfusionScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - if (AI_CanConfuse(battlerAtk, battlerDef, AI_DATA->defAbility, AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove) - && AI_DATA->defHoldEffect != HOLD_EFFECT_CURE_CONFUSION - && AI_DATA->defHoldEffect != HOLD_EFFECT_CURE_STATUS) + if (AI_CanConfuse(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) + && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_CURE_CONFUSION + && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_CURE_STATUS) { if (gBattleMons[battlerDef].status1 & STATUS1_PARALYSIS || gBattleMons[battlerDef].status2 & STATUS2_INFATUATION - || (AI_DATA->atkAbility == ABILITY_SERENE_GRACE && HasMoveEffect(battlerAtk, EFFECT_FLINCH_HIT))) + || (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && HasMoveEffect(battlerAtk, EFFECT_FLINCH_HIT))) *score += 3; else *score += 2; diff --git a/src/battle_debug.c b/src/battle_debug.c index 2ea46321d..0657ed2ac 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -714,7 +714,7 @@ void CB2_BattleDebugMenu(void) static void PutMovesPointsText(struct BattleDebugMenu *data) { - u32 i, j, count; + u32 i, j, count, battlerDef; u8 *text = malloc(0x50); FillWindowPixelBuffer(data->aiMovesWindowId, 0x11); @@ -727,13 +727,14 @@ static void PutMovesPointsText(struct BattleDebugMenu *data) { if (data->aiIconSpriteIds[j] == 0xFF) continue; + battlerDef = gSprites[data->aiIconSpriteIds[j]].data[0]; ConvertIntToDecimalStringN(text, - gBattleStruct->aiFinalScore[data->aiBattlerId][gSprites[data->aiIconSpriteIds[j]].data[0]][i], + gBattleStruct->aiFinalScore[data->aiBattlerId][battlerDef][i], STR_CONV_MODE_RIGHT_ALIGN, 3); AddTextPrinterParameterized(data->aiMovesWindowId, 1, text, 83 + count * 54, i * 15, 0, NULL); ConvertIntToDecimalStringN(text, - gBattleStruct->aiSimulatedDamage[data->aiBattlerId][gSprites[data->aiIconSpriteIds[j]].data[0]][i], + AI_DATA->simulatedDmg[data->aiBattlerId][battlerDef][i], STR_CONV_MODE_RIGHT_ALIGN, 3); AddTextPrinterParameterized(data->aiMovesWindowId, 1, text, 110 + count * 54, i * 15, 0, NULL); diff --git a/src/battle_main.c b/src/battle_main.c index 37845472a..336f76f6c 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3698,6 +3698,8 @@ static void TryDoEventsBeforeFirstTurn(void) gMoveResultFlags = 0; gRandomTurnNumber = Random(); + + GetAiLogicData(); // get assumed abilities, hold effects, etc of all battlers if (gBattleTypeFlags & BATTLE_TYPE_ARENA) { @@ -3786,6 +3788,7 @@ void BattleTurnPassed(void) *(&gBattleStruct->absentBattlerFlags) = gAbsentBattlerFlags; BattlePutTextOnWindow(gText_EmptyString3, B_WIN_MSG); + GetAiLogicData(); // get assumed abilities, hold effects, etc of all battlers gBattleMainFunc = HandleTurnActionSelectionState; gRandomTurnNumber = Random(); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c624130a6..d3717b53d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1657,20 +1657,14 @@ static bool32 AccuracyCalcHelper(u16 move) return FALSE; } -u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move) +u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u32 defAbility, u32 atkHoldEffect, u32 defHoldEffect) { - u32 calc, moveAcc, atkHoldEffect, atkParam, defHoldEffect, defParam, atkAbility, defAbility; + u32 calc, moveAcc; s8 buff, accStage, evasionStage; + u8 atkParam = GetBattlerHoldEffectParam(battlerAtk); + u8 defParam = GetBattlerHoldEffectParam(battlerDef); - atkAbility = GetBattlerAbility(battlerAtk); - atkHoldEffect = GetBattlerHoldEffect(battlerAtk, TRUE); - atkParam = GetBattlerHoldEffectParam(battlerAtk); - - defAbility = GetBattlerAbility(battlerDef); - defHoldEffect = GetBattlerHoldEffect(battlerDef, TRUE); - defParam = GetBattlerHoldEffectParam(battlerDef); gPotentialItemEffectBattler = battlerDef; - accStage = gBattleMons[battlerAtk].statStages[STAT_ACC]; evasionStage = gBattleMons[battlerDef].statStages[STAT_EVASION]; if (atkAbility == ABILITY_UNAWARE || atkAbility == ABILITY_KEEN_EYE) @@ -1767,7 +1761,8 @@ static void Cmd_accuracycheck(void) return; // final calculation - if ((Random() % 100 + 1) > GetTotalAccuracy(gBattlerAttacker, gBattlerTarget, move)) + if ((Random() % 100 + 1) > GetTotalAccuracy(gBattlerAttacker, gBattlerTarget, move, GetBattlerAbility(gBattlerAttacker), GetBattlerAbility(gBattlerTarget), + GetBattlerHoldEffect(gBattlerAttacker, TRUE), GetBattlerHoldEffect(gBattlerTarget, TRUE))) { gMoveResultFlags |= MOVE_RESULT_MISSED; if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_BLUNDER_POLICY) diff --git a/src/battle_util.c b/src/battle_util.c index b293b9a5e..d600a26e7 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8957,13 +8957,11 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move return dmg; } -s32 CalculateMoveDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 fixedBasePower, bool32 isCrit, bool32 randomFactor, bool32 updateFlags) +static s32 DoMoveDamageCalc(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 fixedBasePower, + bool32 isCrit, bool32 randomFactor, bool32 updateFlags, u16 typeEffectivenessModifier) { s32 dmg; - u16 typeEffectivenessModifier; - - typeEffectivenessModifier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, updateFlags); - + // Don't calculate damage if the move has no effect on target. if (typeEffectivenessModifier == UQ_4_12(0)) return 0; @@ -8996,6 +8994,19 @@ s32 CalculateMoveDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 return dmg; } +s32 CalculateMoveDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 fixedBasePower, bool32 isCrit, bool32 randomFactor, bool32 updateFlags) +{ + return DoMoveDamageCalc(move, battlerAtk, battlerDef, moveType, fixedBasePower, isCrit, randomFactor, + updateFlags, CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, updateFlags)); +} + +// for AI - get move damage and effectiveness with one function call +s32 CalculateMoveDamageAndEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, u16 *typeEffectivenessModifier) +{ + *typeEffectivenessModifier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, FALSE); + return DoMoveDamageCalc(move, battlerAtk, battlerDef, moveType, 0, FALSE, FALSE, FALSE, *typeEffectivenessModifier); +} + static void MulByTypeEffectiveness(u16 *modifier, u16 move, u8 moveType, u8 battlerDef, u8 defType, u8 battlerAtk, bool32 recordAbilities) { u16 mod = GetTypeModifier(moveType, defType); diff --git a/src/battle_util2.c b/src/battle_util2.c index c269d8613..2ccc38a8a 100644 --- a/src/battle_util2.c +++ b/src/battle_util2.c @@ -26,6 +26,7 @@ void AllocateBattleResources(void) gBattleResources->battleCallbackStack = AllocZeroed(sizeof(*gBattleResources->battleCallbackStack)); gBattleResources->beforeLvlUp = AllocZeroed(sizeof(*gBattleResources->beforeLvlUp)); gBattleResources->ai = AllocZeroed(sizeof(*gBattleResources->ai)); + gBattleResources->aiData = AllocZeroed(sizeof(*gBattleResources->aiData)); gBattleResources->battleHistory = AllocZeroed(sizeof(*gBattleResources->battleHistory)); gLinkBattleSendBuffer = AllocZeroed(BATTLE_BUFFER_LINK_SIZE); @@ -57,6 +58,7 @@ void FreeBattleResources(void) FREE_AND_SET_NULL(gBattleResources->battleCallbackStack); FREE_AND_SET_NULL(gBattleResources->beforeLvlUp); FREE_AND_SET_NULL(gBattleResources->ai); + FREE_AND_SET_NULL(gBattleResources->aiData); FREE_AND_SET_NULL(gBattleResources->battleHistory); FREE_AND_SET_NULL(gBattleResources); From 078874aa1eacec94dfb47b6e081f1dd13e0d7d72 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 13 Jan 2022 11:32:22 -0500 Subject: [PATCH 055/208] move some WEATHER_HAS_EFFECT after bitfield checks to speed up damage calcs --- src/battle_util.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index d600a26e7..6c0788d4d 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4400,7 +4400,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move BattleScriptPushCursorAndCallback(BattleScript_DrizzleActivates); effect++; } - else if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone) + else if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT && !gSpecialStatuses[battler].switchInAbilityDone) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); @@ -4413,7 +4413,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move BattleScriptPushCursorAndCallback(BattleScript_SandstreamActivates); effect++; } - else if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone) + else if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT && !gSpecialStatuses[battler].switchInAbilityDone) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); @@ -4426,7 +4426,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move BattleScriptPushCursorAndCallback(BattleScript_DroughtActivates); effect++; } - else if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone) + else if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT && !gSpecialStatuses[battler].switchInAbilityDone) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); @@ -4439,7 +4439,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move BattleScriptPushCursorAndCallback(BattleScript_SnowWarningActivates); effect++; } - else if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone) + else if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT && !gSpecialStatuses[battler].switchInAbilityDone) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); @@ -5316,9 +5316,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && TARGET_TURN_DAMAGED - && !(WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SANDSTORM)) + && !(gBattleWeather & B_WEATHER_SANDSTORM && WEATHER_HAS_EFFECT)) { - if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_PRIMAL_ANY) + if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT) { BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_BlockedByPrimalWeatherRet; @@ -7974,7 +7974,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; break; case EFFECT_WEATHER_BALL: - if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_ANY) + if (gBattleWeather & B_WEATHER_ANY && WEATHER_HAS_EFFECT) basePower *= 2; break; case EFFECT_PURSUIT: @@ -8176,7 +8176,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe break; case ABILITY_SAND_FORCE: if ((moveType == TYPE_STEEL || moveType == TYPE_ROCK || moveType == TYPE_GROUND) - && WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SANDSTORM) + && gBattleWeather & B_WEATHER_SANDSTORM && WEATHER_HAS_EFFECT) MulModifier(&modifier, UQ_4_12(1.3)); break; case ABILITY_RIVALRY: @@ -8785,7 +8785,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, } // sandstorm sp.def boost for rock types - if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_ROCK) && WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SANDSTORM && !usesDefStat) + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_ROCK) && gBattleWeather & B_WEATHER_SANDSTORM && WEATHER_HAS_EFFECT && !usesDefStat) MulModifier(&modifier, UQ_4_12(1.5)); // The defensive stats of a Player's Pokémon are boosted by x1.1 (+10%) if they have the 5th badge and 7th badges. @@ -9038,7 +9038,7 @@ static void MulByTypeEffectiveness(u16 *modifier, u16 move, u8 moveType, u8 batt mod = UQ_4_12(2.0); // B_WEATHER_STRONG_WINDS weakens Super Effective moves against Flying-type Pokémon - if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_STRONG_WINDS) + if (gBattleWeather & B_WEATHER_STRONG_WINDS && WEATHER_HAS_EFFECT) { if (defType == TYPE_FLYING && mod >= UQ_4_12(2.0)) mod = UQ_4_12(1.0); @@ -9986,10 +9986,7 @@ u16 GetUsedHeldItem(u8 battler) bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags) { - if (!WEATHER_HAS_EFFECT) - return FALSE; - - if (gBattleWeather & weatherFlags) + if (gBattleWeather & weatherFlags && WEATHER_HAS_EFFECT) { // given weather is active -> check if its sun, rain against utility umbrella ( since only 1 weather can be active at once) if (gBattleWeather & (B_WEATHER_SUN | B_WEATHER_RAIN) && GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA) From 0a27b575dc7764d976ae5bcd7bc48365cf6e1dc3 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Thu, 27 Jan 2022 17:24:11 +1300 Subject: [PATCH 056/208] Fix merge error in battle scripts --- data/battle_scripts_1.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index fec6a18d7..ebcaf38d7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -403,6 +403,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectOctolock @ EFFECT_OCTOLOCK .4byte BattleScript_EffectClangorousSoul @ EFFECT_CLANGOROUS_SOUL .4byte BattleScript_EffectHit @ EFFECT_BOLT_BEAK + .4byte BattleScript_EffectSkyDrop @ EFFECT_SKY_DROP .4byte BattleScript_EffectHit @ EFFECT_EXPANDING_FORCE .4byte BattleScript_EffectScaleShot @ EFFECT_SCALE_SHOT .4byte BattleScript_EffectMeteorBeam @ EFFECT_METEOR_BEAM @@ -512,11 +513,10 @@ BattleScript_ScaleShotPrintStrings:: BattleScript_ScaleShotEnd:: setmoveeffect MOVE_EFFECT_SCALE_SHOT | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN seteffectwithchance - tryfaintmon BS_TARGET, FALSE, NULL + tryfaintmon BS_TARGET moveendcase MOVEEND_SYNCHRONIZE_TARGET moveendfrom MOVEEND_STATUS_IMMUNITY_ABILITIES end - .4byte BattleScript_EffectSkyDrop @ EFFECT_SKY_DROP BattleScript_EffectSkyDrop: jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_SkyDropTurn2 From 389a38b3cd3bffa87b6fec09c4f8daa8dd977005 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 12 Feb 2022 23:55:54 -0300 Subject: [PATCH 057/208] Config for Facade being affected by burns --- include/constants/battle_config.h | 1 + src/battle_util.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 6306ca687..ab5a613d8 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -116,6 +116,7 @@ // Damage settings #define B_BURN_DAMAGE GEN_7 // In Gen7+, burn damage is 1/16th of max HP instead of 1/8th. +#define B_BURN_FACADE_DMG GEN_7 // In Gen6+, burn's effect of lowering the Attack stat no longer applies to Facade. #define B_BINDING_DAMAGE GEN_7 // In Gen6+, binding damage is 1/8 of max HP instead of 1/16. (With Binding Band, 1/6 and 1/8 respectively.) #define B_PSYWAVE_DMG GEN_7 // Psywave's damage formula. See Cmd_psywavedamageeffect. #define B_PAYBACK_SWITCH_BOOST GEN_7 // In Gen5+, if the opponent switches out, Payback's damage will no longer be doubled. diff --git a/src/battle_util.c b/src/battle_util.c index 4127b9bd4..d9831f8f6 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8869,7 +8869,8 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move // check burn if (gBattleMons[battlerAtk].status1 & STATUS1_BURN && IS_MOVE_PHYSICAL(move) - && gBattleMoves[move].effect != EFFECT_FACADE && abilityAtk != ABILITY_GUTS) + && (gBattleMoves[move].effect != EFFECT_FACADE || B_BURN_FACADE_DMG < GEN_6) + && abilityAtk != ABILITY_GUTS) dmg = ApplyModifier(UQ_4_12(0.5), dmg); // check sunny/rain weather From 76e0b3896044572bcb063176eda30146add07bd5 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 12 Feb 2022 23:57:23 -0300 Subject: [PATCH 058/208] =?UTF-8?q?Config=20for=20Pok=C3=A9mon=20with=20Ob?= =?UTF-8?q?livious=20being=20affected=20by=20Taunt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/constants/battle_config.h | 1 + src/battle_script_commands.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index ab5a613d8..d989e746d 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -182,6 +182,7 @@ #define B_SYNCHRONIZE_NATURE GEN_8 // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously. #define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned. #define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. +#define B_OBLIVIOUS_TAUNT GEN_7 // In Gen6+, Pokémon with Oblivious can't be taunted. // Item settings #define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index e67eb917b..00be0d2f2 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -12297,13 +12297,16 @@ static void Cmd_jumpifnodamage(void) static void Cmd_settaunt(void) { +#if B_OBLIVIOUS_TAUNT >= GEN_6 if (GetBattlerAbility(gBattlerTarget) == ABILITY_OBLIVIOUS) { gBattlescriptCurrInstr = BattleScript_NotAffectedAbilityPopUp; gLastUsedAbility = ABILITY_OBLIVIOUS; RecordAbilityBattle(gBattlerTarget, ABILITY_OBLIVIOUS); } - else if (gDisableStructs[gBattlerTarget].tauntTimer == 0) + else +#endif + if (gDisableStructs[gBattlerTarget].tauntTimer == 0) { #if B_TAUNT_TURNS >= GEN_5 u8 turns = 4; From 748ce99de3aad3b6a588e82ba5cc659a613881e4 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 13 Feb 2022 00:17:37 -0300 Subject: [PATCH 059/208] Config for Ingrain grounding the user --- include/constants/battle_config.h | 1 + src/battle_util.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index d989e746d..9715e802f 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -170,6 +170,7 @@ #define B_BRICK_BREAK GEN_7 // In Gen4+, you can destroy your own side's screens. In Gen 5+, screens are not removed if the target is immune. #define B_WISH_HP_SOURCE GEN_7 // In Gen5+, Wish heals half of the user's max HP instead of the target's. #define B_RAMPAGE_CANCELLING GEN_7 // In Gen5+, a failed Thrash, etc, will cancel except on its last turn. +#define B_ROOTED_GROUNDING GEN_7 // In Gen4+, Ingrain causes the affected Pokémon to become grounded. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. diff --git a/src/battle_util.c b/src/battle_util.c index d9831f8f6..a6040eab1 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7736,8 +7736,10 @@ bool32 IsBattlerGrounded(u8 battlerId) return TRUE; else if (gFieldStatuses & STATUS_FIELD_GRAVITY) return TRUE; +#if B_ROOTED_GROUNDING >= GEN_4 else if (gStatuses3[battlerId] & STATUS3_ROOTED) return TRUE; +#endif else if (gStatuses3[battlerId] & STATUS3_SMACKED_DOWN) return TRUE; From d73e6faab8ede9ba127806971d7944eacdd49f72 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 13 Feb 2022 00:30:37 -0300 Subject: [PATCH 060/208] Config for Growth being affected by sunlight --- data/battle_scripts_1.s | 4 ++++ include/constants/battle_config.h | 1 + 2 files changed, 5 insertions(+) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 624e911bc..c26d11950 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1907,7 +1907,9 @@ BattleScript_GrowthDoMoveAnim:: waitanimation setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPATK, 0 +.if B_GROWTH_UNDER_SUN >= GEN_5 jumpifweatheraffected BS_ATTACKER, B_WEATHER_SUN, BattleScript_GrowthAtk2 +.endif setstatchanger STAT_ATK, 1, FALSE goto BattleScript_GrowthAtk BattleScript_GrowthAtk2: @@ -1918,7 +1920,9 @@ BattleScript_GrowthAtk: printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_GrowthTrySpAtk:: +.if B_GROWTH_UNDER_SUN >= GEN_5 jumpifweatheraffected BS_ATTACKER, B_WEATHER_SUN, BattleScript_GrowthSpAtk2 +.endif setstatchanger STAT_SPATK, 1, FALSE goto BattleScript_GrowthSpAtk BattleScript_GrowthSpAtk2: diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 9715e802f..29ecf2135 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -171,6 +171,7 @@ #define B_WISH_HP_SOURCE GEN_7 // In Gen5+, Wish heals half of the user's max HP instead of the target's. #define B_RAMPAGE_CANCELLING GEN_7 // In Gen5+, a failed Thrash, etc, will cancel except on its last turn. #define B_ROOTED_GROUNDING GEN_7 // In Gen4+, Ingrain causes the affected Pokémon to become grounded. +#define B_GROWTH_UNDER_SUN GEN_7 // In Gen5+, Growth's effects are doubled when under the effects of the sun. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. From c849197a8890c8ddced5b35e84c01d32a20655f0 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 13 Feb 2022 00:45:35 -0300 Subject: [PATCH 061/208] Config for Minimize raising 2 stages --- data/battle_scripts_1.s | 4 ++++ include/constants/battle_config.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index c26d11950..cbdf1bef4 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -4341,7 +4341,11 @@ BattleScript_NightmareWorked:: BattleScript_EffectMinimize:: attackcanceler setminimize +.if B_MINIMIZE_EVASION >= GEN_5 + setstatchanger STAT_EVASION, 2, FALSE +.else setstatchanger STAT_EVASION, 1, FALSE +.endif goto BattleScript_EffectStatUpAfterAtkCanceler BattleScript_EffectCurse:: diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 29ecf2135..4aa4bebdd 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -152,6 +152,8 @@ #define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage. #define B_RECOIL_IF_MISS_DMG GEN_7 // In Gen5+, Jump Kick and High Jump Kick will always do half of the user's max HP when missing. #define B_UPDATED_CONVERSION GEN_7 // In Gen6+, Conversion changes the user's type to match their first move's. Before, it would choose a move at random. +#define B_PP_REDUCED_BY_SPITE GEN_7 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5. +#define B_MINIMIZE_EVASION GEN_7 // In Gen5+, Minimize raises evasion by 2 stages instead of 1. // Move accuracy settings #define B_TOXIC_NEVER_MISS GEN_7 // In Gen6+, if Toxic is used by a Poison-type Pokémon, it will never miss. @@ -161,7 +163,6 @@ // Other move settings #define B_SOUND_SUBSTITUTE GEN_7 // In Gen6+, sound moves bypass Substitute. #define B_INCINERATE_GEMS GEN_7 // In Gen6+, Incinerate can destroy Gems. -#define B_PP_REDUCED_BY_SPITE GEN_7 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5. #define B_CAN_SPITE_FAIL GEN_7 // In Gen4+, Spite can no longer fail if the foe's last move only has 1 remaining PP. #define B_CRASH_IF_TARGET_IMMUNE GEN_7 // In Gen4+, The user of Jump Kick or High Jump Kick will "keep going and crash" if it attacks a target that is immune to the move. #define B_MEMENTO_FAIL GEN_7 // In Gen4+, Memento fails if there is no target or if the target is protected or behind substitute. But not if Atk/Sp. Atk are at -6. From dde65d5cea2e8a89cdd91e24483bae5557ac4cfc Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 13 Feb 2022 01:07:42 -0300 Subject: [PATCH 062/208] =?UTF-8?q?Config=20for=20Sheer=20Cold=20being=20l?= =?UTF-8?q?ess=20accurate=20when=20not=20used=20by=20Ice=20type=20Pok?= =?UTF-8?q?=C3=A9mon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/constants/battle_config.h | 1 + src/battle_script_commands.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 4aa4bebdd..ab70634a8 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -159,6 +159,7 @@ #define B_TOXIC_NEVER_MISS GEN_7 // In Gen6+, if Toxic is used by a Poison-type Pokémon, it will never miss. #define B_MINIMIZE_DMG_ACC GEN_7 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks. #define B_BLIZZARD_HAIL GEN_7 // In Gen4+, Blizzard bypasses accuracy checks if it's hailing. +#define B_SHEER_COLD_ACC GEN_7 // In Gen7+, Sheer Cold's base chance of hitting is reduced to 20% if the user isn't Ice-typed. // Other move settings #define B_SOUND_SUBSTITUTE GEN_7 // In Gen6+, sound moves bypass Substitute. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 00be0d2f2..75357dbed 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -10728,6 +10728,10 @@ static void Cmd_tryKO(void) else { u16 odds = gBattleMoves[gCurrentMove].accuracy + (gBattleMons[gBattlerAttacker].level - gBattleMons[gBattlerTarget].level); + #if B_SHEER_COLD_ACC >= GEN_7 + if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE)) + odds -= 10; + #endif if (Random() % 100 + 1 < odds && gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) lands = TRUE; } From 5e9767e06716c15ea9d3750f3abab203c8fdcbd2 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 13 Feb 2022 01:13:44 -0300 Subject: [PATCH 063/208] Fixed actually checking for Sheer Cold instead of affecting all OHKO moves --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 75357dbed..d3c1d4e21 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -10729,7 +10729,7 @@ static void Cmd_tryKO(void) { u16 odds = gBattleMoves[gCurrentMove].accuracy + (gBattleMons[gBattlerAttacker].level - gBattleMons[gBattlerTarget].level); #if B_SHEER_COLD_ACC >= GEN_7 - if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE)) + if (gCurrentMove == MOVE_SHEER_COLD && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE)) odds -= 10; #endif if (Random() % 100 + 1 < odds && gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) From f8b3a1c6584a76cd3e3f2721c5fb3a54bbf3a4f6 Mon Sep 17 00:00:00 2001 From: Andrea Jemmett <1787979+acidghost@users.noreply.github.com> Date: Wed, 16 Mar 2022 14:41:12 +0100 Subject: [PATCH 064/208] Fix finding libpng in gbagfx and rsfont On macOS 12, Homebrew installs libpng in a custom location. --- tools/gbagfx/Makefile | 2 ++ tools/rsfont/Makefile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tools/gbagfx/Makefile b/tools/gbagfx/Makefile index b4244aa8d..8728fa8d0 100644 --- a/tools/gbagfx/Makefile +++ b/tools/gbagfx/Makefile @@ -1,8 +1,10 @@ CC = gcc CFLAGS = -Wall -Wextra -Werror -Wno-sign-compare -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK +CFLAGS += $(shell pkg-config --cflags libpng) LIBS = -lpng -lz +LDFLAGS += $(shell pkg-config --libs-only-L libpng) SRCS = main.c convert_png.c gfx.c jasc_pal.c lz.c rl.c util.c font.c huff.c diff --git a/tools/rsfont/Makefile b/tools/rsfont/Makefile index 0bc88a42b..92e44b545 100644 --- a/tools/rsfont/Makefile +++ b/tools/rsfont/Makefile @@ -1,8 +1,10 @@ CC ?= gcc CFLAGS = -Wall -Wextra -Werror -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK +CFLAGS += $(shell pkg-config --cflags libpng) LIBS = -lpng -lz +LDFLAGS += $(shell pkg-config --libs-only-L libpng) SRCS = main.c convert_png.c util.c font.c From 5fd468f507dc1d6f18a3cfd76ca3217e5ba6bb14 Mon Sep 17 00:00:00 2001 From: ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> Date: Tue, 22 Mar 2022 13:10:24 -0500 Subject: [PATCH 065/208] Review comments. Commented code removed, ShouldAIUseZMove moved to battle_ai_util and renamed to be consistent with other fns --- data/battle_scripts_1.s | 2 -- include/battle_ai_util.h | 1 + include/battle_z_move.h | 1 - src/battle_ai_util.c | 32 ++++++++++++++++++++++++++ src/battle_controller_opponent.c | 3 ++- src/battle_controller_player_partner.c | 3 ++- src/battle_z_move.c | 31 ------------------------- 7 files changed, 37 insertions(+), 36 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 7d85134ed..bac1b83e7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -9217,8 +9217,6 @@ BattleScript_ZMoveActivateStatus:: printstring STRINGID_ZPOWERSURROUNDS playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL setzeffect -@ printstring STRINGID_ZMOVEUNLEASHED -@ waitmessage 0x40 return BattleScript_ZEffectPrintString:: diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index 6665f78ca..726867c9e 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -60,6 +60,7 @@ bool32 IsAbilityOfRating(u16 ability, s8 rating); s8 GetAbilityRating(u16 ability); bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability); bool32 AI_MoveMakesContact(u32 ability, u32 holdEffect, u16 move); +bool32 ShouldUseZMove(u8 activeId, u8 targetId, u16 chosenMove); // stat stage checks bool32 AnyStatIsRaised(u8 battlerId); diff --git a/include/battle_z_move.h b/include/battle_z_move.h index ae2b38834..5d34e25a9 100644 --- a/include/battle_z_move.h +++ b/include/battle_z_move.h @@ -23,7 +23,6 @@ void DestroyZMoveTriggerSprite(void); bool32 MoveSelectionDisplayZMove(u16 zmove); const u8* GetZMoveName(u16 move); void SetZEffect(void); -bool32 ShouldAIUseZMove(u8 activeId, u8 targetId, u16 chosenMove); bool32 IsZMoveUsable(u8 battlerId, u16 moveIndex); void GetUsableZMoves(u8 battlerId, u16 *moves); diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index e819cfc34..740d3bf51 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -3636,3 +3636,35 @@ bool32 AI_MoveMakesContact(u32 ability, u32 holdEffect, u16 move) return TRUE; return FALSE; } + +//TODO - this could use some more sophisticated logic +bool32 ShouldUseZMove(u8 battlerAtk, u8 battlerDef, u16 chosenMove) +{ + // simple logic. just upgrades chosen move to z move if possible, unless regular move would kill opponent + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && battlerDef == BATTLE_PARTNER(battlerAtk)) + return FALSE; //don't use z move on partner + if (gBattleStruct->zmove.used[battlerAtk]) + return FALSE; //cant use z move twice + + if (IsViableZMove(battlerAtk, chosenMove)) + { + #ifdef POKEMON_EXPANSION + if (gBattleMons[battlerDef].ability == ABILITY_DISGUISE && gBattleMons[battlerDef].species == SPECIES_MIMIKYU) + return FALSE; // Don't waste a Z-Move busting disguise + if (gBattleMons[battlerDef].ability == ABILITY_ICE_FACE && gBattleMons[battlerDef].species == SPECIES_EISCUE && IS_MOVE_PHYSICAL(chosenMove)) + return FALSE; // Don't waste a Z-Move busting Ice Face + #endif + + if (IS_MOVE_STATUS(chosenMove) && !IS_MOVE_STATUS(gBattleStruct->zmove.chosenZMove)) + return FALSE; + else if (!IS_MOVE_STATUS(chosenMove) && IS_MOVE_STATUS(gBattleStruct->zmove.chosenZMove)) + return FALSE; + + if (!IS_MOVE_STATUS(chosenMove) && AI_CalcDamage(chosenMove, battlerAtk, battlerDef, FALSE) >= gBattleMons[battlerDef].hp) + return FALSE; // don't waste damaging z move if can otherwise faint target + + return TRUE; + } + + return FALSE; +} diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 963fd577a..11c6b50ac 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1,6 +1,7 @@ #include "global.h" #include "battle.h" #include "battle_ai_main.h" +#include "battle_ai_util.h" #include "battle_anim.h" #include "battle_arena.h" #include "battle_controllers.h" @@ -1597,7 +1598,7 @@ static void OpponentHandleChooseMove(void) gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); } - if (ShouldAIUseZMove(gActiveBattler, gBattlerTarget, chosenMove)) + if (ShouldUseZMove(gActiveBattler, gBattlerTarget, chosenMove)) QueueZMove(gActiveBattler, moveInfo->moves[chosenMoveId]); if (CanMegaEvolve(gActiveBattler)) // If opponent can mega evolve, do it. diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 19e0c70ee..1703c2af1 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1,6 +1,7 @@ #include "global.h" #include "battle.h" #include "battle_ai_main.h" +#include "battle_ai_util.h" #include "battle_anim.h" #include "battle_controllers.h" #include "battle_message.h" @@ -1535,7 +1536,7 @@ static void PlayerPartnerHandleChooseMove(void) gBattlerTarget = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); } - if (ShouldAIUseZMove(gActiveBattler, gBattlerTarget, moveInfo->moves[chosenMoveId])) + if (ShouldUseZMove(gActiveBattler, gBattlerTarget, moveInfo->moves[chosenMoveId])) QueueZMove(gActiveBattler, moveInfo->moves[chosenMoveId]); // If partner can mega evolve, do it. diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 785563ff1..674082698 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -697,34 +697,3 @@ static bool32 AreStatsMaxed(u8 battlerId, u8 n) return TRUE; } -//TODO - this could use some more sophisticated logic -bool32 ShouldAIUseZMove(u8 battlerAtk, u8 battlerDef, u16 chosenMove) -{ - // simple logic. just upgrades chosen move to z move if possible, unless regular move would kill opponent - if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && battlerDef == BATTLE_PARTNER(battlerAtk)) - return FALSE; //don't use z move on partner - if (gBattleStruct->zmove.used[battlerAtk]) - return FALSE; //cant use z move twice - - if (IsViableZMove(battlerAtk, chosenMove)) - { - #ifdef POKEMON_EXPANSION - if (gBattleMons[battlerDef].ability == ABILITY_DISGUISE && gBattleMons[battlerDef].species == SPECIES_MIMIKYU) - return FALSE; // Don't waste a Z-Move busting disguise - if (gBattleMons[battlerDef].ability == ABILITY_ICE_FACE && gBattleMons[battlerDef].species == SPECIES_EISCUE && IS_MOVE_PHYSICAL(chosenMove)) - return FALSE; // Don't waste a Z-Move busting Ice Face - #endif - - if (IS_MOVE_STATUS(chosenMove) && !IS_MOVE_STATUS(gBattleStruct->zmove.chosenZMove)) - return FALSE; - else if (!IS_MOVE_STATUS(chosenMove) && IS_MOVE_STATUS(gBattleStruct->zmove.chosenZMove)) - return FALSE; - - if (!IS_MOVE_STATUS(chosenMove) && AI_CalcDamage(chosenMove, battlerAtk, battlerDef, FALSE) >= gBattleMons[battlerDef].hp) - return FALSE; // don't waste damaging z move if can otherwise faint target - - return TRUE; - } - - return FALSE; -} From 62f3f144ab499ff47c4451212b7350e0815a57c7 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 4 Mar 2022 11:02:19 -0500 Subject: [PATCH 066/208] Clean up some trainer hill --- asm/macros/trainer_hill.inc | 8 +- data/maps/TrainerHill_Entrance/scripts.inc | 2 +- include/constants/trainer_hill.h | 27 +- include/ereader_helpers.h | 2 +- include/global.h | 11 +- include/trainer_hill.h | 40 +- src/data/battle_frontier/trainer_hill.h | 957 ++++++--------------- src/ereader_helpers.c | 122 ++- src/trainer_hill.c | 167 ++-- 9 files changed, 456 insertions(+), 880 deletions(-) diff --git a/asm/macros/trainer_hill.inc b/asm/macros/trainer_hill.inc index 65c8c6bef..988e2867a 100644 --- a/asm/macros/trainer_hill.inc +++ b/asm/macros/trainer_hill.inc @@ -100,9 +100,9 @@ special CallTrainerHillFunction .endm - @ Set the challenge mode to HILL_TAG_* (Normal, Variety, Unique, or Expert) - .macro trainerhill_settag tag:req - setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_TAG - copyvar VAR_0x8005, \tag + @ Set the challenge mode to HILL_MODE_* (Normal, Variety, Unique, or Expert) + .macro trainerhill_setmode mode:req + setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_MODE + copyvar VAR_0x8005, \mode special CallTrainerHillFunction .endm diff --git a/data/maps/TrainerHill_Entrance/scripts.inc b/data/maps/TrainerHill_Entrance/scripts.inc index 8989883e4..2dd001a3b 100644 --- a/data/maps/TrainerHill_Entrance/scripts.inc +++ b/data/maps/TrainerHill_Entrance/scripts.inc @@ -157,7 +157,7 @@ TrainerHill_Entrance_EventScript_ChooseChallenge:: switch VAR_RESULT case 4, TrainerHill_Entrance_EventScript_CancelEntry case MULTI_B_PRESSED, TrainerHill_Entrance_EventScript_CancelEntry - trainerhill_settag VAR_RESULT + trainerhill_setmode VAR_RESULT setvar VAR_TRAINER_HILL_IS_ACTIVE, 1 setvar VAR_TEMP_5, 0 special HealPlayerParty diff --git a/include/constants/trainer_hill.h b/include/constants/trainer_hill.h index 0e802bba8..371763faf 100644 --- a/include/constants/trainer_hill.h +++ b/include/constants/trainer_hill.h @@ -8,6 +8,12 @@ #define TRAINER_HILL_ROOF 5 #define TRAINER_HILL_ENTRANCE 6 +#define HILL_MODE_NORMAL 0 +#define HILL_MODE_VARIETY 1 +#define HILL_MODE_UNIQUE 2 +#define HILL_MODE_EXPERT 3 +#define NUM_TRAINER_HILL_MODES 4 + #define NUM_TRAINER_HILL_FLOORS 4 #define NUM_TRAINER_HILL_FLOORS_JP 2 @@ -30,20 +36,33 @@ #define TRAINER_HILL_FUNC_SET_GAME_SAVED 14 #define TRAINER_HILL_FUNC_CLEAR_GAME_SAVED 15 #define TRAINER_HILL_FUNC_GET_WON 16 -#define TRAINER_HILL_FUNC_SET_TAG 17 +#define TRAINER_HILL_FUNC_SET_MODE 17 #define TRAINER_HILL_TEXT_INTRO 2 #define TRAINER_HILL_TEXT_PLAYER_LOST 3 #define TRAINER_HILL_TEXT_PLAYER_WON 4 #define TRAINER_HILL_TEXT_AFTER 5 -#define TRAINER_HILL_TRAINERS_PER_FLOOR 2 -#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * TRAINER_HILL_TRAINERS_PER_FLOOR) -#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * TRAINER_HILL_TRAINERS_PER_FLOOR) +#define HILL_TRAINERS_PER_FLOOR 2 +#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * HILL_TRAINERS_PER_FLOOR) +#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * HILL_TRAINERS_PER_FLOOR) // Values returned by TrainerHillGetChallengeStatus #define TRAINER_HILL_PLAYER_STATUS_LOST 0 #define TRAINER_HILL_PLAYER_STATUS_ECARD_SCANNED 1 #define TRAINER_HILL_PLAYER_STATUS_NORMAL 2 +#define HILL_TRAINER_NAME_LENGTH 11 + +#define TRAINER_HILL_OTID 0x10000000 + +// The full map of each Trainer Hill floor is 16x21. +// The first 5x21 at the top is the entrance/exit area, +// and the remaining 16x16 is the randomized portion of +// the room where the trainers are. +#define HILL_FLOOR_WIDTH 16 +#define HILL_FLOOR_HEIGHT_MAIN 16 +#define HILL_FLOOR_HEIGHT_MARGIN 5 +#define HILL_FLOOR_HEIGHT (HILL_FLOOR_HEIGHT_MAIN + HILL_FLOOR_HEIGHT_MARGIN) + #endif diff --git a/include/ereader_helpers.h b/include/ereader_helpers.h index 8bf3dc43b..29386bcb2 100755 --- a/include/ereader_helpers.h +++ b/include/ereader_helpers.h @@ -35,7 +35,7 @@ struct EReaderTrainerHillTrainer { u8 trainerNum; struct TrainerHillTrainer trainer; - struct TrHillDisplay display; + struct TrainerHillFloorMap map; u32 checksum; }; // size=0x274 diff --git a/include/global.h b/include/global.h index 0122ecd5c..89f725176 100644 --- a/include/global.h +++ b/include/global.h @@ -14,6 +14,7 @@ #include "constants/maps.h" #include "constants/pokemon.h" #include "constants/easy_chat.h" +#include "constants/trainer_hill.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); @@ -279,8 +280,6 @@ struct BattleTowerPokemon u8 friendship; }; -#define NULL_BATTLE_TOWER_POKEMON { .nickname = __("$$$$$$$$$$$") } - struct EmeraldBattleTowerRecord { /*0x00*/ u8 lvlMode; // 0 = level 50, 1 = level 100 @@ -808,7 +807,7 @@ struct TrainerNameRecord u8 trainerName[PLAYER_NAME_LENGTH + 1]; }; -struct SaveTrainerHill +struct TrainerHillSave { /*0x3D64*/ u32 timer; /*0x3D68*/ u32 bestTime; @@ -820,7 +819,7 @@ struct SaveTrainerHill /*0x3D6E*/ u16 hasLost:1; /*0x3D6E*/ u16 maybeECardScanDuringChallenge:1; /*0x3D6E*/ u16 field_3D6E_0f:1; - /*0x3D6E*/ u16 tag:2; + /*0x3D6E*/ u16 mode:2; // HILL_MODE_* }; struct WonderNewsMetadata @@ -1003,7 +1002,7 @@ struct SaveBlock1 /*0x31F8*/ struct EnigmaBerry enigmaBerry; /*0x322C*/ struct MysteryGiftSave mysteryGift; /*0x3598*/ u8 unused_3598[0x180]; - /*0x3718*/ u32 trainerHillTimes[4]; + /*0x3718*/ u32 trainerHillTimes[NUM_TRAINER_HILL_MODES]; /*0x3728*/ struct RamScript ramScript; /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[NUM_DEX_FLAG_BYTES]; @@ -1011,7 +1010,7 @@ struct SaveBlock1 /*0x3B98*/ struct TrainerNameRecord trainerNameRecords[20]; /*0x3C88*/ u8 registeredTexts[UNION_ROOM_KB_ROW_COUNT][21]; /*0x3D5A*/ u8 unused_3D5A[10]; - /*0x3D64*/ struct SaveTrainerHill trainerHill; + /*0x3D64*/ struct TrainerHillSave trainerHill; /*0x3D70*/ struct WaldaPhrase waldaPhrase; // sizeof: 0x3D88 }; diff --git a/include/trainer_hill.h b/include/trainer_hill.h index 647ba9647..857cabeae 100644 --- a/include/trainer_hill.h +++ b/include/trainer_hill.h @@ -1,7 +1,7 @@ #ifndef GUARD_TRAINER_HILL_H #define GUARD_TRAINER_HILL_H -#define HILL_TRAINER_NAME_LENGTH 11 +#define DUMMY_HILL_MON { .nickname = __("$$$$$$$$$$$") } struct TrainerHillTrainer { @@ -15,44 +15,30 @@ struct TrainerHillTrainer struct BattleTowerPokemon mons[PARTY_SIZE]; }; -struct TrHillRoomTrainers +struct TrainerHillFloorMap { - u8 name[2][HILL_TRAINER_NAME_LENGTH]; - u8 facilityClass[2]; + u8 metatileData[HILL_FLOOR_WIDTH * HILL_FLOOR_HEIGHT_MAIN]; // Add NUM_METATILES_IN_PRIMARY to the values in this array to get metatile ids. + u16 collisionData[HILL_FLOOR_WIDTH]; // One bit for each tile in column-major order, so every array entry is one row. 1 = impassable, 0 = passable + u8 trainerCoords[HILL_TRAINERS_PER_FLOOR]; // Starting at (0,6). Format is 0bYYYYXXXX. + u8 trainerDirections; // DIR_* - 1, 4 bits per trainer + u8 trainerRanges; // 4 bits per trainer }; -struct TrHillDisplay -{ - // Metatile data. Add 0x200 to the values in this array to get metatiles. - // This data then overwrites the metatiles in the map starting at (0,5) - u8 metatileData[0x100]; - // Collision data. One bit for each tile in column-major order, - // so every array entry is one row. 1 = impassable, 0 = passable - u16 collisionData[16]; - // Trainer coordinates, starting at (0,6). Format is 0bYYYYXXXX. - u8 coords[2]; - // Trainer facing directions. Same as (DIR_* - 1). - // Effectively an array of nibbles, one for each trainer. - u8 direction; - // Trainer sight ranges. Effectively an array of nibbles, one for each trainer. - u8 range; -}; - -struct TrHillFloor +struct TrainerHillFloor { u8 trainerNum1; u8 trainerNum2; - struct TrainerHillTrainer trainers[2]; - struct TrHillDisplay display; + struct TrainerHillTrainer trainers[HILL_TRAINERS_PER_FLOOR]; + struct TrainerHillFloorMap map; }; -struct TrHillTag +struct TrainerHillChallenge { u8 numTrainers; u8 unused1; u8 numFloors; - u32 checksum; - struct TrHillFloor floors[0]; + u32 checksum; // A byte array sum of the floor data + struct TrainerHillFloor floors[0]; // Floor data is assumed to follow, so this will be intentionally read out of bounds }; extern u32 *gTrainerHillVBlankCounter; diff --git a/src/data/battle_frontier/trainer_hill.h b/src/data/battle_frontier/trainer_hill.h index 75785b258..413ec8e12 100644 --- a/src/data/battle_frontier/trainer_hill.h +++ b/src/data/battle_frontier/trainer_hill.h @@ -1,20 +1,23 @@ -#define TRAINER_HILL_OTID 0x10000000 - // NOTE: Each of these macros turn data into one byte. Therefore ranges for all arguments is 0-15 -// See struct TrHillDisplay for more info about each +// See struct TrainerHillFloorMap for more info about each #define COORDS_XY(x,y) ((y<<4)|(x)) #define TRAINER_DIRS(a, b) (((a-1)<<4)|(b-1)) #define TRAINER_RANGE(a, b) ((a<<4)|(b)) -static const struct TrHillTag sDataTagJPDefault = { +// WARNING: While not referenced directly, the floor data in this file is referenced by virtue +// of coming after its corresponding challenge (see SetUpDataStruct in trainer_hill.c). +// Do not insert data between a pair of 'sChallenge_Mode' and 'sFloors_Mode'. + +// Unused +static const struct TrainerHillChallenge sChallenge_JPDefault = { .numTrainers = NUM_TRAINER_HILL_TRAINERS_JP, .unused1 = 1, .numFloors = NUM_TRAINER_HILL_FLOORS_JP, .checksum = 0x0 }; - -static const struct TrHillFloor sDataTagJPDefault_Floors[] = { +// Unused +static const struct TrainerHillFloor sFloors_JPDefault[] = { [0] = { .trainerNum1 = 0, .trainerNum2 = 0, @@ -32,8 +35,6 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .species = SPECIES_ZIGZAGOON, .heldItem = ITEM_SITRUS_BERRY, .moves = { MOVE_HEADBUTT, MOVE_PIN_MISSILE, MOVE_GROWL, MOVE_TAIL_WHIP }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 110, .attackEV = 100, .defenseEV = 100, @@ -50,14 +51,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = __("ジグザグマ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [1] = { .species = SPECIES_SHROOMISH, .heldItem = ITEM_PECHA_BERRY, .moves = { MOVE_MEGA_DRAIN, MOVE_LEECH_SEED, MOVE_POISON_POWDER, MOVE_GROWTH }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 120, .attackEV = 0, .defenseEV = 120, @@ -74,14 +73,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = __("キノココ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [2] = { .species = SPECIES_SANDSHREW, .heldItem = ITEM_QUICK_CLAW, .moves = { MOVE_SCRATCH, MOVE_POISON_STING, MOVE_SAND_ATTACK, MOVE_SWIFT }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 110, .attackEV = 100, .defenseEV = 100, @@ -98,11 +95,11 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = __("サンド$$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, - [3] = NULL_BATTLE_TOWER_POKEMON, - [4] = NULL_BATTLE_TOWER_POKEMON, - [5] = NULL_BATTLE_TOWER_POKEMON + [3] = DUMMY_HILL_MON, + [4] = DUMMY_HILL_MON, + [5] = DUMMY_HILL_MON } }, [1] = { @@ -114,15 +111,13 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .speechLose = { EC_WORD_OH_QUES, EC_MOVE(EARTHQUAKE), EC_WORD_EXISTS, EC_WORD_OF, EC_WORD_WITHOUT, EC_WORD_EXCL }, .speechAfter = { EC_WORD_YOU_RE, EC_WORD_PROBABLY, EC_WORD_END, EC_WORD_UNTIL, EC_WORD_GOING, EC_WORD_ANYWHERE }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_WINGULL, .heldItem = ITEM_CHERI_BERRY, .moves = { MOVE_WATER_GUN, MOVE_WING_ATTACK, MOVE_GROWL, MOVE_SUPERSONIC }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 110, .attackEV = 100, .defenseEV = 100, @@ -139,14 +134,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = __("キャモメ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_NUMEL, .heldItem = ITEM_FOCUS_BAND, .moves = { MOVE_EMBER, MOVE_DIG, MOVE_TACKLE, MOVE_FOCUS_ENERGY }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 110, .attackEV = 100, .defenseEV = 100, @@ -163,14 +156,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("ドンメル$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_SURSKIT, .heldItem = ITEM_PERSIM_BERRY, .moves = { MOVE_BUBBLE_BEAM, MOVE_MUD_SHOT, MOVE_QUICK_ATTACK, MOVE_AGILITY }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 100, .defenseEV = 100, @@ -187,12 +178,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = __("アメタマ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, }, - .display = { + .map = { .metatileData = { 0x31, 0x35, 0x35, 0x3b, 0x26, 0x26, 0x1b, 0x1c, 0x1d, 0x25, 0x39, 0x3a, 0x3b, 0x3b, 0x3b, 0x08, 0x31, 0x2b, 0x2b, 0x3b, 0x34, 0x34, 0x2b, 0x2b, 0x34, 0x33, 0x3f, 0x3f, 0x3f, 0x3f, 0x3b, 0x08, @@ -212,9 +203,9 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = { 0x0381, 0x6fc1, 0x6341, 0x6041, 0x7f41, 0x4401, 0x5541, 0x5541, 0x11c1, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, - .coords = { COORDS_XY(8,2), COORDS_XY(8,7) }, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(2, 3) + .trainerCoords = { COORDS_XY(8,2), COORDS_XY(8,7) }, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(2, 3) } }, [1] = { @@ -234,8 +225,6 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .species = SPECIES_ELECTRIKE, .heldItem = ITEM_CHERI_BERRY, .moves = { MOVE_SPARK, MOVE_THUNDER_WAVE, MOVE_QUICK_ATTACK, MOVE_ROAR }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 120, .attackEV = 120, .defenseEV = 0, @@ -252,14 +241,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 1, .personality = 0x0, .nickname = __("ラクライ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [1] = { .species = SPECIES_CORPHISH, .heldItem = ITEM_QUICK_CLAW, .moves = { MOVE_KNOCK_OFF, MOVE_CRABHAMMER, MOVE_TAUNT, MOVE_PROTECT }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 110, .defenseEV = 100, @@ -276,14 +263,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 1, .personality = 0x96, .nickname = __("ヘイガニ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [2] = { .species = SPECIES_BALTOY, .heldItem = ITEM_PERSIM_BERRY, .moves = { MOVE_PSYBEAM, MOVE_ROCK_TOMB, MOVE_MUD_SLAP, MOVE_HARDEN }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 100, .defenseEV = 100, @@ -300,11 +285,11 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("ヤジロン$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, - [3] = NULL_BATTLE_TOWER_POKEMON, - [4] = NULL_BATTLE_TOWER_POKEMON, - [5] = NULL_BATTLE_TOWER_POKEMON, + [3] = DUMMY_HILL_MON, + [4] = DUMMY_HILL_MON, + [5] = DUMMY_HILL_MON, } }, [1] = { @@ -316,15 +301,13 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .speechLose = { EC_WORD_AWFUL, EC_WORD_GWAH, EC_WORD_HOPELESS, EC_WORD_CAN_T_WIN, EC_WORD_IS, EC_WORD_NONE }, .speechAfter = { EC_WORD_AWW, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_ALMOST, EC_WORD_GOOD, EC_WORD_ANYWHERE }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_SPHEAL, .heldItem = ITEM_FOCUS_BAND, .moves = { MOVE_ICE_BALL, MOVE_BODY_SLAM, MOVE_WATER_GUN, MOVE_ENCORE }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 100, .defenseEV = 100, @@ -341,14 +324,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = __("タマザラシ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_SPOINK, .heldItem = ITEM_PERSIM_BERRY, .moves = { MOVE_PSYWAVE, MOVE_FUTURE_SIGHT, MOVE_CONFUSE_RAY, MOVE_MAGIC_COAT }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 0, .defenseEV = 100, @@ -365,14 +346,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 1, .personality = 0xf, .nickname = __("バネブー$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_POOCHYENA, .heldItem = ITEM_PECHA_BERRY, .moves = { MOVE_BITE, MOVE_POISON_FANG, MOVE_SWAGGER, MOVE_SCARY_FACE }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 70, .attackEV = 80, .defenseEV = 80, @@ -389,12 +368,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("ポチエナ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3b, 0x35, 0x3b, 0x39, 0x26, 0x1b, 0x1c, 0x1d, 0x25, 0x39, 0x3a, 0x3b, 0x35, 0x3b, 0x08, 0x31, 0x3b, 0x2b, 0x3b, 0x3b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x3b, 0x3b, 0x3b, 0x2b, 0x3b, 0x08, @@ -414,14 +393,14 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = { 0x0381, 0x27c5, 0x27c5, 0x27c5, 0x27c5, 0x27c5, 0x26c5, 0x2005, 0x3efd, 0x1, 0x6ff, 0x7ff, 0x7ff, 0xffff, 0xffff, 0xffff }, - .coords = { COORDS_XY(7,6), COORDS_XY(7,10) }, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3) + .trainerCoords = { COORDS_XY(7,6), COORDS_XY(7,10) }, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3) } }, }; -static const struct TrHillTag sDataTagNormal = +static const struct TrainerHillChallenge sChallenge_Normal = { .numTrainers = NUM_TRAINER_HILL_TRAINERS, .unused1 = 2, @@ -429,7 +408,7 @@ static const struct TrHillTag sDataTagNormal = .checksum = 0x00051E05 }; -static const struct TrHillFloor sDataTagNormal_Floors[] = +static const struct TrainerHillFloor sFloors_Normal[] = { [0] = { @@ -453,8 +432,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_MISDREAVUS, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SHADOW_BALL, MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .attackEV = 155, .speedEV = 255, .spAttackEV = 100, @@ -468,15 +445,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x0, .nickname = _("MISDREAVUS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_SOLROCK, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_PSYCHIC, MOVE_FLAMETHROWER, MOVE_ROCK_SLIDE, MOVE_CALM_MIND}, - .level = 0, - .ppBonuses = 0, .hpEV = 200, .defenseEV = 100, .spAttackEV = 110, @@ -491,15 +466,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("SOLROCK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_CLAYDOL, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_EARTHQUAKE, MOVE_PSYCHIC, MOVE_SHADOW_BALL, MOVE_ICE_BEAM}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .defenseEV = 135, .spDefenseEV = 120, @@ -513,15 +486,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xC, .nickname = _("CLAYDOL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_WEEZING, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_SLUDGE_BOMB, MOVE_SHADOW_BALL, MOVE_FRUSTRATION, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .attackEV = 200, .spDefenseEV = 200, @@ -542,8 +513,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_LUNATONE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_PSYCHIC, MOVE_ICE_BEAM, MOVE_ROCK_SLIDE, MOVE_CALM_MIND}, - .level = 0, - .ppBonuses = 0, .hpEV = 200, .defenseEV = 100, .spAttackEV = 110, @@ -558,15 +527,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("LUNATONE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_FLYGON, .heldItem = ITEM_CHOICE_BAND, .moves = {MOVE_EARTHQUAKE, MOVE_DRAGON_CLAW, MOVE_CRUNCH, MOVE_FLAMETHROWER}, - .level = 0, - .ppBonuses = 0, .attackEV = 155, .speedEV = 255, .spAttackEV = 100, @@ -580,7 +547,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x83, .nickname = _("FLYGON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -600,8 +567,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_SEALEO, .heldItem = ITEM_NEVER_MELT_ICE, .moves = {MOVE_BLIZZARD, MOVE_ICE_BALL, MOVE_ENCORE, MOVE_HAIL}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -614,15 +579,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("SEALEO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_AMPHAROS, .heldItem = ITEM_MAGNET, .moves = {MOVE_THUNDER, MOVE_THUNDER_WAVE, MOVE_COTTON_SPORE, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -635,15 +598,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("AMPHAROS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_MACHOKE, .heldItem = ITEM_BLACK_BELT, .moves = {MOVE_DYNAMIC_PUNCH, MOVE_MUD_SLAP, MOVE_COUNTER, MOVE_SCARY_FACE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -656,15 +617,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x4E, .nickname = _("MACHOKE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_FLAREON, .heldItem = ITEM_CHARCOAL, .moves = {MOVE_FIRE_BLAST, MOVE_BITE, MOVE_QUICK_ATTACK, MOVE_SAND_ATTACK}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -677,15 +636,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x28, .nickname = _("FLAREON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_MAGNETON, .heldItem = ITEM_MAGNET, .moves = {MOVE_ZAP_CANNON, MOVE_THUNDER_WAVE, MOVE_SCREECH, MOVE_METAL_SOUND}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -698,15 +655,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x0, .nickname = _("MAGNETON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_PINSIR, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_GUILLOTINE, MOVE_BRICK_BREAK, MOVE_SWAGGER, MOVE_FAINT_ATTACK}, - .level = 0, - .ppBonuses = 0, .hpEV = 200, .defenseEV = 155, .spDefenseEV = 155, @@ -720,12 +675,12 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x85, .nickname = _("PINSIR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x35, 0x35, 0x26, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x26, 0x3A, 0x3B, 0x35, 0x3B, 0x08, 0x31, 0x3B, 0x2C, 0x2C, 0x2C, 0x2B, 0x24, 0x24, 0x24, 0x24, 0x2C, 0x3B, 0x3B, 0x2C, 0x3B, 0x08, @@ -745,10 +700,10 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x3FE5, 0x0401, 0xBDED, 0x8425, 0xDFBD, 0x0221, 0x7E7F, 0x0941, 0x7F7D, 0x0911, 0x7FF7, 0x4101, 0x79F9, 0x0803, 0xFFFF}, - .coords = {COORDS_XY(11,1), COORDS_XY(13,2)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_NORTH), - .range = TRAINER_RANGE(2, 1), - } + .trainerCoords = {COORDS_XY(11,1), COORDS_XY(13,2)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(2, 1), + } }, [1] = { @@ -772,8 +727,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_MEDITITE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -787,15 +740,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x80, .nickname = _("MEDITITE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_HERACROSS, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -809,15 +760,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0x80, .nickname = _("HERACROSS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_HITMONTOP, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -831,15 +780,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x3, .nickname = _("HITMONTOP"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_MACHOP, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -853,15 +800,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x4E, .nickname = _("MACHOP"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_PINSIR, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -875,15 +820,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x80, .nickname = _("PINSIR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_HITMONCHAN, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -897,7 +840,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x3, .nickname = _("HITMONCHAN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -917,8 +860,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_VULPIX, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_WILL_O_WISP, MOVE_CONFUSE_RAY, MOVE_TAIL_WHIP, MOVE_OVERHEAT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -932,15 +873,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("VULPIX"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MINUN, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_THUNDER_WAVE, MOVE_CHARM, MOVE_ENCORE, MOVE_SPARK}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spAttackEV = 6, @@ -954,15 +893,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8C, .nickname = _("MINUN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_ROSELIA, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_TOXIC, MOVE_LEECH_SEED, MOVE_SWEET_SCENT, MOVE_GIGA_DRAIN}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spAttackEV = 6, @@ -976,15 +913,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0xF, .nickname = _("ROSELIA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_MR_MIME, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_SAFEGUARD, MOVE_REFLECT, MOVE_LIGHT_SCREEN, MOVE_PSYCHIC}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -998,15 +933,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x82, .nickname = _("MR. MIME"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_PLUSLE, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_RAIN_DANCE, MOVE_LIGHT_SCREEN, MOVE_HELPING_HAND, MOVE_THUNDER}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -1020,15 +953,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x5, .nickname = _("PLUSLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_TOGEPI, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_LIGHT_SCREEN, MOVE_REFLECT, MOVE_FOLLOW_ME, MOVE_METRONOME}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -1042,12 +973,12 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0x37, .nickname = _("TOGEPI"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0xD1, 0xD5, 0xD5, 0xD5, 0xD9, 0xD9, 0x1B, 0x1C, 0x1D, 0xC5, 0xC6, 0xCE, 0xD5, 0xDB, 0xD5, 0x08, 0xD1, 0xCB, 0xC4, 0xC4, 0xDB, 0xDB, 0xC4, 0xC4, 0xC4, 0xCC, 0xCC, 0xCC, 0xCB, 0xDB, 0xCB, 0x08, @@ -1067,10 +998,10 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x73FB, 0x400B, 0x400B, 0x51EB, 0x538B, 0x51BB, 0x518B, 0x51EB, 0x518B, 0x51BB, 0x5003, 0x501F, 0x101F, 0x101F, 0xFFFF}, - .coords = {COORDS_XY(4,11), COORDS_XY(9,14)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_EAST), - .range = TRAINER_RANGE(3, 5), - } + .trainerCoords = {COORDS_XY(4,11), COORDS_XY(9,14)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 5), + } }, [2] = { @@ -1094,8 +1025,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_VAPOREON, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_HAZE, MOVE_HELPING_HAND, MOVE_TICKLE, MOVE_WATER_PULSE}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1116,8 +1045,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_DODRIO, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_HAZE, MOVE_TRI_ATTACK, MOVE_TAUNT, MOVE_TORMENT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spDefenseEV = 6, @@ -1138,8 +1065,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_OMASTAR, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_HAZE, MOVE_HYDRO_PUMP, MOVE_TICKLE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1153,15 +1078,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x14, .nickname = _("OMASTAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_LICKITUNG, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_BELLY_DRUM, MOVE_REST, MOVE_MUD_SLAP, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1175,15 +1098,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8, .nickname = _("LICKITUNG"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_SLOWBRO, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_BELLY_DRUM, MOVE_MUD_SLAP, MOVE_SWAGGER, MOVE_AMNESIA}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1204,8 +1125,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_LINOONE, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_BELLY_DRUM, MOVE_REST, MOVE_MUD_SLAP, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1219,7 +1138,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8, .nickname = _("LINOONE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -1239,8 +1158,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_SKITTY, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_PSYCH_UP, MOVE_DOUBLE_EDGE, MOVE_SHADOW_BALL, MOVE_IRON_TAIL}, - .level = 0, - .ppBonuses = 0, .attackEV = 252, .speedEV = 252, .otId = TRAINER_HILL_OTID, @@ -1253,15 +1170,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xCB, .nickname = _("SKITTY"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MEDICHAM, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_PSYCH_UP, MOVE_HI_JUMP_KICK, MOVE_MEGA_KICK, MOVE_ROCK_SLIDE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 6, .speedEV = 252, @@ -1282,8 +1197,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_STANTLER, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_PSYCH_UP, MOVE_RETURN, MOVE_EARTHQUAKE, MOVE_SHADOW_BALL}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .speedEV = 6, @@ -1304,8 +1217,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_NIDOQUEEN, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_SUPERPOWER, MOVE_BITE, MOVE_CHARM, MOVE_FLATTER}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -1326,8 +1237,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_NINETALES, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_OVERHEAT, MOVE_QUICK_ATTACK, MOVE_SPITE, MOVE_TAIL_WHIP}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -1341,15 +1250,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xD7, .nickname = _("NINETALES"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_CHARIZARD, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_OVERHEAT, MOVE_BEAT_UP, MOVE_SCARY_FACE, MOVE_GROWL}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -1363,12 +1270,12 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x28, .nickname = _("CHARIZARD"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x35, 0x35, 0x35, 0x26, 0x26, 0x13, 0x14, 0x15, 0x38, 0x26, 0x2E, 0x35, 0x35, 0x3B, 0x08, 0x69, 0x63, 0x64, 0x64, 0x64, 0x64, 0x71, 0x71, 0x71, 0x72, 0x64, 0x64, 0x64, 0x63, 0x73, 0x08, @@ -1388,10 +1295,10 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = 0x69, 0x42, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x42, 0x73, 0x08, }, .collisionData = {0x0381, 0x7C3D, 0x4005, 0x4005, 0x4005, 0x4045, 0x4005, 0x4805, 0x4005, 0x4045, 0x4005, 0x4205, 0x4005, 0x4045, 0x1, 0x1}, - .coords = {COORDS_XY(5,2), COORDS_XY(9,2)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(3, 3), - } + .trainerCoords = {COORDS_XY(5,2), COORDS_XY(9,2)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 3), + } }, [3] = { @@ -1415,8 +1322,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_ALAKAZAM, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_SKILL_SWAP, MOVE_FIRE_PUNCH, MOVE_ICE_PUNCH, MOVE_REFLECT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1429,15 +1334,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x41, .nickname = _("ALAKAZAM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_BLISSEY, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_SKILL_SWAP, MOVE_EGG_BOMB, MOVE_THUNDERBOLT, MOVE_SING}, - .level = 0, - .ppBonuses = 0, .defenseEV = 255, .spAttackEV = 155, .spDefenseEV = 100, @@ -1451,15 +1354,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0xF, .nickname = _("BLISSEY"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_GRUMPIG, .heldItem = ITEM_TWISTED_SPOON, .moves = {MOVE_SKILL_SWAP, MOVE_PSYCHIC, MOVE_CONFUSE_RAY, MOVE_REST}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spAttackEV = 200, @@ -1473,15 +1374,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8C, .nickname = _("GRUMPIG"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_GARDEVOIR, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_SKILL_SWAP, MOVE_DREAM_EATER, MOVE_HYPNOSIS, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1494,15 +1393,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0xF, .nickname = _("GARDEVOIR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_VENOMOTH, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SKILL_SWAP, MOVE_SIGNAL_BEAM, MOVE_SLEEP_POWDER, MOVE_TOXIC}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1515,15 +1412,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x80, .nickname = _("VENOMOTH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ESPEON, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_SKILL_SWAP, MOVE_PSYBEAM, MOVE_SWIFT, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1536,7 +1431,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("ESPEON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -1556,8 +1451,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_WEEZING, .heldItem = ITEM_POISON_BARB, .moves = {MOVE_TOXIC, MOVE_SLUDGE_BOMB, MOVE_SMOKESCREEN, MOVE_HAZE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1570,15 +1463,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x3, .nickname = _("WEEZING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_GLOOM, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_PETAL_DANCE, MOVE_SYNTHESIS, MOVE_SUNNY_DAY, MOVE_SOLAR_BEAM}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1591,15 +1482,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8C, .nickname = _("GLOOM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_MUK, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SCREECH, MOVE_DISABLE, MOVE_SLUDGE_BOMB, MOVE_ACID_ARMOR}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1612,15 +1501,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x3, .nickname = _("MUK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_TROPIUS, .heldItem = ITEM_WHITE_HERB, .moves = {MOVE_SUNNY_DAY, MOVE_SOLAR_BEAM, MOVE_SWEET_SCENT, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .attackEV = 120, .speedEV = 255, .spAttackEV = 135, @@ -1634,15 +1521,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x83, .nickname = _("TROPIUS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_BELLOSSOM, .heldItem = ITEM_MENTAL_HERB, .moves = {MOVE_SWEET_SCENT, MOVE_PETAL_DANCE, MOVE_STUN_SPORE, MOVE_SLUDGE_BOMB}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1655,15 +1540,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x6, .nickname = _("BELLOSSOM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_MEGANIUM, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_RAZOR_LEAF, MOVE_BODY_SLAM, MOVE_LEECH_SEED, MOVE_SYNTHESIS}, - .level = 0, - .ppBonuses = 0, .attackEV = 200, .speedEV = 110, .spAttackEV = 200, @@ -1677,12 +1560,12 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x1F, .nickname = _("MEGANIUM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x1F, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x24, 0x24, 0x24, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x08, @@ -1702,14 +1585,14 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x7C1, 0x8441, 0x8477, 0x8441, 0xA441, 0x0401, 0x1, 0x8401, 0x8465, 0x0445, 0x1441, 0x8449, 0x8449, 0x87C1, 0xFFFF}, - .coords = {COORDS_XY(7,4), COORDS_XY(7,10)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), - } + .trainerCoords = {COORDS_XY(7,4), COORDS_XY(7,10)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), + } }, }; -static const struct TrHillTag sDataTagVariety = +static const struct TrainerHillChallenge sChallenge_Variety = { .numTrainers = NUM_TRAINER_HILL_TRAINERS, .unused1 = 1, @@ -1717,7 +1600,7 @@ static const struct TrHillTag sDataTagVariety = .checksum = 0x00054C15 }; -static const struct TrHillFloor sDataTagVariety_Floors[] = { +static const struct TrainerHillFloor sFloors_Variety[] = { [0] = { .trainerNum1 = 41, @@ -1740,8 +1623,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_DELIBIRD, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_SPLASH, MOVE_HAIL, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1754,15 +1635,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0x8A, .nickname = _("DELIBIRD"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_CLEFAIRY, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_COSMIC_POWER, MOVE_LIGHT_SCREEN, MOVE_MOONLIGHT}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1775,15 +1654,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("CLEFAIRY"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_PIKACHU, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_GROWL, MOVE_TAIL_WHIP, MOVE_AGILITY}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1796,15 +1673,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("PIKACHU"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_MARILL, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_DEFENSE_CURL, MOVE_TAIL_WHIP, MOVE_ENDURE}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1817,15 +1692,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0x8A, .nickname = _("MARILL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_JIGGLYPUFF, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_SING, MOVE_DISABLE, MOVE_REST}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1838,15 +1711,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("JIGGLYPUFF"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_TOGETIC, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_CHARM, MOVE_SWEET_KISS, MOVE_WISH}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1859,7 +1730,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0x26, .nickname = _("TOGETIC"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -1879,8 +1750,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_WIGGLYTUFF, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_ROLLOUT, MOVE_DEFENSE_CURL, MOVE_SING, MOVE_DREAM_EATER}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1893,15 +1762,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xC1, .nickname = _("WIGGLYTUFF"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_SABLEYE, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_ASTONISH, MOVE_FAINT_ATTACK, MOVE_DETECT, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1914,15 +1781,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x87, .nickname = _("SABLEYE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_GRUMPIG, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_PSYBEAM, MOVE_MAGIC_COAT, MOVE_BOUNCE, MOVE_FUTURE_SIGHT}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1935,15 +1800,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("GRUMPIG"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_CORSOLA, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_BUBBLE_BEAM, MOVE_ROCK_BLAST, MOVE_REFLECT, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1956,15 +1819,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x12, .nickname = _("CORSOLA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_CLAMPERL, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_WHIRLPOOL, MOVE_IRON_DEFENSE, MOVE_ENDURE, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1977,15 +1838,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("CLAMPERL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_STARMIE, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_DIVE, MOVE_ICY_WIND, MOVE_SWIFT, MOVE_SKILL_SWAP}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1998,12 +1857,12 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("STARMIE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0x43, 0x43, 0x43, 0x43, 0x43, 0x40, 0x41, 0x41, 0x08, @@ -2023,9 +1882,9 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { 0x40, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x08, }, .collisionData = {0x0381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1}, - .coords = {COORDS_XY(5,8), COORDS_XY(9,8)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(5,8), COORDS_XY(9,8)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 3), } }, [1] = @@ -2050,8 +1909,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_JIGGLYPUFF, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SING, MOVE_HYPER_VOICE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2068,15 +1925,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("JIGGLYPUFF"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_JYNX, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_PERISH_SONG, MOVE_FAKE_TEARS, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2093,15 +1948,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("JYNX"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_EXPLOUD, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_HOWL, MOVE_HYPER_VOICE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2118,15 +1971,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = _("EXPLOUD"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_ABSOL, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SWORDS_DANCE, MOVE_SLASH, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2143,15 +1994,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = _("ABSOL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_PIDGEOTTO, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_FEATHER_DANCE, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2168,15 +2017,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = _("PIDGEOTTO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ALTARIA, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_DRAGON_DANCE, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2193,7 +2040,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("ALTARIA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -2213,8 +2060,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_CHIMECHO, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2228,15 +2073,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("CHIMECHO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_WHISMUR, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2250,15 +2093,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("WHISMUR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_YANMA, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2272,15 +2113,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x8A, .nickname = _("YANMA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_ILLUMISE, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -2294,15 +2133,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("ILLUMISE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_SPHEAL, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spDefenseEV = 6, @@ -2316,15 +2153,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("SPHEAL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_VIGOROTH, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -2338,12 +2173,12 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x87, .nickname = _("VIGOROTH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x91, 0x9B, 0x9C, 0x96, 0x40, 0x40, 0x96, 0x9B, 0x96, 0x40, 0x40, 0x96, 0x9B, 0x9C, 0x9B, 0x08, @@ -2363,9 +2198,9 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF}, - .coords = {COORDS_XY(3,8), COORDS_XY(11,8)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(7, 7), + .trainerCoords = {COORDS_XY(3,8), COORDS_XY(11,8)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(7, 7), } }, [2] = @@ -2390,8 +2225,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_WOOPER, .heldItem = ITEM_FIGY_BERRY, .moves = {MOVE_RAIN_DANCE, MOVE_YAWN, MOVE_SURF, MOVE_HAZE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 6, .spAttackEV = 252, @@ -2405,15 +2238,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x8C, .nickname = _("WOOPER"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_POLIWAG, .heldItem = ITEM_WIKI_BERRY, .moves = {MOVE_SURF, MOVE_ICE_BEAM, MOVE_MIST, MOVE_HYPNOSIS}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 6, .spAttackEV = 252, @@ -2427,15 +2258,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0x3, .nickname = _("POLIWAG"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_PSYDUCK, .heldItem = ITEM_AGUAV_BERRY, .moves = {MOVE_HYPNOSIS, MOVE_SURF, MOVE_DISABLE, MOVE_SEISMIC_TOSS}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -2449,15 +2278,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("PSYDUCK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_RHYDON, .heldItem = ITEM_SOFT_SAND, .moves = {MOVE_EARTHQUAKE, MOVE_MAGNITUDE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .speedEV = 6, @@ -2478,8 +2305,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_RHYHORN, .heldItem = ITEM_SOFT_SAND, .moves = {MOVE_EARTHQUAKE, MOVE_MAGNITUDE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2500,8 +2325,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_CUBONE, .heldItem = ITEM_SOFT_SAND, .moves = {MOVE_EARTHQUAKE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2535,8 +2358,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_MAGNEMITE, .heldItem = ITEM_MAGNET, .moves = {MOVE_THUNDER, MOVE_ZAP_CANNON, MOVE_SPARK, MOVE_THUNDER_SHOCK}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -2550,15 +2371,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x8C, .nickname = _("MAGNEMITE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_ELECTABUZZ, .heldItem = ITEM_MAGNET, .moves = {MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_THUNDER_PUNCH, MOVE_SHOCK_WAVE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -2572,15 +2391,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x41, .nickname = _("ELECTABUZZ"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_FLAAFFY, .heldItem = ITEM_MAGNET, .moves = {MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_SHOCK_WAVE, MOVE_THUNDER_SHOCK}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .spAttackEV = 130, .otId = TRAINER_HILL_OTID, @@ -2593,15 +2410,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("FLAAFFY"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_BALTOY, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2622,8 +2437,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_PINECO, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .speedEV = 6, @@ -2644,8 +2457,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_VOLTORB, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2664,7 +2475,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x1C, 0x1D, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x84, 0x84, 0x84, 0x9A, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x08, @@ -2684,9 +2495,9 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { 0x17, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0x17, 0xBB, 0xBB, 0x08, }, .collisionData = {0x0381, 0x0381, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1}, - .coords = {COORDS_XY(9,1), COORDS_XY(14,1)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(4, 4), + .trainerCoords = {COORDS_XY(9,1), COORDS_XY(14,1)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(4, 4), } }, [3] = @@ -2711,8 +2522,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_UNOWN, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2725,15 +2534,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x202, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_UNOWN, .heldItem = ITEM_MYSTIC_WATER, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2746,15 +2553,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x10001, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_UNOWN, .heldItem = ITEM_BLACK_BELT, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2767,15 +2572,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x102, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_SPINDA, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_TEETER_DANCE, MOVE_DIZZY_PUNCH, MOVE_CALM_MIND, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spDefenseEV = 200, @@ -2789,15 +2592,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x88FE980F, .nickname = _("SPINDA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_PLUSLE, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_HELPING_HAND, MOVE_THUNDERBOLT, MOVE_AGILITY, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2810,15 +2611,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("PLUSLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_VOLBEAT, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_HELPING_HAND, MOVE_SIGNAL_BEAM, MOVE_SOLAR_BEAM, MOVE_MOONLIGHT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2831,7 +2630,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("VOLBEAT"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -2851,8 +2650,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_SPINDA, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_TEETER_DANCE, MOVE_DIZZY_PUNCH, MOVE_CALM_MIND, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spDefenseEV = 200, @@ -2866,15 +2663,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xE2880098, .nickname = _("SPINDA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MINUN, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_HELPING_HAND, MOVE_THUNDERBOLT, MOVE_AGILITY, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2887,15 +2682,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x8C, .nickname = _("MINUN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_ILLUMISE, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_HELPING_HAND, MOVE_WISH, MOVE_THUNDERBOLT, MOVE_MOONLIGHT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2908,15 +2701,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("ILLUMISE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_UNOWN, .heldItem = ITEM_CHARCOAL, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2929,15 +2720,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x302, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_UNOWN, .heldItem = ITEM_SOFT_SAND, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2950,15 +2739,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x203, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_UNOWN, .heldItem = ITEM_TWISTED_SPOON, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2971,12 +2758,12 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x301, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x5E, 0x41, 0x71, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x08, @@ -2996,14 +2783,14 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x1, 0x2201, 0x1, 0x8881, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0xFFFF}, - .coords = {COORDS_XY(10,2), COORDS_XY(14,2)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(10,2), COORDS_XY(14,2)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 3), } }, }; -static const struct TrHillTag sDataTagUnique = +static const struct TrainerHillChallenge sChallenge_Unique = { .numTrainers = NUM_TRAINER_HILL_TRAINERS, .unused1 = 3, @@ -3011,7 +2798,7 @@ static const struct TrHillTag sDataTagUnique = .checksum = 0x000652F3 }; -static const struct TrHillFloor sDataTagUnique_Floors[] = { +static const struct TrainerHillFloor sFloors_Unique[] = { [0] = { .trainerNum1 = 49, @@ -3034,8 +2821,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_SUNFLORA, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_PETAL_DANCE, MOVE_GRASS_WHISTLE, MOVE_LIGHT_SCREEN, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .defenseEV = 155, .spDefenseEV = 100, @@ -3049,15 +2834,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("SUNFLORA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_TANGELA, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_GIGA_DRAIN, MOVE_SLEEP_POWDER, MOVE_AMNESIA, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spDefenseEV = 255, .otId = TRAINER_HILL_OTID, @@ -3070,15 +2853,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x91, .nickname = _("TANGELA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_VENUSAUR, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_SOLAR_BEAM, MOVE_EARTHQUAKE, MOVE_SYNTHESIS, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 100, .attackEV = 110, .defenseEV = 100, @@ -3094,15 +2875,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x1F, .nickname = _("VENUSAUR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_LANTURN, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_SPARK, MOVE_WATER_PULSE, MOVE_CONFUSE_RAY, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3115,15 +2894,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("LANTURN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_MANECTRIC, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_THUNDERBOLT, MOVE_HEADBUTT, MOVE_BITE, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3136,15 +2913,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("MANECTRIC"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_RAIKOU, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_THUNDER, MOVE_CRUNCH, MOVE_ROAR, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3157,7 +2932,7 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("RAIKOU"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -3177,8 +2952,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_RELICANTH, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_ANCIENT_POWER, MOVE_WATER_PULSE, MOVE_MUD_SPORT, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .hpEV = 155, .defenseEV = 100, .spDefenseEV = 255, @@ -3192,15 +2965,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x2F, .nickname = _("RELICANTH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_GOLDUCK, .heldItem = ITEM_LAX_INCENSE, .moves = {MOVE_SURF, MOVE_PSYBEAM, MOVE_BRICK_BREAK, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3213,15 +2984,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("GOLDUCK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_BLASTOISE, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_HYDRO_PUMP, MOVE_BITE, MOVE_MIRROR_COAT, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3234,15 +3003,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x28, .nickname = _("BLASTOISE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_MAGCARGO, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_HEAT_WAVE, MOVE_ROCK_SLIDE, MOVE_PROTECT, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spDefenseEV = 255, .otId = TRAINER_HILL_OTID, @@ -3255,15 +3022,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0x93, .nickname = _("MAGCARGO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_RAPIDASH, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_FIRE_BLAST, MOVE_BOUNCE, MOVE_QUICK_ATTACK, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3276,15 +3041,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("RAPIDASH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_MOLTRES, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SKY_ATTACK, MOVE_AERIAL_ACE, MOVE_ROAR, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3297,12 +3060,12 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("MOLTRES"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0xF1, 0xF5, 0xFB, 0xF5, 0xE6, 0xE6, 0x1B, 0x14, 0x15, 0xF8, 0xF9, 0xFA, 0xFB, 0xFB, 0xFB, 0x08, 0xF1, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xF9, 0xE6, 0xEE, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0x08, @@ -3322,9 +3085,9 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x5E01, 0x50FF, 0x5083, 0x503B, 0x5FEB, 0xC02B, 0x5FEB, 0x5009, 0x57FD, 0x1005, 0x7FF5, 0x15, 0x7FF5, 0x1, 0xFFFF}, - .coords = {COORDS_XY(4,3), COORDS_XY(7,3)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(2, 2), + .trainerCoords = {COORDS_XY(4,3), COORDS_XY(7,3)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(2, 2), } }, [1] = @@ -3349,8 +3112,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_EARTHQUAKE, MOVE_SHADOW_BALL, MOVE_AERIAL_ACE, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 6, .speedEV = 252, @@ -3364,15 +3125,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x8A, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_REST, MOVE_THUNDER_WAVE, MOVE_FLAMETHROWER, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3386,15 +3145,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x87, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_TEETER_DANCE, MOVE_LOCK_ON, MOVE_SHEER_COLD, MOVE_EXPLOSION}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 6, .speedEV = 252, @@ -3408,15 +3165,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_THUNDERBOLT, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3430,15 +3185,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_TOXIC, MOVE_PROTECT, MOVE_WILL_O_WISP, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -3452,15 +3205,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_TEETER_DANCE, MOVE_LOCK_ON, MOVE_SHEER_COLD, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -3474,7 +3225,7 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x8A, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -3494,8 +3245,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_STARYU, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_CAMOUFLAGE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3509,15 +3258,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xA, .nickname = _("STARYU"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MEOWTH, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_PAY_DAY, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3531,15 +3278,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("MEOWTH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_BLAZIKEN, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_BLAZE_KICK, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spDefenseEV = 6, @@ -3553,15 +3298,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x28, .nickname = _("BLAZIKEN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_CUBONE, .heldItem = ITEM_THICK_CLUB, .moves = {MOVE_BONEMERANG, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .spDefenseEV = 252, @@ -3575,15 +3318,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0x16, .nickname = _("CUBONE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_BEEDRILL, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_TWINEEDLE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .otId = TRAINER_HILL_OTID, @@ -3596,15 +3337,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x8A, .nickname = _("BEEDRILL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_RATICATE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_SUPER_FANG, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -3618,12 +3357,12 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xD, .nickname = _("RATICATE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x2D, 0x3B, 0x3B, 0x3B, 0x35, 0x2C, 0x23, 0x24, 0x23, 0x2C, 0x35, 0x3B, 0x3B, 0x3B, 0x3B, 0x08, @@ -3643,9 +3382,9 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x7C1, 0x8AA1, 0x0209, 0x5557, 0xA281, 0x81, 0x5D6D, 0x2283, 0x89, 0xDD55, 0x20A1, 0xA81, 0x7D5D, 0x9, 0xFFFF}, - .coords = {COORDS_XY(9,6), COORDS_XY(13,6)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(9,6), COORDS_XY(13,6)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 3), } }, [2] = @@ -3670,8 +3409,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_CHARMELEON, .heldItem = ITEM_CHARCOAL, .moves = {MOVE_FIRE_SPIN, MOVE_DRAGON_RAGE, MOVE_FLAMETHROWER, MOVE_SLASH}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3692,8 +3429,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_WARTORTLE, .heldItem = ITEM_MYSTIC_WATER, .moves = {MOVE_HYDRO_PUMP, MOVE_SKULL_BASH, MOVE_RAIN_DANCE, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .otId = TRAINER_HILL_OTID, @@ -3713,8 +3448,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_IVYSAUR, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_SOLAR_BEAM, MOVE_SYNTHESIS, MOVE_GROWTH, MOVE_SWEET_SCENT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 6, .spAttackEV = 252, @@ -3735,8 +3468,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_BAYLEEF, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_SOLAR_BEAM, MOVE_SAFEGUARD, MOVE_LIGHT_SCREEN, MOVE_BODY_SLAM}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .attackEV = 130, .spAttackEV = 130, @@ -3757,8 +3488,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_CROCONAW, .heldItem = ITEM_MYSTIC_WATER, .moves = {MOVE_SCARY_FACE, MOVE_SLASH, MOVE_HYDRO_PUMP, MOVE_SCREECH}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .speedEV = 6, @@ -3779,8 +3508,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_QUILAVA, .heldItem = ITEM_CHARCOAL, .moves = {MOVE_QUICK_ATTACK, MOVE_FLAMETHROWER, MOVE_FLAME_WHEEL, MOVE_SWIFT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3814,8 +3541,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_SMOOCHUM, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_ICE_BEAM, MOVE_PSYCHIC, MOVE_SWEET_KISS, MOVE_FAKE_TEARS}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3836,8 +3561,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_AZURILL, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_SURF, MOVE_SING, MOVE_RAIN_DANCE, MOVE_BLIZZARD}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3858,8 +3581,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_ELEKID, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_FIRE_PUNCH, MOVE_THUNDER, MOVE_ICE_PUNCH, MOVE_THUNDER_WAVE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3880,8 +3601,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_CLEFFA, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_MEGA_KICK, MOVE_SWEET_KISS, MOVE_SING, MOVE_METRONOME}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -3902,8 +3621,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_WYNAUT, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_ENCORE, MOVE_COUNTER, MOVE_MIRROR_COAT, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -3924,8 +3641,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_MAGBY, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_FIRE_BLAST, MOVE_CONFUSE_RAY, MOVE_THUNDER_PUNCH, MOVE_BARRIER}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3944,7 +3659,7 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x08, @@ -3964,9 +3679,9 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x7FFB, 0x4003, 0x5FFF, 0x4003, 0x7FFB, 0x4003, 0x7EFF, 0x4443, 0x4443, 0x4443, 0x7EFF, 0x4001, 0x7FFD, 0x1, 0xFFFF}, - .coords = {COORDS_XY(6,9), COORDS_XY(8,9)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(1, 1), + .trainerCoords = {COORDS_XY(6,9), COORDS_XY(8,9)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(1, 1), } }, [3] = @@ -3991,8 +3706,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_SUDOWOODO, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_ROCK_SLIDE, MOVE_BLOCK, MOVE_TOXIC, MOVE_EXPLOSION}, - .level = 0, - .ppBonuses = 0, .hpEV = 100, .attackEV = 255, .spDefenseEV = 155, @@ -4006,15 +3719,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("SUDOWOODO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_SLOWKING, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_SURF, MOVE_PSYCHIC, MOVE_BLIZZARD, MOVE_DISABLE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .defenseEV = 255, .otId = TRAINER_HILL_OTID, @@ -4027,15 +3738,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0x8C, .nickname = _("SLOWKING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_ENTEI, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_FLAMETHROWER, MOVE_CALM_MIND, MOVE_FIRE_SPIN, MOVE_ROAR}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4048,15 +3757,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("ENTEI"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_HITMONCHAN, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_MEGA_PUNCH, MOVE_DETECT, MOVE_COUNTER, MOVE_SKY_UPPERCUT}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -4069,15 +3776,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("HITMONCHAN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_MANTINE, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_SURF, MOVE_CONFUSE_RAY, MOVE_ATTRACT, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .defenseEV = 255, .otId = TRAINER_HILL_OTID, @@ -4090,15 +3795,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0x6, .nickname = _("MANTINE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ZAPDOS, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_THUNDERBOLT, MOVE_DRILL_PECK, MOVE_THUNDER_WAVE, MOVE_AGILITY}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4111,7 +3814,7 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x18, .nickname = _("ZAPDOS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -4131,8 +3834,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_HITMONLEE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_MEGA_KICK, MOVE_MIND_READER, MOVE_FOCUS_ENERGY, MOVE_HI_JUMP_KICK}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4145,15 +3846,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("HITMONLEE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_PORYGON2, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_LOCK_ON, MOVE_BLIZZARD, MOVE_CONVERSION_2, MOVE_PSYCHIC}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4166,15 +3865,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("PORYGON2"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_SUICUNE, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_SURF, MOVE_CALM_MIND, MOVE_MIRROR_COAT, MOVE_MIST}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4187,15 +3884,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("SUICUNE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_HOUNDOOM, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_FLAMETHROWER, MOVE_CRUNCH, MOVE_ROAR, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4208,15 +3903,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("HOUNDOOM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_STANTLER, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_CONFUSE_RAY, MOVE_SWAGGER, MOVE_PSYCH_UP, MOVE_TAKE_DOWN}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -4229,15 +3922,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("STANTLER"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ARTICUNO, .heldItem = ITEM_NEVER_MELT_ICE, .moves = {MOVE_BLIZZARD, MOVE_SHEER_COLD, MOVE_MIST, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4250,12 +3941,12 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("ARTICUNO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0xF1, 0xFB, 0xFB, 0xFB, 0xF9, 0xF9, 0x1B, 0x1C, 0x1D, 0xE5, 0xE6, 0xEE, 0xF5, 0xFB, 0xFB, 0x08, 0xED, 0xF5, 0xF5, 0xF5, 0xFB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEB, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0x08, @@ -4275,14 +3966,14 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x3F9, 0xF041, 0x41, 0x7F5F, 0x4401, 0x4541, 0x5579, 0x5541, 0x555F, 0x5541, 0x5541, 0x557D, 0x1101, 0x1101, 0xFFFF}, - .coords = {COORDS_XY(8,2), COORDS_XY(11,5)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(8,2), COORDS_XY(11,5)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), } }, }; -static const struct TrHillTag sDataTagExpert = +static const struct TrainerHillChallenge sChallenge_Expert = { .numTrainers = NUM_TRAINER_HILL_TRAINERS, .unused1 = 1, @@ -4290,7 +3981,7 @@ static const struct TrHillTag sDataTagExpert = .checksum = 0x00061F3F }; -static const struct TrHillFloor sDataTagExpert_Floors[] = { +static const struct TrainerHillFloor sFloors_Expert[] = { [0] = { .trainerNum1 = 57, @@ -4313,8 +4004,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_SNORLAX, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_MEGA_KICK, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_EARTHQUAKE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .defenseEV = 252, @@ -4328,15 +4017,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x35, .nickname = _("SNORLAX"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MILTANK, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_DOUBLE_EDGE, MOVE_SHADOW_BALL, MOVE_ATTRACT, MOVE_MILK_DRINK}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -4350,15 +4037,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("MILTANK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_URSARING, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_DOUBLE_EDGE, MOVE_CRUNCH, MOVE_BRICK_BREAK, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spAttackEV = 6, @@ -4372,15 +4057,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x7F, .nickname = _("URSARING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_SLAKING, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_HYPER_BEAM, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_REST}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .spDefenseEV = 252, @@ -4394,15 +4077,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("SLAKING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_KANGASKHAN, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_MEGA_KICK, MOVE_SHADOW_BALL, MOVE_ATTRACT, MOVE_FAKE_OUT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -4416,15 +4097,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("KANGASKHAN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ZANGOOSE, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_CRUSH_CLAW, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_ROAR}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -4438,7 +4117,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("ZANGOOSE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -4458,8 +4137,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_SLOWKING, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_ICE_BEAM, MOVE_SKILL_SWAP}, - .level = 0, - .ppBonuses = 0, .hpEV = 200, .defenseEV = 110, .spAttackEV = 200, @@ -4473,15 +4150,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("SLOWKING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_ESPEON, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_PSYCHIC, MOVE_BITE, MOVE_CALM_MIND, MOVE_REFLECT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4495,15 +4170,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x28, .nickname = _("ESPEON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_STARMIE, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_THUNDERBOLT, MOVE_ICE_BEAM}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4517,15 +4190,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("STARMIE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_GENGAR, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_FIRE_PUNCH, MOVE_ICE_PUNCH}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4539,15 +4210,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("GENGAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_GARDEVOIR, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_MAGICAL_LEAF, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4561,15 +4230,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("GARDEVOIR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ALAKAZAM, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_PSYCHIC, MOVE_RECOVER, MOVE_THUNDER_WAVE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4583,12 +4250,12 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("ALAKAZAM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x31, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x08, @@ -4608,9 +4275,9 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x0201, 0x3EF9, 0x3EF9, 0x3EF9, 0x2009, 0x3019, 0x2009, 0x3019, 0x2009, 0x3019, 0x3019, 0x3C79, 0x1, 0x1, 0xFFFF}, - .coords = {COORDS_XY(4,7), COORDS_XY(10,7)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(5, 5), + .trainerCoords = {COORDS_XY(4,7), COORDS_XY(10,7)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(5, 5), } }, [1] = @@ -4635,8 +4302,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_SWELLOW, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_AERIAL_ACE, MOVE_AGILITY, MOVE_FACADE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4650,15 +4315,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("SWELLOW"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MACHAMP, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_LOW_KICK, MOVE_ROCK_SLIDE, MOVE_FACADE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4672,15 +4335,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("MACHAMP"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_URSARING, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_PROTECT, MOVE_ROCK_SLIDE, MOVE_FACADE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4694,15 +4355,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("URSARING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_KINGLER, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_RETURN, MOVE_PROTECT, MOVE_CRABHAMMER, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4716,15 +4375,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("KINGLER"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_TYRANITAR, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_ROCK_SLIDE, MOVE_CRUNCH, MOVE_EARTHQUAKE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .defenseEV = 6, @@ -4738,15 +4395,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("TYRANITAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_DRAGONITE, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_BODY_SLAM, MOVE_THUNDER_WAVE, MOVE_EARTHQUAKE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4760,7 +4415,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("DRAGONITE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -4780,8 +4435,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_JOLTEON, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_THUNDERBOLT, MOVE_THUNDER_WAVE, MOVE_ATTRACT, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4795,15 +4448,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("JOLTEON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_ALAKAZAM, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_PSYCHIC, MOVE_ICE_PUNCH, MOVE_ATTRACT, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4817,15 +4468,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("ALAKAZAM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_STARMIE, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_SURF, MOVE_PSYCHIC, MOVE_CONFUSE_RAY, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4839,15 +4488,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xA, .nickname = _("STARMIE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_DUSCLOPS, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_PURSUIT, MOVE_PROTECT, MOVE_ATTRACT, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -4861,15 +4508,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x82, .nickname = _("DUSCLOPS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_NINETALES, .heldItem = ITEM_WHITE_HERB, .moves = {MOVE_OVERHEAT, MOVE_CONFUSE_RAY, MOVE_WILL_O_WISP, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4883,15 +4528,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xD2, .nickname = _("NINETALES"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_BANETTE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_SHADOW_BALL, MOVE_FAINT_ATTACK, MOVE_ATTRACT, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -4905,12 +4548,12 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x85, .nickname = _("BANETTE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x08, @@ -4930,9 +4573,9 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }, .collisionData = {0x0381, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF}, - .coords = {COORDS_XY(7,10), COORDS_XY(7,14)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(7,10), COORDS_XY(7,14)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), } }, [2] = @@ -4957,8 +4600,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_WOBBUFFET, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_MIRROR_COAT, MOVE_COUNTER, MOVE_SAFEGUARD, MOVE_ENCORE}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -4972,15 +4613,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x94, .nickname = _("WOBBUFFET"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_EXPLOUD, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_HYPER_VOICE, MOVE_COUNTER, MOVE_REST, MOVE_ROCK_SLIDE}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -5001,8 +4640,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_CROBAT, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_AERIAL_ACE, MOVE_TOXIC}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -5016,15 +4653,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("CROBAT"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_DUGTRIO, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_DOUBLE_TEAM, MOVE_PROTECT, MOVE_RETURN, MOVE_SLUDGE_BOMB}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -5038,15 +4673,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xD, .nickname = _("DUGTRIO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_ELECTRODE, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_TORMENT, MOVE_MIRROR_COAT, MOVE_THUNDERBOLT, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spAttackEV = 6, @@ -5067,8 +4700,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_GENGAR, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_CONFUSE_RAY, MOVE_MEAN_LOOK, MOVE_GIGA_DRAIN, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spDefenseEV = 6, @@ -5082,7 +4713,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x14, .nickname = _("GENGAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -5102,8 +4733,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_LAPRAS, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_SURF, MOVE_ICE_BEAM, MOVE_PERISH_SONG, MOVE_SING}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -5124,8 +4753,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_ABSOL, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_PERISH_SONG, MOVE_DOUBLE_EDGE, MOVE_PROTECT, MOVE_TORMENT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -5146,8 +4773,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_ALTARIA, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_PERISH_SONG, MOVE_PROTECT, MOVE_DRAGON_CLAW, MOVE_FIRE_BLAST}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .spAttackEV = 6, .spDefenseEV = 252, @@ -5168,8 +4793,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_DEWGONG, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_ICE_BEAM, MOVE_SIGNAL_BEAM, MOVE_REST, MOVE_PERISH_SONG}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -5190,8 +4813,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_POLITOED, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_HYDRO_PUMP, MOVE_BLIZZARD, MOVE_MIND_READER, MOVE_PERISH_SONG}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .spAttackEV = 6, .spDefenseEV = 252, @@ -5212,8 +4833,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_MAROWAK, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_PERISH_SONG, MOVE_EARTHQUAKE, MOVE_COUNTER, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 6, .spDefenseEV = 252, @@ -5232,7 +4851,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { }, }, }, - .display = { + .map = { .metatileData = { 0xD1, 0xDB, 0xDB, 0xDB, 0xD9, 0xD9, 0x1B, 0x14, 0x15, 0x98, 0x99, 0x9A, 0x9B, 0x9B, 0x9B, 0x08, 0xD1, 0xDB, 0xDB, 0xDB, 0xD5, 0xD5, 0xC3, 0xF9, 0x86, 0x8E, 0x95, 0x9B, 0x9B, 0x9B, 0x9B, 0x08, @@ -5252,9 +4871,9 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { 0xD1, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCC, 0xFB, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x08, }, .collisionData = {0x0381, 0x0201, 0xEE1, 0x1EF1, 0x3EF9, 0x3EF9, 0x7E7D, 0x783D, 0x2BD, 0x783D, 0x7E7D, 0x3E79, 0x3EF9, 0x1EF1, 0xEE1, 0x201}, - .coords = {COORDS_XY(7,6), COORDS_XY(7,10)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(7,6), COORDS_XY(7,10)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), } }, [3] = @@ -5279,8 +4898,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_FORRETRESS, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_EXPLOSION, MOVE_EARTHQUAKE, MOVE_ATTRACT, MOVE_SPIKES}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .attackEV = 200, .spDefenseEV = 200, @@ -5294,15 +4911,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("FORRETRESS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_ELECTRODE, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_EXPLOSION, MOVE_THUNDERBOLT, MOVE_SWIFT, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5315,15 +4930,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xC, .nickname = _("ELECTRODE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_EXEGGUTOR, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_EXPLOSION, MOVE_HYPNOSIS, MOVE_PSYCHIC, MOVE_SOLAR_BEAM}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5336,15 +4949,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x7F, .nickname = _("EXEGGUTOR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_DUSCLOPS, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_ICE_BEAM, MOVE_EARTHQUAKE}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spDefenseEV = 200, @@ -5358,15 +4969,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x93, .nickname = _("DUSCLOPS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_NINETALES, .heldItem = ITEM_WHITE_HERB, .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_OVERHEAT, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5379,15 +4988,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("NINETALES"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_BANETTE, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_THUNDERBOLT, MOVE_THUNDER}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5400,7 +5007,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = _("BANETTE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -5420,8 +5027,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_SALAMENCE, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_ROCK_SLIDE, MOVE_FLAMETHROWER, MOVE_DRAGON_CLAW, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5434,15 +5039,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x95, .nickname = _("SALAMENCE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_GENGAR, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_PSYCHIC, MOVE_GIGA_DRAIN, MOVE_WILL_O_WISP, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5455,15 +5058,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x8C, .nickname = _("GENGAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_GYARADOS, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_DRAGON_DANCE, MOVE_HYPER_BEAM, MOVE_BITE, MOVE_EARTHQUAKE}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -5476,15 +5077,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("GYARADOS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_GENGAR, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_EXPLOSION, MOVE_MEAN_LOOK, MOVE_SHADOW_BALL, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -5497,15 +5096,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("GENGAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_DUSCLOPS, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_WILL_O_WISP, MOVE_SHADOW_BALL}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spDefenseEV = 200, @@ -5519,15 +5116,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x14, .nickname = _("DUSCLOPS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_MISDREAVUS, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_PERISH_SONG, MOVE_SHADOW_BALL}, - .level = 0, - .ppBonuses = 0, .hpEV = 180, .defenseEV = 180, .spDefenseEV = 150, @@ -5541,12 +5136,12 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x85, .nickname = _("MISDREAVUS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { + .map = { .metatileData = { 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x08, @@ -5566,9 +5161,9 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x08, }, .collisionData = {0x0381, 0x0101, 0x0101, 0x6C1, 0x0821, 0x16D1, 0x2829, 0x2009, 0x1, 0x2009, 0x2829, 0x16D1, 0x0821, 0x6C1, 0x0101, 0x101}, - .coords = {COORDS_XY(7,6), COORDS_XY(7,10)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), + .trainerCoords = {COORDS_XY(7,6), COORDS_XY(7,10)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), } }, }; diff --git a/src/ereader_helpers.c b/src/ereader_helpers.c index c3f17f234..ac6e0e1e1 100755 --- a/src/ereader_helpers.c +++ b/src/ereader_helpers.c @@ -57,22 +57,20 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechLose = { EC_WORD_TO_HER, EC_WORD_WIN, EC_WORD_JOKING, EC_WORD_HIGHS, EC_WORD_SCARY, EC_WORD_ELLIPSIS_EXCL }, .speechAfter = { EC_WORD_IGNORANT, EC_WORD_SO, EC_WORD_TODAY, EC_WORD_NIGHTTIME, EC_WORD_YOU_RE, EC_WORD_ELLIPSIS_ELLIPSIS_ELLIPSIS }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_SWALOT, .heldItem = ITEM_SHELL_BELL, .moves = { MOVE_SLUDGE_BOMB, MOVE_SHADOW_BALL, MOVE_PAIN_SPLIT, MOVE_YAWN }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 55, .attackEV = 255, .defenseEV = 100, .speedEV = 0, .spAttackEV = 0, .spDefenseEV = 100, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -82,21 +80,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 1, .personality = 0x80, .nickname = __("マルノーム$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_DUSTOX, .heldItem = ITEM_BRIGHT_POWDER, .moves = { MOVE_SILVER_WIND, MOVE_SLUDGE_BOMB, MOVE_SHADOW_BALL, MOVE_GIGA_DRAIN }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 0, .attackEV = 255, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -106,21 +102,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x6, .nickname = __("ドクケイル$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_RELICANTH, .heldItem = ITEM_QUICK_CLAW, .moves = { MOVE_ANCIENT_POWER, MOVE_SURF, MOVE_EARTHQUAKE, MOVE_AMNESIA }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 0, .defenseEV = 0, .speedEV = 0, .spAttackEV = 155, .spDefenseEV = 255, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -130,7 +124,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x2f, .nickname = __("ジーランス$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, @@ -143,22 +137,20 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechLose = { EC_MOVE2(MINIMIZE), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_SAD, EC_WORD_EXCL }, .speechAfter = { EC_MOVE(BITE), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_ANGRY, EC_WORD_EXCL }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_CACTURNE, .heldItem = ITEM_QUICK_CLAW, .moves = { MOVE_GIGA_DRAIN, MOVE_FAINT_ATTACK, MOVE_THUNDER_PUNCH, MOVE_GROWTH }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 55, .attackEV = 0, .defenseEV = 100, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 100, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -168,21 +160,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x8c, .nickname = __("ノクタス$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_SWELLOW, .heldItem = ITEM_BRIGHT_POWDER, .moves = { MOVE_FACADE, MOVE_AERIAL_ACE, MOVE_QUICK_ATTACK, MOVE_DOUBLE_TEAM }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 255, .attackEV = 255, .defenseEV = 0, .speedEV = 0, .spAttackEV = 0, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -192,21 +182,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x80, .nickname = __("オオスバメ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_WHISCASH, .heldItem = ITEM_CHESTO_BERRY, .moves = { MOVE_SURF, MOVE_EARTHQUAKE, MOVE_AMNESIA, MOVE_REST }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 0, .attackEV = 255, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -216,7 +204,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x0, .nickname = __("ナマズン$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, @@ -229,22 +217,20 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechLose = { EC_WORD_THAT, EC_WORD_ABOVE, EC_WORD_LOST, EC_WORD_STORES, EC_WORD_JOKING, EC_WORD_ELLIPSIS_ELLIPSIS_ELLIPSIS }, .speechAfter = { EC_WORD_ENTERTAINING, EC_WORD_NONE, EC_WORD_HEY_QUES, EC_WORD_ALMOST, EC_WORD_EXCL, EC_EMPTY_WORD }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_DELCATTY, .heldItem = ITEM_LUM_BERRY, .moves = { MOVE_SING, MOVE_BODY_SLAM, MOVE_SHADOW_BALL, MOVE_IRON_TAIL }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 0, .attackEV = 255, .defenseEV = 0, .speedEV = 255, .spAttackEV = 0, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -254,21 +240,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x3, .nickname = __("エネコロロ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_ROSELIA, .heldItem = ITEM_LEFTOVERS, .moves = { MOVE_GIGA_DRAIN, MOVE_GRASS_WHISTLE, MOVE_TOXIC, MOVE_LEECH_SEED }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 255, .attackEV = 0, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -278,21 +262,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 1, .personality = 0x6, .nickname = __("ロゼリア$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_BEAUTIFLY, .heldItem = ITEM_BRIGHT_POWDER, .moves = { MOVE_SILVER_WIND, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_PSYCHIC }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 200, .defenseEV = 0, .speedEV = 0, .spAttackEV = 200, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -302,7 +284,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x6, .nickname = __("アゲハント$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, @@ -315,22 +297,20 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechLose = { EC_WORD_OUTSIDE, EC_WORD_UNCLE, EC_WORD_SURPRISE, EC_WORD_THESE, EC_WORD_HEY_QUES, EC_WORD_ELLIPSIS_EXCL }, .speechAfter = { EC_WORD_HE_S, EC_WORD_NO_1, EC_WORD_STRONG, EC_WORD_CHILDREN, EC_WORD_CAN_T, EC_WORD_EXCL_EXCL }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_MAWILE, .heldItem = ITEM_BRIGHT_POWDER, .moves = { MOVE_CRUNCH, MOVE_FLAMETHROWER, MOVE_THUNDER_PUNCH, MOVE_COMET_PUNCH }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 0, .attackEV = 0, .defenseEV = 100, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 155, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -340,21 +320,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 1, .personality = 0x0, .nickname = __("クチート$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_SHARPEDO, .heldItem = ITEM_SCOPE_LENS, .moves = { MOVE_SURF, MOVE_CRUNCH, MOVE_DOUBLE_EDGE, MOVE_EARTHQUAKE }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 255, .attackEV = 0, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -364,21 +342,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("サメハダー$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_BANETTE, .heldItem = ITEM_LUM_BERRY, .moves = { MOVE_PSYCHIC, MOVE_SHADOW_BALL, MOVE_THUNDERBOLT, MOVE_WILL_O_WISP }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 255, .attackEV = 0, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -388,7 +364,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("ジュペッタ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, @@ -447,40 +423,40 @@ static bool32 ValidateTrainerHillChecksum(struct EReaderTrainerHillSet *hillSet) return TRUE; } -static bool32 TryWriteTrainerHill_Internal(struct EReaderTrainerHillSet * hillSet, struct TrHillTag * hillTag) +static bool32 TryWriteTrainerHill_Internal(struct EReaderTrainerHillSet * hillSet, struct TrainerHillChallenge * challenge) { int i; AGB_ASSERT_EX(hillSet->dummy == 0, "cereader_tool.c", 450); AGB_ASSERT_EX(hillSet->id == 0, "cereader_tool.c", 452); - memset(hillTag, 0, SECTOR_SIZE); - hillTag->numTrainers = hillSet->numTrainers; - hillTag->unused1 = GetTrainerHillUnkVal(); - hillTag->numFloors = (hillSet->numTrainers + 1) / TRAINER_HILL_TRAINERS_PER_FLOOR; + memset(challenge, 0, SECTOR_SIZE); + challenge->numTrainers = hillSet->numTrainers; + challenge->unused1 = GetTrainerHillUnkVal(); + challenge->numFloors = (hillSet->numTrainers + 1) / HILL_TRAINERS_PER_FLOOR; for (i = 0; i < hillSet->numTrainers; i++) { if (!(i & 1)) { - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainerNum1 = hillSet->trainers[i].trainerNum; - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].display = hillSet->trainers[i].display; - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainers[0] = hillSet->trainers[i].trainer; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainerNum1 = hillSet->trainers[i].trainerNum; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].map = hillSet->trainers[i].map; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainers[0] = hillSet->trainers[i].trainer; } else { - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainerNum2 = hillSet->trainers[i].trainerNum; - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainers[1] = hillSet->trainers[i].trainer; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainerNum2 = hillSet->trainers[i].trainerNum; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainers[1] = hillSet->trainers[i].trainer; } } if (i & 1) { - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainers[1] = sTrainerHillTrainerTemplates_JP[i / TRAINER_HILL_TRAINERS_PER_FLOOR]; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainers[1] = sTrainerHillTrainerTemplates_JP[i / HILL_TRAINERS_PER_FLOOR]; } - hillTag->checksum = CalcByteArraySum((u8 *)hillTag->floors, NUM_TRAINER_HILL_FLOORS * sizeof(struct TrHillFloor)); - if (TryWriteSpecialSaveSector(SECTOR_ID_TRAINER_HILL, (u8 *)hillTag) != SAVE_STATUS_OK) + challenge->checksum = CalcByteArraySum((u8 *)challenge->floors, NUM_TRAINER_HILL_FLOORS * sizeof(struct TrainerHillFloor)); + if (TryWriteSpecialSaveSector(SECTOR_ID_TRAINER_HILL, (u8 *)challenge) != SAVE_STATUS_OK) return FALSE; return TRUE; diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 39c6202a0..2deacfc70 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -32,23 +32,21 @@ #include "constants/trainer_hill.h" #include "constants/trainer_types.h" -#define HILL_TAG_NORMAL 0 -#define HILL_TAG_VARIETY 1 -#define HILL_TAG_UNIQUE 2 -#define HILL_TAG_EXPERT 3 - #define HILL_MAX_TIME 215999 // 60 * 60 * 60 - 1 -// EWRAM -struct TrHillStruct2 +struct FloorTrainers { - u8 floorId; - struct TrHillTag tag; - struct TrHillFloor floors[NUM_TRAINER_HILL_FLOORS]; + u8 name[HILL_TRAINERS_PER_FLOOR][HILL_TRAINER_NAME_LENGTH]; + u8 facilityClass[HILL_TRAINERS_PER_FLOOR]; }; -static EWRAM_DATA struct TrHillStruct2 *sHillData = NULL; -static EWRAM_DATA struct TrHillRoomTrainers *sRoomTrainers = NULL; +static EWRAM_DATA struct { + u8 floorId; + struct TrainerHillChallenge challenge; + struct TrainerHillFloor floors[NUM_TRAINER_HILL_FLOORS]; +} *sHillData = NULL; + +static EWRAM_DATA struct FloorTrainers *sFloorTrainers = NULL; EWRAM_DATA u32 *gTrainerHillVBlankCounter = NULL; // This file's functions. @@ -69,7 +67,7 @@ static void GetGameSaved(void); static void SetGameSaved(void); static void ClearGameSaved(void); static void GetChallengeWon(void); -static void TrainerHillSetTag(void); +static void TrainerHillSetMode(void); static void SetUpDataStruct(void); static void FreeDataStruct(void); static void TrainerHillDummy(void); @@ -202,12 +200,12 @@ static const u16 *const *const sPrizeListSets[] = static const u16 sEReader_Pal[] = INCBIN_U16("graphics/trainer_hill/ereader.gbapal"); static const u8 sRecordWinColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}; -static const struct TrHillTag *const sDataPerTag[] = +static const struct TrainerHillChallenge *const sChallengeData[NUM_TRAINER_HILL_MODES] = { - &sDataTagNormal, - &sDataTagVariety, - &sDataTagUnique, - &sDataTagExpert, + [HILL_MODE_NORMAL] = &sChallenge_Normal, + [HILL_MODE_VARIETY] = &sChallenge_Variety, + [HILL_MODE_UNIQUE] = &sChallenge_Unique, + [HILL_MODE_EXPERT] = &sChallenge_Expert, }; // Unused. @@ -238,15 +236,15 @@ static void (* const sHillFunctions[])(void) = [TRAINER_HILL_FUNC_SET_GAME_SAVED] = SetGameSaved, [TRAINER_HILL_FUNC_CLEAR_GAME_SAVED] = ClearGameSaved, [TRAINER_HILL_FUNC_GET_WON] = GetChallengeWon, - [TRAINER_HILL_FUNC_SET_TAG] = TrainerHillSetTag, + [TRAINER_HILL_FUNC_SET_MODE] = TrainerHillSetMode, }; -static const u8 *const sTagMatchStrings[] = +static const u8 *const sModeStrings[NUM_TRAINER_HILL_MODES] = { - gText_NormalTagMatch, - gText_VarietyTagMatch, - gText_UniqueTagMatch, - gText_ExpertTagMatch, + [HILL_MODE_NORMAL] = gText_NormalTagMatch, + [HILL_MODE_VARIETY] = gText_VarietyTagMatch, + [HILL_MODE_UNIQUE] = gText_UniqueTagMatch, + [HILL_MODE_EXPERT] = gText_ExpertTagMatch, }; static const struct ObjectEventTemplate sTrainerObjectEventTemplate = @@ -261,18 +259,17 @@ static const struct ObjectEventTemplate sTrainerObjectEventTemplate = static const u32 sNextFloorMapNum[NUM_TRAINER_HILL_FLOORS] = { - MAP_NUM(TRAINER_HILL_2F), - MAP_NUM(TRAINER_HILL_3F), - MAP_NUM(TRAINER_HILL_4F), - MAP_NUM(TRAINER_HILL_ROOF) + [TRAINER_HILL_1F - 1] = MAP_NUM(TRAINER_HILL_2F), + [TRAINER_HILL_2F - 1] = MAP_NUM(TRAINER_HILL_3F), + [TRAINER_HILL_3F - 1] = MAP_NUM(TRAINER_HILL_4F), + [TRAINER_HILL_4F - 1] = MAP_NUM(TRAINER_HILL_ROOF) }; -static const u8 sTrainerPartySlots[][PARTY_SIZE / 2] = +static const u8 sTrainerPartySlots[HILL_TRAINERS_PER_FLOOR][PARTY_SIZE / 2] = { {0, 1, 2}, {3, 4, 5} }; -// code void CallTrainerHillFunction(void) { SetUpDataStruct(); @@ -287,7 +284,7 @@ void ResetTrainerHillResults(void) gSaveBlock2Ptr->frontier.savedGame = 0; gSaveBlock2Ptr->frontier.unk_EF9 = 0; gSaveBlock1Ptr->trainerHill.bestTime = 0; - for (i = 0; i < 4; i++) + for (i = 0; i < NUM_TRAINER_HILL_MODES; i++) SetTimerValue(&gSaveBlock1Ptr->trainerHillTimes[i], HILL_MAX_TIME); } @@ -300,7 +297,7 @@ u8 GetTrainerHillOpponentClass(u16 trainerId) { u8 id = trainerId - 1; - return gFacilityClassToTrainerClass[sRoomTrainers->facilityClass[id]]; + return gFacilityClassToTrainerClass[sFloorTrainers->facilityClass[id]]; } void GetTrainerHillTrainerName(u8 *dst, u16 trainerId) @@ -309,7 +306,7 @@ void GetTrainerHillTrainerName(u8 *dst, u16 trainerId) u8 id = trainerId - 1; for (i = 0; i < HILL_TRAINER_NAME_LENGTH; i++) - dst[i] = sRoomTrainers->name[id][i]; + dst[i] = sFloorTrainers->name[id][i]; } u8 GetTrainerHillTrainerFrontSpriteId(u16 trainerId) @@ -329,15 +326,14 @@ void InitTrainerHillBattleStruct(void) s32 i, j; SetUpDataStruct(); - sRoomTrainers = AllocZeroed(sizeof(*sRoomTrainers)); + sFloorTrainers = AllocZeroed(sizeof(*sFloorTrainers)); - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) { for (j = 0; j < HILL_TRAINER_NAME_LENGTH; j++) - { - sRoomTrainers->name[i][j] = sHillData->floors[sHillData->floorId].trainers[i].name[j]; - } - sRoomTrainers->facilityClass[i] = sHillData->floors[sHillData->floorId].trainers[i].facilityClass; + sFloorTrainers->name[i][j] = sHillData->floors[sHillData->floorId].trainers[i].name[j]; + + sFloorTrainers->facilityClass[i] = sHillData->floors[sHillData->floorId].trainers[i].facilityClass; } SetTrainerHillVBlankCounter(&gSaveBlock1Ptr->trainerHill.timer); FreeDataStruct(); @@ -345,8 +341,7 @@ void InitTrainerHillBattleStruct(void) void FreeTrainerHillBattleStruct(void) { - if (sRoomTrainers != NULL) - FREE_AND_SET_NULL(sRoomTrainers); + TRY_FREE_AND_SET_NULL(sFloorTrainers); } static void SetUpDataStruct(void) @@ -355,15 +350,20 @@ static void SetUpDataStruct(void) { sHillData = AllocZeroed(sizeof(*sHillData)); sHillData->floorId = gMapHeader.mapLayoutId - LAYOUT_TRAINER_HILL_1F; - CpuCopy32(sDataPerTag[gSaveBlock1Ptr->trainerHill.tag], &sHillData->tag, sizeof(sHillData->tag) + 4 * sizeof(struct TrHillFloor)); + + // This copy depends on the floor data for each challenge being directly after the + // challenge header data, and for the field 'floors' in sHillData to come directly + // after the field 'challenge'. + // e.g. for HILL_MODE_NORMAL, it will copy sChallenge_Normal to sHillData->challenge and + // it will copy sFloors_Normal to sHillData->floors + CpuCopy32(sChallengeData[gSaveBlock1Ptr->trainerHill.mode], &sHillData->challenge, sizeof(sHillData->challenge) + sizeof(sHillData->floors)); TrainerHillDummy(); } } static void FreeDataStruct(void) { - if (sHillData != NULL) - FREE_AND_SET_NULL(sHillData); + TRY_FREE_AND_SET_NULL(sHillData); } void CopyTrainerHillTrainerText(u8 which, u16 trainerId) @@ -428,7 +428,7 @@ static void GiveChallengePrize(void) { u16 itemId = GetPrizeItemId(); - if (sHillData->tag.numFloors != NUM_TRAINER_HILL_FLOORS || gSaveBlock1Ptr->trainerHill.receivedPrize) + if (sHillData->challenge.numFloors != NUM_TRAINER_HILL_FLOORS || gSaveBlock1Ptr->trainerHill.receivedPrize) { gSpecialVar_Result = 2; } @@ -456,7 +456,7 @@ static void CheckFinalTime(void) else if (GetTimerValue(&gSaveBlock1Ptr->trainerHill.bestTime) > gSaveBlock1Ptr->trainerHill.timer) { SetTimerValue(&gSaveBlock1Ptr->trainerHill.bestTime, gSaveBlock1Ptr->trainerHill.timer); - gSaveBlock1Ptr->trainerHillTimes[gSaveBlock1Ptr->trainerHill.tag] = gSaveBlock1Ptr->trainerHill.bestTime; + gSaveBlock1Ptr->trainerHillTimes[gSaveBlock1Ptr->trainerHill.mode] = gSaveBlock1Ptr->trainerHill.bestTime; gSpecialVar_Result = 0; } else @@ -529,9 +529,9 @@ static void BufferChallengeTime(void) static void GetAllFloorsUsed(void) { SetUpDataStruct(); - if (sHillData->tag.numFloors != NUM_TRAINER_HILL_FLOORS) + if (sHillData->challenge.numFloors != NUM_TRAINER_HILL_FLOORS) { - ConvertIntToDecimalStringN(gStringVar1, sHillData->tag.numFloors, STR_CONV_MODE_LEFT_ALIGN, 1); + ConvertIntToDecimalStringN(gStringVar1, sHillData->challenge.numFloors, STR_CONV_MODE_LEFT_ALIGN, 1); gSpecialVar_Result = FALSE; } else @@ -592,9 +592,9 @@ void PrintOnTrainerHillRecordsWindow(void) AddTextPrinterParameterized3(0, FONT_NORMAL, x, 2, sRecordWinColors, TEXT_SKIP_DRAW, gText_TimeBoard); y = 18; - for (i = 0; i < 4; i++) + for (i = 0; i < NUM_TRAINER_HILL_MODES; i++) { - AddTextPrinterParameterized3(0, FONT_NORMAL, 0, y, sRecordWinColors, TEXT_SKIP_DRAW, sTagMatchStrings[i]); + AddTextPrinterParameterized3(0, FONT_NORMAL, 0, y, sRecordWinColors, TEXT_SKIP_DRAW, sModeStrings[i]); y += 15; total = GetTimerValue(&gSaveBlock1Ptr->trainerHillTimes[i]); minutes = total / (60 * 60); @@ -637,23 +637,23 @@ void LoadTrainerHillObjectEventTemplates(void) return; SetUpDataStruct(); - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF; CpuFill32(0, gSaveBlock1Ptr->objectEventTemplates, sizeof(gSaveBlock1Ptr->objectEventTemplates)); floorId = GetFloorId(); - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) { u8 bits; eventTemplates[i] = sTrainerObjectEventTemplate; eventTemplates[i].localId = i + 1; eventTemplates[i].graphicsId = FacilityClassToGraphicsId(sHillData->floors[floorId].trainers[i].facilityClass); - eventTemplates[i].x = sHillData->floors[floorId].display.coords[i] & 0xF; - eventTemplates[i].y = ((sHillData->floors[floorId].display.coords[i] >> 4) & 0xF) + 5; + eventTemplates[i].x = sHillData->floors[floorId].map.trainerCoords[i] & 0xF; + eventTemplates[i].y = ((sHillData->floors[floorId].map.trainerCoords[i] >> 4) & 0xF) + 5; bits = i << 2; - eventTemplates[i].movementType = ((sHillData->floors[floorId].display.direction >> bits) & 0xF) + MOVEMENT_TYPE_FACE_UP; - eventTemplates[i].trainerRange_berryTreeId = (sHillData->floors[floorId].display.range >> bits) & 0xF; + eventTemplates[i].movementType = ((sHillData->floors[floorId].map.trainerDirections >> bits) & 0xF) + MOVEMENT_TYPE_FACE_UP; + eventTemplates[i].trainerRange_berryTreeId = (sHillData->floors[floorId].map.trainerRanges >> bits) & 0xF; eventTemplates[i].script = TrainerHill_EventScript_TrainerBattle; gSaveBlock2Ptr->frontier.trainerIds[i] = i + 1; } @@ -669,14 +669,14 @@ bool32 LoadTrainerHillFloorObjectEventScripts(void) return TRUE; } -static u16 GetMetatileForFloor(u8 floorId, u32 x, u32 y, u32 stride) // stride is always 16 +static u16 GetMetatileForFloor(u8 floorId, u32 x, u32 y, u32 floorWidth) // floorWidth is always 16 { bool8 impassable; u16 metatile; u16 elevation; - impassable = (sHillData->floors[floorId].display.collisionData[y] >> (15 - x) & 1); - metatile = sHillData->floors[floorId].display.metatileData[stride * y + x] + NUM_METATILES_IN_PRIMARY; + impassable = (sHillData->floors[floorId].map.collisionData[y] >> (15 - x) & 1); + metatile = sHillData->floors[floorId].map.metatileData[floorWidth * y + x] + NUM_METATILES_IN_PRIMARY; elevation = 3 << MAPGRID_ELEVATION_SHIFT; return ((impassable << MAPGRID_COLLISION_SHIFT) & MAPGRID_COLLISION_MASK) | elevation | (metatile & MAPGRID_METATILE_ID_MASK); @@ -684,7 +684,7 @@ static u16 GetMetatileForFloor(u8 floorId, u32 x, u32 y, u32 stride) // stride i void GenerateTrainerHillFloorLayout(u16 *mapArg) { - s32 i, j; + s32 y, x; u16 *src, *dst; u8 mapId = GetCurrentTrainerHillMapId(); @@ -705,24 +705,25 @@ void GenerateTrainerHillFloorLayout(u16 *mapArg) mapId = GetFloorId(); src = gMapHeader.mapLayout->map; gBackupMapLayout.map = mapArg; - gBackupMapLayout.width = 31; - gBackupMapLayout.height = 35; + // Dimensions include border area loaded beyond map + gBackupMapLayout.width = HILL_FLOOR_WIDTH + 15; + gBackupMapLayout.height = HILL_FLOOR_HEIGHT + 14; dst = mapArg + 224; // First 5 rows of the map (Entrance / Exit) are always the same - for (i = 0; i < 5; i++) + for (y = 0; y < HILL_FLOOR_HEIGHT_MARGIN; y++) { - for (j = 0; j < 16; j++) - dst[j] = src[j]; + for (x = 0; x < HILL_FLOOR_WIDTH; x++) + dst[x] = src[x]; dst += 31; src += 16; } // Load the 16x16 floor-specific layout - for (i = 0; i < 16; i++) + for (y = 0; y < HILL_FLOOR_HEIGHT_MAIN; y++) { - for (j = 0; j < 16; j++) - dst[j] = GetMetatileForFloor(mapId, j, i, 16); + for (x = 0; x < HILL_FLOOR_WIDTH; x++) + dst[x] = GetMetatileForFloor(mapId, x, y, HILL_FLOOR_WIDTH); dst += 31; } @@ -812,8 +813,8 @@ u16 LocalIdToHillTrainerId(u8 localId) bool8 GetHillTrainerFlag(u8 objectEventId) { - u32 floorId = GetFloorId() * 2; - u8 bitId = gObjectEvents[objectEventId].localId - 1 + floorId; + u32 trainerIndexStart = GetFloorId() * HILL_TRAINERS_PER_FLOOR; + u8 bitId = gObjectEvents[objectEventId].localId - 1 + trainerIndexStart; return gSaveBlock2Ptr->frontier.trainerFlags & gBitTable[bitId]; } @@ -821,24 +822,24 @@ bool8 GetHillTrainerFlag(u8 objectEventId) void SetHillTrainerFlag(void) { u8 i; - u8 floorId = GetFloorId() * 2; + u8 trainerIndexStart = GetFloorId() * HILL_TRAINERS_PER_FLOOR; - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) { if (gSaveBlock2Ptr->frontier.trainerIds[i] == gTrainerBattleOpponent_A) { - gSaveBlock2Ptr->frontier.trainerFlags |= gBitTable[floorId + i]; + gSaveBlock2Ptr->frontier.trainerFlags |= gBitTable[trainerIndexStart + i]; break; } } if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) { - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) { if (gSaveBlock2Ptr->frontier.trainerIds[i] == gTrainerBattleOpponent_B) { - gSaveBlock2Ptr->frontier.trainerFlags |= gBitTable[floorId + i]; + gSaveBlock2Ptr->frontier.trainerFlags |= gBitTable[trainerIndexStart + i]; break; } } @@ -861,14 +862,14 @@ static void CreateNPCTrainerHillParty(u16 trainerId, u8 firstMonId) u8 trId, level; s32 i, floorId, partySlot; - if (trainerId == 0 || trainerId > 2) + if (trainerId == 0 || trainerId > HILL_TRAINERS_PER_FLOOR) return; trId = trainerId - 1; SetUpDataStruct(); level = GetHighestLevelInPlayerParty(); floorId = GetFloorId(); - for (i = firstMonId, partySlot = 0; i < firstMonId + 3; i++, partySlot++) + for (i = firstMonId, partySlot = 0; i < firstMonId + PARTY_SIZE / 2; i++, partySlot++) { u8 id = sTrainerPartySlots[trId][partySlot]; struct Pokemon *mon = &gEnemyParty[i]; @@ -890,7 +891,7 @@ void FillHillTrainersParties(void) { ZeroEnemyPartyMons(); CreateNPCTrainerHillParty(gTrainerBattleOpponent_A, 0); - CreateNPCTrainerHillParty(gTrainerBattleOpponent_B, 3); + CreateNPCTrainerHillParty(gTrainerBattleOpponent_B, PARTY_SIZE / 2); } // This function is unused, but my best guess is @@ -935,7 +936,7 @@ u8 GetNumFloorsInTrainerHillChallenge(void) u8 floors; SetUpDataStruct(); - floors = sHillData->tag.numFloors; + floors = sHillData->challenge.numFloors; FreeDataStruct(); return floors; @@ -989,9 +990,9 @@ static void GetChallengeWon(void) gSpecialVar_Result = TRUE; } -static void TrainerHillSetTag(void) +static void TrainerHillSetMode(void) { - gSaveBlock1Ptr->trainerHill.tag = gSpecialVar_0x8005; + gSaveBlock1Ptr->trainerHill.mode = gSpecialVar_0x8005; gSaveBlock1Ptr->trainerHill.bestTime = gSaveBlock1Ptr->trainerHillTimes[gSpecialVar_0x8005]; } @@ -1030,12 +1031,12 @@ static u16 GetPrizeItemId(void) prizeListSetId = var / 256; prizeListSetId %= 2; - if (FlagGet(FLAG_SYS_GAME_CLEAR) && sHillData->tag.numTrainers == NUM_TRAINER_HILL_TRAINERS) + if (FlagGet(FLAG_SYS_GAME_CLEAR) && sHillData->challenge.numTrainers == NUM_TRAINER_HILL_TRAINERS) i = GetPrizeListId(TRUE); else i = GetPrizeListId(FALSE); - if (gSaveBlock1Ptr->trainerHill.tag == HILL_TAG_EXPERT) + if (gSaveBlock1Ptr->trainerHill.mode == HILL_MODE_EXPERT) i = (i + 1) % NUM_TRAINER_HILL_PRIZE_LISTS; prizeList = sPrizeListSets[prizeListSetId][i]; From 328b925a08c3dfc47ebd49b7b8f9db2822790e34 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 31 Mar 2022 13:11:44 -0400 Subject: [PATCH 067/208] Move trainer hill map data to bin files --- .../maps_expert/floor_0/collision.bin | Bin 0 -> 32 bytes .../maps_expert/floor_0/metatiles.bin | 1 + .../maps_expert/floor_1/collision.bin | Bin 0 -> 32 bytes .../maps_expert/floor_1/metatiles.bin | 1 + .../maps_expert/floor_2/collision.bin | 1 + .../maps_expert/floor_2/metatiles.bin | 1 + .../maps_expert/floor_3/collision.bin | Bin 0 -> 32 bytes .../maps_expert/floor_3/metatiles.bin | 1 + .../maps_jp/floor_0/collision.bin | 1 + .../maps_jp/floor_0/metatiles.bin | 1 + .../maps_jp/floor_1/collision.bin | Bin 0 -> 32 bytes .../maps_jp/floor_1/metatiles.bin | 1 + .../maps_normal/floor_0/collision.bin | 1 + .../maps_normal/floor_0/metatiles.bin | 1 + .../maps_normal/floor_1/collision.bin | 1 + .../maps_normal/floor_1/metatiles.bin | 1 + .../maps_normal/floor_2/collision.bin | Bin 0 -> 32 bytes .../maps_normal/floor_2/metatiles.bin | 1 + .../maps_normal/floor_3/collision.bin | Bin 0 -> 32 bytes .../maps_normal/floor_3/metatiles.bin | 1 + .../maps_unique/floor_0/collision.bin | Bin 0 -> 32 bytes .../maps_unique/floor_0/metatiles.bin | 1 + .../maps_unique/floor_1/collision.bin | Bin 0 -> 32 bytes .../maps_unique/floor_1/metatiles.bin | 1 + .../maps_unique/floor_2/collision.bin | Bin 0 -> 32 bytes .../maps_unique/floor_2/metatiles.bin | 1 + .../maps_unique/floor_3/collision.bin | Bin 0 -> 32 bytes .../maps_unique/floor_3/metatiles.bin | 1 + .../maps_variety/floor_0/collision.bin | Bin 0 -> 32 bytes .../maps_variety/floor_0/metatiles.bin | 1 + .../maps_variety/floor_1/collision.bin | Bin 0 -> 32 bytes .../maps_variety/floor_1/metatiles.bin | 1 + .../maps_variety/floor_2/collision.bin | Bin 0 -> 32 bytes .../maps_variety/floor_2/metatiles.bin | 1 + .../maps_variety/floor_3/collision.bin | Bin 0 -> 32 bytes .../maps_variety/floor_3/metatiles.bin | 1 + include/trainer_hill.h | 2 +- src/data/battle_frontier/trainer_hill.h | 432 ++---------------- 38 files changed, 63 insertions(+), 393 deletions(-) create mode 100755 graphics/trainer_hill/maps_expert/floor_0/collision.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_0/metatiles.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_1/collision.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_1/metatiles.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_2/collision.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_2/metatiles.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_3/collision.bin create mode 100755 graphics/trainer_hill/maps_expert/floor_3/metatiles.bin create mode 100755 graphics/trainer_hill/maps_jp/floor_0/collision.bin create mode 100755 graphics/trainer_hill/maps_jp/floor_0/metatiles.bin create mode 100755 graphics/trainer_hill/maps_jp/floor_1/collision.bin create mode 100755 graphics/trainer_hill/maps_jp/floor_1/metatiles.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_0/collision.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_0/metatiles.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_1/collision.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_1/metatiles.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_2/collision.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_2/metatiles.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_3/collision.bin create mode 100755 graphics/trainer_hill/maps_normal/floor_3/metatiles.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_0/collision.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_0/metatiles.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_1/collision.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_1/metatiles.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_2/collision.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_2/metatiles.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_3/collision.bin create mode 100755 graphics/trainer_hill/maps_unique/floor_3/metatiles.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_0/collision.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_0/metatiles.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_1/collision.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_1/metatiles.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_2/collision.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_2/metatiles.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_3/collision.bin create mode 100755 graphics/trainer_hill/maps_variety/floor_3/metatiles.bin diff --git a/graphics/trainer_hill/maps_expert/floor_0/collision.bin b/graphics/trainer_hill/maps_expert/floor_0/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..ca6e4ca28beaf070d34dedbd697149620da6ea68 GIT binary patch literal 32 ecmZo0f}Z{gu?&-0mT0byZ`_I literal 0 HcmV?d00001 diff --git a/graphics/trainer_hill/maps_expert/floor_1/metatiles.bin b/graphics/trainer_hill/maps_expert/floor_1/metatiles.bin new file mode 100755 index 000000000..a89a14c69 --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_1/metatiles.bin @@ -0,0 +1 @@ +1;;;9989:;;;FFFFFFFFFFFFFxF|}|{zF}FFFFFFFFFFFFF~}~FFFFFFFFFFFFFF}|{z|FFFFFFFFFFFFFF|}~}~FFFFFFFFFFFFF֖֖֛֖֖֖֖֖֖֖֛ \ No newline at end of file diff --git a/graphics/trainer_hill/maps_expert/floor_2/collision.bin b/graphics/trainer_hill/maps_expert/floor_2/collision.bin new file mode 100755 index 000000000..891a7f2c1 --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_2/collision.bin @@ -0,0 +1 @@ +>>}~=x=x}~y>> \ No newline at end of file diff --git a/graphics/trainer_hill/maps_expert/floor_2/metatiles.bin b/graphics/trainer_hill/maps_expert/floor_2/metatiles.bin new file mode 100755 index 000000000..7164f059d --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_2/metatiles.bin @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/graphics/trainer_hill/maps_expert/floor_3/collision.bin b/graphics/trainer_hill/maps_expert/floor_3/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..3d25428f1569114f61521dfb75a0b10efeaee5ba GIT binary patch literal 32 kcmZoFHg#WXcI6&M*f6*M(2iYam&WCO_n09tVcFaQ7m literal 0 HcmV?d00001 diff --git a/graphics/trainer_hill/maps_expert/floor_3/metatiles.bin b/graphics/trainer_hill/maps_expert/floor_3/metatiles.bin new file mode 100755 index 000000000..f2200b713 --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_3/metatiles.bin @@ -0,0 +1 @@ +1;;;9999:;;;FFFFFFF6666FFFFFFFF6FۛF6FF6ۛ6F֖ۛF6ۛ6FF6FۛF6FFFFFFFF6666FFFFFFF \ No newline at end of file diff --git a/graphics/trainer_hill/maps_jp/floor_0/collision.bin b/graphics/trainer_hill/maps_jp/floor_0/collision.bin new file mode 100755 index 000000000..817f4f54c --- /dev/null +++ b/graphics/trainer_hill/maps_jp/floor_0/collision.bin @@ -0,0 +1 @@ +oAcA`ADAUAU \ No newline at end of file diff --git a/graphics/trainer_hill/maps_jp/floor_0/metatiles.bin b/graphics/trainer_hill/maps_jp/floor_0/metatiles.bin new file mode 100755 index 000000000..8d1787efd --- /dev/null +++ b/graphics/trainer_hill/maps_jp/floor_0/metatiles.bin @@ -0,0 +1 @@ +155;&&%9:;;;1++;44++43????;1++;;;44;3???;;1++55555;3???;?1+444+44;,???;;1+;5;+;5;5;???;1+;+;+;+;+;???;14;+;4;+5+;;?;;1;;4;;;444?;;;? \ No newline at end of file diff --git a/graphics/trainer_hill/maps_jp/floor_1/collision.bin b/graphics/trainer_hill/maps_jp/floor_1/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..58f80b49bb1ab2c9e27f9e8c19f3cfa17b6dcdfe GIT binary patch literal 32 bcmZo?HC#Uv;AiWLNEXT<6#hZ literal 0 HcmV?d00001 diff --git a/graphics/trainer_hill/maps_jp/floor_1/metatiles.bin b/graphics/trainer_hill/maps_jp/floor_1/metatiles.bin new file mode 100755 index 000000000..951723792 --- /dev/null +++ b/graphics/trainer_hill/maps_jp/floor_1/metatiles.bin @@ -0,0 +1 @@ +1;5;9&%9:;5;1;+;;+++++;;;+;1;+;;+++++>>;+;1;+;;+++++;;;+;?;+;;+++++;>>+;1;+;;++,++;;;+;1?+;;,,;,,>>;+;1;+5555;55555+;?;,,,,,;,,,,,,;1;??;55;55555551???;++5+++++++1??;;++++++++++1;;;?,,,,,,,,,, \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_0/collision.bin b/graphics/trainer_hill/maps_normal/floor_0/collision.bin new file mode 100755 index 000000000..80213aaae --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_0/collision.bin @@ -0,0 +1 @@ +?%!~A } Ay \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_0/metatiles.bin b/graphics/trainer_hill/maps_normal/floor_0/metatiles.bin new file mode 100755 index 000000000..658a5ace6 --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_0/metatiles.bin @@ -0,0 +1 @@ +1;55&&%&:;5;1;,,,+$$$$,;;,;-;;;;+;;;;5;55;3;2!0+;2!0+;,+;35;;;,5;;;+;;+;4,;2!0+20;+20,;15;;5;,;;5,;;551,20+205;+2!0,,15;;+;;+;,;5;;;1,20+20+;20+20;1555+;;+;;5+;551+,,,20+20,,;,,1+;;5;;+;;5;;;;1,20+;;,20,20;51;;;,;;;;;;;;;, \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_1/collision.bin b/graphics/trainer_hill/maps_normal/floor_1/collision.bin new file mode 100755 index 000000000..fb3f6aec0 --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_1/collision.bin @@ -0,0 +1 @@ +s @ @QSQQQQQPP \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_1/metatiles.bin b/graphics/trainer_hill/maps_normal/floor_1/metatiles.bin new file mode 100755 index 000000000..52af9cfdc --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_1/metatiles.bin @@ -0,0 +1 @@ +˛ۛۛۛ \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_2/collision.bin b/graphics/trainer_hill/maps_normal/floor_2/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..b3ccacdd4c25fee4cf227fac1346ee02b189d8c2 GIT binary patch literal 32 acmZoeskKr|x*BLe_r>jg#t literal 0 HcmV?d00001 diff --git a/graphics/trainer_hill/maps_normal/floor_2/metatiles.bin b/graphics/trainer_hill/maps_normal/floor_2/metatiles.bin new file mode 100755 index 000000000..bf2b52c32 --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_2/metatiles.bin @@ -0,0 +1 @@ +1555&&8&.55;icddddqqqrdddcsicssssssssssscsicssssssssssscsicCA@ABAAJBAAcsicsssssssdssscsicACKCCABB@A@csicssdsssssssscsicA@BBAABJBABcsicsssssssdssscsicABACKAAA@CAcsicssssdsssssscsicA@CABBAJBABcsidsssssssdsssdsiCCABBACAA@BABsiBsssssssssssBs \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_3/collision.bin b/graphics/trainer_hill/maps_normal/floor_3/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..f4c47254c56adb7e19d0d6ed491a13178b73c526 GIT binary patch literal 32 ncmZoUbL@H$@m!0ULkk4!I2@pp3%k8wKCK(G#-c@Lu*4B1sMhZ{|5lD4+_)( literal 0 HcmV?d00001 diff --git a/graphics/trainer_hill/maps_unique/floor_3/metatiles.bin b/graphics/trainer_hill/maps_unique/floor_3/metatiles.bin new file mode 100755 index 000000000..66840137c --- /dev/null +++ b/graphics/trainer_hill/maps_unique/floor_3/metatiles.bin @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/graphics/trainer_hill/maps_variety/floor_0/collision.bin b/graphics/trainer_hill/maps_variety/floor_0/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..24fc2ea1e6b203d760a554f6b02de209bdeadb1e GIT binary patch literal 32 McmZo+m literal 0 HcmV?d00001 diff --git a/graphics/trainer_hill/maps_variety/floor_1/metatiles.bin b/graphics/trainer_hill/maps_variety/floor_1/metatiles.bin new file mode 100755 index 000000000..c5a9aa5d4 --- /dev/null +++ b/graphics/trainer_hill/maps_variety/floor_1/metatiles.bin @@ -0,0 +1 @@ +1;;;9989:;;;@@@@@@@B@BBBBBBBBBBBBBBBBBAB֖AB֖@֜ \ No newline at end of file diff --git a/graphics/trainer_hill/maps_variety/floor_2/collision.bin b/graphics/trainer_hill/maps_variety/floor_2/collision.bin new file mode 100755 index 0000000000000000000000000000000000000000..606249b2a0085c18fc9fea19f02a98713c93233a GIT binary patch literal 32 RcmZo Date: Fri, 1 Apr 2022 01:21:00 -0400 Subject: [PATCH 068/208] Document trainer hill prize selection --- src/trainer_hill.c | 60 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 2deacfc70..dad6b97ea 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -996,10 +996,14 @@ static void TrainerHillSetMode(void) gSaveBlock1Ptr->trainerHill.bestTime = gSaveBlock1Ptr->trainerHillTimes[gSpecialVar_0x8005]; } -static u8 GetPrizeListId(bool8 maxTrainers) +// Determines which prize list to use from the set of prize lists. +static u8 GetPrizeListId(bool8 allowTMs) { u8 prizeListId, i, modBy; + // The initial selection depends on the trainer numbers for the completed challenge. + // These don't change with the available challenge modes, so Normal/Unique will always + // have a prizeListId of 8, and Variety/Expert will have a prizeListId of 24. prizeListId = 0; for (i = 0; i < NUM_TRAINER_HILL_FLOORS; i++) { @@ -1007,8 +1011,10 @@ static u8 GetPrizeListId(bool8 maxTrainers) prizeListId ^= sHillData->floors[i].trainerNum2 & 0x1F; } - // Not possible to win TMs with fewer than 8 trainers - if (maxTrainers) + // In practice, the conditional below is always true. + // The 2nd half of the lists in both sets of lists all have a TM as the "grand prize", while the 1st half do not, + // so taking the mod of the (total / 2) ensures that a prize list without a TM will be used. + if (allowTMs) modBy = NUM_TRAINER_HILL_PRIZE_LISTS; else modBy = NUM_TRAINER_HILL_PRIZE_LISTS / 2; @@ -1021,38 +1027,64 @@ static u16 GetPrizeItemId(void) { u8 i; const u16 *prizeList; - s32 var = 0, prizeListSetId, minutes, id; + s32 trainerNumSum = 0, prizeListSetId, minutes, id; + // First determine which set of prize lists to use. The sets of lists only differ in + // what TMs they can offer as the "grand prize" for a time under 12 minutes. + // Which set of lists gets used is based on the sum of all the trainer numbers for that + // challenge. These don't change with the available challenge modes, so Normal will always + // have a prizeListSetId of 0, and Unique/Variety/Expert will have a prizeListSetId of 1. for (i = 0; i < NUM_TRAINER_HILL_FLOORS; i++) { - var += sHillData->floors[i].trainerNum1; - var += sHillData->floors[i].trainerNum2; + trainerNumSum += sHillData->floors[i].trainerNum1; + trainerNumSum += sHillData->floors[i].trainerNum2; } + prizeListSetId = trainerNumSum / 256; + prizeListSetId %= (int)ARRAY_COUNT(sPrizeListSets); - prizeListSetId = var / 256; - prizeListSetId %= 2; + // Now get which prize list to use from the set. See GetPrizeListId for details. + // The below conditional will always be true, because a Trainer Hill challenge can't be entered + // until the player has entered the Hall of Fame (FLAG_SYS_GAME_CLEAR is set) and because all + // of the available challenge modes have the full 8 trainers (NUM_TRAINER_HILL_TRAINERS). if (FlagGet(FLAG_SYS_GAME_CLEAR) && sHillData->challenge.numTrainers == NUM_TRAINER_HILL_TRAINERS) i = GetPrizeListId(TRUE); else i = GetPrizeListId(FALSE); + // 1 is added to Expert mode's prize list selection because otherwise it has the same prizes as Variety if (gSaveBlock1Ptr->trainerHill.mode == HILL_MODE_EXPERT) i = (i + 1) % NUM_TRAINER_HILL_PRIZE_LISTS; + // After the above (non-random) calculations, the following are the possible prize list selections: + // sPrizeListSets[0][8] (Normal) + // sPrizeListSets[1][4] (Variety) + // sPrizeListSets[1][8] (Unique) + // sPrizeListSets[1][5] (Expert) prizeList = sPrizeListSets[prizeListSetId][i]; + + // Which prize is given from the list depends on the time scored. + // The prize for any time after 12 minutes is the same in every list. + // The prizes for a time under 12 minutes are: + // - ITEM_TM11_SUNNY_DAY (Normal) + // - ITEM_ELIXIR (Variety) + // - ITEM_TM19_GIGA_DRAIN (Unique) + // - ITEM_TM31_BRICK_BREAK (Expert) + // As an additional note, if players were allowed to enter a Trainer Hill challenge before + // entering the Hall of Fame, there would be 1 additional prize possibility (ITEM_MAX_ETHER) + // as Normal / Unique modes would use sPrizeListSets[0][3] / sPrizeListSets[1][3] respectively. minutes = (signed)(gSaveBlock1Ptr->trainerHill.timer) / (60 * 60); if (minutes < 12) - id = 0; + id = 0; // Depends on list else if (minutes < 13) - id = 1; + id = 1; // ITEM_ETHER else if (minutes < 14) - id = 2; + id = 2; // ITEM_MAX_POTION else if (minutes < 16) - id = 3; + id = 3; // ITEM_REVIVE else if (minutes < 18) - id = 4; + id = 4; // ITEM_FLUFFY_TAIL else - id = 5; + id = 5; // ITEM_GREAT_BALL return prizeList[id]; } From dafb5ca74ddd436008a171d908c123cbddd49983 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 3 Apr 2022 13:03:53 -0400 Subject: [PATCH 069/208] Fixed trapping moves not reflecting the configured turn config --- src/data/text/move_descriptions.h | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/data/text/move_descriptions.h b/src/data/text/move_descriptions.h index 4704af3fd..80c97a505 100644 --- a/src/data/text/move_descriptions.h +++ b/src/data/text/move_descriptions.h @@ -79,7 +79,11 @@ static const u8 sFlyDescription[] = _( static const u8 sBindDescription[] = _( "Binds and squeezes the foe\n" +#if B_BINDING_TURNS >= GEN_5 + "for 4 or 5 turns."); +#else "for 2 to 5 turns."); +#endif static const u8 sSlamDescription[] = _( "Slams the foe with a long\n" @@ -139,7 +143,11 @@ static const u8 sBodySlamDescription[] = _( static const u8 sWrapDescription[] = _( "Wraps and squeezes the foe\n" +#if B_BINDING_TURNS >= GEN_5 + "4 or 5 times with vines, etc."); +#else "2 to 5 times with vines, etc."); +#endif static const u8 sTakeDownDescription[] = _( "A reckless charge attack\n" @@ -331,7 +339,11 @@ static const u8 sDragonRageDescription[] = _( static const u8 sFireSpinDescription[] = _( "Traps the foe in a ring of\n" +#if B_BINDING_TURNS >= GEN_5 + "fire for 4 or 5 turns."); +#else "fire for 2 to 5 turns."); +#endif static const u8 sThunderShockDescription[] = _( "An electrical attack that\n" @@ -511,7 +523,11 @@ static const u8 sWaterfallDescription[] = _( static const u8 sClampDescription[] = _( "Traps and squeezes the\n" +#if B_BINDING_TURNS >= GEN_5 + "foe for 4 or 5 turns."); +#else "foe for 2 to 5 turns."); +#endif static const u8 sSwiftDescription[] = _( "Sprays star-shaped rays\n" @@ -999,7 +1015,11 @@ static const u8 sRockSmashDescription[] = _( static const u8 sWhirlpoolDescription[] = _( "Traps and hurts the foe in\n" +#if B_BINDING_TURNS >= GEN_5 + "a whirlpool for 4 or 5 turns."); +#else "a whirlpool for 2 to 5 turns."); +#endif static const u8 sBeatUpDescription[] = _( "Summons party Pokémon to\n" @@ -1311,7 +1331,11 @@ static const u8 sSkyUppercutDescription[] = _( static const u8 sSandTombDescription[] = _( "Traps and hurts the foe in\n" +#if B_BINDING_TURNS >= GEN_5 + "quicksand for 4 or 5 turns."); +#else "quicksand for 2 to 5 turns."); +#endif static const u8 sSheerColdDescription[] = _( "A chilling attack that\n" @@ -1815,7 +1839,11 @@ static const u8 sSpacialRendDescription[] = _( static const u8 sMagmaStormDescription[] = _( "Traps the foe in a vortex\n" +#if B_BINDING_TURNS >= GEN_5 + "of fire for 4 or 5 turns."); +#else "of fire for 2 to 5 turns."); +#endif static const u8 sDarkVoidDescription[] = _( "Drags the foe into total\n" @@ -2367,7 +2395,11 @@ static const u8 sNuzzleDescription[] = _( static const u8 sInfestationDescription[] = _( "The foe is infested and\n" +#if B_BINDING_TURNS >= GEN_5 + "attacked for 4 or 5 turns."); +#else "attacked for 2 to 5 turns."); +#endif static const u8 sPowerUpPunchDescription[] = _( "A hard punch that raises\n" @@ -2912,7 +2944,11 @@ static const u8 sSurgingStrikesDescription[] = _( static const u8 sThunderCageDescription[] = _( "Traps the foe in a cage of\n" +#if B_BINDING_TURNS >= GEN_5 + "electricity for 4 or 5 turns."); +#else "electricity for 2 to 5 turns."); +#endif static const u8 sDragonEnergyDescription[] = _( "The higher the user's HP\n" From d604d99d6e74e5bf183c79faf1bdffd99682f8f9 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 3 Apr 2022 16:54:07 -0400 Subject: [PATCH 070/208] Adjusted description of Glacial Lance and Astral Barrage --- src/data/text/move_descriptions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/text/move_descriptions.h b/src/data/text/move_descriptions.h index f3b982756..942ab0fbf 100644 --- a/src/data/text/move_descriptions.h +++ b/src/data/text/move_descriptions.h @@ -2932,11 +2932,11 @@ static const u8 sThunderousKickDescription[] = _( static const u8 sGlacialLanceDescription[] = _( "Strikes by hurling a blizzard-\n" - "cloaked icicle lance at a foe."); + "cloaked icicle lance at foes."); static const u8 sAstralBarrageDescription[] = _( "Strikes by sending a frightful\n" - "amount of ghosts at a foe."); + "amount of ghosts at foes."); static const u8 sEerieSpellDescription[] = _( "Attacks with psychic power.\n" From 59cff2190d44edf9e64c1d8c4cfd5931b2354aaf Mon Sep 17 00:00:00 2001 From: sbird Date: Sat, 16 Apr 2022 19:03:20 +0200 Subject: [PATCH 071/208] fix building without NDEBUG on agbcc --- ld_script.txt | 43 ++++++++++++++++++++++++++++++++++++++++--- src/libisagbprn.c | 10 +++++----- src/mystery_gift.c | 4 ++++ 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/ld_script.txt b/ld_script.txt index d68498a8b..1460c8443 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -20,7 +20,9 @@ SECTIONS { . = 0x1C000; INCLUDE "sym_ewram.ld" - + *libc.a:impure.o(.data); + *libc.a:locale.o(.data); + *libc.a:mallocr.o(.data); . = 0x40000; } @@ -462,6 +464,7 @@ SECTIONS { src/mystery_gift_server.o(.rodata); src/mystery_gift_client.o(.rodata); src/mystery_gift_scripts.o(.rodata); + src/wonder_news.o(.rodata); src/union_room_chat.o(.rodata); src/berry_crush.o(.rodata); src/berry_powder.o(.rodata); @@ -1245,9 +1248,43 @@ SECTIONS { src/librfu_sio32id.o(.rodata); *libgcc.a:_divdi3.o(.rodata); *libgcc.a:_udivdi3.o(.rodata); - *libc.a(.rodata); - *libc.a(.data); + *libc.a:memcpy.o(.rodata); + *libc.a:memset.o(.rodata); + *libc.a:strcmp.o(.rodata); + *libc.a:strcpy.o(.rodata); + *libc.a:impure.o(.rodata); + *libc.a:vsprintf.o(.rodata); + *libc.a:vfprintf.o(.rodata); + *libc.a:wsetup.o(.rodata); + *libc.a:dtoa.o(.rodata); + *libc.a:fflush.o(.rodata); + *libc.a:findfp.o(.rodata); + *libc.a:freer.o(.rodata); + *libc.a:mtrim.o(.rodata); + *libc.a:fvwrite.o(.rodata); + *libc.a:fwalk.o(.rodata); + *libc.a:locale.o(.rodata); + *libc.a:makebuf.o(.rodata); + *libc.a:mallocr.o(.rodata); + *libc.a:mbtowc_r.o(.rodata); + *libc.a:memchr.o(.rodata); + *libc.a:memmove.o(.rodata); + *libc.a:mlock.o(.rodata); + *libc.a:mprec.o(.rodata); + *libc.a:s_isinf.o(.rodata); + *libc.a:s_isnan.o(.rodata); + *libc.a:sbrkr.o(.rodata); + *libc.a:stdio.o(.rodata); + *libc.a:strlen.o(.rodata); *libc.a:syscalls.o(.rodata); + *libc.a:writer.o(.rodata); + *libc.a:callocr.o(.rodata); + *libc.a:closer.o(.rodata); + *libc.a:errno.o(.rodata); + *libc.a:fstatr.o(.rodata); + *libc.a:libcfunc.o(.rodata); + *libc.a:lseekr.o(.rodata); + *libc.a:readr.o(.rodata); src/libisagbprn.o(.rodata); } =0 diff --git a/src/libisagbprn.c b/src/libisagbprn.c index 69c6986ae..7a70cf41f 100644 --- a/src/libisagbprn.c +++ b/src/libisagbprn.c @@ -31,7 +31,7 @@ void AGBPrintFlush1Block(void); void AGBPrintInit(void) { volatile struct AGBPrintStruct *pPrint = (struct AGBPrintStruct *)AGB_PRINT_STRUCT_ADDR; - u16 *pWSCNT = ®_WAITCNT; + vu16 *pWSCNT = ®_WAITCNT; u16 *pProtect = (u16 *)AGB_PRINT_PROTECT_ADDR; u16 nOldWSCNT = *pWSCNT; *pWSCNT = WSCNT_DATA; @@ -57,7 +57,7 @@ static void AGBPutcInternal(const char cChr) void AGBPutc(const char cChr) { - u16 *pWSCNT = ®_WAITCNT; + vu16 *pWSCNT = ®_WAITCNT; u16 nOldWSCNT = *pWSCNT; volatile struct AGBPrintStruct *pPrint; *pWSCNT = WSCNT_DATA; @@ -71,7 +71,7 @@ void AGBPutc(const char cChr) void AGBPrint(const char *pBuf) { volatile struct AGBPrintStruct *pPrint = (struct AGBPrintStruct *)AGB_PRINT_STRUCT_ADDR; - u16 *pWSCNT = ®_WAITCNT; + vu16 *pWSCNT = ®_WAITCNT; u16 nOldWSCNT = *pWSCNT; *pWSCNT = WSCNT_DATA; while (*pBuf) @@ -95,9 +95,9 @@ void AGBPrintf(const char *pBuf, ...) static void AGBPrintTransferDataInternal(u32 bAllData) { LPFN_PRINT_FLUSH lpfnFuncFlush; - u16 *pIME; + vu16 *pIME; u16 nIME; - u16 *pWSCNT; + vu16 *pWSCNT; u16 nOldWSCNT; u16 *pProtect; volatile struct AGBPrintStruct *pPrint; diff --git a/src/mystery_gift.c b/src/mystery_gift.c index 1df6533d9..72fc2b377 100755 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -506,9 +506,13 @@ static void IncrementCardStat(u32 statType) } if (stat == NULL) + { AGB_ASSERT(0); + } else if (++(*stat) > MAX_WONDER_CARD_STAT) + { *stat = MAX_WONDER_CARD_STAT; + } } } From 0bda107188b5623f34d95214fae1c715b757ec7f Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Wed, 20 Apr 2022 01:07:10 -0400 Subject: [PATCH 072/208] don't build modern with -g by default --- INSTALL.md | 1 + Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index f6434c07b..72f3c92f3 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -457,6 +457,7 @@ To build **pokeemerald.elf** with enhanced debug info: ```bash make DINFO=1 ``` +Note that this is only necessary for the `modern` target; the regular target has debug info enabled by default. ## devkitARM's C compiler diff --git a/Makefile b/Makefile index 6283a87fe..c36cc8e93 100644 --- a/Makefile +++ b/Makefile @@ -107,7 +107,7 @@ LIBPATH := -L ../../tools/agbcc/lib LIB := $(LIBPATH) -lgcc -lc -L../../libagbsyscall -lagbsyscall else CC1 = $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet -override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -g +override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast ROM := $(MODERN_ROM_NAME) OBJ_DIR := $(MODERN_OBJ_DIR_NAME) LIBPATH := -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libc.a))" From 055c72a384aa5fc9f56970166a3595f3ba545b09 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 23 Apr 2022 04:23:27 -0300 Subject: [PATCH 073/208] Improved the special animation of Shell Side Arm --- data/battle_anim_scripts.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index ef2e1d5d5..157e638c9 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -14078,8 +14078,8 @@ Move_SHELL_SIDE_ARM_SPECIAL: @ Modified Snipe Shot, placeholder loadspritegfx ANIM_TAG_LEER createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_IMPACT_2, 0, 6, 6, RGB_MAGENTA createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_LEER, 0, 6, 6, RGB_MAGENTA - launchtemplate gLeerSpriteTemplate 0x82, 2 0x18 -12 playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x82, 2 0x18 -12 waitforvisualfinish delay 0x20 playsewithpan SE_M_GIGA_DRAIN, SOUND_PAN_TARGET From 487e3c46d164d579f711eb28387ecae3ea2f9577 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 24 Apr 2022 17:27:23 -0300 Subject: [PATCH 074/208] Updated trainer slide-in array --- src/battle_message.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/battle_message.c b/src/battle_message.c index 039aca722..7b2afab54 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -26,6 +26,7 @@ #include "constants/frontier_util.h" #include "constants/items.h" #include "constants/moves.h" +#include "constants/opponents.h" #include "constants/species.h" #include "constants/trainers.h" #include "constants/trainer_hill.h" @@ -3878,7 +3879,9 @@ struct TrainerSlide static const struct TrainerSlide sTrainerSlides[] = { - {0x291, sText_AarghAlmostHadIt, sText_BoxIsFull, sText_123Poof}, + // Put any trainer slide-in messages inside this array. + // Example: + // {TRAINER_WALLY_VR_2, sText_AarghAlmostHadIt, sText_BoxIsFull, sText_123Poof}, }; static u32 GetEnemyMonCount(bool32 onlyAlive) From 2b223acd876169cd8f90f8f5723f28aaaa32f373 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 26 Apr 2022 21:44:11 -0400 Subject: [PATCH 075/208] Fix math in CreateBerrySprite --- src/berry_blender.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/berry_blender.c b/src/berry_blender.c index 27ea641ce..9b74c7bab 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1188,9 +1188,9 @@ static void SetBerrySpriteData(struct Sprite* sprite, s16 x, s16 y, s16 bounceSp #undef sXSpeed #undef sYDownSpeed -static void CreateBerrySprite(u16 a0, u8 playerId) +static void CreateBerrySprite(u16 itemId, u8 playerId) { - u8 spriteId = CreateSpinningBerrySprite(a0 + FIRST_BERRY_INDEX - 10, 0, 80, playerId & 1); + u8 spriteId = CreateSpinningBerrySprite(ITEM_TO_BERRY(itemId) - 1, 0, 80, playerId & 1); SetBerrySpriteData(&gSprites[spriteId], sBerrySpriteData[playerId][0], sBerrySpriteData[playerId][1], From af6242f2e027d62eb7cb34971adb142f7eb74fe9 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 27 Apr 2022 21:51:10 +1200 Subject: [PATCH 076/208] Requested changes, Sticky Web edge case Fix issues found by ghoulslash, and make sure Defiant works properly with Sticky Web and Court Change. --- data/battle_scripts_1.s | 2 +- include/constants/battle_script_commands.h | 2 +- src/battle_ai_main.c | 2 +- src/battle_script_commands.c | 8 ++++++-- src/battle_util.c | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 37eaa5b83..6574e26ab 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7290,7 +7290,7 @@ BattleScript_DefDownSpeedUpTryDef:: setstatchanger STAT_DEF, 1, TRUE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR | MOVE_EFFECT_CERTAIN, BattleScript_DefDownSpeedUpTrySpeed jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DefDownSpeedUpTrySpeed - printfromtable gStatUpStringIds + printfromtable gStatDownStringIds waitmessage B_WAIT_TIME_LONG BattleScript_DefDownSpeedUpTrySpeed: playstatchangeanimation BS_ATTACKER, BIT_SPEED, 0 diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 2903963f4..da44714e2 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -39,7 +39,7 @@ #define sABILITY_OVERWRITE (gBattleScripting + 0x34) // abilityPopupOverwrite #define sSWITCH_CASE (gBattleScripting + 0x36) // switchCase #define sBERRY_OVERRIDE (gBattleScripting + 0x37) // overrideBerryRequirements -#define sSTICKY_WEB_STAT_DROP (gBattleScripting + 0x38) // +#define sSTICKY_WEB_STAT_DROP (gBattleScripting + 0x38) // stickyWebStatDrop // Array entries for battle communication #define MULTIUSE_STATE 0 diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 02597a0aa..16e830efe 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -566,7 +566,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) GET_MOVE_TYPE(move, moveType); // check non-user target - if (moveTarget & MOVE_TARGET_USER) + if (!(moveTarget & MOVE_TARGET_USER)) { // handle negative checks on non-user target // check powder moves diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 4d464c5d2..01944f508 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3504,8 +3504,11 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattleMons[gBattlerAttacker].status2 |= STATUS2_ESCAPE_PREVENTION; break; case MOVE_EFFECT_SCALE_SHOT: - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_DefDownSpeedUp; + if (!NoAliveMonsForEitherParty()) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_DefDownSpeedUp; + } break; } } @@ -7700,6 +7703,7 @@ static bool32 CourtChangeSwapSideStatuses(void) UPDATE_COURTCHANGED_BATTLER(auroraVeilBattlerId); UPDATE_COURTCHANGED_BATTLER(tailwindBattlerId); UPDATE_COURTCHANGED_BATTLER(luckyChantBattlerId); + gBattleStruct->stickyWebUser ^= BIT_SIDE; // Track which side originally set the Sticky Web SWAP(sideTimerPlayer->stickyWebBattlerSide, sideTimerOpp->stickyWebBattlerSide, temp); diff --git a/src/battle_util.c b/src/battle_util.c index 041661cdc..c0a7f2150 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1569,7 +1569,7 @@ void PrepareStringBattle(u16 stringId, u8 battler) && ((targetAbility == ABILITY_DEFIANT && CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) || (targetAbility == ABILITY_COMPETITIVE && CompareStat(gBattlerTarget, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN))) && gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != BATTLE_PARTNER(gBattlerTarget) - // && gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != gBattlerTarget) // Why was this here? Needs investigating + && ((gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != gBattlerTarget) || gBattleScripting.stickyWebStatDrop == 1) && !(gBattleScripting.stickyWebStatDrop == 1 && gSideTimers[targetSide].stickyWebBattlerSide == targetSide)) // Sticky Web must have been set by the foe { gBattleScripting.stickyWebStatDrop = 0; From 746d9ea6c52c523ebd52d765fd63b112e9933912 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 27 Apr 2022 22:23:20 +1200 Subject: [PATCH 077/208] Add AI_GetBattlerMoveTargetType() Add AI version of the function that handles move target selection, as it needs to have ability and item info that it may not have access to. --- include/battle_ai_util.h | 1 + src/battle_ai_main.c | 18 +++++++++--------- src/battle_ai_util.c | 12 +++++++++++- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index 5ccf68c58..0b2afebae 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -60,6 +60,7 @@ bool32 IsAbilityOfRating(u16 ability, s8 rating); s8 GetAbilityRating(u16 ability); bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability); bool32 AI_MoveMakesContact(u32 ability, u32 holdEffect, u16 move); +u32 AI_GetBattlerMoveTargetType(u8 battlerId, u16 move); // stat stage checks bool32 AnyStatIsRaised(u8 battlerId); diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 16e830efe..192b75d74 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -550,7 +550,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) u8 atkPriority = GetMovePriority(battlerAtk, move); u16 moveEffect = gBattleMoves[move].effect; s32 moveType; - u16 moveTarget = GetBattlerMoveTargetType(battlerAtk, move); + u16 moveTarget = AI_GetBattlerMoveTargetType(battlerAtk, move); u16 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect, move); u8 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); @@ -2371,7 +2371,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else { - if (GetBattlerMoveTargetType(battlerDef, instructedMove) & (MOVE_TARGET_SELECTED + if (AI_GetBattlerMoveTargetType(battlerDef, instructedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_DEPENDS | MOVE_TARGET_RANDOM | MOVE_TARGET_BOTH @@ -2568,7 +2568,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // move data u8 moveType = gBattleMoves[move].type; u16 effect = gBattleMoves[move].effect; - u16 moveTarget = GetBattlerMoveTargetType(battlerAtk, move); + u16 moveTarget = AI_GetBattlerMoveTargetType(battlerAtk, move); // ally data u8 battlerAtkPartner = AI_DATA->battlerAtkPartner; u16 atkPartnerAbility = AI_DATA->atkPartnerAbility; @@ -2875,7 +2875,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (instructedMove != MOVE_NONE && !IS_MOVE_STATUS(instructedMove) - && (GetBattlerMoveTargetType(battlerAtkPartner, instructedMove) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) // Use instruct on multi-target moves + && (AI_GetBattlerMoveTargetType(battlerAtkPartner, instructedMove) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) // Use instruct on multi-target moves { RETURN_SCORE_PLUS(1); } @@ -3698,24 +3698,24 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); break; case MOVE_WIDE_GUARD: - if (predictedMove != MOVE_NONE && GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_BOTH)) + if (predictedMove != MOVE_NONE && AI_GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_BOTH)) { ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); } - else if (isDoubleBattle && GetBattlerMoveTargetType(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) & MOVE_TARGET_FOES_AND_ALLY) + else if (isDoubleBattle && AI_GetBattlerMoveTargetType(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) & MOVE_TARGET_FOES_AND_ALLY) { if (AI_DATA->atkAbility != ABILITY_TELEPATHY) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); } break; case MOVE_CRAFTY_SHIELD: - if (predictedMove != MOVE_NONE && IS_MOVE_STATUS(predictedMove) && !(GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER)) + if (predictedMove != MOVE_NONE && IS_MOVE_STATUS(predictedMove) && !(AI_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)) + && !IS_MOVE_STATUS(predictedMove) && !(AI_GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER)) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); break; case MOVE_KINGS_SHIELD: @@ -4160,7 +4160,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 10; break; case EFFECT_MAGIC_COAT: - if (IS_MOVE_STATUS(predictedMove) && GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH)) + if (IS_MOVE_STATUS(predictedMove) && AI_GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH)) score += 3; break; case EFFECT_RECYCLE: diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 4b344ecba..de4271bba 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1251,6 +1251,16 @@ bool32 AI_WeatherHasEffect(void) return TRUE; } +u32 AI_GetBattlerMoveTargetType(u8 battlerId, u16 move) +{ + u32 target; + + if (gBattleMoves[move].effect == EFFECT_EXPANDING_FORCE && AI_IsTerrainAffected(battlerId, STATUS_FIELD_PSYCHIC_TERRAIN)) + return MOVE_TARGET_BOTH; + else + return gBattleMoves[move].target; +} + bool32 IsAromaVeilProtectedMove(u16 move) { u32 i; @@ -1919,7 +1929,7 @@ bool32 HasMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef, u8 accCheck, bool32 if (ignoreStatus && IS_MOVE_STATUS(moves[i])) continue; else if ((!IS_MOVE_STATUS(moves[i]) && gBattleMoves[moves[i]].accuracy == 0) - || GetBattlerMoveTargetType(battlerAtk, moves[i]) & (MOVE_TARGET_USER | MOVE_TARGET_OPPONENTS_FIELD)) + || AI_GetBattlerMoveTargetType(battlerAtk, moves[i]) & (MOVE_TARGET_USER | MOVE_TARGET_OPPONENTS_FIELD)) continue; if (AI_GetMoveAccuracy(battlerAtk, battlerDef, atkAbility, defAbility, atkHoldEffect, defHoldEffect, moves[i]) <= accCheck) return TRUE; From 66d8409075eb8ce3eaf53c06fa2f2a66c1449af0 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 27 Apr 2022 09:47:32 -0300 Subject: [PATCH 078/208] Update post review --- src/battle_message.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/battle_message.c b/src/battle_message.c index 7b2afab54..ee0cf63e4 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -3879,9 +3879,15 @@ struct TrainerSlide static const struct TrainerSlide sTrainerSlides[] = { - // Put any trainer slide-in messages inside this array. - // Example: - // {TRAINER_WALLY_VR_2, sText_AarghAlmostHadIt, sText_BoxIsFull, sText_123Poof}, + /* Put any trainer slide-in messages inside this array. + Example: + { + .trainerId = TRAINER_WALLY_VR_2, + .msgLastSwitchIn = sText_AarghAlmostHadIt, + .msgLastLowHp = sText_BoxIsFull, + .msgFirstDown = sText_123Poof, + }, + */ }; static u32 GetEnemyMonCount(bool32 onlyAlive) From cbf0a6704b79f9d12d92ab0d91014e7ce9efde82 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 1 May 2022 12:54:33 +1200 Subject: [PATCH 079/208] Set Sticky Web user to Court Change user This is for Mirror Armor to track the current user of Sticky Web/the mon that caused the stat drop. --- src/battle_script_commands.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 01944f508..d6edb0ab2 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7703,7 +7703,9 @@ static bool32 CourtChangeSwapSideStatuses(void) UPDATE_COURTCHANGED_BATTLER(auroraVeilBattlerId); UPDATE_COURTCHANGED_BATTLER(tailwindBattlerId); UPDATE_COURTCHANGED_BATTLER(luckyChantBattlerId); - gBattleStruct->stickyWebUser ^= BIT_SIDE; + + // For Mirror Armor only + gBattleStruct->stickyWebUser = gBattlerAttacker; // Track which side originally set the Sticky Web SWAP(sideTimerPlayer->stickyWebBattlerSide, sideTimerOpp->stickyWebBattlerSide, temp); From be6148d876fb15d9e9b916587982aee5e616da7c Mon Sep 17 00:00:00 2001 From: sneed Date: Mon, 2 May 2022 04:54:25 +0300 Subject: [PATCH 080/208] Add missing Heal Block functionalities --- src/battle_script_commands.c | 2 +- src/battle_util.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d6edb0ab2..e20832bb5 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7872,7 +7872,7 @@ static void Cmd_various(void) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); return; case VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS: - if ((gStatuses3[gActiveBattler] & (STATUS3_SEMI_INVULNERABLE)) + if ((gStatuses3[gActiveBattler] & (STATUS3_SEMI_INVULNERABLE | STATUS3_HEAL_BLOCK)) || BATTLER_MAX_HP(gActiveBattler) || !gBattleMons[gActiveBattler].hp || !(IsBattlerGrounded(gActiveBattler))) diff --git a/src/battle_util.c b/src/battle_util.c index c0a7f2150..775c8eebc 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1689,6 +1689,7 @@ bool32 IsHealBlockPreventingMove(u32 battler, u32 move) case EFFECT_HEALING_WISH: case EFFECT_WISH: case EFFECT_DREAM_EATER: + case EFFECT_STRENGTH_SAP: return TRUE; default: return FALSE; @@ -6082,7 +6083,7 @@ bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId) static u8 HealConfuseBerry(u32 battlerId, u32 itemId, u8 flavorId, bool32 end2) { - if (HasEnoughHpToEatBerry(battlerId, 2, itemId)) + if (HasEnoughHpToEatBerry(battlerId, 2, itemId) && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) { PREPARE_FLAVOR_BUFFER(gBattleTextBuff1, flavorId); @@ -6268,7 +6269,7 @@ u8 TryHandleSeed(u8 battler, u32 terrainFlag, u8 statId, u16 itemId, bool32 exec static u8 ItemHealHp(u32 battlerId, u32 itemId, bool32 end2, bool32 percentHeal) { - if (HasEnoughHpToEatBerry(battlerId, 2, itemId) + if (HasEnoughHpToEatBerry(battlerId, 2, itemId) && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK) && !(gBattleScripting.overrideBerryRequirements && gBattleMons[battlerId].hp == gBattleMons[battlerId].maxHP)) { if (percentHeal) @@ -6707,7 +6708,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) break; case HOLD_EFFECT_LEFTOVERS: LEFTOVERS: - if (gBattleMons[battlerId].hp < gBattleMons[battlerId].maxHP && !moveTurn) + if (gBattleMons[battlerId].hp < gBattleMons[battlerId].maxHP && !moveTurn + && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) { gBattleMoveDamage = gBattleMons[battlerId].maxHP / 16; if (gBattleMoveDamage == 0) @@ -7137,7 +7139,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) if (gSpecialStatuses[gBattlerAttacker].damagedMons // Need to have done damage && gBattlerAttacker != gBattlerTarget && gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP - && gBattleMons[gBattlerAttacker].hp != 0) + && gBattleMons[gBattlerAttacker].hp != 0 + && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) { gLastUsedItem = atkItem; gPotentialItemEffectBattler = gBattlerAttacker; From b17d1f7816bde54b64c306968a1c6fdc0d42da85 Mon Sep 17 00:00:00 2001 From: sneed Date: Mon, 2 May 2022 17:56:09 +0300 Subject: [PATCH 081/208] Add generation specific interactions --- data/battle_scripts_1.s | 4 ++++ include/constants/battle_config.h | 2 ++ src/battle_util.c | 32 +++++++++++++++++++++++++------ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 6574e26ab..a58dc1339 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1272,6 +1272,7 @@ BattleScript_StrengthSapTryHp: attackanimation waitanimation BattleScript_StrengthSapHp: + jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_MoveEnd jumpiffullhp BS_ATTACKER, BattleScript_MoveEnd manipulatedamage DMG_BIG_ROOT healthbarupdate BS_ATTACKER @@ -3103,6 +3104,7 @@ BattleScript_EffectAbsorb:: waitmessage B_WAIT_TIME_LONG resultmessage waitmessage B_WAIT_TIME_LONG + jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_AbsorbHealBlock setdrainedhp manipulatedamage DMG_BIG_ROOT orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE @@ -3122,6 +3124,7 @@ BattleScript_AbsorbUpdateHp:: waitmessage B_WAIT_TIME_LONG BattleScript_AbsorbTryFainting:: tryfaintmon BS_ATTACKER +BattleScript_AbsorbHealBlock:: tryfaintmon BS_TARGET goto BattleScript_MoveEnd @@ -3228,6 +3231,7 @@ BattleScript_DreamEaterWorked: waitmessage B_WAIT_TIME_LONG resultmessage waitmessage B_WAIT_TIME_LONG + jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_DreamEaterTryFaintEnd setdrainedhp manipulatedamage DMG_BIG_ROOT orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index a3ef7cc94..29395dc80 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -170,6 +170,8 @@ #define B_BRICK_BREAK GEN_7 // In Gen4+, you can destroy your own side's screens. In Gen 5+, screens are not removed if the target is immune. #define B_WISH_HP_SOURCE GEN_7 // In Gen5+, Wish heals half of the user's max HP instead of the target's. #define B_RAMPAGE_CANCELLING GEN_7 // In Gen5+, a failed Thrash, etc, will cancel except on its last turn. +#define B_HEAL_BLOCKING GEN_7 // In Gen5+, Heal Block prevents healing by Black Sludge, Leftovers, Shell Bell. Affected Pokémon will not consume held HP-restoring Berries or Berry Juice. + // Draining abilities will not heal but will prevent damage. In Gen6+, Heal Block prevents the use of most HP-draining moves. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. diff --git a/src/battle_util.c b/src/battle_util.c index 775c8eebc..1aa917f82 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1680,7 +1680,11 @@ bool32 IsHealBlockPreventingMove(u32 battler, u32 move) switch (gBattleMoves[move].effect) { +#if B_HEAL_BLOCKING >= GEN_6 case EFFECT_ABSORB: + case EFFECT_STRENGTH_SAP: + case EFFECT_DREAM_EATER: +#endif case EFFECT_MORNING_SUN: case EFFECT_MOONLIGHT: case EFFECT_RESTORE_HP: @@ -1688,8 +1692,6 @@ bool32 IsHealBlockPreventingMove(u32 battler, u32 move) case EFFECT_ROOST: case EFFECT_HEALING_WISH: case EFFECT_WISH: - case EFFECT_DREAM_EATER: - case EFFECT_STRENGTH_SAP: return TRUE; default: return FALSE; @@ -4908,7 +4910,11 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (effect == 1) // Drain Hp ability. { +#if B_HEAL_BLOCKING >= GEN_5 if (BATTLER_MAX_HP(battler) || gStatuses3[battler] & STATUS3_HEAL_BLOCK) +#else + if (BATTLER_MAX_HP(battler)) +#endif { if ((gProtectStructs[gBattlerAttacker].notFirstStrike)) gBattlescriptCurrInstr = BattleScript_MonMadeMoveUseless; @@ -6083,7 +6089,11 @@ bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId) static u8 HealConfuseBerry(u32 battlerId, u32 itemId, u8 flavorId, bool32 end2) { +#if B_HEAL_BLOCKING >= GEN_5 if (HasEnoughHpToEatBerry(battlerId, 2, itemId) && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) +#else + if (HasEnoughHpToEatBerry(battlerId, 2, itemId)) +#endif { PREPARE_FLAVOR_BUFFER(gBattleTextBuff1, flavorId); @@ -6269,7 +6279,11 @@ u8 TryHandleSeed(u8 battler, u32 terrainFlag, u8 statId, u16 itemId, bool32 exec static u8 ItemHealHp(u32 battlerId, u32 itemId, bool32 end2, bool32 percentHeal) { +#if B_HEAL_BLOCKING >= GEN_5 if (HasEnoughHpToEatBerry(battlerId, 2, itemId) && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK) +#else + if (HasEnoughHpToEatBerry(battlerId, 2, itemId) +#endif && !(gBattleScripting.overrideBerryRequirements && gBattleMons[battlerId].hp == gBattleMons[battlerId].maxHP)) { if (percentHeal) @@ -6708,8 +6722,11 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) break; case HOLD_EFFECT_LEFTOVERS: LEFTOVERS: - if (gBattleMons[battlerId].hp < gBattleMons[battlerId].maxHP && !moveTurn - && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) +#if B_HEAL_BLOCKING >= GEN_5 + if (gBattleMons[battlerId].hp < gBattleMons[battlerId].maxHP && !moveTurn && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) +#else + if (gBattleMons[battlerId].hp < gBattleMons[battlerId].maxHP && !moveTurn) +#endif { gBattleMoveDamage = gBattleMons[battlerId].maxHP / 16; if (gBattleMoveDamage == 0) @@ -7139,8 +7156,11 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) if (gSpecialStatuses[gBattlerAttacker].damagedMons // Need to have done damage && gBattlerAttacker != gBattlerTarget && gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP - && gBattleMons[gBattlerAttacker].hp != 0 - && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) +#if B_HEAL_BLOCKING >= GEN_5 + && gBattleMons[gBattlerAttacker].hp != 0 && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) +#else + && gBattleMons[gBattlerAttacker].hp != 0) +#endif { gLastUsedItem = atkItem; gPotentialItemEffectBattler = gBattlerAttacker; From 60d7d8f97e044f8c69a52daa72ef30ed6c1aa119 Mon Sep 17 00:00:00 2001 From: sneed Date: Tue, 3 May 2022 03:38:44 +0300 Subject: [PATCH 082/208] Initial Commit --- data/battle_scripts_1.s | 45 +++++++++++++++++++++++++ include/constants/battle_move_effects.h | 3 +- src/battle_script_commands.c | 2 +- src/data/battle_moves.h | 2 +- 4 files changed, 49 insertions(+), 3 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 6574e26ab..61fbf91aa 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -410,6 +410,51 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_RISING_VOLTAGE .4byte BattleScript_EffectHit @ EFFECT_BEAK_BLAST .4byte BattleScript_EffectCourtChange @ EFFECT_COURT_CHANGE + .4byte BattleScript_EffectSteelBeam @ EFFECT_STEEL_BEAM + +BattleScript_EffectSteelBeam:: + attackcanceler + attackstring + ppreduce + accuracycheck BattleScript_SteelBeamMiss, ACC_CURR_MOVE + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage B_WAIT_TIME_LONG + resultmessage + waitmessage B_WAIT_TIME_LONG + seteffectwithchance + jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_SteelBeamAfterSelfDamage + call BattleScript_SteelBeamSelfDamage +BattleScript_SteelBeamAfterSelfDamage:: + waitstate + tryfaintmon BS_ATTACKER + tryfaintmon BS_TARGET + goto BattleScript_MoveEnd +BattleScript_SteelBeamMiss:: + pause B_WAIT_TIME_SHORT + effectivenesssound + resultmessage + waitmessage B_WAIT_TIME_LONG + jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_MoveEnd + bichalfword gMoveResultFlags, MOVE_RESULT_MISSED + call BattleScript_SteelBeamSelfDamage + orhalfword gMoveResultFlags, MOVE_RESULT_MISSED + goto BattleScript_SteelBeamAfterSelfDamage + +BattleScript_SteelBeamSelfDamage:: + dmg_1_2_attackerhp + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + return BattleScript_EffectCourtChange:: attackcanceler diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 3cc3d72b3..c3460bcfe 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -393,7 +393,8 @@ #define EFFECT_RISING_VOLTAGE 387 #define EFFECT_BEAK_BLAST 388 #define EFFECT_COURT_CHANGE 389 +#define EFFECT_STEEL_BEAM 390 -#define NUM_BATTLE_MOVE_EFFECTS 390 +#define NUM_BATTLE_MOVE_EFFECTS 391 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d6edb0ab2..072130b8b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9882,7 +9882,7 @@ static void Cmd_manipulatedamage(void) gBattleMoveDamage = GetDrainedBigRootHp(gBattlerAttacker, gBattleMoveDamage); break; case DMG_1_2_ATTACKER_HP: - gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; + gBattleMoveDamage = (gBattleMons[gBattlerAttacker].maxHP + 1) / 2; // Half of Max HP Rounded UP break; case DMG_RECOIL_FROM_IMMUNE: gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 1f90abf03..2035acff7 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11221,7 +11221,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_STEEL_BEAM] = { - .effect = EFFECT_RECOIL_50, + .effect = EFFECT_STEEL_BEAM, .power = 140, .type = TYPE_STEEL, .accuracy = 95, From 865b771db7ad3ad31b427ad45ce537e8f4ba4bd4 Mon Sep 17 00:00:00 2001 From: sneed Date: Thu, 5 May 2022 00:57:19 +0300 Subject: [PATCH 083/208] initial commit --- include/constants/battle_config.h | 2 +- src/battle_util.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index a3ef7cc94..a8d6ebdf7 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -181,7 +181,7 @@ #define B_FLASH_FIRE_FROZEN GEN_7 // In Gen5+, Flash Fire can trigger even when frozen, when it couldn't before. #define B_SYNCHRONIZE_NATURE GEN_8 // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously. #define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned. -#define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. +#define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. It also activates Rattled. // Item settings #define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. diff --git a/src/battle_util.c b/src/battle_util.c index c0a7f2150..c18e4f113 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1581,6 +1581,16 @@ void PrepareStringBattle(u16 stringId, u8 battler) else SET_STATCHANGER(STAT_SPATK, 2, FALSE); } +#if B_UPDATED_INTIMIDATE >= GEN_8 + else if (stringId == STRINGID_PKMNCUTSATTACKWITH && targetAbility == ABILITY_RATTLED + && CompareStat(gBattlerTarget, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + gBattlerAbility = gBattlerTarget; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_DefiantActivates; + SET_STATCHANGER(STAT_SPEED, 1, FALSE); + } +#endif gActiveBattler = battler; BtlController_EmitPrintString(BUFFER_A, stringId); From 6c23eb431de0f3f6538d49c1e8a98fe835feedb4 Mon Sep 17 00:00:00 2001 From: sneed Date: Thu, 5 May 2022 13:56:59 +0300 Subject: [PATCH 084/208] Heal Pulse and Pollen Puff --- data/battle_scripts_1.s | 2 ++ src/battle_util.c | 1 + 2 files changed, 3 insertions(+) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a58dc1339..132a8ea35 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2410,6 +2410,8 @@ BattleScript_EffectHealPulse: attackcanceler attackstring ppreduce + jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_MoveUsedHealBlockPrevents @ stops pollen puff + jumpifstatus3 BS_TARGET, STATUS3_HEAL_BLOCK, BattleScript_MoveUsedHealBlockPrevents accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON jumpifsubstituteblocks BattleScript_ButItFailed tryhealpulse BS_TARGET, BattleScript_AlreadyAtFullHp diff --git a/src/battle_util.c b/src/battle_util.c index 1aa917f82..6569c6a1b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1692,6 +1692,7 @@ bool32 IsHealBlockPreventingMove(u32 battler, u32 move) case EFFECT_ROOST: case EFFECT_HEALING_WISH: case EFFECT_WISH: + case EFFECT_HEAL_PULSE: return TRUE; default: return FALSE; From 6235970722ad9eab298deaf3b66580f9a78dd2d9 Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Thu, 5 May 2022 11:41:27 -0700 Subject: [PATCH 085/208] added special battle evo changes --- include/constants/pokemon.h | 2 ++ src/battle_main.c | 37 +++++++++++++++++++++++++++++++++--- src/battle_script_commands.c | 7 +++++++ src/pokemon.c | 13 +++++++++++++ 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index c375bbdd1..a7f0e3e4e 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -379,6 +379,7 @@ #define EVO_SPECIFIC_MAP 32 // Pokémon levels up on specified map #define EVO_LEVEL_NATURE_AMPED 33 // Pokémon reaches the specified level, it has a Hardy, Brave, Adamant, Naughty, Docile, Impish, Lax, Hasty, Jolly, Naive, Rash, Sassy, or Quirky nature. #define EVO_LEVEL_NATURE_LOW_KEY 34 // Pokémon reaches the specified level, it has a Lonely, Bold, Relaxed, Timid, Serious, Modest, Mild, Quiet, Bashful, Calm, Gentle, or Careful nature. +#define EVO_CRITICAL_HITS 35 // Pokémon performs specified number of critical hits in one battle #define EVOS_PER_MON 10 @@ -387,6 +388,7 @@ #define EVO_MODE_TRADE 1 #define EVO_MODE_ITEM_USE 2 #define EVO_MODE_ITEM_CHECK 3 // If an Everstone is being held, still want to show that the stone *could* be used on that Pokémon to evolve +#define EVO_MODE_BATTLE_SPECIAL 4 #define NUM_MALE_LINK_FACILITY_CLASSES 8 #define NUM_FEMALE_LINK_FACILITY_CLASSES 8 diff --git a/src/battle_main.c b/src/battle_main.c index 479cafae6..ca59ff86e 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -115,6 +115,7 @@ static void HandleEndTurn_MonFled(void); static void HandleEndTurn_FinishBattle(void); static void SpriteCB_UnusedBattleInit(struct Sprite* sprite); static void SpriteCB_UnusedBattleInit_Main(struct Sprite *sprite); +static void TrySpecialEvolution(void); EWRAM_DATA u16 gBattle_BG0_X = 0; EWRAM_DATA u16 gBattle_BG0_Y = 0; @@ -237,6 +238,8 @@ EWRAM_DATA bool8 gHasFetchedBall = FALSE; EWRAM_DATA u8 gLastUsedBall = 0; EWRAM_DATA u16 gLastThrownBall = 0; EWRAM_DATA bool8 gSwapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky +EWRAM_DATA u8 gPartyCriticalHits[PARTY_SIZE] = {0}; +EWRAM_DATA static u8 sTriedEvolving = 0; void (*gPreBattleCallback1)(void); void (*gBattleMainFunc)(void); @@ -2999,6 +3002,7 @@ static void BattleStartClearSetData(void) gBattleStruct->usedHeldItems[i][0] = 0; gBattleStruct->usedHeldItems[i][1] = 0; gBattleStruct->itemStolen[i].originalItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); + gPartyCriticalHits[i] = 0; } gSwapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky @@ -5154,9 +5158,16 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void) gIsFishingEncounter = FALSE; gIsSurfingEncounter = FALSE; ResetSpriteData(); - if (gLeveledUpInBattle && (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT)) + if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK + | BATTLE_TYPE_RECORDED_LINK + | BATTLE_TYPE_FIRST_BATTLE + | BATTLE_TYPE_SAFARI + | BATTLE_TYPE_FRONTIER + | BATTLE_TYPE_EREADER_TRAINER + | BATTLE_TYPE_WALLY_TUTORIAL)) + && (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT)) { - gBattleMainFunc = TryEvolvePokemon; + gBattleMainFunc = TrySpecialEvolution; } else { @@ -5174,6 +5185,26 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void) } } +static void TrySpecialEvolution(void) // Attempts to perform non-level related battle evolutions (not the script command). +{ + s32 i; + + for (i = 0; i < PARTY_SIZE; i++) + { + u16 species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_BATTLE_SPECIAL, i, SPECIES_NONE); + if (species != SPECIES_NONE && !(sTriedEvolving & gBitTable[i])) + { + sTriedEvolving |= gBitTable[i]; + FreeAllWindowBuffers(); + gBattleMainFunc = WaitForEvoSceneToFinish; + EvolutionScene(&gPlayerParty[i], species, TRUE, i); + return; + } + } + sTriedEvolving = 0; + gBattleMainFunc = TryEvolvePokemon; +} + static void TryEvolvePokemon(void) { s32 i; @@ -5208,7 +5239,7 @@ static void TryEvolvePokemon(void) static void WaitForEvoSceneToFinish(void) { if (gMain.callback2 == BattleMainCB2) - gBattleMainFunc = TryEvolvePokemon; + gBattleMainFunc = TrySpecialEvolution; } static void ReturnFromBattleToOverworld(void) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d6edb0ab2..4ae67d1a2 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1914,6 +1914,7 @@ s8 GetInverseCritChance(u8 battlerAtk, u8 battlerDef, u32 move) static void Cmd_critcalc(void) { + u16 partySlot; s32 critChance = CalcCritChanceStage(gBattlerAttacker, gBattlerTarget, gCurrentMove, TRUE); gPotentialItemEffectBattler = gBattlerAttacker; @@ -1928,6 +1929,12 @@ static void Cmd_critcalc(void) else gIsCriticalHit = FALSE; + // Counter for EVO_CRITICAL_HITS. + partySlot = gBattlerPartyIndexes[gBattlerAttacker]; + if (gIsCriticalHit && GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER + && !(gBattleTypeFlags & BATTLE_TYPE_MULTI && GetBattlerPosition(gBattlerAttacker) == B_POSITION_PLAYER_LEFT)) + gPartyCriticalHits[partySlot]++; + gBattlescriptCurrInstr++; } diff --git a/src/pokemon.c b/src/pokemon.c index 71176d2eb..ff2dcbe51 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5394,6 +5394,19 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem) } } break; + // Battle evolution without leveling; party slot is being passed into the evolutionItem arg. + case EVO_MODE_BATTLE_SPECIAL: + for (i = 0; i < EVOS_PER_MON; i++) + { + switch (gEvolutionTable[species][i].method) + { + case EVO_CRITICAL_HITS: + if (gPartyCriticalHits[evolutionItem] >= gEvolutionTable[species][i].param) + targetSpecies = gEvolutionTable[species][i].targetSpecies; + break; + } + } + break; } return targetSpecies; From e343c73cd8cd3ad16bd045f9cf8b48b00f05f638 Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Thu, 5 May 2022 15:17:31 -0700 Subject: [PATCH 086/208] fixed compile error + small tweaks --- src/battle_main.c | 6 +++++- src/pokemon.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/battle_main.c b/src/battle_main.c index ca59ff86e..ee6166062 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5191,7 +5191,11 @@ static void TrySpecialEvolution(void) // Attempts to perform non-level related b for (i = 0; i < PARTY_SIZE; i++) { - u16 species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_BATTLE_SPECIAL, i, SPECIES_NONE); + #ifndef POKEMON_EXPANSION + u16 species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_BATTLE_SPECIAL, i); + #else + u16 species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_BATTLE_SPECIAL, i, SPECIES_NONE); + #endif if (species != SPECIES_NONE && !(sTriedEvolving & gBitTable[i])) { sTriedEvolving |= gBitTable[i]; diff --git a/src/pokemon.c b/src/pokemon.c index ff2dcbe51..fe2bcf9dd 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5394,6 +5394,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem) } } break; + #ifdef BATTLE_ENGINE // Battle evolution without leveling; party slot is being passed into the evolutionItem arg. case EVO_MODE_BATTLE_SPECIAL: for (i = 0; i < EVOS_PER_MON; i++) @@ -5407,6 +5408,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem) } } break; + #endif } return targetSpecies; From e730d64945b95aba49eaf924ef29c553abd2e433 Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Thu, 5 May 2022 15:54:33 -0700 Subject: [PATCH 087/208] corrections --- include/battle.h | 1 + src/pokemon.c | 15 --------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/include/battle.h b/include/battle.h index 4068454bf..fde4162c7 100644 --- a/include/battle.h +++ b/include/battle.h @@ -932,5 +932,6 @@ extern bool8 gHasFetchedBall; extern u8 gLastUsedBall; extern u16 gLastThrownBall; extern bool8 gSwapDamageCategory; // Photon Geyser, Shell Side Arm, Light That Burns the Sky +extern u8 gPartyCriticalHits[PARTY_SIZE]; #endif // GUARD_BATTLE_H diff --git a/src/pokemon.c b/src/pokemon.c index fe2bcf9dd..71176d2eb 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5394,21 +5394,6 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem) } } break; - #ifdef BATTLE_ENGINE - // Battle evolution without leveling; party slot is being passed into the evolutionItem arg. - case EVO_MODE_BATTLE_SPECIAL: - for (i = 0; i < EVOS_PER_MON; i++) - { - switch (gEvolutionTable[species][i].method) - { - case EVO_CRITICAL_HITS: - if (gPartyCriticalHits[evolutionItem] >= gEvolutionTable[species][i].param) - targetSpecies = gEvolutionTable[species][i].targetSpecies; - break; - } - } - break; - #endif } return targetSpecies; From 07b42d62ef9db2d01b45b2312c53d5351b4453cc Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Thu, 5 May 2022 20:46:45 -0700 Subject: [PATCH 088/208] fixed shed shell --- src/battle_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/battle_main.c b/src/battle_main.c index 479cafae6..3edbea48b 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4020,10 +4020,18 @@ static void HandleTurnActionSelectionState(void) { BtlController_EmitChoosePokemon(BUFFER_A, PARTY_ACTION_CANT_SWITCH, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]); } + #ifdef ITEM_EXPANSION + else if ((i = IsAbilityPreventingEscape(gActiveBattler) + && ItemId_GetHoldEffect(gBattleMons[gActiveBattler].item) != HOLD_EFFECT_SHED_SHELL)) + { + BtlController_EmitChoosePokemon(BUFFER_A, ((i - 1) << 4) | PARTY_ACTION_ABILITY_PREVENTS, PARTY_SIZE, gBattleMons[i - 1].ability, gBattleStruct->battlerPartyOrders[gActiveBattler]); + } + #else else if ((i = IsAbilityPreventingEscape(gActiveBattler))) { BtlController_EmitChoosePokemon(BUFFER_A, ((i - 1) << 4) | PARTY_ACTION_ABILITY_PREVENTS, PARTY_SIZE, gBattleMons[i - 1].ability, gBattleStruct->battlerPartyOrders[gActiveBattler]); } + #endif else { if (gActiveBattler == 2 && gChosenActionByBattler[0] == B_ACTION_SWITCH) From aff1d3949f23d253cd3a3692d2f49a5f8489784c Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Thu, 5 May 2022 21:58:16 -0700 Subject: [PATCH 089/208] fixed spotlight function --- src/battle_message.c | 2 +- src/battle_script_commands.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battle_message.c b/src/battle_message.c index 3e2d9abd9..8cf9a508b 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -220,7 +220,7 @@ static const u8 sText_PkmnForesawAttack[] = _("{B_ATK_NAME_WITH_PREFIX} foresaw\ static const u8 sText_PkmnTookAttack[] = _("{B_DEF_NAME_WITH_PREFIX} took the\n{B_BUFF1} attack!"); static const u8 sText_PkmnChoseXAsDestiny[] = _("{B_ATK_NAME_WITH_PREFIX} chose\n{B_CURRENT_MOVE} as its destiny!"); static const u8 sText_PkmnAttack[] = _("{B_BUFF1}'s attack!"); -static const u8 sText_PkmnCenterAttention[] = _("{B_ATK_NAME_WITH_PREFIX} became the\ncenter of attention!"); +static const u8 sText_PkmnCenterAttention[] = _("{B_DEF_NAME_WITH_PREFIX} became the\ncenter of attention!"); static const u8 sText_PkmnChargingPower[] = _("{B_ATK_NAME_WITH_PREFIX} began\ncharging power!"); static const u8 sText_NaturePowerTurnedInto[] = _("NATURE POWER turned into\n{B_CURRENT_MOVE}!"); static const u8 sText_PkmnStatusNormal[] = _("{B_ATK_NAME_WITH_PREFIX}'s status\nreturned to normal!"); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d6edb0ab2..227d2f573 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -12397,9 +12397,9 @@ static void Cmd_jumpifattackandspecialattackcannotfall(void) // memento static void Cmd_setforcedtarget(void) // follow me { - gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTimer = 1; - gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTarget = gBattlerAttacker; - gSideTimers[GetBattlerSide(gBattlerAttacker)].followmePowder = TestMoveFlags(gCurrentMove, FLAG_POWDER); + gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTimer = 1; + gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTarget = gBattlerTarget; + gSideTimers[GetBattlerSide(gBattlerTarget)].followmePowder = TestMoveFlags(gCurrentMove, FLAG_POWDER); gBattlescriptCurrInstr++; } From 74cc8c5ecb18962204f3ff1a42c8e9cc7f998b60 Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Thu, 5 May 2022 22:37:28 -0700 Subject: [PATCH 090/208] fixed bolt beak switch-in boost --- src/battle_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index c0a7f2150..55602cdc1 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8119,7 +8119,8 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; break; case EFFECT_BOLT_BEAK: - if (GetBattlerTurnOrderNum(battlerAtk) < GetBattlerTurnOrderNum(battlerDef)) + if (GetBattlerTurnOrderNum(battlerAtk) < GetBattlerTurnOrderNum(battlerDef) + || gDisableStructs[battlerDef].isFirstTurn == 2) basePower *= 2; break; case EFFECT_ROUND: From 382cd41d12c22ef7e4ea1dfddb0be5263f0b0ac0 Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Thu, 5 May 2022 22:49:46 -0700 Subject: [PATCH 091/208] realized hold effect is defined already --- src/battle_main.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/battle_main.c b/src/battle_main.c index 3edbea48b..4adca1987 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4020,18 +4020,11 @@ static void HandleTurnActionSelectionState(void) { BtlController_EmitChoosePokemon(BUFFER_A, PARTY_ACTION_CANT_SWITCH, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]); } - #ifdef ITEM_EXPANSION else if ((i = IsAbilityPreventingEscape(gActiveBattler) && ItemId_GetHoldEffect(gBattleMons[gActiveBattler].item) != HOLD_EFFECT_SHED_SHELL)) { BtlController_EmitChoosePokemon(BUFFER_A, ((i - 1) << 4) | PARTY_ACTION_ABILITY_PREVENTS, PARTY_SIZE, gBattleMons[i - 1].ability, gBattleStruct->battlerPartyOrders[gActiveBattler]); } - #else - else if ((i = IsAbilityPreventingEscape(gActiveBattler))) - { - BtlController_EmitChoosePokemon(BUFFER_A, ((i - 1) << 4) | PARTY_ACTION_ABILITY_PREVENTS, PARTY_SIZE, gBattleMons[i - 1].ability, gBattleStruct->battlerPartyOrders[gActiveBattler]); - } - #endif else { if (gActiveBattler == 2 && gChosenActionByBattler[0] == B_ACTION_SWITCH) From ef7cd3cdfecad531ec57230e6876db4cff68e7b6 Mon Sep 17 00:00:00 2001 From: sneed Date: Fri, 6 May 2022 11:15:24 +0300 Subject: [PATCH 092/208] BattleScript_DefiantActivates rename --- data/battle_scripts_1.s | 2 +- include/battle_scripts.h | 2 +- src/battle_util.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 6574e26ab..0dc88eb43 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7925,7 +7925,7 @@ BattleScript_DrizzleActivates:: call BattleScript_WeatherFormChanges end3 -BattleScript_DefiantActivates:: +BattleScript_AbilityRaisesDefenderStat:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp statbuffchange 0, NULL diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 740d27148..5fd70159b 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -308,7 +308,7 @@ extern const u8 BattleScript_MistySurgeActivates[]; extern const u8 BattleScript_ElectricSurgeActivates[]; extern const u8 BattleScript_SpectralThiefSteal[]; extern const u8 BattleScript_StatUpMsg[]; -extern const u8 BattleScript_DefiantActivates[]; +extern const u8 BattleScript_AbilityRaisesDefenderStat[]; extern const u8 BattleScript_PowderMoveNoEffect[]; extern const u8 BattleScript_GrassyTerrainHeals[]; extern const u8 BattleScript_VCreateStatLoss[]; diff --git a/src/battle_util.c b/src/battle_util.c index c18e4f113..a5542e225 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1575,7 +1575,7 @@ void PrepareStringBattle(u16 stringId, u8 battler) gBattleScripting.stickyWebStatDrop = 0; gBattlerAbility = gBattlerTarget; BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_DefiantActivates; + gBattlescriptCurrInstr = BattleScript_AbilityRaisesDefenderStat; if (targetAbility == ABILITY_DEFIANT) SET_STATCHANGER(STAT_ATK, 2, FALSE); else @@ -1587,7 +1587,7 @@ void PrepareStringBattle(u16 stringId, u8 battler) { gBattlerAbility = gBattlerTarget; BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_DefiantActivates; + gBattlescriptCurrInstr = BattleScript_AbilityRaisesDefenderStat; SET_STATCHANGER(STAT_SPEED, 1, FALSE); } #endif From 07579bd42bbf5087274af3504af9da3d92df558d Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sat, 7 May 2022 09:56:32 -0400 Subject: [PATCH 093/208] prevent ally pollen puff selection under heal block. add some ai checks for heal block --- include/battle_util.h | 1 + src/battle_ai_main.c | 8 ++++++++ src/battle_controller_opponent.c | 11 ++++++++--- src/battle_controller_player.c | 6 ++++-- src/battle_util.c | 9 +++++++++ 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/include/battle_util.h b/include/battle_util.h index d2d7ac29f..dee85ef7f 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -171,6 +171,7 @@ void TryToApplyMimicry(u8 battlerId, bool8 various); void TryToRevertMimicry(void); void RestoreBattlerOriginalTypes(u8 battlerId); u32 GetBattlerMoveTargetType(u8 battlerId, u16 move); +bool32 CanTargetBattler(u8 battlerAtk, u8 battlerDef, u16 move); // Ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability); bool32 IsRolePlayBannedAbility(u16 ability); diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 192b75d74..5c7d577c0 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -438,6 +438,9 @@ static u8 ChooseMoveOrAction_Doubles(void) { if (gBattleMons[sBattler_AI].moves[j] != 0) { + if (!CanTargetBattler(sBattler_AI, i, gBattleMons[sBattler_AI].moves[j])) + continue; + if (mostViableMovesScores[0] == AI_THINKING_STRUCT->score[j]) { mostViableMovesScores[mostViableMovesNo] = AI_THINKING_STRUCT->score[j]; @@ -2296,6 +2299,8 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_HIT_ENEMY_HEAL_ALLY: // pollen puff if (IsTargetingPartner(battlerAtk, battlerDef)) { + if (gStatuses3[battlerDef] & STATUS3_HEAL_BLOCK) + return 0; if (AtMaxHp(battlerDef)) score -= 10; else if (gBattleMons[battlerDef].hp > gBattleMons[battlerDef].maxHP / 2) @@ -4902,6 +4907,9 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || (moveType == TYPE_ELECTRIC && AI_DATA->atkPartnerAbility == ABILITY_VOLT_ABSORB) || (moveType == TYPE_WATER && (AI_DATA->atkPartnerAbility == ABILITY_DRY_SKIN || AI_DATA->atkPartnerAbility == ABILITY_WATER_ABSORB))) { + if (gStatuses3[battlerDef] & STATUS3_HEAL_BLOCK) + return 0; + if (CanTargetFaintAi(FOE(battlerAtk), AI_DATA->battlerAtkPartner) || (CanTargetFaintAi(BATTLE_PARTNER(FOE(battlerAtk)), AI_DATA->battlerAtkPartner))) score--; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 69e0de5af..35e774341 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1605,6 +1605,7 @@ static void OpponentHandleChooseMove(void) else // Wild pokemon - use random move { u16 move; + u8 target; do { chosenMoveId = Random() & 3; @@ -1615,6 +1616,10 @@ static void OpponentHandleChooseMove(void) BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gActiveBattler << 8)); else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { + do { + target = GetBattlerAtPosition(Random() & 2); + } while (!CanTargetBattler(gActiveBattler, target, move)); + #if B_WILD_NATURAL_ENEMIES == TRUE // Don't bother to loop through table if the move can't attack ally if (!(gBattleMoves[move].target & MOVE_TARGET_BOTH)) @@ -1641,14 +1646,14 @@ static void OpponentHandleChooseMove(void) break; } } - if (isPartnerEnemy) + if (isPartnerEnemy && CanTargetBattler(gActiveBattler, target, move)) BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(BATTLE_PARTNER(gActiveBattler)) << 8)); else - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8)); + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (target << 8)); } else #endif - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8)); + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (target << 8)); } else BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) << 8)); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index bd6b3a023..0e01eb549 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -436,7 +436,8 @@ static void HandleInputChooseTarget(void) break; } - if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor]) + if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor] + || !CanTargetBattler(gActiveBattler, gMultiUsePlayerCursor, move)) i = 0; } while (i == 0); } @@ -485,7 +486,8 @@ static void HandleInputChooseTarget(void) break; } - if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor]) + if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor] + || !CanTargetBattler(gActiveBattler, gMultiUsePlayerCursor, move)) i = 0; } while (i == 0); } diff --git a/src/battle_util.c b/src/battle_util.c index 68c675c54..d17c9ce99 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -10099,3 +10099,12 @@ u32 GetBattlerMoveTargetType(u8 battlerId, u16 move) else return gBattleMoves[move].target; } + +bool32 CanTargetBattler(u8 battlerAtk, u8 battlerDef, u16 move) +{ + if (gBattleMoves[move].effect == EFFECT_HIT_ENEMY_HEAL_ALLY + && GetBattlerSide(battlerAtk) == GetBattlerSide(battlerDef) + && gStatuses3[battlerDef] & STATUS3_HEAL_BLOCK) + return FALSE; + return TRUE; +} From 89816b62bad6fd4ba2f7626f11f3abc826be74f8 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 7 May 2022 10:38:16 -0400 Subject: [PATCH 094/208] Added Sheer Cold accuracy change to ShouldTryOHKO --- src/battle_ai_util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index de4271bba..8ed6e0490 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1499,6 +1499,10 @@ bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbilit else // test the odds { u16 odds = accuracy + (gBattleMons[battlerAtk].level - gBattleMons[battlerDef].level); + #if B_SHEER_COLD_ACC >= GEN_7 + if (gCurrentMove == MOVE_SHEER_COLD && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE)) + odds -= 10; + #endif if (Random() % 100 + 1 < odds && gBattleMons[battlerAtk].level >= gBattleMons[battlerDef].level) return TRUE; } From 096fe3c11d5e4d830d89b6d6892b0ae477d3b01b Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 7 May 2022 10:56:31 -0400 Subject: [PATCH 095/208] Removed unecessary B_LEEK_ALWAYS_CRIT config --- include/constants/battle_config.h | 3 +-- src/battle_script_commands.c | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 047d7c1a6..fa181fb65 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -99,7 +99,7 @@ #endif // Calculation settings -#define B_CRIT_CHANCE GEN_7 // Chances of a critical hit landing. See CalcCritChanceStage. +#define B_CRIT_CHANCE GEN_7 // Chances of a critical hit landing. See CalcCritChanceStage. Gen6+ chances guarantee that Farfetch'd and Sirfetch'd always get critical hits while holding a Leek and using high-crit ratio moves. #define B_CRIT_MULTIPLIER GEN_7 // In Gen6+, critical hits multiply damage by 1.5 instead of 2. #define B_PARALYSIS_SPEED GEN_7 // In Gen7+, Speed is decreased by 50% instead of 75%. #define B_CONFUSION_SELF_DMG_CHANCE GEN_7 // In Gen7+, confusion has a 33.3% of self-damage, instead of 50%. @@ -209,7 +209,6 @@ #define B_HEAVY_BALL_MODIFIER GEN_7 // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow. #define B_DREAM_BALL_MODIFIER GEN_8 // In Gen8, Dream Ball's catch multiplier is x4 when the target is asleep or has the ability Comatose. #define B_SERENE_GRACE_BOOST GEN_7 // In Gen5+, Serene Grace boosts the added flinch chance of King's Rock and Razor Fang. -#define B_LEEK_ALWAYS_CRIT GEN_7 // In Gen6+, if a Farfetch'd or Sirfetch'd holding a Leek use a move with increased Critical Hit ratio, it will always result in a Critical Hit. // Flag settings // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 1d9009e6e..d0431c25e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1878,11 +1878,7 @@ s32 CalcCritChanceStage(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbi else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS || gBattleMoves[move].effect == EFFECT_ALWAYS_CRIT || (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY) - || move == MOVE_SURGING_STRIKES - #if B_LEEK_ALWAYS_CRIT >= GEN_6 - || ((gBattleMoves[gCurrentMove].flags & FLAG_HIGH_CRIT) && BENEFITS_FROM_LEEK(battlerAtk, holdEffectAtk)) - #endif - ) + || move == MOVE_SURGING_STRIKES) { critChance = -2; } From 5456a87b83a7a86655c7a757a8bd6f1a8535da75 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sat, 7 May 2022 11:27:32 -0400 Subject: [PATCH 096/208] fix pollen puff heal blocked battler in CanTargetBattler --- src/battle_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index d17c9ce99..f1a5bd883 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -10104,7 +10104,7 @@ bool32 CanTargetBattler(u8 battlerAtk, u8 battlerDef, u16 move) { if (gBattleMoves[move].effect == EFFECT_HIT_ENEMY_HEAL_ALLY && GetBattlerSide(battlerAtk) == GetBattlerSide(battlerDef) - && gStatuses3[battlerDef] & STATUS3_HEAL_BLOCK) - return FALSE; + && gStatuses3[battlerAtk] & STATUS3_HEAL_BLOCK) + return FALSE; // Pokémon affected by Heal Block cannot target allies with Pollen Puff return TRUE; } From 017f44f5ac2ec86cc5d9182bfa6cedd02d8da489 Mon Sep 17 00:00:00 2001 From: AgustinGDLV <103095241+AgustinGDLV@users.noreply.github.com> Date: Sat, 7 May 2022 09:35:00 -0700 Subject: [PATCH 097/208] Apply suggestions from code review Co-authored-by: Eduardo Quezada D'Ottone --- include/constants/pokemon.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index a7f0e3e4e..b1aea3334 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -380,15 +380,20 @@ #define EVO_LEVEL_NATURE_AMPED 33 // Pokémon reaches the specified level, it has a Hardy, Brave, Adamant, Naughty, Docile, Impish, Lax, Hasty, Jolly, Naive, Rash, Sassy, or Quirky nature. #define EVO_LEVEL_NATURE_LOW_KEY 34 // Pokémon reaches the specified level, it has a Lonely, Bold, Relaxed, Timid, Serious, Modest, Mild, Quiet, Bashful, Calm, Gentle, or Careful nature. #define EVO_CRITICAL_HITS 35 // Pokémon performs specified number of critical hits in one battle +#define EVO_SCRIPT_TRIGGER_DMG 36 // Pokémon has specified HP below max, then player interacts trigger +#define EVO_DARK_SCROLL 37 // interacts with Scroll of Darkness +#define EVO_WATER_SCROLL 38 // interacts with Scroll of Waters #define EVOS_PER_MON 10 // Evolution 'modes,' for GetEvolutionTargetSpecies #define EVO_MODE_NORMAL 0 -#define EVO_MODE_TRADE 1 -#define EVO_MODE_ITEM_USE 2 -#define EVO_MODE_ITEM_CHECK 3 // If an Everstone is being held, still want to show that the stone *could* be used on that Pokémon to evolve -#define EVO_MODE_BATTLE_SPECIAL 4 +#define EVO_MODE_NORMAL 0 +#define EVO_MODE_TRADE 1 +#define EVO_MODE_ITEM_USE 2 +#define EVO_MODE_ITEM_CHECK 3 // If an Everstone is being held, still want to show that the stone *could* be used on that Pokémon to evolve +#define EVO_MODE_BATTLE_SPECIAL 4 +#define EVO_MODE_OVERWORLD_SPECIAL 5 #define NUM_MALE_LINK_FACILITY_CLASSES 8 #define NUM_FEMALE_LINK_FACILITY_CLASSES 8 From 4c8770fdc2a308ae2ac4155c931eb8c0559d732e Mon Sep 17 00:00:00 2001 From: sneed Date: Sat, 7 May 2022 21:57:50 +0300 Subject: [PATCH 098/208] Update battle_util.c --- src/battle_util.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 30df20f4f..114235f73 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6098,12 +6098,18 @@ bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId) return FALSE; } +#if defined(ITEM_EXPANSION) && B_CONFUSE_BERRIES_HEAL >= GEN_7 + #define CONFUSE_BERRY_HP_FRACTION 4 +#else + #define CONFUSE_BERRY_HP_FRACTION 2 +#endif + static u8 HealConfuseBerry(u32 battlerId, u32 itemId, u8 flavorId, bool32 end2) { #if B_HEAL_BLOCKING >= GEN_5 - if (HasEnoughHpToEatBerry(battlerId, 2, itemId) && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) + if (HasEnoughHpToEatBerry(battlerId, CONFUSE_BERRY_HP_FRACTION, itemId) && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) #else - if (HasEnoughHpToEatBerry(battlerId, 2, itemId)) + if (HasEnoughHpToEatBerry(battlerId, CONFUSE_BERRY_HP_FRACTION, itemId)) #endif { PREPARE_FLAVOR_BUFFER(gBattleTextBuff1, flavorId); @@ -6140,6 +6146,8 @@ static u8 HealConfuseBerry(u32 battlerId, u32 itemId, u8 flavorId, bool32 end2) return 0; } +#undef CONFUSE_BERRY_HP_FRACTION + static u8 StatRaiseBerry(u32 battlerId, u32 itemId, u32 statId, bool32 end2) { if (CompareStat(battlerId, statId, MAX_STAT_STAGE, CMP_LESS_THAN) && HasEnoughHpToEatBerry(battlerId, GetBattlerHoldEffectParam(battlerId), itemId)) From c6b529ed50ec42f0d3e9f1e7eecef84bcb80b46f Mon Sep 17 00:00:00 2001 From: sneed Date: Sat, 7 May 2022 22:09:08 +0300 Subject: [PATCH 099/208] add missing constant --- include/constants/battle_config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index fa181fb65..86d6582ba 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -194,6 +194,7 @@ // Item settings #define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. #define B_BERRIES_INSTANT GEN_7 // In Gen4+, most berries activate on battle start/switch-in if applicable. In Gen3, they only activate either at the move end or turn end. +#define B_CONFUSE_BERRIES_HEAL GEN_8 // Before Gen7, Figy and similar berries restore 1/8th of HP and trigger at half HP. In Gen7 they restore half HP, triggering at 25% HP. In Gen8 they heal 1/3rd of HP. #define B_X_ITEMS_BUFF GEN_7 // In Gen7+, the X Items raise a stat by 2 stages instead of 1. #define B_MENTAL_HERB GEN_5 // In Gen5+, the Mental Herb cures Infatuation, Taunt, Encore, Torment, Heal Block, and Disable #define B_TRAINERS_KNOCK_OFF_ITEMS TRUE // If TRUE, trainers can steal/swap your items (non-berries are restored after battle). In vanilla games trainers cannot steal items. From f83875cf0f06c28507f58b07477c67f6b327e786 Mon Sep 17 00:00:00 2001 From: sneed Date: Sat, 7 May 2022 23:34:38 +0300 Subject: [PATCH 100/208] remove item expansion check --- include/constants/battle_config.h | 1 + src/battle_util.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 86d6582ba..baecae018 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -195,6 +195,7 @@ #define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. #define B_BERRIES_INSTANT GEN_7 // In Gen4+, most berries activate on battle start/switch-in if applicable. In Gen3, they only activate either at the move end or turn end. #define B_CONFUSE_BERRIES_HEAL GEN_8 // Before Gen7, Figy and similar berries restore 1/8th of HP and trigger at half HP. In Gen7 they restore half HP, triggering at 25% HP. In Gen8 they heal 1/3rd of HP. + // Requires using Item Expansion or manually editing the holdEffectParam of Figy, Wiki, Mago, Aguav and Iapapa berries. #define B_X_ITEMS_BUFF GEN_7 // In Gen7+, the X Items raise a stat by 2 stages instead of 1. #define B_MENTAL_HERB GEN_5 // In Gen5+, the Mental Herb cures Infatuation, Taunt, Encore, Torment, Heal Block, and Disable #define B_TRAINERS_KNOCK_OFF_ITEMS TRUE // If TRUE, trainers can steal/swap your items (non-berries are restored after battle). In vanilla games trainers cannot steal items. diff --git a/src/battle_util.c b/src/battle_util.c index 114235f73..9681afbe2 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6098,7 +6098,7 @@ bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId) return FALSE; } -#if defined(ITEM_EXPANSION) && B_CONFUSE_BERRIES_HEAL >= GEN_7 +#if B_CONFUSE_BERRIES_HEAL >= GEN_7 #define CONFUSE_BERRY_HP_FRACTION 4 #else #define CONFUSE_BERRY_HP_FRACTION 2 From 07b0ce973766c16d9109ce4326c480e2f2b55e0a Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 8 May 2022 17:57:30 -0400 Subject: [PATCH 101/208] add inner focus ability popup msg --- data/battle_scripts_1.s | 7 +++++++ include/battle_scripts.h | 1 + src/battle_script_commands.c | 12 +++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 89d2292cc..354dde4f0 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8498,6 +8498,13 @@ BattleScript_ObliviousPreventsAttraction:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd +BattleScript_FlinchPrevention:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNSXPREVENTSFLINCHING + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + BattleScript_OwnTempoPrevents:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 5fd70159b..4134a87dc 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -169,6 +169,7 @@ extern const u8 BattleScript_BRNPrevention[]; extern const u8 BattleScript_PRLZPrevention[]; extern const u8 BattleScript_PSNPrevention[]; extern const u8 BattleScript_ObliviousPreventsAttraction[]; +extern const u8 BattleScript_FlinchPrevention[]; extern const u8 BattleScript_OwnTempoPrevents[]; extern const u8 BattleScript_SoundproofProtected[]; extern const u8 BattleScript_AbilityNoSpecificStatLoss[]; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ef8c5a764..f64b57d66 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2941,7 +2941,17 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_FLINCH: if (battlerAbility == ABILITY_INNER_FOCUS) { - gBattlescriptCurrInstr++; + if (primary == TRUE || certain == MOVE_EFFECT_CERTAIN) + { + gLastUsedAbility = ABILITY_INNER_FOCUS; + gBattlerAbility = gEffectBattler; + RecordAbilityBattle(gEffectBattler, ABILITY_INNER_FOCUS); + gBattlescriptCurrInstr = BattleScript_FlinchPrevention; + } + else + { + gBattlescriptCurrInstr++; + } } else { From 277f4a37511495a567b2f671e9b0ac64eb69db70 Mon Sep 17 00:00:00 2001 From: AgustinGDLV <103095241+AgustinGDLV@users.noreply.github.com> Date: Sun, 8 May 2022 21:23:06 -0700 Subject: [PATCH 102/208] niceties Co-authored-by: Eduardo Quezada D'Ottone --- src/battle_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_main.c b/src/battle_main.c index ee6166062..fbe132eae 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5194,7 +5194,7 @@ static void TrySpecialEvolution(void) // Attempts to perform non-level related b #ifndef POKEMON_EXPANSION u16 species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_BATTLE_SPECIAL, i); #else - u16 species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_BATTLE_SPECIAL, i, SPECIES_NONE); + u16 species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_BATTLE_SPECIAL, i, NULL); #endif if (species != SPECIES_NONE && !(sTriedEvolving & gBitTable[i])) { From 9bb5db2275e42ace6bb34b384659e4f8136505c5 Mon Sep 17 00:00:00 2001 From: AgustinGDLV Date: Sun, 8 May 2022 21:23:51 -0700 Subject: [PATCH 103/208] removed duplicate define --- include/constants/pokemon.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index b1aea3334..13db5644e 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -387,7 +387,6 @@ #define EVOS_PER_MON 10 // Evolution 'modes,' for GetEvolutionTargetSpecies -#define EVO_MODE_NORMAL 0 #define EVO_MODE_NORMAL 0 #define EVO_MODE_TRADE 1 #define EVO_MODE_ITEM_USE 2 From 709f583390f2889eba2f3ccd0df3a820c6b7fbeb Mon Sep 17 00:00:00 2001 From: sneed Date: Tue, 10 May 2022 02:58:24 +0300 Subject: [PATCH 104/208] Initial commit --- include/constants/battle_config.h | 1 + src/battle_main.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index baecae018..d968dbd2f 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -252,6 +252,7 @@ // Other settings #define B_DOUBLE_WILD_CHANCE 0 // % chance of encountering two Pokémon in a Wild Encounter. #define B_MULTI_BATTLE_WHITEOUT GEN_8 // In Gen4+, multi battles end when the Player and also their Partner don't have any more Pokémon to fight. +#define B_EVOLUTION_AFTER_WHITEOUT TRUE // If set to TRUE, Pokemon that qualify for evolution after battle will evolve even if the player loses. #define B_WILD_NATURAL_ENEMIES TRUE // If set to TRUE, certain wild mon species will attack other species when partnered in double wild battles (eg. Zangoose vs Seviper) // Animation Settings diff --git a/src/battle_main.c b/src/battle_main.c index c376b227e..b2b205cbe 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5174,7 +5174,11 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void) | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_WALLY_TUTORIAL)) +#if !B_EVOLUTION_AFTER_WHITEOUT && (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT)) +#else + ) +#endif { gBattleMainFunc = TrySpecialEvolution; } From bceccf54747f36aaba7a81637285af553e79943a Mon Sep 17 00:00:00 2001 From: sneed Date: Tue, 10 May 2022 08:17:31 +0300 Subject: [PATCH 105/208] changes --- include/constants/battle_config.h | 2 +- src/battle_main.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index d968dbd2f..74ac9e129 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -252,7 +252,7 @@ // Other settings #define B_DOUBLE_WILD_CHANCE 0 // % chance of encountering two Pokémon in a Wild Encounter. #define B_MULTI_BATTLE_WHITEOUT GEN_8 // In Gen4+, multi battles end when the Player and also their Partner don't have any more Pokémon to fight. -#define B_EVOLUTION_AFTER_WHITEOUT TRUE // If set to TRUE, Pokemon that qualify for evolution after battle will evolve even if the player loses. +#define B_EVOLUTION_AFTER_WHITEOUT GEN_6 // In Gen6+, Pokemon that qualify for evolution after battle will evolve even if the player loses. #define B_WILD_NATURAL_ENEMIES TRUE // If set to TRUE, certain wild mon species will attack other species when partnered in double wild battles (eg. Zangoose vs Seviper) // Animation Settings diff --git a/src/battle_main.c b/src/battle_main.c index b2b205cbe..bf2853a7b 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5174,11 +5174,7 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void) | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_WALLY_TUTORIAL)) -#if !B_EVOLUTION_AFTER_WHITEOUT - && (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT)) -#else - ) -#endif + && (B_EVOLUTION_AFTER_WHITEOUT >= GEN_6 || gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT)) { gBattleMainFunc = TrySpecialEvolution; } From 1c13335d16f610d2c3881effb7eddf3fefd5d894 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Thu, 12 May 2022 22:05:44 -0400 Subject: [PATCH 106/208] Update INSTALL.md --- INSTALL.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 72f3c92f3..42d8a75ec 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -451,14 +451,6 @@ Replace `` with the number that the `nproc` command returned. `nproc` is not available on macOS. The alternative is `sysctl -n hw.ncpu` ([relevant Stack Overflow thread](https://stackoverflow.com/questions/1715580)). -## Debug info - -To build **pokeemerald.elf** with enhanced debug info: -```bash -make DINFO=1 -``` -Note that this is only necessary for the `modern` target; the regular target has debug info enabled by default. - ## devkitARM's C compiler This project supports the `arm-none-eabi-gcc` compiler included with devkitARM. If devkitARM (a.k.a. gba-dev) has already been installed as part of the platform-specific instructions, simply run: @@ -535,7 +527,7 @@ devkitARM is now installed. devkitARM is now installed. -## Installing devkitARM on Arch Linux +### Installing devkitARM on Arch Linux 1. Follow [devkitPro's instructions](https://devkitpro.org/wiki/devkitPro_pacman#Customising_Existing_Pacman_Install) to configure `pacman` to download devkitPro packages. 2. Install `gba-dev`: run the following command as root. @@ -553,7 +545,7 @@ devkitARM is now installed. devkitARM is now installed. -## Other toolchains +### Other toolchains To build using a toolchain other than devkitARM, override the `TOOLCHAIN` environment variable with the path to your toolchain, which must contain the subdirectory `bin`. ```bash @@ -565,6 +557,14 @@ make TOOLCHAIN="/usr/local/arm-none-eabi" ``` To compile the `modern` target with this toolchain, the subdirectories `lib`, `include`, and `arm-none-eabi` must also be present. +### Building with debug info under a modern toolchain + +To build **pokeemerald.elf** with debug symbols under a modern toolchain: +```bash +make DINFO=1 +``` +Note that this is not necessary for a non-modern build since those are built with debug symbols by default. + # Useful additional tools * [porymap](https://github.com/huderlem/porymap) for viewing and editing maps From 7d224197c05fb319c03d2bcbed3ed36d6f246fd8 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Thu, 12 May 2022 22:33:17 -0400 Subject: [PATCH 107/208] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 42d8a75ec..7f1d47879 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -561,7 +561,7 @@ To compile the `modern` target with this toolchain, the subdirectories `lib`, `i To build **pokeemerald.elf** with debug symbols under a modern toolchain: ```bash -make DINFO=1 +make modern DINFO=1 ``` Note that this is not necessary for a non-modern build since those are built with debug symbols by default. From 577791a6bc203e0ce5c8e564b88d9c7a5040f4cc Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 13 May 2022 10:52:09 -0300 Subject: [PATCH 108/208] Moved order of defined header files in include/global.h --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/global.h b/include/global.h index ddd77ac9b..e1d19cdec 100644 --- a/include/global.h +++ b/include/global.h @@ -14,8 +14,8 @@ #include "constants/maps.h" #include "constants/pokemon.h" #include "constants/easy_chat.h" -#include "constants/expansion_branches.h" #include "constants/trainer_hill.h" +#include "constants/expansion_branches.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); From b5d98ec93eb1582bc4627de4b65458c9e67b6477 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 13 May 2022 20:05:52 -0400 Subject: [PATCH 109/208] prevent overwriting wild mon held items --- src/pokemon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pokemon.c b/src/pokemon.c index 71176d2eb..65aad6196 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -6459,6 +6459,9 @@ void SetWildMonHeldItem(void) for (i = 0; i < count; i++) { + if (GetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM) != ITEM_NONE) + continue; // prevent ovewriting previously set item + rnd = Random() % 100; species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES, 0); if (gMapHeader.mapLayoutId == LAYOUT_ALTERING_CAVE) From 7dd6988b2b525e3a2ed7f2191725889f3b777012 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 13 May 2022 20:32:03 -0400 Subject: [PATCH 110/208] fix args to GetMonData --- src/pokemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pokemon.c b/src/pokemon.c index 65aad6196..26f12dca2 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -6459,7 +6459,7 @@ void SetWildMonHeldItem(void) for (i = 0; i < count; i++) { - if (GetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM) != ITEM_NONE) + if (GetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, NULL) != ITEM_NONE) continue; // prevent ovewriting previously set item rnd = Random() % 100; From 6d6dac3adde8cd3e47d062aa2698239d97e44679 Mon Sep 17 00:00:00 2001 From: cbt6 <91667135+cbt6@users.noreply.github.com> Date: Sun, 15 May 2022 21:44:04 +0800 Subject: [PATCH 111/208] Use ARRAY_COUNT in sStepTimes for step functions --- src/event_object_movement.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index eb699e89f..091293551 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -8251,11 +8251,11 @@ static const SpriteStepFunc *const sNpcStepFuncTables[] = { }; static const s16 sStepTimes[] = { - [MOVE_SPEED_NORMAL] = 16, - [MOVE_SPEED_FAST_1] = 8, - [MOVE_SPEED_FAST_2] = 6, - [MOVE_SPEED_FASTER] = 4, - [MOVE_SPEED_FASTEST] = 2, + [MOVE_SPEED_NORMAL] = ARRAY_COUNT(sStep1Funcs), + [MOVE_SPEED_FAST_1] = ARRAY_COUNT(sStep2Funcs), + [MOVE_SPEED_FAST_2] = ARRAY_COUNT(sStep3Funcs), + [MOVE_SPEED_FASTER] = ARRAY_COUNT(sStep4Funcs), + [MOVE_SPEED_FASTEST] = ARRAY_COUNT(sStep8Funcs), }; static bool8 NpcTakeStep(struct Sprite *sprite) From 71ea78cc32ed2f6178434c516118118e282f9e65 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 16 May 2022 14:55:20 -0400 Subject: [PATCH 112/208] Document Task_UpdateContestResultBar --- src/contest_util.c | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/src/contest_util.c b/src/contest_util.c index 1ca217526..d8726d860 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -77,7 +77,10 @@ enum { #define TAG_CONFETTI 3017 #define TAG_WIRELESS_INDICATOR_WINDOW 22222 -#define MAX_BAR_LENGTH 87 +// Length of the score bar on the results screen +#define NUM_BAR_SEGMENTS 11 +#define BAR_SEGMENT_LENGTH 8 // Each segment of the results bar is a single tile, so 8 pixels long +#define MAX_BAR_LENGTH (NUM_BAR_SEGMENTS * BAR_SEGMENT_LENGTH) // Starting x/y for the sliding results screen text box #define TEXT_BOX_X (DISPLAY_WIDTH + 32) @@ -96,7 +99,7 @@ struct ContestResultsInternal u8 winnerMonSpriteId; bool8 destroyConfetti; bool8 pointsFlashing; - s16 unkC[CONTESTANT_COUNT]; + s16 barLength[CONTESTANT_COUNT]; u8 numBarsUpdating; }; @@ -1748,7 +1751,7 @@ static void CalculateContestantsResultData(void) if ((*sContestResults->monResults)[i].lostPoints) barLengthRound2 *= -1; - if (barLengthPreliminary + barLengthRound2 == MAX_BAR_LENGTH + 1) + if (barLengthPreliminary + barLengthRound2 == MAX_BAR_LENGTH) { if (barLengthRound2 > 0) (*sContestResults->monResults)[i].barLengthRound2--; @@ -1841,47 +1844,52 @@ static void Task_UpdateContestResultBar(u8 taskId) s16 target = gTasks[taskId].tTarget; s16 decreasing = gTasks[taskId].tDecreasing; + // Has the results bar reached the limit? if (decreasing) { - if (sContestResults->data->unkC[monId] <= 0) + if (sContestResults->data->barLength[monId] <= 0) minMaxReached = TRUE; } else { - if (sContestResults->data->unkC[monId] > MAX_BAR_LENGTH) + if (sContestResults->data->barLength[monId] >= MAX_BAR_LENGTH) minMaxReached = TRUE; } - if (sContestResults->data->unkC[monId] == target) + if (sContestResults->data->barLength[monId] == target) targetReached = TRUE; if (!targetReached) { + // Target length has not been reached, update bar length if (minMaxReached) - sContestResults->data->unkC[monId] = target; + sContestResults->data->barLength[monId] = target; else if (decreasing) - sContestResults->data->unkC[monId] = sContestResults->data->unkC[monId] - 1; + sContestResults->data->barLength[monId]--; else - sContestResults->data->unkC[monId] = sContestResults->data->unkC[monId] + 1; + sContestResults->data->barLength[monId]++; } + // Update the tiles of the results bar if it's still changing if (!minMaxReached && !targetReached) { - u8 var0; + u8 tileOffset; u16 tileNum; - for (i = 0; i < 11; i++) + for (i = 0; i < NUM_BAR_SEGMENTS; i++) { - if (sContestResults->data->unkC[monId] >= (i + 1) * 8) - var0 = 8; - else if (sContestResults->data->unkC[monId] >= i * 8) - var0 = sContestResults->data->unkC[monId] % 8; + if (sContestResults->data->barLength[monId] >= (i + 1) * BAR_SEGMENT_LENGTH) + tileOffset = 8; // Bar segment is full + else if (sContestResults->data->barLength[monId] >= i * BAR_SEGMENT_LENGTH) + tileOffset = sContestResults->data->barLength[monId] % 8; // Bar segment is between full and empty else - var0 = 0; + tileOffset = 0; // Bar segment is empty - if (var0 < 4) - tileNum = 0x504C + var0; + // The first 4 bar segment tiles are not adjacent in the tileset to the + // remaining bar segment tiles; choose the base tile number accordingly. + if (tileOffset < 4) + tileNum = 0x504C + tileOffset; else - tileNum = 0x5057 + var0; + tileNum = 0x5057 + tileOffset; FillBgTilemapBufferRect_Palette0(2, tileNum, i + 7, monId * 3 + 6, 1, 1); } From 593e2c9be0329241c3c110059333f41a865409bb Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 17 May 2022 13:51:54 -0400 Subject: [PATCH 113/208] Fix inconsistent static s/g names --- data/scripts/gift_altering_cave.inc | 2 +- data/text/pokedex_rating.inc | 2 +- include/constants/battle.h | 2 +- include/constants/flags.h | 2 +- include/contest.h | 1 - src/agb_flash_1m.c | 2 +- src/battle_anim_dragon.c | 4 +- src/battle_anim_status_effects.c | 4 +- src/battle_bg.c | 8 +- src/battle_tower.c | 4 +- src/coins.c | 2 +- src/contest.c | 26 +- src/data/field_effects/field_effect_objects.h | 2 +- src/data/trade.h | 6 +- src/data/trainer_graphics/back_pic_anims.h | 30 +- src/dodrio_berry_picking.c | 2 +- src/event_data.c | 6 +- src/field_effect.c | 46 +- src/field_screen_effect.c | 2 +- src/field_special_scene.c | 8 +- src/field_weather.c | 2 +- src/field_weather_effect.c | 30 +- src/fieldmap.c | 42 +- src/item_menu_icons.c | 16 +- src/landmark.c | 16 +- src/m4a_1.s | 8 +- src/main.c | 6 +- src/main_menu.c | 16 +- src/map_name_popup.c | 38 +- src/overworld.c | 14 +- src/palette.c | 6 +- src/pokedex.c | 4 +- src/pokemon_storage_system.c | 4 +- src/pokenav_main_menu.c | 10 +- src/pokenav_match_call_data.c | 2 +- src/pokenav_region_map.c | 2 +- src/region_map.c | 596 +++++++++--------- src/rotating_gate.c | 70 +- src/script_movement.c | 9 +- src/tileset_anims.c | 6 +- src/trade.c | 2 +- src/tv.c | 2 +- 42 files changed, 528 insertions(+), 534 deletions(-) diff --git a/data/scripts/gift_altering_cave.inc b/data/scripts/gift_altering_cave.inc index 65ff87068..0ea69aac0 100644 --- a/data/scripts/gift_altering_cave.inc +++ b/data/scripts/gift_altering_cave.inc @@ -12,7 +12,7 @@ MysteryGiftScript_AlteringCave_: release end -sText_MysteryGiftAlteringCave:: +sText_MysteryGiftAlteringCave: .string "Thank you for using the MYSTERY\n" .string "GIFT System.\p" .string "There appears to be a rumor about\n" diff --git a/data/text/pokedex_rating.inc b/data/text/pokedex_rating.inc index fcb26bc7d..175aaccc6 100644 --- a/data/text/pokedex_rating.inc +++ b/data/text/pokedex_rating.inc @@ -3,7 +3,7 @@ gBirchDexRatingText_AreYouCurious:: .string "Are you curious about how your\n" .string "POKéDEX is coming along?$" -gBirchDexRatingText_Cancel: +gBirchDexRatingText_Cancel:: .string "Hm? Oh, you haven't caught enough\n" .string "POKéMON to make it worthwhile.$" diff --git a/include/constants/battle.h b/include/constants/battle.h index d87a800e2..31bc7fa3f 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -319,7 +319,7 @@ #define B_WIN_TYPE_NORMAL 0 #define B_WIN_TYPE_ARENA 1 -// Window Ids for gStandardBattleWindowTemplates / gBattleArenaWindowTemplates +// Window Ids for sStandardBattleWindowTemplates / sBattleArenaWindowTemplates #define B_WIN_MSG 0 #define B_WIN_ACTION_PROMPT 1 // "What will {x} do?" #define B_WIN_ACTION_MENU 2 // "Fight/Pokémon/Bag/Run" menu diff --git a/include/constants/flags.h b/include/constants/flags.h index eacb2426d..8fbc24630 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1634,7 +1634,7 @@ #define FLAGS_COUNT (DAILY_FLAGS_END + 1) -// Special Flags (Stored in EWRAM (gSpecialFlags), not in the SaveBlock) +// Special Flags (Stored in EWRAM (sSpecialFlags), not in the SaveBlock) #define SPECIAL_FLAGS_START 0x4000 #define FLAG_HIDE_MAP_NAME_POPUP (SPECIAL_FLAGS_START + 0x0) #define FLAG_DONT_TRANSITION_MUSIC (SPECIAL_FLAGS_START + 0x1) diff --git a/include/contest.h b/include/contest.h index e7acb5a11..1168ebfe7 100644 --- a/include/contest.h +++ b/include/contest.h @@ -324,7 +324,6 @@ extern u16 gSpecialVar_ContestRank; extern u8 gNumLinkContestPlayers; extern u8 gHighestRibbonRank; extern struct ContestResources *gContestResources; -extern u8 sContestBgCopyFlags; extern struct ContestWinner gCurContestWinner; extern u8 gCurContestWinnerIsForArtist; extern u8 gCurContestWinnerSaveIdx; diff --git a/src/agb_flash_1m.c b/src/agb_flash_1m.c index e249fab9a..6fc4f3d60 100644 --- a/src/agb_flash_1m.c +++ b/src/agb_flash_1m.c @@ -3,7 +3,7 @@ static const char AgbLibFlashVersion[] = "FLASH1M_V103"; -const struct FlashSetupInfo * const sSetupInfos[] = +static const struct FlashSetupInfo * const sSetupInfos[] = { &MX29L010, &LE26FV10N1TS, diff --git a/src/battle_anim_dragon.c b/src/battle_anim_dragon.c index 029a5c30d..4badd5362 100644 --- a/src/battle_anim_dragon.c +++ b/src/battle_anim_dragon.c @@ -15,7 +15,7 @@ static void AnimOverheatFlame_Step(struct Sprite *); static void AnimTask_DragonDanceWaver_Step(u8); static void UpdateDragonDanceScanlineEffect(struct Task *); -EWRAM_DATA static u16 gUnusedOverheatData[7] = {0}; +EWRAM_DATA static u16 sUnusedOverheatData[7] = {0}; static const union AnimCmd sAnim_OutrageOverheatFire_0[] = { @@ -426,7 +426,7 @@ static void AnimOverheatFlame(struct Sprite *sprite) sprite->data[3] = gBattleAnimArgs[3]; sprite->callback = AnimOverheatFlame_Step; for (i = 0; i < 7; i++) - gUnusedOverheatData[i] = sprite->data[i]; + sUnusedOverheatData[i] = sprite->data[i]; } static void AnimOverheatFlame_Step(struct Sprite *sprite) diff --git a/src/battle_anim_status_effects.c b/src/battle_anim_status_effects.c index 9be3d65dc..47ba00c90 100644 --- a/src/battle_anim_status_effects.c +++ b/src/battle_anim_status_effects.c @@ -248,7 +248,7 @@ static const struct SubspriteTable sFrozenIceCubeSubspriteTable[] = {ARRAY_COUNT(sFrozenIceCubeSubsprites), sFrozenIceCubeSubsprites}, }; -static const struct SpriteTemplate gFrozenIceCubeSpriteTemplate = +static const struct SpriteTemplate sFrozenIceCubeSpriteTemplate = { .tileTag = ANIM_TAG_ICE_CUBE, .paletteTag = ANIM_TAG_ICE_CUBE, @@ -389,7 +389,7 @@ void AnimTask_FrozenIceCube(u8 taskId) x -= 6; SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); - spriteId = CreateSprite(&gFrozenIceCubeSpriteTemplate, x, y, 4); + spriteId = CreateSprite(&sFrozenIceCubeSpriteTemplate, x, y, 4); if (GetSpriteTileStartByTag(ANIM_TAG_ICE_CUBE) == 0xFFFF) gSprites[spriteId].invisible = TRUE; SetSubspriteTables(&gSprites[spriteId], sFrozenIceCubeSubspriteTable); diff --git a/src/battle_bg.c b/src/battle_bg.c index f739a002f..ed32c009c 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -159,7 +159,7 @@ const struct BgTemplate gBattleBgTemplates[] = }, }; -static const struct WindowTemplate gStandardBattleWindowTemplates[] = +static const struct WindowTemplate sStandardBattleWindowTemplates[] = { [B_WIN_MSG] = { .bg = 0, @@ -380,7 +380,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] = DUMMY_WIN_TEMPLATE }; -static const struct WindowTemplate gBattleArenaWindowTemplates[] = +static const struct WindowTemplate sBattleArenaWindowTemplates[] = { [B_WIN_MSG] = { .bg = 0, @@ -594,8 +594,8 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] = const struct WindowTemplate * const gBattleWindowTemplates[] = { - [B_WIN_TYPE_NORMAL] = gStandardBattleWindowTemplates, - [B_WIN_TYPE_ARENA] = gBattleArenaWindowTemplates, + [B_WIN_TYPE_NORMAL] = sStandardBattleWindowTemplates, + [B_WIN_TYPE_ARENA] = sBattleArenaWindowTemplates, }; static const struct BattleBackground sBattleTerrainTable[] = diff --git a/src/battle_tower.c b/src/battle_tower.c index 989412e9e..e652038ac 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -687,7 +687,7 @@ struct { u32 facilityClass; const u8 *const *strings; -} const sPartnerTrainerTextTables[] = +} static const sPartnerTrainerTextTables[] = { {FACILITY_CLASS_LASS, sPartnerTextsLass}, {FACILITY_CLASS_YOUNGSTER, sPartnerTextsYoungster}, @@ -769,7 +769,7 @@ struct u8 nature; u8 evs[NUM_STATS]; u16 moves[MAX_MON_MOVES]; -} const sStevenMons[MULTI_PARTY_SIZE] = +} static const sStevenMons[MULTI_PARTY_SIZE] = { { .species = SPECIES_METANG, diff --git a/src/coins.c b/src/coins.c index 17fd147b7..4c4739999 100644 --- a/src/coins.c +++ b/src/coins.c @@ -8,7 +8,7 @@ #include "international_string_util.h" #include "constants/coins.h" -EWRAM_DATA u8 sCoinsWindowId = 0; +static EWRAM_DATA u8 sCoinsWindowId = 0; void PrintCoinsString(u32 coinAmount) { diff --git a/src/contest.c b/src/contest.c index ced9f90cd..091d7fb63 100644 --- a/src/contest.c +++ b/src/contest.c @@ -352,7 +352,7 @@ EWRAM_DATA u16 gSpecialVar_ContestRank = 0; EWRAM_DATA u8 gNumLinkContestPlayers = 0; EWRAM_DATA u8 gHighestRibbonRank = 0; EWRAM_DATA struct ContestResources *gContestResources = NULL; -EWRAM_DATA u8 sContestBgCopyFlags = 0; +static EWRAM_DATA u8 sContestBgCopyFlags = 0; EWRAM_DATA struct ContestWinner gCurContestWinner = {0}; EWRAM_DATA bool8 gCurContestWinnerIsForArtist = 0; EWRAM_DATA u8 gCurContestWinnerSaveIdx = 0; @@ -625,7 +625,7 @@ static const struct SpriteTemplate sSpriteTemplate_ApplauseMeter = .callback = SpriteCallbackDummy }; -const struct OamData sOam_Judge = +static const struct OamData sOam_Judge = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, @@ -639,7 +639,7 @@ const struct OamData sOam_Judge = .paletteNum = 2, }; -const struct SpriteTemplate sSpriteTemplate_Judge = +static const struct SpriteTemplate sSpriteTemplate_Judge = { .tileTag = TAG_JUDGE, .paletteTag = TAG_JUDGE, @@ -650,7 +650,7 @@ const struct SpriteTemplate sSpriteTemplate_Judge = .callback = SpriteCallbackDummy }; -const struct CompressedSpriteSheet sSpriteSheet_Judge = +static const struct CompressedSpriteSheet sSpriteSheet_Judge = { .data = gContestJudgeGfx, .size = 0x800, @@ -664,13 +664,13 @@ static const struct CompressedSpriteSheet sSpriteSheet_JudgeSymbols = .tag = TAG_JUDGE_SYMBOLS_GFX }; -const struct CompressedSpritePalette sSpritePalette_JudgeSymbols = +static const struct CompressedSpritePalette sSpritePalette_JudgeSymbols = { .data = gContestJudgeSymbolsPal, .tag = TAG_CONTEST_SYMBOLS_PAL }; -const struct SpriteTemplate sSpriteTemplate_JudgeSpeechBubble = +static const struct SpriteTemplate sSpriteTemplate_JudgeSpeechBubble = { .tileTag = TAG_JUDGE_SYMBOLS_GFX, .paletteTag = TAG_CONTEST_SYMBOLS_PAL, @@ -876,7 +876,7 @@ static const struct SpritePalette sSpritePalettes_ContestantsTurnBlinkEffect[CON } }; -const struct OamData sOam_ContestantsTurnBlinkEffect = +static const struct OamData sOam_ContestantsTurnBlinkEffect = { .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, @@ -891,13 +891,13 @@ const struct OamData sOam_ContestantsTurnBlinkEffect = .affineParam = 0, }; -const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_0[] = +static const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_0[] = { AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), AFFINEANIMCMD_END }; -const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_1[] = +static const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_1[] = { AFFINEANIMCMD_FRAME(3, 3, 0, 15), AFFINEANIMCMD_FRAME(-3, -3, 0, 15), @@ -906,13 +906,13 @@ const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_1[] = AFFINEANIMCMD_END }; -const union AffineAnimCmd *const sAffineAnims_ContestantsTurnBlinkEffect[] = +static const union AffineAnimCmd *const sAffineAnims_ContestantsTurnBlinkEffect[] = { sAffineAnim_ContestantsTurnBlinkEffect_0, sAffineAnim_ContestantsTurnBlinkEffect_1 }; -const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTANT_COUNT] = +static const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTANT_COUNT] = { { .tileTag = TAG_BLINK_EFFECT_CONTESTANT0, @@ -952,7 +952,7 @@ const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTA } }; -static const s8 gContestExcitementTable[CONTEST_CATEGORIES_COUNT][CONTEST_CATEGORIES_COUNT] = +static const s8 sContestExcitementTable[CONTEST_CATEGORIES_COUNT][CONTEST_CATEGORIES_COUNT] = { [CONTEST_CATEGORY_COOL] = { [CONTEST_CATEGORY_COOL] = +1, @@ -4744,7 +4744,7 @@ static void UpdateApplauseMeter(void) s8 Contest_GetMoveExcitement(u16 move) { - return gContestExcitementTable[gSpecialVar_ContestCategory][gContestMoves[move].contestCategory]; + return sContestExcitementTable[gSpecialVar_ContestCategory][gContestMoves[move].contestCategory]; } static u8 StartApplauseOverflowAnimation(void) diff --git a/src/data/field_effects/field_effect_objects.h b/src/data/field_effects/field_effect_objects.h index 598b88932..938b6bfc5 100755 --- a/src/data/field_effects/field_effect_objects.h +++ b/src/data/field_effects/field_effect_objects.h @@ -1272,7 +1272,7 @@ static const union AnimCmd *const sAnimTable_RayquazaSpotlightEffect[] = { sAnim_RayquazaSpotlightEffect, }; -const struct SpriteFrameImage sPicTable_RayquazaSpotlightEffect[] = { +static const struct SpriteFrameImage sPicTable_RayquazaSpotlightEffect[] = { overworld_frame(gObjectEventPic_Rayquaza, 4, 4, 0), }; diff --git a/src/data/trade.h b/src/data/trade.h index b26072763..80d17a49b 100644 --- a/src/data/trade.h +++ b/src/data/trade.h @@ -174,10 +174,10 @@ static const struct SpriteTemplate sSpriteTemplate_MenuText = .callback = SpriteCallbackDummy, }; -static const u16 TradeScreenTextPalette[] = INCBIN_U16("graphics/trade/text.gbapal"); -static const struct SpritePalette gSpritePalette_TradeScreenText = +static const u16 sTradeScreenTextPalette[] = INCBIN_U16("graphics/trade/text.gbapal"); +static const struct SpritePalette sSpritePalette_TradeScreenText = { - .data = TradeScreenTextPalette, + .data = sTradeScreenTextPalette, .tag = PALTAG_MENU_TEXT }; diff --git a/src/data/trainer_graphics/back_pic_anims.h b/src/data/trainer_graphics/back_pic_anims.h index 821039cb3..ed12e0cb4 100644 --- a/src/data/trainer_graphics/back_pic_anims.h +++ b/src/data/trainer_graphics/back_pic_anims.h @@ -1,4 +1,4 @@ -static const union AnimCmd gAnimCmd_Brendan_1[] = +static const union AnimCmd sAnimCmd_Brendan_1[] = { ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(1, 9), @@ -8,7 +8,7 @@ static const union AnimCmd gAnimCmd_Brendan_1[] = ANIMCMD_END, }; -static const union AnimCmd gAnimCmd_May_Steven_1[] = +static const union AnimCmd sAnimCmd_May_Steven_1[] = { ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(1, 9), @@ -18,7 +18,7 @@ static const union AnimCmd gAnimCmd_May_Steven_1[] = ANIMCMD_END, }; -static const union AnimCmd gAnimCmd_Wally_1[] = +static const union AnimCmd sAnimCmd_Wally_1[] = { ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(1, 9), @@ -28,7 +28,7 @@ static const union AnimCmd gAnimCmd_Wally_1[] = ANIMCMD_END, }; -static const union AnimCmd gAnimCmd_Red_1[] = +static const union AnimCmd sAnimCmd_Red_1[] = { ANIMCMD_FRAME(1, 20), ANIMCMD_FRAME(2, 6), @@ -38,7 +38,7 @@ static const union AnimCmd gAnimCmd_Red_1[] = ANIMCMD_END, }; -static const union AnimCmd gAnimCmd_Leaf_1[] = +static const union AnimCmd sAnimCmd_Leaf_1[] = { ANIMCMD_FRAME(1, 20), ANIMCMD_FRAME(2, 6), @@ -48,7 +48,7 @@ static const union AnimCmd gAnimCmd_Leaf_1[] = ANIMCMD_END, }; -static const union AnimCmd gAnimCmd_RubySapphireBrendan_1[] = +static const union AnimCmd sAnimCmd_RubySapphireBrendan_1[] = { ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(1, 9), @@ -58,7 +58,7 @@ static const union AnimCmd gAnimCmd_RubySapphireBrendan_1[] = ANIMCMD_END, }; -static const union AnimCmd gAnimCmd_RubySapphireMay_1[] = +static const union AnimCmd sAnimCmd_RubySapphireMay_1[] = { ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(1, 9), @@ -71,49 +71,49 @@ static const union AnimCmd gAnimCmd_RubySapphireMay_1[] = static const union AnimCmd *const sBackAnims_Brendan[] = { sAnim_GeneralFrame3, - gAnimCmd_Brendan_1, + sAnimCmd_Brendan_1, }; static const union AnimCmd *const sBackAnims_May[] = { sAnim_GeneralFrame3, - gAnimCmd_May_Steven_1, + sAnimCmd_May_Steven_1, }; static const union AnimCmd *const sBackAnims_Red[] = { sAnim_GeneralFrame0, - gAnimCmd_Red_1, + sAnimCmd_Red_1, }; static const union AnimCmd *const sBackAnims_Leaf[] = { sAnim_GeneralFrame0, - gAnimCmd_Leaf_1, + sAnimCmd_Leaf_1, }; static const union AnimCmd *const sBackAnims_RubySapphireBrendan[] = { sAnim_GeneralFrame3, - gAnimCmd_RubySapphireBrendan_1, + sAnimCmd_RubySapphireBrendan_1, }; static const union AnimCmd *const sBackAnims_RubySapphireMay[] = { sAnim_GeneralFrame3, - gAnimCmd_RubySapphireMay_1, + sAnimCmd_RubySapphireMay_1, }; static const union AnimCmd *const sBackAnims_Wally[] = { sAnim_GeneralFrame3, - gAnimCmd_Wally_1, + sAnimCmd_Wally_1, }; static const union AnimCmd *const sBackAnims_Steven[] = { sAnim_GeneralFrame3, - gAnimCmd_May_Steven_1, + sAnimCmd_May_Steven_1, }; const union AnimCmd *const *const gTrainerBackAnimsPtrTable[] = diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 691ca6b2a..80cdd8126 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -4546,7 +4546,7 @@ struct { u8 id; void (*func)(void); -} const sGfxFuncs[] = +} static const sGfxFuncs[] = { {GFXFUNC_LOAD, LoadGfx}, // Element not used, LoadGfx is passed directly to SetGfxFunc {GFXFUNC_SHOW_NAMES, ShowNames}, diff --git a/src/event_data.c b/src/event_data.c index e2af6c3d0..22ebdb0d1 100644 --- a/src/event_data.c +++ b/src/event_data.c @@ -30,7 +30,7 @@ EWRAM_DATA u16 gSpecialVar_Facing = 0; EWRAM_DATA u16 gSpecialVar_MonBoxId = 0; EWRAM_DATA u16 gSpecialVar_MonBoxPos = 0; EWRAM_DATA u16 gSpecialVar_Unused_0x8014 = 0; -EWRAM_DATA static u8 gSpecialFlags[SPECIAL_FLAGS_SIZE] = {0}; +EWRAM_DATA static u8 sSpecialFlags[SPECIAL_FLAGS_SIZE] = {0}; extern u16 *const gSpecialVars[]; @@ -38,7 +38,7 @@ void InitEventData(void) { memset(gSaveBlock1Ptr->flags, 0, sizeof(gSaveBlock1Ptr->flags)); memset(gSaveBlock1Ptr->vars, 0, sizeof(gSaveBlock1Ptr->vars)); - memset(gSpecialFlags, 0, sizeof(gSpecialFlags)); + memset(sSpecialFlags, 0, sizeof(sSpecialFlags)); } void ClearTempFieldEventData(void) @@ -205,7 +205,7 @@ u8 *GetFlagPointer(u16 id) else if (id < SPECIAL_FLAGS_START) return &gSaveBlock1Ptr->flags[id / 8]; else - return &gSpecialFlags[(id - SPECIAL_FLAGS_START) / 8]; + return &sSpecialFlags[(id - SPECIAL_FLAGS_START) / 8]; } u8 FlagSet(u16 id) diff --git a/src/field_effect.c b/src/field_effect.c index f57ce8cdd..369239f6b 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -481,13 +481,13 @@ static const struct Subsprite sSubsprites_HofMonitorBig[] = static const struct SubspriteTable sSubspriteTable_HofMonitorBig = subsprite_table(sSubsprites_HofMonitorBig); -const union AnimCmd sAnim_Static[] = +static const union AnimCmd sAnim_Static[] = { ANIMCMD_FRAME(.imageValue = 0, .duration = 1), ANIMCMD_JUMP(0) }; -const union AnimCmd sAnim_Flicker[] = +static const union AnimCmd sAnim_Flicker[] = { ANIMCMD_FRAME(.imageValue = 0, .duration = 16), ANIMCMD_FRAME(.imageValue = 1, .duration = 16), @@ -501,7 +501,7 @@ const union AnimCmd sAnim_Flicker[] = }; // Flicker on and off, for the Pokéballs / monitors during the PokéCenter heal effect -const union AnimCmd *const sAnims_Flicker[] = +static const union AnimCmd *const sAnims_Flicker[] = { sAnim_Static, sAnim_Flicker @@ -556,7 +556,7 @@ static const struct SpriteTemplate sSpriteTemplate_HofMonitorSmall = .callback = SpriteCB_HallOfFameMonitor }; -void (*const sPokecenterHealEffectFuncs[])(struct Task *) = +static void (*const sPokecenterHealEffectFuncs[])(struct Task *) = { PokecenterHealEffect_Init, PokecenterHealEffect_WaitForBallPlacement, @@ -564,7 +564,7 @@ void (*const sPokecenterHealEffectFuncs[])(struct Task *) = PokecenterHealEffect_WaitForSoundAndEnd }; -void (*const sHallOfFameRecordEffectFuncs[])(struct Task *) = +static void (*const sHallOfFameRecordEffectFuncs[])(struct Task *) = { HallOfFameRecordEffect_Init, HallOfFameRecordEffect_WaitForBallPlacement, @@ -572,7 +572,7 @@ void (*const sHallOfFameRecordEffectFuncs[])(struct Task *) = HallOfFameRecordEffect_WaitForSoundAndEnd }; -void (*const sPokeballGlowEffectFuncs[])(struct Sprite *) = +static void (*const sPokeballGlowEffectFuncs[])(struct Sprite *) = { PokeballGlowEffect_PlaceBalls, PokeballGlowEffect_TryPlaySe, @@ -598,7 +598,7 @@ static const u8 sPokeballGlowReds[] = {16, 12, 8, 0}; static const u8 sPokeballGlowGreens[] = {16, 12, 8, 0}; static const u8 sPokeballGlowBlues[] = { 0, 0, 0, 0}; -bool8 (*const sFallWarpFieldEffectFuncs[])(struct Task *) = +static bool8 (*const sFallWarpFieldEffectFuncs[])(struct Task *) = { FallWarpEffect_Init, FallWarpEffect_WaitWeather, @@ -609,7 +609,7 @@ bool8 (*const sFallWarpFieldEffectFuncs[])(struct Task *) = FallWarpEffect_End, }; -bool8 (*const sEscalatorWarpOutFieldEffectFuncs[])(struct Task *) = +static bool8 (*const sEscalatorWarpOutFieldEffectFuncs[])(struct Task *) = { EscalatorWarpOut_Init, EscalatorWarpOut_WaitForPlayer, @@ -619,7 +619,7 @@ bool8 (*const sEscalatorWarpOutFieldEffectFuncs[])(struct Task *) = EscalatorWarpOut_Down_End, }; -bool8 (*const sEscalatorWarpInFieldEffectFuncs[])(struct Task *) = +static bool8 (*const sEscalatorWarpInFieldEffectFuncs[])(struct Task *) = { EscalatorWarpIn_Init, EscalatorWarpIn_Down_Init, @@ -630,7 +630,7 @@ bool8 (*const sEscalatorWarpInFieldEffectFuncs[])(struct Task *) = EscalatorWarpIn_End, }; -bool8 (*const sWaterfallFieldEffectFuncs[])(struct Task *, struct ObjectEvent *) = +static bool8 (*const sWaterfallFieldEffectFuncs[])(struct Task *, struct ObjectEvent *) = { WaterfallFieldEffect_Init, WaterfallFieldEffect_ShowMon, @@ -639,14 +639,14 @@ bool8 (*const sWaterfallFieldEffectFuncs[])(struct Task *, struct ObjectEvent *) WaterfallFieldEffect_ContinueRideOrEnd, }; -bool8 (*const sDiveFieldEffectFuncs[])(struct Task *) = +static bool8 (*const sDiveFieldEffectFuncs[])(struct Task *) = { DiveFieldEffect_Init, DiveFieldEffect_ShowMon, DiveFieldEffect_TryWarp, }; -bool8 (*const sLavaridgeGymB1FWarpEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = +static bool8 (*const sLavaridgeGymB1FWarpEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = { LavaridgeGymB1FWarpEffect_Init, LavaridgeGymB1FWarpEffect_CameraShake, @@ -656,7 +656,7 @@ bool8 (*const sLavaridgeGymB1FWarpEffectFuncs[])(struct Task *, struct ObjectEve LavaridgeGymB1FWarpEffect_Warp, }; -bool8 (*const sLavaridgeGymB1FWarpExitEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = +static bool8 (*const sLavaridgeGymB1FWarpExitEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = { LavaridgeGymB1FWarpExitEffect_Init, LavaridgeGymB1FWarpExitEffect_StartPopOut, @@ -664,7 +664,7 @@ bool8 (*const sLavaridgeGymB1FWarpExitEffectFuncs[])(struct Task *, struct Objec LavaridgeGymB1FWarpExitEffect_End, }; -bool8 (*const sLavaridgeGym1FWarpEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = +static bool8 (*const sLavaridgeGym1FWarpEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = { LavaridgeGym1FWarpEffect_Init, LavaridgeGym1FWarpEffect_AshPuff, @@ -673,7 +673,7 @@ bool8 (*const sLavaridgeGym1FWarpEffectFuncs[])(struct Task *, struct ObjectEven LavaridgeGym1FWarpEffect_Warp, }; -void (*const sEscapeRopeWarpOutEffectFuncs[])(struct Task *) = +static void (*const sEscapeRopeWarpOutEffectFuncs[])(struct Task *) = { EscapeRopeWarpOutEffect_Init, EscapeRopeWarpOutEffect_Spin, @@ -2277,7 +2277,7 @@ static void EscapeRopeWarpOutEffect_Spin(struct Task *task) } } -void (*const sEscapeRopeWarpInEffectFuncs[])(struct Task *) = { +static void (*const sEscapeRopeWarpInEffectFuncs[])(struct Task *) = { EscapeRopeWarpInEffect_Init, EscapeRopeWarpInEffect_Spin }; @@ -2448,7 +2448,7 @@ static void FieldCallback_TeleportWarpIn(void) CreateTask(Task_TeleportWarpIn, 0); } -void (*const sTeleportWarpInFieldEffectFuncs[])(struct Task *) = { +static void (*const sTeleportWarpInFieldEffectFuncs[])(struct Task *) = { TeleportWarpInFieldEffect_Init, TeleportWarpInFieldEffect_SpinEnter, TeleportWarpInFieldEffect_SpinGround @@ -2582,7 +2582,7 @@ bool8 FldEff_FieldMoveShowMonInit(void) return FALSE; } -void (*const sFieldMoveShowMonOutdoorsEffectFuncs[])(struct Task *) = { +static void (*const sFieldMoveShowMonOutdoorsEffectFuncs[])(struct Task *) = { FieldMoveShowMonOutdoorsEffect_Init, FieldMoveShowMonOutdoorsEffect_LoadGfx, FieldMoveShowMonOutdoorsEffect_CreateBanner, @@ -2750,7 +2750,7 @@ static void LoadFieldMoveOutdoorStreaksTilemap(u16 offs) #define tBgOffset data[4] #define tMonSpriteId data[15] -void (*const sFieldMoveShowMonIndoorsEffectFuncs[])(struct Task *) = { +static void (*const sFieldMoveShowMonIndoorsEffectFuncs[])(struct Task *) = { FieldMoveShowMonIndoorsEffect_Init, FieldMoveShowMonIndoorsEffect_LoadGfx, FieldMoveShowMonIndoorsEffect_SlideBannerOn, @@ -2978,7 +2978,7 @@ u8 FldEff_UseSurf(void) return FALSE; } -void (*const sSurfFieldEffectFuncs[])(struct Task *) = { +static void (*const sSurfFieldEffectFuncs[])(struct Task *) = { SurfFieldEffect_Init, SurfFieldEffect_FieldMovePose, SurfFieldEffect_ShowMon, @@ -3154,7 +3154,7 @@ u8 FldEff_UseFly(void) return 0; } -void (*const sFlyOutFieldEffectFuncs[])(struct Task *) = { +static void (*const sFlyOutFieldEffectFuncs[])(struct Task *) = { FlyOutFieldEffect_FieldMovePose, FlyOutFieldEffect_ShowMon, FlyOutFieldEffect_BirdLeaveBall, @@ -3444,7 +3444,7 @@ u8 FldEff_FlyIn(void) return 0; } -void (*const sFlyInFieldEffectFuncs[])(struct Task *) = { +static void (*const sFlyInFieldEffectFuncs[])(struct Task *) = { FlyInFieldEffect_BirdSwoopDown, FlyInFieldEffect_FlyInWithBird, FlyInFieldEffect_JumpOffBird, @@ -3675,7 +3675,7 @@ static void StartEndingDeoxysRockCameraShake(u8 taskId) #undef tEndDelay #undef tEnding -void (*const sDestroyDeoxysRockEffectFuncs[])(s16*, u8) = { +static void (*const sDestroyDeoxysRockEffectFuncs[])(s16*, u8) = { DestroyDeoxysRockEffect_CameraShake, DestroyDeoxysRockEffect_RockFragments, DestroyDeoxysRockEffect_WaitAndEnd, diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index eda146725..77978c269 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -53,7 +53,7 @@ static void Task_EnableScriptAfterMusicFade(u8 taskId); static const u16 sFlashLevelToRadius[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 }; const s32 gMaxFlashLevel = ARRAY_COUNT(sFlashLevelToRadius) - 1; -const struct ScanlineEffectParams sFlashEffectParams = +static const struct ScanlineEffectParams sFlashEffectParams = { ®_WIN0H, ((DMA_ENABLE | DMA_START_HBLANK | DMA_REPEAT | DMA_DEST_RELOAD) << 16) | 1, diff --git a/src/field_special_scene.c b/src/field_special_scene.c index d8b9eb05d..da7e4ed7d 100644 --- a/src/field_special_scene.c +++ b/src/field_special_scene.c @@ -31,7 +31,7 @@ enum }; //. rodata -static const s8 gTruckCamera_HorizontalTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, -1, -1, -1, 0}; +static const s8 sTruckCamera_HorizontalTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, -1, -1, -1, 0}; static const u8 sSSTidalSailEastMovementScript[] = { @@ -109,10 +109,10 @@ void Task_Truck2(u8 taskId) } else { - if (gTruckCamera_HorizontalTable[data[1]] == 2) + if (sTruckCamera_HorizontalTable[data[1]] == 2) gTasks[taskId].func = Task_Truck3; - cameraXpan = gTruckCamera_HorizontalTable[data[1]]; + cameraXpan = sTruckCamera_HorizontalTable[data[1]]; cameraYpan = GetTruckCameraBobbingY(data[2]); SetCameraPanning(cameraXpan, cameraYpan); box1 = GetTruckBoxMovement(data[2] + 30) * 4; @@ -144,7 +144,7 @@ static void Task_Truck3(u8 taskId) } else { - cameraXpan = gTruckCamera_HorizontalTable[data[1]]; + cameraXpan = sTruckCamera_HorizontalTable[data[1]]; cameraYpan = 0; SetCameraPanning(cameraXpan, 0); SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, cameraYpan + 3); diff --git a/src/field_weather.c b/src/field_weather.c index cd3436441..0f203bd24 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -72,7 +72,7 @@ static const u8 *sPaletteGammaTypes; // The drought weather effect uses a precalculated color lookup table. Presumably this // is because the underlying color shift calculation is slow. -const u16 sDroughtWeatherColors[][0x1000] = { +static const u16 sDroughtWeatherColors[][0x1000] = { INCBIN_U16("graphics/weather/drought/colors_0.bin"), INCBIN_U16("graphics/weather/drought/colors_1.bin"), INCBIN_U16("graphics/weather/drought/colors_2.bin"), diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 2b87557c2..94c41a613 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -15,8 +15,8 @@ #include "gpu_regs.h" // EWRAM -EWRAM_DATA static u8 gCurrentAbnormalWeather = 0; -EWRAM_DATA static u16 gUnusedWeatherRelated = 0; +EWRAM_DATA static u8 sCurrentAbnormalWeather = 0; +EWRAM_DATA static u16 sUnusedWeatherRelated = 0; // CONST const u16 gCloudsWeatherPalette[] = INCBIN_U16("graphics/weather/cloud.gbapal"); @@ -1815,7 +1815,7 @@ static void UpdateFogDiagonalMovement(void) gWeatherPtr->fogDPosY = gSpriteCoordOffsetY + gWeatherPtr->fogDYOffset; } -static const struct SpriteSheet gFogDiagonalSpriteSheet = +static const struct SpriteSheet sFogDiagonalSpriteSheet = { .data = gWeatherFogDiagonalTiles, .size = sizeof(gWeatherFogDiagonalTiles), @@ -1870,7 +1870,7 @@ static void CreateFogDiagonalSprites(void) if (!gWeatherPtr->fogDSpritesCreated) { - fogDiagonalSpriteSheet = gFogDiagonalSpriteSheet; + fogDiagonalSpriteSheet = sFogDiagonalSpriteSheet; LoadSpriteSheet(&fogDiagonalSpriteSheet); for (i = 0; i < NUM_FOG_DIAGONAL_SPRITES; i++) { @@ -2429,8 +2429,8 @@ static void UpdateBubbleSprite(struct Sprite *sprite) // Unused function. static void UnusedSetCurrentAbnormalWeather(u32 a0, u32 a1) { - gCurrentAbnormalWeather = a0; - gUnusedWeatherRelated = a1; + sCurrentAbnormalWeather = a0; + sUnusedWeatherRelated = a1; } static void Task_DoAbnormalWeather(u8 taskId) @@ -2443,7 +2443,7 @@ static void Task_DoAbnormalWeather(u8 taskId) if (data[15]-- <= 0) { SetNextWeather(data[1]); - gCurrentAbnormalWeather = data[1]; + sCurrentAbnormalWeather = data[1]; data[15] = 600; data[0]++; } @@ -2452,7 +2452,7 @@ static void Task_DoAbnormalWeather(u8 taskId) if (data[15]-- <= 0) { SetNextWeather(data[2]); - gCurrentAbnormalWeather = data[2]; + sCurrentAbnormalWeather = data[2]; data[15] = 600; data[0] = 0; } @@ -2466,19 +2466,19 @@ static void CreateAbnormalWeatherTask(void) s16 *data = gTasks[taskId].data; data[15] = 600; - if (gCurrentAbnormalWeather == WEATHER_DOWNPOUR) + if (sCurrentAbnormalWeather == WEATHER_DOWNPOUR) { data[1] = WEATHER_DROUGHT; data[2] = WEATHER_DOWNPOUR; } - else if (gCurrentAbnormalWeather == WEATHER_DROUGHT) + else if (sCurrentAbnormalWeather == WEATHER_DROUGHT) { data[1] = WEATHER_DOWNPOUR; data[2] = WEATHER_DROUGHT; } else { - gCurrentAbnormalWeather = WEATHER_DOWNPOUR; + sCurrentAbnormalWeather = WEATHER_DOWNPOUR; data[1] = WEATHER_DROUGHT; data[2] = WEATHER_DOWNPOUR; } @@ -2526,13 +2526,13 @@ void DoCurrentWeather(void) { if (!FuncIsActiveTask(Task_DoAbnormalWeather)) CreateAbnormalWeatherTask(); - weather = gCurrentAbnormalWeather; + weather = sCurrentAbnormalWeather; } else { if (FuncIsActiveTask(Task_DoAbnormalWeather)) DestroyTask(FindTaskIdByFunc(Task_DoAbnormalWeather)); - gCurrentAbnormalWeather = WEATHER_DOWNPOUR; + sCurrentAbnormalWeather = WEATHER_DOWNPOUR; } SetNextWeather(weather); } @@ -2545,13 +2545,13 @@ void ResumePausedWeather(void) { if (!FuncIsActiveTask(Task_DoAbnormalWeather)) CreateAbnormalWeatherTask(); - weather = gCurrentAbnormalWeather; + weather = sCurrentAbnormalWeather; } else { if (FuncIsActiveTask(Task_DoAbnormalWeather)) DestroyTask(FindTaskIdByFunc(Task_DoAbnormalWeather)); - gCurrentAbnormalWeather = WEATHER_DOWNPOUR; + sCurrentAbnormalWeather = WEATHER_DOWNPOUR; } SetCurrentAndNextWeather(weather); } diff --git a/src/fieldmap.c b/src/fieldmap.c index 4dbf981cf..a02355e72 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -25,10 +25,10 @@ struct ConnectionFlags u8 east:1; }; -EWRAM_DATA static u16 gBackupMapData[MAX_MAP_DATA_SIZE] = {0}; +EWRAM_DATA static u16 sBackupMapData[MAX_MAP_DATA_SIZE] = {0}; EWRAM_DATA struct MapHeader gMapHeader = {0}; EWRAM_DATA struct Camera gCamera = {0}; -EWRAM_DATA static struct ConnectionFlags gMapConnectionFlags = {0}; +EWRAM_DATA static struct ConnectionFlags sMapConnectionFlags = {0}; EWRAM_DATA static u32 sFiller = 0; // without this, the next file won't align properly struct BackupMapLayout gBackupMapLayout; @@ -87,14 +87,14 @@ void InitMapFromSavedGame(void) void InitBattlePyramidMap(bool8 setPlayerPosition) { - CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData)); - GenerateBattlePyramidFloorLayout(gBackupMapData, setPlayerPosition); + CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData)); + GenerateBattlePyramidFloorLayout(sBackupMapData, setPlayerPosition); } void InitTrainerHillMap(void) { - CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData)); - GenerateTrainerHillFloorLayout(gBackupMapData); + CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData)); + GenerateTrainerHillFloorLayout(sBackupMapData); } static void InitMapLayoutData(struct MapHeader *mapHeader) @@ -103,8 +103,8 @@ static void InitMapLayoutData(struct MapHeader *mapHeader) int width; int height; mapLayout = mapHeader->mapLayout; - CpuFastFill16(MAPGRID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData)); - gBackupMapLayout.map = gBackupMapData; + CpuFastFill16(MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData)); + gBackupMapLayout.map = sBackupMapData; width = mapLayout->width + MAP_OFFSET_W; gBackupMapLayout.width = width; height = mapLayout->height + MAP_OFFSET_H; @@ -140,7 +140,7 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader) { count = mapHeader->connections->count; connection = mapHeader->connections->connections; - gMapConnectionFlags = sDummyConnectionFlags; + sMapConnectionFlags = sDummyConnectionFlags; for (i = 0; i < count; i++, connection++) { struct MapHeader const *cMap = GetMapHeaderFromConnection(connection); @@ -149,19 +149,19 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader) { case CONNECTION_SOUTH: FillSouthConnection(mapHeader, cMap, offset); - gMapConnectionFlags.south = TRUE; + sMapConnectionFlags.south = TRUE; break; case CONNECTION_NORTH: FillNorthConnection(mapHeader, cMap, offset); - gMapConnectionFlags.north = TRUE; + sMapConnectionFlags.north = TRUE; break; case CONNECTION_WEST: FillWestConnection(mapHeader, cMap, offset); - gMapConnectionFlags.west = TRUE; + sMapConnectionFlags.west = TRUE; break; case CONNECTION_EAST: FillEastConnection(mapHeader, cMap, offset); - gMapConnectionFlags.east = TRUE; + sMapConnectionFlags.east = TRUE; break; } } @@ -436,7 +436,7 @@ void SaveMapView(void) for (i = y; i < y + MAP_OFFSET_H; i++) { for (j = x; j < x + MAP_OFFSET_W; j++) - *mapView++ = gBackupMapData[width * i + j]; + *mapView++ = sBackupMapData[width * i + j]; } } @@ -491,8 +491,8 @@ static void LoadSavedMapView(void) for (j = x; j < x + MAP_OFFSET_W; j++) { - if (!SkipCopyingMetatileFromSavedMap(&gBackupMapData[j + width * i], width, yMode)) - gBackupMapData[j + width * i] = *mapView; + if (!SkipCopyingMetatileFromSavedMap(&sBackupMapData[j + width * i], width, yMode)) + sBackupMapData[j + width * i] = *mapView; mapView++; } } @@ -554,7 +554,7 @@ static void MoveMapViewToBackup(u8 direction) desti = width * (y + y0); srci = (y + r8) * MAP_OFFSET_W + r9; src = &mapView[srci + i]; - dest = &gBackupMapData[x0 + desti + j]; + dest = &sBackupMapData[x0 + desti + j]; *dest = *src; i++; j++; @@ -570,28 +570,28 @@ int GetMapBorderIdAt(int x, int y) if (x >= (gBackupMapLayout.width - (MAP_OFFSET + 1))) { - if (!gMapConnectionFlags.east) + if (!sMapConnectionFlags.east) return CONNECTION_INVALID; return CONNECTION_EAST; } else if (x < MAP_OFFSET) { - if (!gMapConnectionFlags.west) + if (!sMapConnectionFlags.west) return CONNECTION_INVALID; return CONNECTION_WEST; } else if (y >= (gBackupMapLayout.height - MAP_OFFSET)) { - if (!gMapConnectionFlags.south) + if (!sMapConnectionFlags.south) return CONNECTION_INVALID; return CONNECTION_SOUTH; } else if (y < MAP_OFFSET) { - if (!gMapConnectionFlags.north) + if (!sMapConnectionFlags.north) return CONNECTION_INVALID; return CONNECTION_NORTH; diff --git a/src/item_menu_icons.c b/src/item_menu_icons.c index a5c265f90..b1e163499 100644 --- a/src/item_menu_icons.c +++ b/src/item_menu_icons.c @@ -35,8 +35,8 @@ static void SpriteCB_SwitchPocketRotatingBallContinue(struct Sprite *sprite); // static const rom data static const u16 sRotatingBall_Pal[] = INCBIN_U16("graphics/bag/rotating_ball.gbapal"); static const u8 sRotatingBall_Gfx[] = INCBIN_U8("graphics/bag/rotating_ball.4bpp"); -static const u8 gCherryUnused[] = INCBIN_U8("graphics/unused/cherry.4bpp"); -static const u16 gCherryUnused_Pal[] = INCBIN_U16("graphics/unused/cherry.gbapal"); +static const u8 sCherryUnused[] = INCBIN_U8("graphics/unused/cherry.4bpp"); +static const u16 sCherryUnused_Pal[] = INCBIN_U16("graphics/unused/cherry.gbapal"); static const struct OamData sBagOamData = { @@ -269,7 +269,7 @@ static const struct SpriteFrameImage sBerryPicSpriteImageTable[] = {&gDecompressionBuffer[0], 0x800}, }; -static const struct SpriteTemplate gBerryPicSpriteTemplate = +static const struct SpriteTemplate sBerryPicSpriteTemplate = { .tileTag = TAG_NONE, .paletteTag = TAG_BERRY_PIC_PAL, @@ -308,7 +308,7 @@ static const union AffineAnimCmd *const sBerryPicRotatingAnimCmds[] = sSpriteAffineAnim_BerryPicRotation2 }; -static const struct SpriteTemplate gBerryPicRotatingSpriteTemplate = +static const struct SpriteTemplate sBerryPicRotatingSpriteTemplate = { .tileTag = TAG_NONE, .paletteTag = TAG_BERRY_PIC_PAL, @@ -404,7 +404,7 @@ static const union AnimCmd *const sBerryCheckCircleSpriteAnimTable[] = sSpriteAnim_BerryCheckCircle }; -static const struct SpriteTemplate gBerryCheckCircleSpriteTemplate = +static const struct SpriteTemplate sBerryCheckCircleSpriteTemplate = { .tileTag = TAG_BERRY_CHECK_CIRCLE_GFX, .paletteTag = TAG_BERRY_CHECK_CIRCLE_GFX, @@ -609,7 +609,7 @@ static void LoadBerryGfx(u8 berryId) u8 CreateBerryTagSprite(u8 id, s16 x, s16 y) { LoadBerryGfx(id); - return CreateSprite(&gBerryPicSpriteTemplate, x, y, 0); + return CreateSprite(&sBerryPicSpriteTemplate, x, y, 0); } void FreeBerryTagSpritePalette(void) @@ -624,7 +624,7 @@ u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine) FreeSpritePaletteByTag(TAG_BERRY_PIC_PAL); LoadBerryGfx(berryId); - spriteId = CreateSprite(&gBerryPicRotatingSpriteTemplate, x, y, 0); + spriteId = CreateSprite(&sBerryPicRotatingSpriteTemplate, x, y, 0); if (startAffine == TRUE) StartSpriteAffineAnim(&gSprites[spriteId], 1); @@ -633,5 +633,5 @@ u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine) u8 CreateBerryFlavorCircleSprite(s16 x) { - return CreateSprite(&gBerryCheckCircleSpriteTemplate, x, 116, 0); + return CreateSprite(&sBerryCheckCircleSpriteTemplate, x, 116, 0); } diff --git a/src/landmark.c b/src/landmark.c index 52d52500a..615a9bfe3 100644 --- a/src/landmark.c +++ b/src/landmark.c @@ -336,7 +336,7 @@ static const struct Landmark *const Landmarks_MtChimney_2[] = NULL, }; -static const struct LandmarkList gLandmarkLists[] = +static const struct LandmarkList sLandmarkLists[] = { {MAPSEC_ROUTE_103, 2, Landmarks_Route103_2}, {MAPSEC_ROUTE_104, 0, Landmarks_Route104_0}, @@ -420,21 +420,21 @@ static const struct Landmark *const *GetLandmarks(u8 mapSection, u8 id) { u16 i = 0; - for (; gLandmarkLists[i].mapSection != MAPSEC_NONE; i++) + for (; sLandmarkLists[i].mapSection != MAPSEC_NONE; i++) { - if (gLandmarkLists[i].mapSection > mapSection) + if (sLandmarkLists[i].mapSection > mapSection) return NULL; - if (gLandmarkLists[i].mapSection == mapSection) + if (sLandmarkLists[i].mapSection == mapSection) break; } - if (gLandmarkLists[i].mapSection == MAPSEC_NONE) + if (sLandmarkLists[i].mapSection == MAPSEC_NONE) return NULL; - for (; gLandmarkLists[i].mapSection == mapSection; i++) + for (; sLandmarkLists[i].mapSection == mapSection; i++) { - if (gLandmarkLists[i].id == id) - return gLandmarkLists[i].landmarks; + if (sLandmarkLists[i].id == id) + return sLandmarkLists[i].landmarks; } return NULL; diff --git a/src/m4a_1.s b/src/m4a_1.s index cc5d3238d..3f1578806 100644 --- a/src/m4a_1.s +++ b/src/m4a_1.s @@ -680,7 +680,7 @@ SoundMainRAM_Unk2: ldr r1, [r4, o_SoundChannel_wav] add r2, r2, r1 add r2, r2, 0x10 - ldr r5, =gDecodingBuffer + ldr r5, =sDecodingBuffer ldr r6, =gDeltaEncodingTable mov r7, 0x40 ldrb lr, [r2], 1 @@ -701,7 +701,7 @@ _081DD57C: subs r7, r7, 2 bgt _081DD568 _081DD594: - ldr r5, =gDecodingBuffer + ldr r5, =sDecodingBuffer and r0, r3, 0x3F ldrsb r1, [r5, r0] pop {r0,r2,r5-r7,pc} @@ -1911,6 +1911,6 @@ _081DDD90: .align 2, 0 @ Don't pad with nop. .bss -gDecodingBuffer: @ Used as a buffer for audio decoded from compressed DPCM +sDecodingBuffer: @ Used as a buffer for audio decoded from compressed DPCM .space 0x40 - .size gDecodingBuffer, .-gDecodingBuffer + .size sDecodingBuffer, .-sDecodingBuffer diff --git a/src/main.c b/src/main.c index 2b96a8698..5fd236447 100644 --- a/src/main.c +++ b/src/main.c @@ -69,7 +69,7 @@ u8 gLinkVSyncDisabled; u32 IntrMain_Buffer[0x200]; s8 gPcmDmaCounter; -static EWRAM_DATA u16 gTrainerId = 0; +static EWRAM_DATA u16 sTrainerId = 0; //EWRAM_DATA void (**gFlashTimerIntrFunc)(void) = NULL; @@ -201,12 +201,12 @@ void SeedRngAndSetTrainerId(void) u16 val = REG_TM1CNT_L; SeedRng(val); REG_TM1CNT_H = 0; - gTrainerId = val; + sTrainerId = val; } u16 GetGeneratedTrainerIdLower(void) { - return gTrainerId; + return sTrainerId; } void EnableVCountIntrAtLine150(void) diff --git a/src/main_menu.c b/src/main_menu.c index ed6158a9c..7a5dd9ebd 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -371,7 +371,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] = DUMMY_WIN_TEMPLATE }; -static const struct WindowTemplate gNewGameBirchSpeechTextWindows[] = +static const struct WindowTemplate sNewGameBirchSpeechTextWindows[] = { { .bg = 0, @@ -457,7 +457,7 @@ static const struct MenuAction sMenuActions_Gender[] = { {gText_BirchGirl, NULL} }; -static const u8 *const gMalePresetNames[] = { +static const u8 *const sMalePresetNames[] = { gText_DefaultNameStu, gText_DefaultNameMilton, gText_DefaultNameTom, @@ -480,7 +480,7 @@ static const u8 *const gMalePresetNames[] = { gText_DefaultNameQuincy }; -static const u8 *const gFemalePresetNames[] = { +static const u8 *const sFemalePresetNames[] = { gText_DefaultNameKimmy, gText_DefaultNameTiara, gText_DefaultNameBella, @@ -1325,7 +1325,7 @@ static void Task_NewGameBirchSpeech_WaitForSpriteFadeInWelcome(u8 taskId) } else { - InitWindows(gNewGameBirchSpeechTextWindows); + InitWindows(sNewGameBirchSpeechTextWindows); LoadMainMenuWindowFrameTiles(0, 0xF3); LoadMessageBoxGfx(0, 0xFC, 0xF0); NewGameBirchSpeech_ShowDialogueWindow(0, 1); @@ -1851,7 +1851,7 @@ static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void) REG_IME = savedIme; SetVBlankCallback(VBlankCB_MainMenu); SetMainCallback2(CB2_MainMenu); - InitWindows(gNewGameBirchSpeechTextWindows); + InitWindows(sNewGameBirchSpeechTextWindows); LoadMainMenuWindowFrameTiles(0, 0xF3); LoadMessageBoxGfx(0, 0xFC, 0xF0); PutWindowTilemap(0); @@ -2087,7 +2087,7 @@ static void NewGameBirchSpeech_StartFadePlatformOut(u8 taskId, u8 delay) static void NewGameBirchSpeech_ShowGenderMenu(void) { - DrawMainMenuWindowBorder(&gNewGameBirchSpeechTextWindows[1], 0xF3); + DrawMainMenuWindowBorder(&sNewGameBirchSpeechTextWindows[1], 0xF3); FillWindowPixelBuffer(1, PIXEL_FILL(1)); PrintMenuTable(1, ARRAY_COUNT(sMenuActions_Gender), sMenuActions_Gender); InitMenuInUpperLeftCornerNormal(1, ARRAY_COUNT(sMenuActions_Gender), 0); @@ -2106,9 +2106,9 @@ static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId) u8 i; if (gSaveBlock2Ptr->playerGender == MALE) - name = gMalePresetNames[nameId]; + name = sMalePresetNames[nameId]; else - name = gFemalePresetNames[nameId]; + name = sFemalePresetNames[nameId]; for (i = 0; i < PLAYER_NAME_LENGTH; i++) gSaveBlock2Ptr->playerName[i] = name[i]; gSaveBlock2Ptr->playerName[PLAYER_NAME_LENGTH] = EOS; diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 8cf1a6bab..363f2bc06 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -176,25 +176,25 @@ static const u8 sRegionMapSectionId_To_PopUpThemeIdMapping[] = [MAPSEC_TRAINER_HILL - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_MARBLE }; -static const u8 gText_PyramidFloor1[] = _("PYRAMID FLOOR 1"); -static const u8 gText_PyramidFloor2[] = _("PYRAMID FLOOR 2"); -static const u8 gText_PyramidFloor3[] = _("PYRAMID FLOOR 3"); -static const u8 gText_PyramidFloor4[] = _("PYRAMID FLOOR 4"); -static const u8 gText_PyramidFloor5[] = _("PYRAMID FLOOR 5"); -static const u8 gText_PyramidFloor6[] = _("PYRAMID FLOOR 6"); -static const u8 gText_PyramidFloor7[] = _("PYRAMID FLOOR 7"); -static const u8 gText_Pyramid[] = _("PYRAMID"); +static const u8 sText_PyramidFloor1[] = _("PYRAMID FLOOR 1"); +static const u8 sText_PyramidFloor2[] = _("PYRAMID FLOOR 2"); +static const u8 sText_PyramidFloor3[] = _("PYRAMID FLOOR 3"); +static const u8 sText_PyramidFloor4[] = _("PYRAMID FLOOR 4"); +static const u8 sText_PyramidFloor5[] = _("PYRAMID FLOOR 5"); +static const u8 sText_PyramidFloor6[] = _("PYRAMID FLOOR 6"); +static const u8 sText_PyramidFloor7[] = _("PYRAMID FLOOR 7"); +static const u8 sText_Pyramid[] = _("PYRAMID"); -static const u8 * const gBattlePyramid_MapHeaderStrings[] = +static const u8 * const sBattlePyramid_MapHeaderStrings[] = { - gText_PyramidFloor1, - gText_PyramidFloor2, - gText_PyramidFloor3, - gText_PyramidFloor4, - gText_PyramidFloor5, - gText_PyramidFloor6, - gText_PyramidFloor7, - gText_Pyramid, + sText_PyramidFloor1, + sText_PyramidFloor2, + sText_PyramidFloor3, + sText_PyramidFloor4, + sText_PyramidFloor5, + sText_PyramidFloor6, + sText_PyramidFloor7, + sText_Pyramid, }; // Unused @@ -309,12 +309,12 @@ static void ShowMapNamePopUpWindow(void) if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP) { withoutPrefixPtr = &(mapDisplayHeader[3]); - mapDisplayHeaderSource = gBattlePyramid_MapHeaderStrings[7]; + mapDisplayHeaderSource = sBattlePyramid_MapHeaderStrings[7]; } else { withoutPrefixPtr = &(mapDisplayHeader[3]); - mapDisplayHeaderSource = gBattlePyramid_MapHeaderStrings[gSaveBlock2Ptr->frontier.curChallengeBattleNum]; + mapDisplayHeaderSource = sBattlePyramid_MapHeaderStrings[gSaveBlock2Ptr->frontier.curChallengeBattleNum]; } StringCopy(withoutPrefixPtr, mapDisplayHeaderSource); } diff --git a/src/overworld.c b/src/overworld.c index ba6eaa167..36f52223f 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -318,7 +318,7 @@ static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *, struct Obje static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); static u8 MovementEventModeCB_Scripted(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); -static u8 (*const gLinkPlayerMovementModes[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) = +static u8 (*const sLinkPlayerMovementModes[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) = { [MOVEMENT_MODE_FREE] = MovementEventModeCB_Normal, [MOVEMENT_MODE_FROZEN] = MovementEventModeCB_Ignored, @@ -330,7 +330,7 @@ static u8 FacingHandler_DpadMovement(struct LinkPlayerObjectEvent *, struct Obje static u8 FacingHandler_ForcedFacingChange(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); // These handlers return TRUE if the movement was scripted and successful, and FALSE otherwise. -static bool8 (*const gLinkPlayerFacingHandlers[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) = +static bool8 (*const sLinkPlayerFacingHandlers[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) = { FacingHandler_DoNothing, FacingHandler_DpadMovement, @@ -349,7 +349,7 @@ static void MovementStatusHandler_EnterFreeMode(struct LinkPlayerObjectEvent *, static void MovementStatusHandler_TryAdvanceScript(struct LinkPlayerObjectEvent *, struct ObjectEvent *); // These handlers are run after an attempted movement. -static void (*const gMovementStatusHandler[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *) = +static void (*const sMovementStatusHandler[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *) = { // FALSE: MovementStatusHandler_EnterFreeMode, @@ -3048,9 +3048,9 @@ static void SetPlayerFacingDirection(u8 linkPlayerId, u8 facing) { // This is a hack to split this code onto two separate lines, without declaring a local variable. // C++ style inline variables would be nice here. - #define TEMP gLinkPlayerMovementModes[linkPlayerObjEvent->movementMode](linkPlayerObjEvent, objEvent, facing) + #define TEMP sLinkPlayerMovementModes[linkPlayerObjEvent->movementMode](linkPlayerObjEvent, objEvent, facing) - gMovementStatusHandler[TEMP](linkPlayerObjEvent, objEvent); + sMovementStatusHandler[TEMP](linkPlayerObjEvent, objEvent); // Clean up the hack. #undef TEMP @@ -3061,7 +3061,7 @@ static void SetPlayerFacingDirection(u8 linkPlayerId, u8 facing) static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) { - return gLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); + return sLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); } static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) @@ -3072,7 +3072,7 @@ static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *linkPlayerOb // Identical to MovementEventModeCB_Normal static u8 MovementEventModeCB_Scripted(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) { - return gLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); + return sLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); } static bool8 FacingHandler_DoNothing(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) diff --git a/src/palette.c b/src/palette.c index 9fec449bc..174c04e14 100644 --- a/src/palette.c +++ b/src/palette.c @@ -60,13 +60,13 @@ static void Task_BlendPalettesGradually(u8 taskId); // unaligned word reads are issued in BlendPalette otherwise ALIGNED(4) EWRAM_DATA u16 gPlttBufferUnfaded[PLTT_BUFFER_SIZE] = {0}; ALIGNED(4) EWRAM_DATA u16 gPlttBufferFaded[PLTT_BUFFER_SIZE] = {0}; -EWRAM_DATA struct PaletteStruct sPaletteStructs[NUM_PALETTE_STRUCTS] = {0}; +static EWRAM_DATA struct PaletteStruct sPaletteStructs[NUM_PALETTE_STRUCTS] = {0}; EWRAM_DATA struct PaletteFadeControl gPaletteFade = {0}; static EWRAM_DATA u32 sFiller = 0; static EWRAM_DATA u32 sPlttBufferTransferPending = 0; EWRAM_DATA u8 gPaletteDecompressionBuffer[PLTT_DECOMP_BUFFER_SIZE] = {0}; -static const struct PaletteStructTemplate gDummyPaletteStructTemplate = { +static const struct PaletteStructTemplate sDummyPaletteStructTemplate = { .id = 0xFFFF, .state = 1 }; @@ -352,7 +352,7 @@ void PaletteStruct_ResetById(u16 id) static void PaletteStruct_Reset(u8 paletteNum) { - sPaletteStructs[paletteNum].template = &gDummyPaletteStructTemplate; + sPaletteStructs[paletteNum].template = &sDummyPaletteStructTemplate; sPaletteStructs[paletteNum].active = FALSE; sPaletteStructs[paletteNum].baseDestOffset = 0; sPaletteStructs[paletteNum].destOffset = 0; diff --git a/src/pokedex.c b/src/pokedex.c index 206782e59..5730593e1 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -840,7 +840,7 @@ static const u8 sText_No000[] = _("{NO}000"); static const u8 sCaughtBall_Gfx[] = INCBIN_U8("graphics/pokedex/caught_ball.4bpp"); static const u8 sText_TenDashes[] = _("----------"); -ALIGNED(4) static const u8 gExpandedPlaceholder_PokedexDescription[] = _(""); +ALIGNED(4) static const u8 sExpandedPlaceholder_PokedexDescription[] = _(""); #include "data/pokemon/pokedex_text.h" #include "data/pokemon/pokedex_entries.h" @@ -4138,7 +4138,7 @@ static void PrintMonInfo(u32 num, u32 value, u32 owned, u32 newEntry) if (owned) description = gPokedexEntries[num].description; else - description = gExpandedPlaceholder_PokedexDescription; + description = sExpandedPlaceholder_PokedexDescription; PrintInfoScreenText(description, GetStringCenterAlignXOffset(FONT_NORMAL, description, 0xF0), 0x5F); } diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 8bf12c2bd..8f80b0b37 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1040,7 +1040,7 @@ static const struct BgTemplate sBgTemplates[] = }, }; -static const struct SpritePalette gWaveformSpritePalette = +static const struct SpritePalette sWaveformSpritePalette = { sWaveform_Pal, PALTAG_MISC_2 }; @@ -3844,7 +3844,7 @@ static bool8 InitPokeStorageWindows(void) static void LoadWaveformSpritePalette(void) { - LoadSpritePalette(&gWaveformSpritePalette); + LoadSpritePalette(&sWaveformSpritePalette); } static void InitPalettesAndSprites(void) diff --git a/src/pokenav_main_menu.c b/src/pokenav_main_menu.c index 318ed520d..7d668c67f 100644 --- a/src/pokenav_main_menu.c +++ b/src/pokenav_main_menu.c @@ -105,7 +105,7 @@ static const u8 sHelpBarTextColors[3] = TEXT_COLOR_RED, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY }; -static const struct CompressedSpriteSheet gSpinningPokenavSpriteSheet[] = +static const struct CompressedSpriteSheet sSpinningPokenavSpriteSheet[] = { { .data = sSpinningPokenav_Gfx, @@ -114,7 +114,7 @@ static const struct CompressedSpriteSheet gSpinningPokenavSpriteSheet[] = } }; -static const struct SpritePalette gSpinningNavgearPalettes[] = +static const struct SpritePalette sSpinningNavgearPalettes[] = { { .data = sSpinningPokenav_Pal, @@ -583,10 +583,10 @@ static void InitPokenavMainMenuResources(void) u8 spriteId; struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU); - for (i = 0; i < ARRAY_COUNT(gSpinningPokenavSpriteSheet); i++) - LoadCompressedSpriteSheet(&gSpinningPokenavSpriteSheet[i]); + for (i = 0; i < ARRAY_COUNT(sSpinningPokenavSpriteSheet); i++) + LoadCompressedSpriteSheet(&sSpinningPokenavSpriteSheet[i]); - Pokenav_AllocAndLoadPalettes(gSpinningNavgearPalettes); + Pokenav_AllocAndLoadPalettes(sSpinningNavgearPalettes); menu->palettes = ~1 & ~(0x10000 << IndexOfSpritePaletteTag(0)); spriteId = CreateSprite(&sSpinningPokenavSpriteTemplate, 220, 12, 0); menu->spinningPokenav = &gSprites[spriteId]; diff --git a/src/pokenav_match_call_data.c b/src/pokenav_match_call_data.c index 29dd62621..2e8cc40b5 100644 --- a/src/pokenav_match_call_data.c +++ b/src/pokenav_match_call_data.c @@ -324,7 +324,7 @@ static const match_call_text_data_t sWallyTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -const struct MatchCallLocationOverride sWallyLocationData[] = { +static const struct MatchCallLocationOverride sWallyLocationData[] = { { FLAG_HIDE_MAUVILLE_CITY_WALLY, MAPSEC_VERDANTURF_TOWN }, { FLAG_GROUDON_AWAKENED_MAGMA_HIDEOUT, MAPSEC_NONE }, { FLAG_HIDE_VICTORY_ROAD_ENTRANCE_WALLY, MAPSEC_VICTORY_ROAD }, diff --git a/src/pokenav_region_map.c b/src/pokenav_region_map.c index 16ba48070..828bd525d 100755 --- a/src/pokenav_region_map.c +++ b/src/pokenav_region_map.c @@ -146,7 +146,7 @@ static const struct WindowTemplate sMapSecInfoWindowTemplate = #include "data/region_map/city_map_entries.h" -const struct OamData sCityZoomTextSprite_OamData = +static const struct OamData sCityZoomTextSprite_OamData = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, diff --git a/src/region_map.c b/src/region_map.c index 09e2d69bf..5b3b8b008 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -64,7 +64,7 @@ struct MultiNameFlyDest // Static RAM declarations -static EWRAM_DATA struct RegionMap *gRegionMap = NULL; +static EWRAM_DATA struct RegionMap *sRegionMap = NULL; static EWRAM_DATA struct { void (*callback)(void); @@ -516,49 +516,49 @@ void InitRegionMap(struct RegionMap *regionMap, bool8 zoomed) void InitRegionMapData(struct RegionMap *regionMap, const struct BgTemplate *template, bool8 zoomed) { - gRegionMap = regionMap; - gRegionMap->initStep = 0; - gRegionMap->zoomed = zoomed; - gRegionMap->inputCallback = zoomed == TRUE ? ProcessRegionMapInput_Zoomed : ProcessRegionMapInput_Full; + sRegionMap = regionMap; + sRegionMap->initStep = 0; + sRegionMap->zoomed = zoomed; + sRegionMap->inputCallback = zoomed == TRUE ? ProcessRegionMapInput_Zoomed : ProcessRegionMapInput_Full; if (template != NULL) { - gRegionMap->bgNum = template->bg; - gRegionMap->charBaseIdx = template->charBaseIndex; - gRegionMap->mapBaseIdx = template->mapBaseIndex; - gRegionMap->bgManaged = TRUE; + sRegionMap->bgNum = template->bg; + sRegionMap->charBaseIdx = template->charBaseIndex; + sRegionMap->mapBaseIdx = template->mapBaseIndex; + sRegionMap->bgManaged = TRUE; } else { - gRegionMap->bgNum = 2; - gRegionMap->charBaseIdx = 2; - gRegionMap->mapBaseIdx = 28; - gRegionMap->bgManaged = FALSE; + sRegionMap->bgNum = 2; + sRegionMap->charBaseIdx = 2; + sRegionMap->mapBaseIdx = 28; + sRegionMap->bgManaged = FALSE; } } void ShowRegionMapForPokedexAreaScreen(struct RegionMap *regionMap) { - gRegionMap = regionMap; + sRegionMap = regionMap; InitMapBasedOnPlayerLocation(); - gRegionMap->playerIconSpritePosX = gRegionMap->cursorPosX; - gRegionMap->playerIconSpritePosY = gRegionMap->cursorPosY; + sRegionMap->playerIconSpritePosX = sRegionMap->cursorPosX; + sRegionMap->playerIconSpritePosY = sRegionMap->cursorPosY; } bool8 LoadRegionMapGfx(void) { - switch (gRegionMap->initStep) + switch (sRegionMap->initStep) { case 0: - if (gRegionMap->bgManaged) - DecompressAndCopyTileDataToVram(gRegionMap->bgNum, sRegionMapBg_GfxLZ, 0, 0, 0); + if (sRegionMap->bgManaged) + DecompressAndCopyTileDataToVram(sRegionMap->bgNum, sRegionMapBg_GfxLZ, 0, 0, 0); else LZ77UnCompVram(sRegionMapBg_GfxLZ, (u16 *)BG_CHAR_ADDR(2)); break; case 1: - if (gRegionMap->bgManaged) + if (sRegionMap->bgManaged) { if (!FreeTempTileDataBuffersIfPossible()) - DecompressAndCopyTileDataToVram(gRegionMap->bgNum, sRegionMapBg_TilemapLZ, 0, 0, 1); + DecompressAndCopyTileDataToVram(sRegionMap->bgNum, sRegionMapBg_TilemapLZ, 0, 0, 1); } else { @@ -570,54 +570,54 @@ bool8 LoadRegionMapGfx(void) LoadPalette(sRegionMapBg_Pal, 0x70, 0x60); break; case 3: - LZ77UnCompWram(sRegionMapCursorSmallGfxLZ, gRegionMap->cursorSmallImage); + LZ77UnCompWram(sRegionMapCursorSmallGfxLZ, sRegionMap->cursorSmallImage); break; case 4: - LZ77UnCompWram(sRegionMapCursorLargeGfxLZ, gRegionMap->cursorLargeImage); + LZ77UnCompWram(sRegionMapCursorLargeGfxLZ, sRegionMap->cursorLargeImage); break; case 5: InitMapBasedOnPlayerLocation(); - gRegionMap->playerIconSpritePosX = gRegionMap->cursorPosX; - gRegionMap->playerIconSpritePosY = gRegionMap->cursorPosY; - gRegionMap->mapSecId = CorrectSpecialMapSecId_Internal(gRegionMap->mapSecId); - gRegionMap->mapSecType = GetMapsecType(gRegionMap->mapSecId); - GetMapName(gRegionMap->mapSecName, gRegionMap->mapSecId, MAP_NAME_LENGTH); + sRegionMap->playerIconSpritePosX = sRegionMap->cursorPosX; + sRegionMap->playerIconSpritePosY = sRegionMap->cursorPosY; + sRegionMap->mapSecId = CorrectSpecialMapSecId_Internal(sRegionMap->mapSecId); + sRegionMap->mapSecType = GetMapsecType(sRegionMap->mapSecId); + GetMapName(sRegionMap->mapSecName, sRegionMap->mapSecId, MAP_NAME_LENGTH); break; case 6: - if (gRegionMap->zoomed == FALSE) + if (sRegionMap->zoomed == FALSE) { CalcZoomScrollParams(0, 0, 0, 0, 0x100, 0x100, 0); } else { - gRegionMap->scrollX = gRegionMap->cursorPosX * 8 - 0x34; - gRegionMap->scrollY = gRegionMap->cursorPosY * 8 - 0x44; - gRegionMap->zoomedCursorPosX = gRegionMap->cursorPosX; - gRegionMap->zoomedCursorPosY = gRegionMap->cursorPosY; - CalcZoomScrollParams(gRegionMap->scrollX, gRegionMap->scrollY, 0x38, 0x48, 0x80, 0x80, 0); + sRegionMap->scrollX = sRegionMap->cursorPosX * 8 - 0x34; + sRegionMap->scrollY = sRegionMap->cursorPosY * 8 - 0x44; + sRegionMap->zoomedCursorPosX = sRegionMap->cursorPosX; + sRegionMap->zoomedCursorPosY = sRegionMap->cursorPosY; + CalcZoomScrollParams(sRegionMap->scrollX, sRegionMap->scrollY, 0x38, 0x48, 0x80, 0x80, 0); } break; case 7: GetPositionOfCursorWithinMapSec(); UpdateRegionMapVideoRegs(); - gRegionMap->cursorSprite = NULL; - gRegionMap->playerIconSprite = NULL; - gRegionMap->cursorMovementFrameCounter = 0; - gRegionMap->blinkPlayerIcon = FALSE; - if (gRegionMap->bgManaged) + sRegionMap->cursorSprite = NULL; + sRegionMap->playerIconSprite = NULL; + sRegionMap->cursorMovementFrameCounter = 0; + sRegionMap->blinkPlayerIcon = FALSE; + if (sRegionMap->bgManaged) { - SetBgAttribute(gRegionMap->bgNum, BG_ATTR_SCREENSIZE, 2); - SetBgAttribute(gRegionMap->bgNum, BG_ATTR_CHARBASEINDEX, gRegionMap->charBaseIdx); - SetBgAttribute(gRegionMap->bgNum, BG_ATTR_MAPBASEINDEX, gRegionMap->mapBaseIdx); - SetBgAttribute(gRegionMap->bgNum, BG_ATTR_WRAPAROUND, 1); - SetBgAttribute(gRegionMap->bgNum, BG_ATTR_PALETTEMODE, 1); + SetBgAttribute(sRegionMap->bgNum, BG_ATTR_SCREENSIZE, 2); + SetBgAttribute(sRegionMap->bgNum, BG_ATTR_CHARBASEINDEX, sRegionMap->charBaseIdx); + SetBgAttribute(sRegionMap->bgNum, BG_ATTR_MAPBASEINDEX, sRegionMap->mapBaseIdx); + SetBgAttribute(sRegionMap->bgNum, BG_ATTR_WRAPAROUND, 1); + SetBgAttribute(sRegionMap->bgNum, BG_ATTR_PALETTEMODE, 1); } - gRegionMap->initStep++; + sRegionMap->initStep++; return FALSE; default: return FALSE; } - gRegionMap->initStep++; + sRegionMap->initStep++; return TRUE; } @@ -629,23 +629,23 @@ void BlendRegionMap(u16 color, u32 coeff) void FreeRegionMapIconResources(void) { - if (gRegionMap->cursorSprite != NULL) + if (sRegionMap->cursorSprite != NULL) { - DestroySprite(gRegionMap->cursorSprite); - FreeSpriteTilesByTag(gRegionMap->cursorTileTag); - FreeSpritePaletteByTag(gRegionMap->cursorPaletteTag); + DestroySprite(sRegionMap->cursorSprite); + FreeSpriteTilesByTag(sRegionMap->cursorTileTag); + FreeSpritePaletteByTag(sRegionMap->cursorPaletteTag); } - if (gRegionMap->playerIconSprite != NULL) + if (sRegionMap->playerIconSprite != NULL) { - DestroySprite(gRegionMap->playerIconSprite); - FreeSpriteTilesByTag(gRegionMap->playerIconTileTag); - FreeSpritePaletteByTag(gRegionMap->playerIconPaletteTag); + DestroySprite(sRegionMap->playerIconSprite); + FreeSpriteTilesByTag(sRegionMap->playerIconTileTag); + FreeSpritePaletteByTag(sRegionMap->playerIconPaletteTag); } } u8 DoRegionMapInputCallback(void) { - return gRegionMap->inputCallback(); + return sRegionMap->inputCallback(); } static u8 ProcessRegionMapInput_Full(void) @@ -653,26 +653,26 @@ static u8 ProcessRegionMapInput_Full(void) u8 input; input = MAP_INPUT_NONE; - gRegionMap->cursorDeltaX = 0; - gRegionMap->cursorDeltaY = 0; - if (JOY_HELD(DPAD_UP) && gRegionMap->cursorPosY > MAPCURSOR_Y_MIN) + sRegionMap->cursorDeltaX = 0; + sRegionMap->cursorDeltaY = 0; + if (JOY_HELD(DPAD_UP) && sRegionMap->cursorPosY > MAPCURSOR_Y_MIN) { - gRegionMap->cursorDeltaY = -1; + sRegionMap->cursorDeltaY = -1; input = MAP_INPUT_MOVE_START; } - if (JOY_HELD(DPAD_DOWN) && gRegionMap->cursorPosY < MAPCURSOR_Y_MAX) + if (JOY_HELD(DPAD_DOWN) && sRegionMap->cursorPosY < MAPCURSOR_Y_MAX) { - gRegionMap->cursorDeltaY = +1; + sRegionMap->cursorDeltaY = +1; input = MAP_INPUT_MOVE_START; } - if (JOY_HELD(DPAD_LEFT) && gRegionMap->cursorPosX > MAPCURSOR_X_MIN) + if (JOY_HELD(DPAD_LEFT) && sRegionMap->cursorPosX > MAPCURSOR_X_MIN) { - gRegionMap->cursorDeltaX = -1; + sRegionMap->cursorDeltaX = -1; input = MAP_INPUT_MOVE_START; } - if (JOY_HELD(DPAD_RIGHT) && gRegionMap->cursorPosX < MAPCURSOR_X_MAX) + if (JOY_HELD(DPAD_RIGHT) && sRegionMap->cursorPosX < MAPCURSOR_X_MAX) { - gRegionMap->cursorDeltaX = +1; + sRegionMap->cursorDeltaX = +1; input = MAP_INPUT_MOVE_START; } if (JOY_NEW(A_BUTTON)) @@ -685,8 +685,8 @@ static u8 ProcessRegionMapInput_Full(void) } if (input == MAP_INPUT_MOVE_START) { - gRegionMap->cursorMovementFrameCounter = 4; - gRegionMap->inputCallback = MoveRegionMapCursor_Full; + sRegionMap->cursorMovementFrameCounter = 4; + sRegionMap->inputCallback = MoveRegionMapCursor_Full; } return input; } @@ -695,35 +695,35 @@ static u8 MoveRegionMapCursor_Full(void) { u16 mapSecId; - if (gRegionMap->cursorMovementFrameCounter != 0) + if (sRegionMap->cursorMovementFrameCounter != 0) return MAP_INPUT_MOVE_CONT; - if (gRegionMap->cursorDeltaX > 0) + if (sRegionMap->cursorDeltaX > 0) { - gRegionMap->cursorPosX++; + sRegionMap->cursorPosX++; } - if (gRegionMap->cursorDeltaX < 0) + if (sRegionMap->cursorDeltaX < 0) { - gRegionMap->cursorPosX--; + sRegionMap->cursorPosX--; } - if (gRegionMap->cursorDeltaY > 0) + if (sRegionMap->cursorDeltaY > 0) { - gRegionMap->cursorPosY++; + sRegionMap->cursorPosY++; } - if (gRegionMap->cursorDeltaY < 0) + if (sRegionMap->cursorDeltaY < 0) { - gRegionMap->cursorPosY--; + sRegionMap->cursorPosY--; } - mapSecId = GetMapSecIdAt(gRegionMap->cursorPosX, gRegionMap->cursorPosY); - gRegionMap->mapSecType = GetMapsecType(mapSecId); - if (mapSecId != gRegionMap->mapSecId) + mapSecId = GetMapSecIdAt(sRegionMap->cursorPosX, sRegionMap->cursorPosY); + sRegionMap->mapSecType = GetMapsecType(mapSecId); + if (mapSecId != sRegionMap->mapSecId) { - gRegionMap->mapSecId = mapSecId; - GetMapName(gRegionMap->mapSecName, gRegionMap->mapSecId, MAP_NAME_LENGTH); + sRegionMap->mapSecId = mapSecId; + GetMapName(sRegionMap->mapSecName, sRegionMap->mapSecId, MAP_NAME_LENGTH); } GetPositionOfCursorWithinMapSec(); - gRegionMap->inputCallback = ProcessRegionMapInput_Full; + sRegionMap->inputCallback = ProcessRegionMapInput_Full; return MAP_INPUT_MOVE_END; } @@ -732,26 +732,26 @@ static u8 ProcessRegionMapInput_Zoomed(void) u8 input; input = MAP_INPUT_NONE; - gRegionMap->zoomedCursorDeltaX = 0; - gRegionMap->zoomedCursorDeltaY = 0; - if (JOY_HELD(DPAD_UP) && gRegionMap->scrollY > -0x34) + sRegionMap->zoomedCursorDeltaX = 0; + sRegionMap->zoomedCursorDeltaY = 0; + if (JOY_HELD(DPAD_UP) && sRegionMap->scrollY > -0x34) { - gRegionMap->zoomedCursorDeltaY = -1; + sRegionMap->zoomedCursorDeltaY = -1; input = MAP_INPUT_MOVE_START; } - if (JOY_HELD(DPAD_DOWN) && gRegionMap->scrollY < 0x3c) + if (JOY_HELD(DPAD_DOWN) && sRegionMap->scrollY < 0x3c) { - gRegionMap->zoomedCursorDeltaY = +1; + sRegionMap->zoomedCursorDeltaY = +1; input = MAP_INPUT_MOVE_START; } - if (JOY_HELD(DPAD_LEFT) && gRegionMap->scrollX > -0x2c) + if (JOY_HELD(DPAD_LEFT) && sRegionMap->scrollX > -0x2c) { - gRegionMap->zoomedCursorDeltaX = -1; + sRegionMap->zoomedCursorDeltaX = -1; input = MAP_INPUT_MOVE_START; } - if (JOY_HELD(DPAD_RIGHT) && gRegionMap->scrollX < 0xac) + if (JOY_HELD(DPAD_RIGHT) && sRegionMap->scrollX < 0xac) { - gRegionMap->zoomedCursorDeltaX = +1; + sRegionMap->zoomedCursorDeltaX = +1; input = MAP_INPUT_MOVE_START; } if (JOY_NEW(A_BUTTON)) @@ -764,8 +764,8 @@ static u8 ProcessRegionMapInput_Zoomed(void) } if (input == MAP_INPUT_MOVE_START) { - gRegionMap->inputCallback = MoveRegionMapCursor_Zoomed; - gRegionMap->zoomedCursorMovementFrameCounter = 0; + sRegionMap->inputCallback = MoveRegionMapCursor_Zoomed; + sRegionMap->zoomedCursorMovementFrameCounter = 0; } return input; } @@ -776,29 +776,29 @@ static u8 MoveRegionMapCursor_Zoomed(void) u16 y; u16 mapSecId; - gRegionMap->scrollY += gRegionMap->zoomedCursorDeltaY; - gRegionMap->scrollX += gRegionMap->zoomedCursorDeltaX; - RegionMap_SetBG2XAndBG2Y(gRegionMap->scrollX, gRegionMap->scrollY); - gRegionMap->zoomedCursorMovementFrameCounter++; - if (gRegionMap->zoomedCursorMovementFrameCounter == 8) + sRegionMap->scrollY += sRegionMap->zoomedCursorDeltaY; + sRegionMap->scrollX += sRegionMap->zoomedCursorDeltaX; + RegionMap_SetBG2XAndBG2Y(sRegionMap->scrollX, sRegionMap->scrollY); + sRegionMap->zoomedCursorMovementFrameCounter++; + if (sRegionMap->zoomedCursorMovementFrameCounter == 8) { - x = (gRegionMap->scrollX + 0x2c) / 8 + 1; - y = (gRegionMap->scrollY + 0x34) / 8 + 2; - if (x != gRegionMap->zoomedCursorPosX || y != gRegionMap->zoomedCursorPosY) + x = (sRegionMap->scrollX + 0x2c) / 8 + 1; + y = (sRegionMap->scrollY + 0x34) / 8 + 2; + if (x != sRegionMap->zoomedCursorPosX || y != sRegionMap->zoomedCursorPosY) { - gRegionMap->zoomedCursorPosX = x; - gRegionMap->zoomedCursorPosY = y; + sRegionMap->zoomedCursorPosX = x; + sRegionMap->zoomedCursorPosY = y; mapSecId = GetMapSecIdAt(x, y); - gRegionMap->mapSecType = GetMapsecType(mapSecId); - if (mapSecId != gRegionMap->mapSecId) + sRegionMap->mapSecType = GetMapsecType(mapSecId); + if (mapSecId != sRegionMap->mapSecId) { - gRegionMap->mapSecId = mapSecId; - GetMapName(gRegionMap->mapSecName, gRegionMap->mapSecId, MAP_NAME_LENGTH); + sRegionMap->mapSecId = mapSecId; + GetMapName(sRegionMap->mapSecName, sRegionMap->mapSecId, MAP_NAME_LENGTH); } GetPositionOfCursorWithinMapSec(); } - gRegionMap->zoomedCursorMovementFrameCounter = 0; - gRegionMap->inputCallback = ProcessRegionMapInput_Zoomed; + sRegionMap->zoomedCursorMovementFrameCounter = 0; + sRegionMap->inputCallback = ProcessRegionMapInput_Zoomed; return MAP_INPUT_MOVE_END; } return MAP_INPUT_MOVE_CONT; @@ -806,35 +806,35 @@ static u8 MoveRegionMapCursor_Zoomed(void) void SetRegionMapDataForZoom(void) { - if (gRegionMap->zoomed == FALSE) + if (sRegionMap->zoomed == FALSE) { - gRegionMap->scrollY = 0; - gRegionMap->scrollX = 0; - gRegionMap->unk_040 = 0; - gRegionMap->unk_03c = 0; - gRegionMap->unk_060 = gRegionMap->cursorPosX * 8 - 0x34; - gRegionMap->unk_062 = gRegionMap->cursorPosY * 8 - 0x44; - gRegionMap->unk_044 = (gRegionMap->unk_060 << 8) / 16; - gRegionMap->unk_048 = (gRegionMap->unk_062 << 8) / 16; - gRegionMap->zoomedCursorPosX = gRegionMap->cursorPosX; - gRegionMap->zoomedCursorPosY = gRegionMap->cursorPosY; - gRegionMap->unk_04c = 0x10000; - gRegionMap->unk_050 = -0x800; + sRegionMap->scrollY = 0; + sRegionMap->scrollX = 0; + sRegionMap->unk_040 = 0; + sRegionMap->unk_03c = 0; + sRegionMap->unk_060 = sRegionMap->cursorPosX * 8 - 0x34; + sRegionMap->unk_062 = sRegionMap->cursorPosY * 8 - 0x44; + sRegionMap->unk_044 = (sRegionMap->unk_060 << 8) / 16; + sRegionMap->unk_048 = (sRegionMap->unk_062 << 8) / 16; + sRegionMap->zoomedCursorPosX = sRegionMap->cursorPosX; + sRegionMap->zoomedCursorPosY = sRegionMap->cursorPosY; + sRegionMap->unk_04c = 0x10000; + sRegionMap->unk_050 = -0x800; } else { - gRegionMap->unk_03c = gRegionMap->scrollX * 0x100; - gRegionMap->unk_040 = gRegionMap->scrollY * 0x100; - gRegionMap->unk_060 = 0; - gRegionMap->unk_062 = 0; - gRegionMap->unk_044 = -(gRegionMap->unk_03c / 16); - gRegionMap->unk_048 = -(gRegionMap->unk_040 / 16); - gRegionMap->cursorPosX = gRegionMap->zoomedCursorPosX; - gRegionMap->cursorPosY = gRegionMap->zoomedCursorPosY; - gRegionMap->unk_04c = 0x8000; - gRegionMap->unk_050 = 0x800; + sRegionMap->unk_03c = sRegionMap->scrollX * 0x100; + sRegionMap->unk_040 = sRegionMap->scrollY * 0x100; + sRegionMap->unk_060 = 0; + sRegionMap->unk_062 = 0; + sRegionMap->unk_044 = -(sRegionMap->unk_03c / 16); + sRegionMap->unk_048 = -(sRegionMap->unk_040 / 16); + sRegionMap->cursorPosX = sRegionMap->zoomedCursorPosX; + sRegionMap->cursorPosY = sRegionMap->zoomedCursorPosY; + sRegionMap->unk_04c = 0x8000; + sRegionMap->unk_050 = 0x800; } - gRegionMap->unk_06e = 0; + sRegionMap->unk_06e = 0; FreeRegionMapCursorSprite(); HideRegionMapPlayerIcon(); } @@ -843,60 +843,60 @@ bool8 UpdateRegionMapZoom(void) { bool8 retVal; - if (gRegionMap->unk_06e >= 16) + if (sRegionMap->unk_06e >= 16) { return FALSE; } - gRegionMap->unk_06e++; - if (gRegionMap->unk_06e == 16) + sRegionMap->unk_06e++; + if (sRegionMap->unk_06e == 16) { - gRegionMap->unk_044 = 0; - gRegionMap->unk_048 = 0; - gRegionMap->scrollX = gRegionMap->unk_060; - gRegionMap->scrollY = gRegionMap->unk_062; - gRegionMap->unk_04c = (gRegionMap->zoomed == FALSE) ? (128 << 8) : (256 << 8); - gRegionMap->zoomed = !gRegionMap->zoomed; - gRegionMap->inputCallback = (gRegionMap->zoomed == FALSE) ? ProcessRegionMapInput_Full : ProcessRegionMapInput_Zoomed; - CreateRegionMapCursor(gRegionMap->cursorTileTag, gRegionMap->cursorPaletteTag); + sRegionMap->unk_044 = 0; + sRegionMap->unk_048 = 0; + sRegionMap->scrollX = sRegionMap->unk_060; + sRegionMap->scrollY = sRegionMap->unk_062; + sRegionMap->unk_04c = (sRegionMap->zoomed == FALSE) ? (128 << 8) : (256 << 8); + sRegionMap->zoomed = !sRegionMap->zoomed; + sRegionMap->inputCallback = (sRegionMap->zoomed == FALSE) ? ProcessRegionMapInput_Full : ProcessRegionMapInput_Zoomed; + CreateRegionMapCursor(sRegionMap->cursorTileTag, sRegionMap->cursorPaletteTag); UnhideRegionMapPlayerIcon(); retVal = FALSE; } else { - gRegionMap->unk_03c += gRegionMap->unk_044; - gRegionMap->unk_040 += gRegionMap->unk_048; - gRegionMap->scrollX = gRegionMap->unk_03c >> 8; - gRegionMap->scrollY = gRegionMap->unk_040 >> 8; - gRegionMap->unk_04c += gRegionMap->unk_050; - if ((gRegionMap->unk_044 < 0 && gRegionMap->scrollX < gRegionMap->unk_060) || (gRegionMap->unk_044 > 0 && gRegionMap->scrollX > gRegionMap->unk_060)) + sRegionMap->unk_03c += sRegionMap->unk_044; + sRegionMap->unk_040 += sRegionMap->unk_048; + sRegionMap->scrollX = sRegionMap->unk_03c >> 8; + sRegionMap->scrollY = sRegionMap->unk_040 >> 8; + sRegionMap->unk_04c += sRegionMap->unk_050; + if ((sRegionMap->unk_044 < 0 && sRegionMap->scrollX < sRegionMap->unk_060) || (sRegionMap->unk_044 > 0 && sRegionMap->scrollX > sRegionMap->unk_060)) { - gRegionMap->scrollX = gRegionMap->unk_060; - gRegionMap->unk_044 = 0; + sRegionMap->scrollX = sRegionMap->unk_060; + sRegionMap->unk_044 = 0; } - if ((gRegionMap->unk_048 < 0 && gRegionMap->scrollY < gRegionMap->unk_062) || (gRegionMap->unk_048 > 0 && gRegionMap->scrollY > gRegionMap->unk_062)) + if ((sRegionMap->unk_048 < 0 && sRegionMap->scrollY < sRegionMap->unk_062) || (sRegionMap->unk_048 > 0 && sRegionMap->scrollY > sRegionMap->unk_062)) { - gRegionMap->scrollY = gRegionMap->unk_062; - gRegionMap->unk_048 = 0; + sRegionMap->scrollY = sRegionMap->unk_062; + sRegionMap->unk_048 = 0; } - if (gRegionMap->zoomed == FALSE) + if (sRegionMap->zoomed == FALSE) { - if (gRegionMap->unk_04c < (128 << 8)) + if (sRegionMap->unk_04c < (128 << 8)) { - gRegionMap->unk_04c = (128 << 8); - gRegionMap->unk_050 = 0; + sRegionMap->unk_04c = (128 << 8); + sRegionMap->unk_050 = 0; } } else { - if (gRegionMap->unk_04c > (256 << 8)) + if (sRegionMap->unk_04c > (256 << 8)) { - gRegionMap->unk_04c = (256 << 8); - gRegionMap->unk_050 = 0; + sRegionMap->unk_04c = (256 << 8); + sRegionMap->unk_050 = 0; } } retVal = TRUE; } - CalcZoomScrollParams(gRegionMap->scrollX, gRegionMap->scrollY, 0x38, 0x48, gRegionMap->unk_04c >> 8, gRegionMap->unk_04c >> 8, 0); + CalcZoomScrollParams(sRegionMap->scrollX, sRegionMap->scrollY, 0x38, 0x48, sRegionMap->unk_04c >> 8, sRegionMap->unk_04c >> 8, 0); return retVal; } @@ -907,42 +907,42 @@ static void CalcZoomScrollParams(s16 scrollX, s16 scrollY, s16 c, s16 d, u16 e, s32 var3; s32 var4; - gRegionMap->bg2pa = e * gSineTable[rotation + 64] >> 8; - gRegionMap->bg2pc = e * -gSineTable[rotation] >> 8; - gRegionMap->bg2pb = f * gSineTable[rotation] >> 8; - gRegionMap->bg2pd = f * gSineTable[rotation + 64] >> 8; + sRegionMap->bg2pa = e * gSineTable[rotation + 64] >> 8; + sRegionMap->bg2pc = e * -gSineTable[rotation] >> 8; + sRegionMap->bg2pb = f * gSineTable[rotation] >> 8; + sRegionMap->bg2pd = f * gSineTable[rotation + 64] >> 8; var1 = (scrollX << 8) + (c << 8); - var2 = d * gRegionMap->bg2pb + gRegionMap->bg2pa * c; - gRegionMap->bg2x = var1 - var2; + var2 = d * sRegionMap->bg2pb + sRegionMap->bg2pa * c; + sRegionMap->bg2x = var1 - var2; var3 = (scrollY << 8) + (d << 8); - var4 = gRegionMap->bg2pd * d + gRegionMap->bg2pc * c; - gRegionMap->bg2y = var3 - var4; + var4 = sRegionMap->bg2pd * d + sRegionMap->bg2pc * c; + sRegionMap->bg2y = var3 - var4; - gRegionMap->needUpdateVideoRegs = TRUE; + sRegionMap->needUpdateVideoRegs = TRUE; } static void RegionMap_SetBG2XAndBG2Y(s16 x, s16 y) { - gRegionMap->bg2x = (x << 8) + 0x1c00; - gRegionMap->bg2y = (y << 8) + 0x2400; - gRegionMap->needUpdateVideoRegs = TRUE; + sRegionMap->bg2x = (x << 8) + 0x1c00; + sRegionMap->bg2y = (y << 8) + 0x2400; + sRegionMap->needUpdateVideoRegs = TRUE; } void UpdateRegionMapVideoRegs(void) { - if (gRegionMap->needUpdateVideoRegs) + if (sRegionMap->needUpdateVideoRegs) { - SetGpuReg(REG_OFFSET_BG2PA, gRegionMap->bg2pa); - SetGpuReg(REG_OFFSET_BG2PB, gRegionMap->bg2pb); - SetGpuReg(REG_OFFSET_BG2PC, gRegionMap->bg2pc); - SetGpuReg(REG_OFFSET_BG2PD, gRegionMap->bg2pd); - SetGpuReg(REG_OFFSET_BG2X_L, gRegionMap->bg2x); - SetGpuReg(REG_OFFSET_BG2X_H, gRegionMap->bg2x >> 16); - SetGpuReg(REG_OFFSET_BG2Y_L, gRegionMap->bg2y); - SetGpuReg(REG_OFFSET_BG2Y_H, gRegionMap->bg2y >> 16); - gRegionMap->needUpdateVideoRegs = FALSE; + SetGpuReg(REG_OFFSET_BG2PA, sRegionMap->bg2pa); + SetGpuReg(REG_OFFSET_BG2PB, sRegionMap->bg2pb); + SetGpuReg(REG_OFFSET_BG2PC, sRegionMap->bg2pc); + SetGpuReg(REG_OFFSET_BG2PD, sRegionMap->bg2pd); + SetGpuReg(REG_OFFSET_BG2X_L, sRegionMap->bg2x); + SetGpuReg(REG_OFFSET_BG2X_H, sRegionMap->bg2x >> 16); + SetGpuReg(REG_OFFSET_BG2Y_L, sRegionMap->bg2y); + SetGpuReg(REG_OFFSET_BG2Y_H, sRegionMap->bg2y >> 16); + sRegionMap->needUpdateVideoRegs = FALSE; } } @@ -950,10 +950,10 @@ void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y) { CalcZoomScrollParams(x, y, 0x38, 0x48, 0x100, 0x100, 0); UpdateRegionMapVideoRegs(); - if (gRegionMap->playerIconSprite != NULL) + if (sRegionMap->playerIconSprite != NULL) { - gRegionMap->playerIconSprite->x2 = -x; - gRegionMap->playerIconSprite->y2 = -y; + sRegionMap->playerIconSprite->x2 = -x; + sRegionMap->playerIconSprite->y2 = -y; } } @@ -996,22 +996,22 @@ static void InitMapBasedOnPlayerLocation(void) case MAP_TYPE_ROUTE: case MAP_TYPE_UNDERWATER: case MAP_TYPE_OCEAN_ROUTE: - gRegionMap->mapSecId = gMapHeader.regionMapSectionId; - gRegionMap->playerIsInCave = FALSE; + sRegionMap->mapSecId = gMapHeader.regionMapSectionId; + sRegionMap->playerIsInCave = FALSE; mapWidth = gMapHeader.mapLayout->width; mapHeight = gMapHeader.mapLayout->height; x = gSaveBlock1Ptr->pos.x; y = gSaveBlock1Ptr->pos.y; - if (gRegionMap->mapSecId == MAPSEC_UNDERWATER_SEAFLOOR_CAVERN || gRegionMap->mapSecId == MAPSEC_UNDERWATER_MARINE_CAVE) - gRegionMap->playerIsInCave = TRUE; + if (sRegionMap->mapSecId == MAPSEC_UNDERWATER_SEAFLOOR_CAVERN || sRegionMap->mapSecId == MAPSEC_UNDERWATER_MARINE_CAVE) + sRegionMap->playerIsInCave = TRUE; break; case MAP_TYPE_UNDERGROUND: case MAP_TYPE_UNKNOWN: if (gMapHeader.allowEscaping) { mapHeader = Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->escapeWarp.mapGroup, gSaveBlock1Ptr->escapeWarp.mapNum); - gRegionMap->mapSecId = mapHeader->regionMapSectionId; - gRegionMap->playerIsInCave = TRUE; + sRegionMap->mapSecId = mapHeader->regionMapSectionId; + sRegionMap->playerIsInCave = TRUE; mapWidth = mapHeader->mapLayout->width; mapHeight = mapHeader->mapLayout->height; x = gSaveBlock1Ptr->escapeWarp.x; @@ -1019,8 +1019,8 @@ static void InitMapBasedOnPlayerLocation(void) } else { - gRegionMap->mapSecId = gMapHeader.regionMapSectionId; - gRegionMap->playerIsInCave = TRUE; + sRegionMap->mapSecId = gMapHeader.regionMapSectionId; + sRegionMap->playerIsInCave = TRUE; mapWidth = 1; mapHeight = 1; x = 1; @@ -1029,16 +1029,16 @@ static void InitMapBasedOnPlayerLocation(void) break; case MAP_TYPE_SECRET_BASE: mapHeader = Overworld_GetMapHeaderByGroupAndId((u16)gSaveBlock1Ptr->dynamicWarp.mapGroup, (u16)gSaveBlock1Ptr->dynamicWarp.mapNum); - gRegionMap->mapSecId = mapHeader->regionMapSectionId; - gRegionMap->playerIsInCave = TRUE; + sRegionMap->mapSecId = mapHeader->regionMapSectionId; + sRegionMap->playerIsInCave = TRUE; mapWidth = mapHeader->mapLayout->width; mapHeight = mapHeader->mapLayout->height; x = gSaveBlock1Ptr->dynamicWarp.x; y = gSaveBlock1Ptr->dynamicWarp.y; break; case MAP_TYPE_INDOOR: - gRegionMap->mapSecId = gMapHeader.regionMapSectionId; - if (gRegionMap->mapSecId != MAPSEC_DYNAMIC) + sRegionMap->mapSecId = gMapHeader.regionMapSectionId; + if (sRegionMap->mapSecId != MAPSEC_DYNAMIC) { warp = &gSaveBlock1Ptr->escapeWarp; mapHeader = Overworld_GetMapHeaderByGroupAndId(warp->mapGroup, warp->mapNum); @@ -1047,13 +1047,13 @@ static void InitMapBasedOnPlayerLocation(void) { warp = &gSaveBlock1Ptr->dynamicWarp; mapHeader = Overworld_GetMapHeaderByGroupAndId(warp->mapGroup, warp->mapNum); - gRegionMap->mapSecId = mapHeader->regionMapSectionId; + sRegionMap->mapSecId = mapHeader->regionMapSectionId; } - if (IsPlayerInAquaHideout(gRegionMap->mapSecId)) - gRegionMap->playerIsInCave = TRUE; + if (IsPlayerInAquaHideout(sRegionMap->mapSecId)) + sRegionMap->playerIsInCave = TRUE; else - gRegionMap->playerIsInCave = FALSE; + sRegionMap->playerIsInCave = FALSE; mapWidth = mapHeader->mapLayout->width; mapHeight = mapHeader->mapLayout->height; @@ -1064,29 +1064,29 @@ static void InitMapBasedOnPlayerLocation(void) xOnMap = x; - dimensionScale = mapWidth / gRegionMapEntries[gRegionMap->mapSecId].width; + dimensionScale = mapWidth / gRegionMapEntries[sRegionMap->mapSecId].width; if (dimensionScale == 0) { dimensionScale = 1; } x /= dimensionScale; - if (x >= gRegionMapEntries[gRegionMap->mapSecId].width) + if (x >= gRegionMapEntries[sRegionMap->mapSecId].width) { - x = gRegionMapEntries[gRegionMap->mapSecId].width - 1; + x = gRegionMapEntries[sRegionMap->mapSecId].width - 1; } - dimensionScale = mapHeight / gRegionMapEntries[gRegionMap->mapSecId].height; + dimensionScale = mapHeight / gRegionMapEntries[sRegionMap->mapSecId].height; if (dimensionScale == 0) { dimensionScale = 1; } y /= dimensionScale; - if (y >= gRegionMapEntries[gRegionMap->mapSecId].height) + if (y >= gRegionMapEntries[sRegionMap->mapSecId].height) { - y = gRegionMapEntries[gRegionMap->mapSecId].height - 1; + y = gRegionMapEntries[sRegionMap->mapSecId].height - 1; } - switch (gRegionMap->mapSecId) + switch (sRegionMap->mapSecId) { case MAPSEC_ROUTE_114: if (y != 0) @@ -1116,11 +1116,11 @@ static void InitMapBasedOnPlayerLocation(void) x++; break; case MAPSEC_UNDERWATER_MARINE_CAVE: - GetMarineCaveCoords(&gRegionMap->cursorPosX, &gRegionMap->cursorPosY); + GetMarineCaveCoords(&sRegionMap->cursorPosX, &sRegionMap->cursorPosY); return; } - gRegionMap->cursorPosX = gRegionMapEntries[gRegionMap->mapSecId].x + x + MAPCURSOR_X_MIN; - gRegionMap->cursorPosY = gRegionMapEntries[gRegionMap->mapSecId].y + y + MAPCURSOR_Y_MIN; + sRegionMap->cursorPosX = gRegionMapEntries[sRegionMap->mapSecId].x + x + MAPCURSOR_X_MIN; + sRegionMap->cursorPosY = gRegionMapEntries[sRegionMap->mapSecId].y + y + MAPCURSOR_Y_MIN; } static void RegionMap_InitializeStateBasedOnSSTidalLocation(void) @@ -1139,40 +1139,40 @@ static void RegionMap_InitializeStateBasedOnSSTidalLocation(void) switch (GetSSTidalLocation(&mapGroup, &mapNum, &xOnMap, &yOnMap)) { case SS_TIDAL_LOCATION_SLATEPORT: - gRegionMap->mapSecId = MAPSEC_SLATEPORT_CITY; + sRegionMap->mapSecId = MAPSEC_SLATEPORT_CITY; break; case SS_TIDAL_LOCATION_LILYCOVE: - gRegionMap->mapSecId = MAPSEC_LILYCOVE_CITY; + sRegionMap->mapSecId = MAPSEC_LILYCOVE_CITY; break; case SS_TIDAL_LOCATION_ROUTE124: - gRegionMap->mapSecId = MAPSEC_ROUTE_124; + sRegionMap->mapSecId = MAPSEC_ROUTE_124; break; case SS_TIDAL_LOCATION_ROUTE131: - gRegionMap->mapSecId = MAPSEC_ROUTE_131; + sRegionMap->mapSecId = MAPSEC_ROUTE_131; break; default: case SS_TIDAL_LOCATION_CURRENTS: mapHeader = Overworld_GetMapHeaderByGroupAndId(mapGroup, mapNum); - gRegionMap->mapSecId = mapHeader->regionMapSectionId; - dimensionScale = mapHeader->mapLayout->width / gRegionMapEntries[gRegionMap->mapSecId].width; + sRegionMap->mapSecId = mapHeader->regionMapSectionId; + dimensionScale = mapHeader->mapLayout->width / gRegionMapEntries[sRegionMap->mapSecId].width; if (dimensionScale == 0) dimensionScale = 1; x = xOnMap / dimensionScale; - if (x >= gRegionMapEntries[gRegionMap->mapSecId].width) - x = gRegionMapEntries[gRegionMap->mapSecId].width - 1; + if (x >= gRegionMapEntries[sRegionMap->mapSecId].width) + x = gRegionMapEntries[sRegionMap->mapSecId].width - 1; - dimensionScale = mapHeader->mapLayout->height / gRegionMapEntries[gRegionMap->mapSecId].height; + dimensionScale = mapHeader->mapLayout->height / gRegionMapEntries[sRegionMap->mapSecId].height; if (dimensionScale == 0) dimensionScale = 1; y = yOnMap / dimensionScale; - if (y >= gRegionMapEntries[gRegionMap->mapSecId].height) - y = gRegionMapEntries[gRegionMap->mapSecId].height - 1; + if (y >= gRegionMapEntries[sRegionMap->mapSecId].height) + y = gRegionMapEntries[sRegionMap->mapSecId].height - 1; break; } - gRegionMap->playerIsInCave = FALSE; - gRegionMap->cursorPosX = gRegionMapEntries[gRegionMap->mapSecId].x + x + MAPCURSOR_X_MIN; - gRegionMap->cursorPosY = gRegionMapEntries[gRegionMap->mapSecId].y + y + MAPCURSOR_Y_MIN; + sRegionMap->playerIsInCave = FALSE; + sRegionMap->cursorPosX = gRegionMapEntries[sRegionMap->mapSecId].x + x + MAPCURSOR_X_MIN; + sRegionMap->cursorPosY = gRegionMapEntries[sRegionMap->mapSecId].y + y + MAPCURSOR_Y_MIN; } static u8 GetMapsecType(u16 mapSecId) @@ -1300,20 +1300,20 @@ static void GetPositionOfCursorWithinMapSec(void) u16 y; u16 posWithinMapSec; - if (gRegionMap->mapSecId == MAPSEC_NONE) + if (sRegionMap->mapSecId == MAPSEC_NONE) { - gRegionMap->posWithinMapSec = 0; + sRegionMap->posWithinMapSec = 0; return; } - if (!gRegionMap->zoomed) + if (!sRegionMap->zoomed) { - x = gRegionMap->cursorPosX; - y = gRegionMap->cursorPosY; + x = sRegionMap->cursorPosX; + y = sRegionMap->cursorPosY; } else { - x = gRegionMap->zoomedCursorPosX; - y = gRegionMap->zoomedCursorPosY; + x = sRegionMap->zoomedCursorPosX; + y = sRegionMap->zoomedCursorPosY; } posWithinMapSec = 0; while (1) @@ -1333,13 +1333,13 @@ static void GetPositionOfCursorWithinMapSec(void) else { x--; - if (GetMapSecIdAt(x, y) == gRegionMap->mapSecId) + if (GetMapSecIdAt(x, y) == sRegionMap->mapSecId) { posWithinMapSec++; } } } - gRegionMap->posWithinMapSec = posWithinMapSec; + sRegionMap->posWithinMapSec = posWithinMapSec; } static bool8 RegionMap_IsMapSecIdInNextRow(u16 y) @@ -1352,7 +1352,7 @@ static bool8 RegionMap_IsMapSecIdInNextRow(u16 y) } for (x = MAPCURSOR_X_MIN; x <= MAPCURSOR_X_MAX; x++) { - if (GetMapSecIdAt(x, y) == gRegionMap->mapSecId) + if (GetMapSecIdAt(x, y) == sRegionMap->mapSecId) { return TRUE; } @@ -1362,11 +1362,11 @@ static bool8 RegionMap_IsMapSecIdInNextRow(u16 y) static void SpriteCB_CursorMapFull(struct Sprite *sprite) { - if (gRegionMap->cursorMovementFrameCounter != 0) + if (sRegionMap->cursorMovementFrameCounter != 0) { - sprite->x += 2 * gRegionMap->cursorDeltaX; - sprite->y += 2 * gRegionMap->cursorDeltaY; - gRegionMap->cursorMovementFrameCounter--; + sprite->x += 2 * sRegionMap->cursorDeltaX; + sprite->y += 2 * sRegionMap->cursorDeltaY; + sRegionMap->cursorMovementFrameCounter--; } } @@ -1386,20 +1386,20 @@ void CreateRegionMapCursor(u16 tileTag, u16 paletteTag) template = sRegionMapCursorSpriteTemplate; sheet.tag = tileTag; template.tileTag = tileTag; - gRegionMap->cursorTileTag = tileTag; + sRegionMap->cursorTileTag = tileTag; palette.tag = paletteTag; template.paletteTag = paletteTag; - gRegionMap->cursorPaletteTag = paletteTag; - if (!gRegionMap->zoomed) + sRegionMap->cursorPaletteTag = paletteTag; + if (!sRegionMap->zoomed) { - sheet.data = gRegionMap->cursorSmallImage; - sheet.size = sizeof(gRegionMap->cursorSmallImage); + sheet.data = sRegionMap->cursorSmallImage; + sheet.size = sizeof(sRegionMap->cursorSmallImage); template.callback = SpriteCB_CursorMapFull; } else { - sheet.data = gRegionMap->cursorLargeImage; - sheet.size = sizeof(gRegionMap->cursorLargeImage); + sheet.data = sRegionMap->cursorLargeImage; + sheet.size = sizeof(sRegionMap->cursorLargeImage); template.callback = SpriteCB_CursorMapZoomed; } LoadSpriteSheet(&sheet); @@ -1407,46 +1407,46 @@ void CreateRegionMapCursor(u16 tileTag, u16 paletteTag) spriteId = CreateSprite(&template, 0x38, 0x48, 0); if (spriteId != MAX_SPRITES) { - gRegionMap->cursorSprite = &gSprites[spriteId]; - if (gRegionMap->zoomed == TRUE) + sRegionMap->cursorSprite = &gSprites[spriteId]; + if (sRegionMap->zoomed == TRUE) { - gRegionMap->cursorSprite->oam.size = SPRITE_SIZE(32x32); - gRegionMap->cursorSprite->x -= 8; - gRegionMap->cursorSprite->y -= 8; - StartSpriteAnim(gRegionMap->cursorSprite, 1); + sRegionMap->cursorSprite->oam.size = SPRITE_SIZE(32x32); + sRegionMap->cursorSprite->x -= 8; + sRegionMap->cursorSprite->y -= 8; + StartSpriteAnim(sRegionMap->cursorSprite, 1); } else { - gRegionMap->cursorSprite->oam.size = SPRITE_SIZE(16x16); - gRegionMap->cursorSprite->x = 8 * gRegionMap->cursorPosX + 4; - gRegionMap->cursorSprite->y = 8 * gRegionMap->cursorPosY + 4; + sRegionMap->cursorSprite->oam.size = SPRITE_SIZE(16x16); + sRegionMap->cursorSprite->x = 8 * sRegionMap->cursorPosX + 4; + sRegionMap->cursorSprite->y = 8 * sRegionMap->cursorPosY + 4; } - gRegionMap->cursorSprite->data[1] = 2; - gRegionMap->cursorSprite->data[2] = (IndexOfSpritePaletteTag(paletteTag) << 4) + 0x101; - gRegionMap->cursorSprite->data[3] = TRUE; + sRegionMap->cursorSprite->data[1] = 2; + sRegionMap->cursorSprite->data[2] = (IndexOfSpritePaletteTag(paletteTag) << 4) + 0x101; + sRegionMap->cursorSprite->data[3] = TRUE; } } static void FreeRegionMapCursorSprite(void) { - if (gRegionMap->cursorSprite != NULL) + if (sRegionMap->cursorSprite != NULL) { - DestroySprite(gRegionMap->cursorSprite); - FreeSpriteTilesByTag(gRegionMap->cursorTileTag); - FreeSpritePaletteByTag(gRegionMap->cursorPaletteTag); + DestroySprite(sRegionMap->cursorSprite); + FreeSpriteTilesByTag(sRegionMap->cursorTileTag); + FreeSpritePaletteByTag(sRegionMap->cursorPaletteTag); } } // Unused static void SetUnkCursorSpriteData(void) { - gRegionMap->cursorSprite->data[3] = TRUE; + sRegionMap->cursorSprite->data[3] = TRUE; } // Unused static void ClearUnkCursorSpriteData(void) { - gRegionMap->cursorSprite->data[3] = FALSE; + sRegionMap->cursorSprite->data[3] = FALSE; } void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag) @@ -1458,7 +1458,7 @@ void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag) if (IsEventIslandMapSecId(gMapHeader.regionMapSectionId)) { - gRegionMap->playerIconSprite = NULL; + sRegionMap->playerIconSprite = NULL; return; } if (gSaveBlock2Ptr->playerGender == FEMALE) @@ -1469,49 +1469,49 @@ void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag) LoadSpriteSheet(&sheet); LoadSpritePalette(&palette); spriteId = CreateSprite(&template, 0, 0, 1); - gRegionMap->playerIconSprite = &gSprites[spriteId]; - if (!gRegionMap->zoomed) + sRegionMap->playerIconSprite = &gSprites[spriteId]; + if (!sRegionMap->zoomed) { - gRegionMap->playerIconSprite->x = gRegionMap->playerIconSpritePosX * 8 + 4; - gRegionMap->playerIconSprite->y = gRegionMap->playerIconSpritePosY * 8 + 4; - gRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapFull; + sRegionMap->playerIconSprite->x = sRegionMap->playerIconSpritePosX * 8 + 4; + sRegionMap->playerIconSprite->y = sRegionMap->playerIconSpritePosY * 8 + 4; + sRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapFull; } else { - gRegionMap->playerIconSprite->x = gRegionMap->playerIconSpritePosX * 16 - 0x30; - gRegionMap->playerIconSprite->y = gRegionMap->playerIconSpritePosY * 16 - 0x42; - gRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapZoomed; + sRegionMap->playerIconSprite->x = sRegionMap->playerIconSpritePosX * 16 - 0x30; + sRegionMap->playerIconSprite->y = sRegionMap->playerIconSpritePosY * 16 - 0x42; + sRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapZoomed; } } static void HideRegionMapPlayerIcon(void) { - if (gRegionMap->playerIconSprite != NULL) + if (sRegionMap->playerIconSprite != NULL) { - gRegionMap->playerIconSprite->invisible = TRUE; - gRegionMap->playerIconSprite->callback = SpriteCallbackDummy; + sRegionMap->playerIconSprite->invisible = TRUE; + sRegionMap->playerIconSprite->callback = SpriteCallbackDummy; } } static void UnhideRegionMapPlayerIcon(void) { - if (gRegionMap->playerIconSprite != NULL) + if (sRegionMap->playerIconSprite != NULL) { - if (gRegionMap->zoomed == TRUE) + if (sRegionMap->zoomed == TRUE) { - gRegionMap->playerIconSprite->x = gRegionMap->playerIconSpritePosX * 16 - 0x30; - gRegionMap->playerIconSprite->y = gRegionMap->playerIconSpritePosY * 16 - 0x42; - gRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapZoomed; - gRegionMap->playerIconSprite->invisible = FALSE; + sRegionMap->playerIconSprite->x = sRegionMap->playerIconSpritePosX * 16 - 0x30; + sRegionMap->playerIconSprite->y = sRegionMap->playerIconSpritePosY * 16 - 0x42; + sRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapZoomed; + sRegionMap->playerIconSprite->invisible = FALSE; } else { - gRegionMap->playerIconSprite->x = gRegionMap->playerIconSpritePosX * 8 + 4; - gRegionMap->playerIconSprite->y = gRegionMap->playerIconSpritePosY * 8 + 4; - gRegionMap->playerIconSprite->x2 = 0; - gRegionMap->playerIconSprite->y2 = 0; - gRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapFull; - gRegionMap->playerIconSprite->invisible = FALSE; + sRegionMap->playerIconSprite->x = sRegionMap->playerIconSpritePosX * 8 + 4; + sRegionMap->playerIconSprite->y = sRegionMap->playerIconSpritePosY * 8 + 4; + sRegionMap->playerIconSprite->x2 = 0; + sRegionMap->playerIconSprite->y2 = 0; + sRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapFull; + sRegionMap->playerIconSprite->invisible = FALSE; } } } @@ -1523,8 +1523,8 @@ static void UnhideRegionMapPlayerIcon(void) static void SpriteCB_PlayerIconMapZoomed(struct Sprite *sprite) { - sprite->x2 = -2 * gRegionMap->scrollX; - sprite->y2 = -2 * gRegionMap->scrollY; + sprite->x2 = -2 * sRegionMap->scrollX; + sprite->y2 = -2 * sRegionMap->scrollY; sprite->sY = sprite->y + sprite->y2 + sprite->centerToCornerVecY; sprite->sX = sprite->x + sprite->x2 + sprite->centerToCornerVecX; if (sprite->sY < -8 || sprite->sY > DISPLAY_HEIGHT + 8 || sprite->sX < -8 || sprite->sX > DISPLAY_WIDTH + 8) @@ -1545,7 +1545,7 @@ static void SpriteCB_PlayerIconMapFull(struct Sprite *sprite) static void SpriteCB_PlayerIcon(struct Sprite *sprite) { - if (gRegionMap->blinkPlayerIcon) + if (sRegionMap->blinkPlayerIcon) { if (++sprite->sTimer > 16) { @@ -1561,8 +1561,8 @@ static void SpriteCB_PlayerIcon(struct Sprite *sprite) void TrySetPlayerIconBlink(void) { - if (gRegionMap->playerIsInCave) - gRegionMap->blinkPlayerIcon = TRUE; + if (sRegionMap->playerIsInCave) + sRegionMap->blinkPlayerIcon = TRUE; } #undef sY @@ -1634,7 +1634,7 @@ static void GetMapSecDimensions(u16 mapSecId, u16 *x, u16 *y, u16 *width, u16 *h bool8 IsRegionMapZoomed(void) { - return gRegionMap->zoomed; + return sRegionMap->zoomed; } bool32 IsEventIslandMapSecId(u8 mapSecId) diff --git a/src/rotating_gate.c b/src/rotating_gate.c index f839d22c3..e2fd575a1 100644 --- a/src/rotating_gate.c +++ b/src/rotating_gate.c @@ -612,12 +612,10 @@ static const u8 sRotatingGate_ArmLayout[][4 * 2] = }, }; -// ewram -static EWRAM_DATA u8 gRotatingGate_GateSpriteIds[ROTATING_GATE_PUZZLE_MAX] = {0}; -static EWRAM_DATA const struct RotatingGatePuzzle *gRotatingGate_PuzzleConfig = NULL; -static EWRAM_DATA u8 gRotatingGate_PuzzleCount = 0; +static EWRAM_DATA u8 sRotatingGate_GateSpriteIds[ROTATING_GATE_PUZZLE_MAX] = {0}; +static EWRAM_DATA const struct RotatingGatePuzzle *sRotatingGate_PuzzleConfig = NULL; +static EWRAM_DATA u8 sRotatingGate_PuzzleCount = 0; -// text static s32 GetCurrentMapRotatingGatePuzzleType(void) { if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(FORTREE_CITY_GYM) && @@ -640,9 +638,9 @@ static void RotatingGate_ResetAllGateOrientations(void) s32 i; u8 *ptr = (u8 *)GetVarPointer(VAR_TEMP_0); - for (i = 0; i < gRotatingGate_PuzzleCount; i++) + for (i = 0; i < sRotatingGate_PuzzleCount; i++) { - ptr[i] = gRotatingGate_PuzzleConfig[i].orientation; + ptr[i] = sRotatingGate_PuzzleConfig[i].orientation; } } @@ -683,12 +681,12 @@ static void RotatingGate_LoadPuzzleConfig(void) switch (puzzleType) { case PUZZLE_FORTREE_CITY_GYM: - gRotatingGate_PuzzleConfig = sRotatingGate_FortreePuzzleConfig; - gRotatingGate_PuzzleCount = ARRAY_COUNT(sRotatingGate_FortreePuzzleConfig); + sRotatingGate_PuzzleConfig = sRotatingGate_FortreePuzzleConfig; + sRotatingGate_PuzzleCount = ARRAY_COUNT(sRotatingGate_FortreePuzzleConfig); break; case PUZZLE_ROUTE110_TRICK_HOUSE_PUZZLE6: - gRotatingGate_PuzzleConfig = sRotatingGate_TrickHousePuzzleConfig; - gRotatingGate_PuzzleCount = ARRAY_COUNT(sRotatingGate_TrickHousePuzzleConfig); + sRotatingGate_PuzzleConfig = sRotatingGate_TrickHousePuzzleConfig; + sRotatingGate_PuzzleCount = ARRAY_COUNT(sRotatingGate_TrickHousePuzzleConfig); break; case PUZZLE_NONE: default: @@ -696,7 +694,7 @@ static void RotatingGate_LoadPuzzleConfig(void) } for (i = 0; i < ROTATING_GATE_PUZZLE_MAX - 1; i++) - gRotatingGate_GateSpriteIds[i] = MAX_SPRITES; + sRotatingGate_GateSpriteIds[i] = MAX_SPRITES; } static void RotatingGate_CreateGatesWithinViewport(s16 deltaX, s16 deltaY) @@ -710,15 +708,15 @@ static void RotatingGate_CreateGatesWithinViewport(s16 deltaX, s16 deltaY) s16 y = gSaveBlock1Ptr->pos.y - 2; s16 y2 = gSaveBlock1Ptr->pos.y + MAP_OFFSET_H; - for (i = 0; i < gRotatingGate_PuzzleCount; i++) + for (i = 0; i < sRotatingGate_PuzzleCount; i++) { - s16 x3 = gRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; - s16 y3 = gRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; + s16 x3 = sRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; + s16 y3 = sRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; if (y <= y3 && y2 >= y3 && x <= x3 && x2 >= x3 && - gRotatingGate_GateSpriteIds[i] == MAX_SPRITES) + sRotatingGate_GateSpriteIds[i] == MAX_SPRITES) { - gRotatingGate_GateSpriteIds[i] = RotatingGate_CreateGate(i, deltaX, deltaY); + sRotatingGate_GateSpriteIds[i] = RotatingGate_CreateGate(i, deltaX, deltaY); } } } @@ -730,7 +728,7 @@ static u8 RotatingGate_CreateGate(u8 gateId, s16 deltaX, s16 deltaY) u8 spriteId; s16 x, y; - const struct RotatingGatePuzzle *gate = &gRotatingGate_PuzzleConfig[gateId]; + const struct RotatingGatePuzzle *gate = &sRotatingGate_PuzzleConfig[gateId]; if (gate->shape == GATE_SHAPE_L1 || gate->shape == GATE_SHAPE_T1) template = sSpriteTemplate_RotatingGateRegular; @@ -827,20 +825,20 @@ static void RotatingGate_DestroyGatesOutsideViewport(void) s16 y = gSaveBlock1Ptr->pos.y - 2; s16 y2 = gSaveBlock1Ptr->pos.y + MAP_OFFSET_H; - for (i = 0; i < gRotatingGate_PuzzleCount; i++) + for (i = 0; i < sRotatingGate_PuzzleCount; i++) { - s16 xGate = gRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; - s16 yGate = gRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; + s16 xGate = sRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; + s16 yGate = sRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; - if (gRotatingGate_GateSpriteIds[i] == MAX_SPRITES) + if (sRotatingGate_GateSpriteIds[i] == MAX_SPRITES) continue; if (xGate < x || xGate > x2 || yGate < y || yGate > y2) { - struct Sprite *sprite = &gSprites[gRotatingGate_GateSpriteIds[i]]; + struct Sprite *sprite = &gSprites[sRotatingGate_GateSpriteIds[i]]; FreeSpriteOamMatrix(sprite); DestroySprite(sprite); - gRotatingGate_GateSpriteIds[i] = MAX_SPRITES; + sRotatingGate_GateSpriteIds[i] = MAX_SPRITES; } } } @@ -862,9 +860,9 @@ static s32 RotatingGate_CanRotate(u8 gateId, s32 rotationDirection) orientation = RotatingGate_GetGateOrientation(gateId); - shape = gRotatingGate_PuzzleConfig[gateId].shape; - x = gRotatingGate_PuzzleConfig[gateId].x + MAP_OFFSET; - y = gRotatingGate_PuzzleConfig[gateId].y + MAP_OFFSET; + shape = sRotatingGate_PuzzleConfig[gateId].shape; + x = sRotatingGate_PuzzleConfig[gateId].x + MAP_OFFSET; + y = sRotatingGate_PuzzleConfig[gateId].y + MAP_OFFSET; // Loop through the gate's "arms" clockwise (north, south, east, west) for (i = GATE_ARM_NORTH; i <= GATE_ARM_WEST; i++) @@ -891,15 +889,15 @@ static s32 RotatingGate_HasArm(u8 gateId, u8 armInfo) s32 isLongArm = armInfo % 2; s8 armOrientation = (arm - RotatingGate_GetGateOrientation(gateId) + 4) % 4; - s32 shape = gRotatingGate_PuzzleConfig[gateId].shape; + s32 shape = sRotatingGate_PuzzleConfig[gateId].shape; return sRotatingGate_ArmLayout[shape][armOrientation * 2 + isLongArm]; } static void RotatingGate_TriggerRotationAnimation(u8 gateId, s32 rotationDirection) { - if (gRotatingGate_GateSpriteIds[gateId] != MAX_SPRITES) + if (sRotatingGate_GateSpriteIds[gateId] != MAX_SPRITES) { - struct Sprite *sprite = &gSprites[gRotatingGate_GateSpriteIds[gateId]]; + struct Sprite *sprite = &gSprites[sRotatingGate_GateSpriteIds[gateId]]; sprite->data[1] = rotationDirection; sprite->data[2] = RotatingGate_GetGateOrientation(gateId); } @@ -957,10 +955,10 @@ bool8 CheckForRotatingGatePuzzleCollision(u8 direction, s16 x, s16 y) if (!GetCurrentMapRotatingGatePuzzleType()) return FALSE; - for (i = 0; i < gRotatingGate_PuzzleCount; i++) + for (i = 0; i < sRotatingGate_PuzzleCount; i++) { - s16 gateX = gRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; - s16 gateY = gRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; + s16 gateX = sRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; + s16 gateY = sRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; if (gateX - 2 <= x && x <= gateX + 1 && gateY - 2 <= y && y <= gateY + 1) { @@ -995,10 +993,10 @@ bool8 CheckForRotatingGatePuzzleCollisionWithoutAnimation(u8 direction, s16 x, s if (!GetCurrentMapRotatingGatePuzzleType()) return FALSE; - for (i = 0; i < gRotatingGate_PuzzleCount; i++) + for (i = 0; i < sRotatingGate_PuzzleCount; i++) { - s16 gateX = gRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; - s16 gateY = gRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; + s16 gateX = sRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; + s16 gateY = sRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; if (gateX - 2 <= x && x <= gateX + 1 && gateY - 2 <= y && y <= gateY + 1) { diff --git a/src/script_movement.c b/src/script_movement.c index 92f36e92d..10517dfc8 100644 --- a/src/script_movement.c +++ b/src/script_movement.c @@ -6,7 +6,6 @@ #include "constants/event_objects.h" #include "constants/event_object_movement.h" -// static functions static void ScriptMovement_StartMoveObjects(u8 priority); static u8 GetMoveObjectsTaskId(void); static bool8 ScriptMovement_TryAddNewMovement(u8 taskId, u8 objEventId, const u8 *movementScript); @@ -17,10 +16,8 @@ static void ScriptMovement_UnfreezeActiveObjects(u8 taskId); static void ScriptMovement_MoveObjects(u8 taskId); static void ScriptMovement_TakeStep(u8 taskId, u8 moveScrId, u8 objEventId, const u8 *movementScript); -// EWRAM_DATA -static EWRAM_DATA const u8 *gMovementScripts[OBJECT_EVENTS_COUNT] = {0}; +static EWRAM_DATA const u8 *sMovementScripts[OBJECT_EVENTS_COUNT] = {0}; -// text bool8 ScriptMovement_StartObjectMovementScript(u8 localId, u8 mapNum, u8 mapGroup, const u8 *movementScript) { u8 objEventId; @@ -167,12 +164,12 @@ static bool8 IsMovementScriptFinished(u8 taskId, u8 moveScrId) static void SetMovementScript(u8 moveScrId, const u8 *movementScript) { - gMovementScripts[moveScrId] = movementScript; + sMovementScripts[moveScrId] = movementScript; } static const u8 *GetMovementScript(u8 moveScrId) { - return gMovementScripts[moveScrId]; + return sMovementScripts[moveScrId]; } static void ScriptMovement_AddNewMovement(u8 taskId, u8 moveScrId, u8 objEventId, const u8 *movementScript) diff --git a/src/tileset_anims.c b/src/tileset_anims.c index 3676006a6..6a7589e36 100644 --- a/src/tileset_anims.c +++ b/src/tileset_anims.c @@ -537,7 +537,7 @@ const u16 *const gTilesetAnims_BattlePyramid_StatueShadow[] = { gTilesetAnims_BattlePyramid_StatueShadow_Frame2 }; -static const u16 *const gTilesetAnims_BattleDomeFloorLightPals[] = { +static const u16 *const sTilesetAnims_BattleDomeFloorLightPals[] = { gTilesetAnims_BattleDomePals0_0, gTilesetAnims_BattleDomePals0_1, gTilesetAnims_BattleDomePals0_2, @@ -1167,7 +1167,7 @@ static void QueueAnimTiles_BattlePyramid_StatueShadow(u16 timer) static void BlendAnimPalette_BattleDome_FloorLights(u16 timer) { - CpuCopy16(gTilesetAnims_BattleDomeFloorLightPals[timer % ARRAY_COUNT(gTilesetAnims_BattleDomeFloorLightPals)], &gPlttBufferUnfaded[0x80], 32); + CpuCopy16(sTilesetAnims_BattleDomeFloorLightPals[timer % ARRAY_COUNT(sTilesetAnims_BattleDomeFloorLightPals)], &gPlttBufferUnfaded[0x80], 32); BlendPalette(0x80, 16, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF); if ((u8)FindTaskIdByFunc(Task_BattleTransition_Intro) != TASK_NONE) { @@ -1178,7 +1178,7 @@ static void BlendAnimPalette_BattleDome_FloorLights(u16 timer) static void BlendAnimPalette_BattleDome_FloorLightsNoBlend(u16 timer) { - CpuCopy16(gTilesetAnims_BattleDomeFloorLightPals[timer % ARRAY_COUNT(gTilesetAnims_BattleDomeFloorLightPals)], &gPlttBufferUnfaded[0x80], 32); + CpuCopy16(sTilesetAnims_BattleDomeFloorLightPals[timer % ARRAY_COUNT(sTilesetAnims_BattleDomeFloorLightPals)], &gPlttBufferUnfaded[0x80], 32); if ((u8)FindTaskIdByFunc(Task_BattleTransition_Intro) == TASK_NONE) { BlendPalette(0x80, 16, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF); diff --git a/src/trade.c b/src/trade.c index dd0851bbd..f95b479fe 100644 --- a/src/trade.c +++ b/src/trade.c @@ -2195,7 +2195,7 @@ static bool8 LoadTradeMenuSpriteSheetsAndPalettes(void) sTradeMenuData->timer++; break; case GFXTAG_MENU_TEXT_COUNT: - LoadSpritePalette(&gSpritePalette_TradeScreenText); + LoadSpritePalette(&sSpritePalette_TradeScreenText); sTradeMenuData->timer++; break; case GFXTAG_MENU_TEXT_COUNT + 1: diff --git a/src/tv.c b/src/tv.c index b9d064026..5cca91ff7 100644 --- a/src/tv.c +++ b/src/tv.c @@ -723,7 +723,7 @@ static const u8 *const sTVInSearchOfTrainersTextGroup[] = { // Secret Base Secrets TV Show states for actions that can be taken in a secret base // The flags that determine whether or not the action was taken are commented -const u8 sTVSecretBaseSecretsActions[NUM_SECRET_BASE_FLAGS] = +static const u8 sTVSecretBaseSecretsActions[NUM_SECRET_BASE_FLAGS] = { SBSECRETS_STATE_USED_CHAIR, // SECRET_BASE_USED_CHAIR SBSECRETS_STATE_USED_BALLOON, // SECRET_BASE_USED_BALLOON From 67d73ee36fc1cec15088f1ed7c04ea317449888c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 17 May 2022 17:13:29 -0400 Subject: [PATCH 114/208] Clean up door animation functions --- src/field_camera.c | 4 +-- src/field_door.c | 66 ++++++++++++++++++++++++++++------------------ 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/src/field_camera.c b/src/field_camera.c index 0a00dcbee..ae7b2bbb1 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -212,13 +212,13 @@ void CurrentMapDrawMetatileAt(int x, int y) } } -void DrawDoorMetatileAt(int x, int y, u16 *arr) +void DrawDoorMetatileAt(int x, int y, u16 *tiles) { int offset = MapPosToBgTilemapOffset(&sFieldCameraOffset, x, y); if (offset >= 0) { - DrawMetatile(METATILE_LAYER_TYPE_COVERED, arr, offset); + DrawMetatile(METATILE_LAYER_TYPE_COVERED, tiles, offset); sFieldCameraOffset.copyBGToVRAM = TRUE; } } diff --git a/src/field_door.c b/src/field_door.c index 988ea615d..fa813a053 100644 --- a/src/field_door.c +++ b/src/field_door.c @@ -18,7 +18,7 @@ struct DoorGraphics u8 sound; u8 size; const void *tiles; - const void *palette; + const void *palettes; }; struct DoorAnimFrame @@ -278,52 +278,68 @@ static const struct DoorGraphics sDoorAnimGraphicsTable[] = {}, }; +#define DOOR_TILE_START_SIZE1 (NUM_TILES_TOTAL - 8) +#define DOOR_TILE_START_SIZE2 (NUM_TILES_TOTAL - 16) + static void CopyDoorTilesToVram(const struct DoorGraphics *gfx, const struct DoorAnimFrame *frame) { if (gfx->size == 2) - CpuFastSet(gfx->tiles + frame->offset, (void *)(VRAM + 0x7E00), 0x80); + CpuFastCopy(gfx->tiles + frame->offset, (void *)(VRAM + TILE_OFFSET_4BPP(DOOR_TILE_START_SIZE2)), 16 * TILE_SIZE_4BPP); else - CpuFastSet(gfx->tiles + frame->offset, (void *)(VRAM + 0x7F00), 0x40); + CpuFastCopy(gfx->tiles + frame->offset, (void *)(VRAM + TILE_OFFSET_4BPP(DOOR_TILE_START_SIZE1)), 8 * TILE_SIZE_4BPP); } -static void door_build_blockdef(u16 *a, u16 b, const u8 *c) +static void BuildDoorTiles(u16 *tiles, u16 tileNum, const u8 *paletteNums) { int i; - u16 unk; + u16 tile; + // Only the first 4 tiles of each metatile (bottom layer) actually use the door tiles for (i = 0; i < 4; i++) { - unk = *(c++) << 12; - a[i] = unk | (b + i); + tile = *(paletteNums++) << 12; + tiles[i] = tile | (tileNum + i); } + + // The remaining layers are left as tile 0 (with the same palette) for (; i < 8; i++) { - unk = *(c++) << 12; - a[i] = unk; + tile = *(paletteNums++) << 12; + tiles[i] = tile; } } -static void DrawCurrentDoorAnimFrame(const struct DoorGraphics *gfx, u32 x, u32 y, const u8 *pal) +static void DrawCurrentDoorAnimFrame(const struct DoorGraphics *gfx, u32 x, u32 y, const u8 *paletteNums) { - u16 arr[24]; + u16 tiles[24]; if (gfx->size == 2) { - door_build_blockdef(&arr[8], 0x3F0, pal); - DrawDoorMetatileAt(x, y - 1, &arr[8]); - door_build_blockdef(&arr[8], 0x3F4, pal + 4); - DrawDoorMetatileAt(x, y, &arr[8]); - door_build_blockdef(&arr[8], 0x3F8, pal); - DrawDoorMetatileAt(x + 1, y - 1, &arr[8]); - door_build_blockdef(&arr[8], 0x3FC, pal + 4); - DrawDoorMetatileAt(x + 1, y, &arr[8]); + // Top left metatile + BuildDoorTiles(&tiles[8], DOOR_TILE_START_SIZE2 + 0, &paletteNums[0]); + DrawDoorMetatileAt(x, y - 1, &tiles[8]); + + // Bottom left metatile + BuildDoorTiles(&tiles[8], DOOR_TILE_START_SIZE2 + 4, &paletteNums[4]); + DrawDoorMetatileAt(x, y, &tiles[8]); + + // Top right metatile + BuildDoorTiles(&tiles[8], DOOR_TILE_START_SIZE2 + 8, &paletteNums[0]); + DrawDoorMetatileAt(x + 1, y - 1, &tiles[8]); + + // Bottom right metatile + BuildDoorTiles(&tiles[8], DOOR_TILE_START_SIZE2 + 12, &paletteNums[4]); + DrawDoorMetatileAt(x + 1, y, &tiles[8]); } else { - door_build_blockdef(&arr[0], 0x3F8, pal); - DrawDoorMetatileAt(x, y - 1, &arr[0]); - door_build_blockdef(&arr[0], 0x3FC, pal + 4); - DrawDoorMetatileAt(x, y, &arr[0]); + // Top metatile + BuildDoorTiles(&tiles[0], DOOR_TILE_START_SIZE1 + 0, &paletteNums[0]); + DrawDoorMetatileAt(x, y - 1, &tiles[0]); + + // Bottom metatile + BuildDoorTiles(&tiles[0], DOOR_TILE_START_SIZE1 + 4, &paletteNums[4]); + DrawDoorMetatileAt(x, y, &tiles[0]); } } @@ -350,9 +366,9 @@ static void DrawDoor(const struct DoorGraphics *gfx, const struct DoorAnimFrame else { CopyDoorTilesToVram(gfx, frame); - DrawCurrentDoorAnimFrame(gfx, x, y, gfx->palette); + DrawCurrentDoorAnimFrame(gfx, x, y, gfx->palettes); if (ShouldUseMultiCorridorDoor()) - DrawCurrentDoorAnimFrame(gfx, gSpecialVar_0x8004 + MAP_OFFSET, gSpecialVar_0x8005 + MAP_OFFSET, gfx->palette); + DrawCurrentDoorAnimFrame(gfx, gSpecialVar_0x8004 + MAP_OFFSET, gSpecialVar_0x8005 + MAP_OFFSET, gfx->palettes); } } From 5c8e1e81ea1734e5ff61fccc780c3fdaedcd4812 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 17 May 2022 18:38:21 -0400 Subject: [PATCH 115/208] Color single-palette door anim graphics --- graphics/door_anims/abandoned_ship.png | Bin 420 -> 306 bytes graphics/door_anims/abandoned_ship_room.png | Bin 419 -> 305 bytes graphics/door_anims/battle_arena.png | Bin 509 -> 394 bytes graphics/door_anims/battle_arena_lobby.png | Bin 408 -> 293 bytes graphics/door_anims/battle_dome.png | Bin 394 -> 279 bytes graphics/door_anims/battle_dome_corridor.png | Bin 462 -> 347 bytes graphics/door_anims/battle_dome_lobby.png | Bin 486 -> 374 bytes graphics/door_anims/battle_factory.png | Bin 366 -> 251 bytes graphics/door_anims/battle_frontier.png | Bin 421 -> 306 bytes graphics/door_anims/battle_frontier_sliding.png | Bin 390 -> 277 bytes graphics/door_anims/battle_palace_lobby.png | Bin 432 -> 319 bytes graphics/door_anims/battle_tent.png | Bin 544 -> 429 bytes graphics/door_anims/battle_tent_interior.png | Bin 504 -> 389 bytes graphics/door_anims/battle_tower.png | Bin 467 -> 352 bytes graphics/door_anims/battle_tower_corridor.png | Bin 404 -> 0 bytes graphics/door_anims/battle_tower_elevator.png | Bin 398 -> 283 bytes .../door_anims/battle_tower_multi_corridor.png | Bin 554 -> 413 bytes graphics/door_anims/battle_tower_old.png | Bin 458 -> 343 bytes graphics/door_anims/birchs_lab.png | Bin 402 -> 287 bytes graphics/door_anims/cable_club.png | Bin 368 -> 253 bytes graphics/door_anims/contest.png | Bin 452 -> 337 bytes graphics/door_anims/cycling_road.png | Bin 441 -> 328 bytes graphics/door_anims/fallarbor_light_roof.png | Bin 432 -> 317 bytes graphics/door_anims/general.png | Bin 425 -> 310 bytes graphics/door_anims/gym.png | Bin 404 -> 289 bytes graphics/door_anims/lilycove.png | Bin 426 -> 311 bytes graphics/door_anims/lilycove_dept_store.png | Bin 430 -> 315 bytes graphics/door_anims/lilycove_wooden.png | Bin 401 -> 286 bytes graphics/door_anims/mauville.png | Bin 432 -> 317 bytes graphics/door_anims/mossdeep_space_center.png | Bin 509 -> 394 bytes graphics/door_anims/pacifidlog.png | Bin 452 -> 337 bytes graphics/door_anims/petalburg_gym.png | Bin 0 -> 289 bytes graphics/door_anims/poke_center.png | Bin 419 -> 304 bytes graphics/door_anims/pokemon_league.png | Bin 445 -> 332 bytes graphics/door_anims/rustboro_gray.png | Bin 440 -> 325 bytes graphics/door_anims/rustboro_tan.png | Bin 440 -> 325 bytes graphics/door_anims/safari_zone.png | Bin 458 -> 343 bytes graphics/door_anims/sootopolis.png | Bin 435 -> 322 bytes graphics/door_anims/sootopolis_peaked_roof.png | Bin 435 -> 322 bytes .../door_anims/trainer_hill_lobby_elevator.png | Bin 348 -> 231 bytes include/constants/metatile_labels.h | 2 +- spritesheet_rules.mk | 3 +++ src/field_door.c | 6 +++--- 43 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 graphics/door_anims/battle_tower_corridor.png create mode 100644 graphics/door_anims/petalburg_gym.png diff --git a/graphics/door_anims/abandoned_ship.png b/graphics/door_anims/abandoned_ship.png index e46aca9ba94b1b66552d49666d925b87b1dfea1d..0030246b4e08aace30276066cf61d1510e8c2712 100644 GIT binary patch delta 290 zcmV+-0p0$j1F`~;8Gi!+008Fy?~?!k05DKYR7C&)07^mg{ds5z{VzjjXtgJcz|6;*#<;nm60KG{>K~yM_z0ffV!Y~xZ@mwKU z3Izjsi{LrDf@djo$xQ^a6f&fD@c^!c4z7;%CHbOQX+coG>3>J2yua9E;vEep4%iwb z77@beU4jo+zz1O0w+ZfSU!j4`soMfglMxDzfYb$H1p`poTLPKNP7Fm+45Fx3C`yuo zuqS@eM`}MhAk5)%ABLUb@<2C-{s5{TGRX7^e0?>gKHR|OKKz6}WJ(|UTc7yLWz=5< o-*YzyJUM07*qoM6N<$f`l}GNB{r; literal 420 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0IEi7Q8@egp~$Bq#cnfoLFB0AesmJ-~bw$k^lQ;uxZF ze(wc)u0sYQ$3L3yvJ%-<#qj=;Im<4W4{DKIw%y?$WSUNEyJ(bno=f=mXHi6^V?h1o zcAv_4tK=_za*KtxvGuzegnOxL++*r$^uDb6VsB+DYhL>|t}nH0;xdf++!d^*1~Yw| zcqT7oP!D8O3Y4|<{G@V2c>jyXYgd^ZD1LEA{lJ+G)eGhxu46F2CTV2C`S4d~(EJMr zp4dI)tWD9VeUe}MNPoIvo#?}DJd81o4C@>i!W9k_&9~0m?BaiY#VIkMKU7OxBT7;d zOH!?pi&B9UgOP!efv$m}u90DgfvJ_TrInG1wt<0_fkFNZD=!ocx%nxXX_dG&$Q^C^ P1`0AyS3j3^P6mg{ds5z{VzjjXtgJcz|6;*#<;nm60K7>=K~yM_z0ffV!Y~xZ@mwKU z3Izjsi{Lpti&rRg$xQ^a6f&fD@c^!c4z7;%CHbOQY(Y@J>3>J2yuWBLvB%bMz}`S& z5h0A;CHQa!d;oTRo8Zp&6&l!_x-HN&8KK|^NL>(CFaVXkC6KA?#84E)Ac|^*q9iE@ zd*T;;r1ql&!W=I5Vb~ci4|H?r51{HHgG`^m*H=^O!wqci!%yf#ru3n|^@+b+M*UUr nZ5afp0s>S40UD}+faN}SsrAO?ff1I$-}jNP6tjv*T7 z_g*mMI%FVn>|@V5zSebe2X=qqZPXLo<2lV~{ewuG_6MK11i4}-8UL766R5LIVa5F~ z%E9;Izs|5q&bCO*7udkD$ZIx>Z?uDOLFO)&&D+-(9C&*nu5sV_1x?BVF^p>$u&M3# ze2}=w>w%@$0hz0s=RF+_za7#4#j;$R`GSnvcflKyW&B%;ckn+rZq?kb=D2Qt$SY;u zoOjCpFAh7uJY4@;xPE8P$JG;V8%ca%<@v$HR>R1Ay7t|SC`b9FGq;HYy`fs-8c~vx zSdwa$T$Bo=7>o>z40H_)b&U)|3{0(zEv-z}I6;98E>g5EdT|jb2ya<8tgxIhE#{_{P+DQPOZ*6@W8T4sueFI*k ztz}~nB19rN&WESZw}vUTD_DC~=61PPQz4-l+UKK>+}oo zQ-TkM5Ywn3>T@~+VyEkLV?+$|0OPVE_S+20+9KBd2B{{3U_S8xAMee_tCG)Gk literal 509 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0G`Msst;e?TFDPV&9*H$8=og>^lXcknxhr8iYIoJXtCIo$u3tkA4@9dF7a6T zL+DfTf%-T6XIKM|@+2wnM_gxly~;qyRFWl7WZU}CuR9NJ zbqyiHjpp*@4gMU@ghNg~uk0(Vyez!$SVj7!2%#qtMt{0g!1AZLTaov#h6ul|nz!6^7JBH+@Ady{}6rCQ<|QIe8al4_M)lnSI6 zj0}tnbPWu3jSNE!Osz}|tPBjb4S=M?7F+jU4KoV;AZO3t`pHB`Uk|g zD&$0$u!nsn(^P?{3e1|BK@2A?1;~V>=R@QU+=nP=i(lXrq4Cif#R|llQHP{5hUxI0 zfs@G_B+m`lGG!kq%$t3n!}pPw?Hj&?vQJ#c8EvmWk7lxuSV0S-Vh79k>WrYh({63| b!9p+WZ#l8r2o9sd00000NkvXXu0mjf|I3L( literal 408 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0G`zU3V@`9L9o z_or>@kMQJPl*E4e$*Z0PdoSnZen04>ANu@o{{JujTYzp?Epd$~Nl7e8wMs5Z1yT$~ z21W+D28Oyuh9L%~Rwf2kh9=qu237_JCYH<(P&DM`r(~v8;@04rvO5N-fx*+&&t;uc GLK6T^XOOG_ diff --git a/graphics/door_anims/battle_dome.png b/graphics/door_anims/battle_dome.png index 729385b3fc7063eb1f781ecfe03d58bd183868e3..4bc9fab94b53c414908c14401b996d133fb93213 100644 GIT binary patch delta 262 zcmV+h0r~!l1D67j8Gi!+008Fy?~?!k05DKYR7DsmQvd(|-sbMT&E}l6-h+dSVq$wi zN@^)FT64YjVyy1}y@T$QbKYuV%|TLg#iX8JIZ6Nk0HR4mK~yM_&CtOK0x=K;(5cD_ zmhE810@j%Y58g~VvKq02c=V*H!TC-^Jncd}_#w=LB#?YMw|`J4?lCV^DrPNIO7)aN zzK}}xz`Pnw2W;IoG>zujIfhft`=JAAZa8imR2rBUAOR&YV>VM_!NZh$Yx!9}WA>~@ zGMfX;0cDnNuxBMCfPQfOkNUA!95eo&7J##W;XAmcfOJCw`oX)OCqy=@mZ6Cva{vGU M07*qoM6N<$f<&Tr>;M1& literal 394 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0G`t2Ubxw}3(d$%%etAR34jfEWx?4=`T^G8TEdIEHAP zKYQUICzGK7>xE3ks!uOU6vC3-BlG22&g@{dxO{Mv=#8nLeO+wcI@$bCJkzW)p~h-k zfcmylxenp9q$EGVw60c_NxaYEGWH~7e_v2I>4dJq{Gxs5WF@=~|Gc;0+Jk)zs{@P# z%LP@{!byW>wLzl8$j2pmbgZgq$HN4S|t~y0x1R~10w@n14CUS!w>^gD-#1N pQwwba11kfA^2_OYC>nC}Q!>*kacf}fyMGB3FrKb{F6*2UngECmgDU_4 diff --git a/graphics/door_anims/battle_dome_corridor.png b/graphics/door_anims/battle_dome_corridor.png index 198ad9acca356dd0b5025adcdb576b26ba046fd1..78e77869ea6752f126873b250962606ec13f34b9 100644 GIT binary patch delta 309 zcmV-50m}Z)1KR?S8Gi!+008Fy?~?!k05DKYR7L*)|58$Fl$4~+y~Y3k|K8Q+d#sC# z&8(d6&5NA0oV3NP&DFgr5Z+24|6(!!-h;|31}*>q0Om%y|M?OR@geoe~I}pfx;#Tx(6=Ha{3Vc7>ULS^m*)DOX z){!~adWLzPnEQDSEX#xWx-5GrbGITfmmknnd`3k8TOs1R?jjf8CDL{|wi!FF2+q7= zXhr|a2kj%D5iQpx-WIXe9aSYKo zzxKjL!Da&<)_}DWM2)y}uLNG&#a*0YamqnGe2#T?+Y4oRrRgnNS{JMZPSjiqE6Ehy zv5l+7?pFN#Wu8~{3e}eeZe3E+wog9f`9A)VyS`s%zvJ}F{gUcHd%r?$lZR>^fr z)26It*l_xhqeDx`1aF3q3JOkICsaTDuh}DSXHlh}E+JF=;8_LRjg3L2PxKR9rOXch zYhJzfM!<`>#yuAvY>3@-)o1bI3070&`i}RBdrCe&V)cus4d`Rl64!{5l*E!$tK_0o zAjM#0U}T_cV5n*WnyS$XsT^sU}a!X+moDyq9HdwB{QuOw+5bzx37T$*VEO{ JWt~$(69C{dqW=H@ diff --git a/graphics/door_anims/battle_dome_lobby.png b/graphics/door_anims/battle_dome_lobby.png index bd4e4e895baef67bd6e8104f8b3d248b6496ae70..631cdeccedb5b1fd7973a1ba8127945ff9bc2544 100644 GIT binary patch delta 358 zcmV-s0h#{h1NH)t8Gi!+008Fy?~?!k05DKYR7L*)|58$Fl$4~+y~Y3k|K8Q+d#sC# z&8(d6&5NA0oV3NP&DFgr5Z+24|6(!!-h;|31}*>q0Rc%wK~yM_z0f^Q12GT<;CBT( zijWm3Y$_V01R9c(Tp%U!DX8`w=BIF-q}dL6x7v!Hh6B)W0DsQFjAtbyVWmR6#-C)5 zta(_EK?PSiYutY2T;o#kiL;NK_kz>6oL8tZh>?#NE4ULpW7`I$bbEl`XY}wLW9YH! z_|1^88b$_|vAT)$&*U1U^ix zU~3urP~Zi$sb5UfrhkY(@&7o zRIm|Dk6|vD6jUCYNC^a4kfsDQ<#K9R2+j+%!2a&%8>gJ=K|q%GkN^Mx07*qoM6N<$ Eg75LGzW@LL literal 486 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0Hx^*@SJoq$3D$%%etAR34jfEWx?4=`T^GX8nGIEHAP z-+RH(kJ(Uw^+G)>pTl9sj2A1n-P-zMn`h8&jt9j#M>Sf_O zUu3R%w2sO8Y(}EB+vTLYA7{HI-tE~CK5w1f?fC^FZsK!4@0_}@FX_|^QL`q=L#EEs zcU0Ye9WwZ^{BVQ)o&JZ)FSx|!397S(IZXDNttP7R=E?)FK#IZ0z{o(?z);u7FvP&r%EZvh*izfTz{x~Hq3%Q~loCIA+?tFr(A diff --git a/graphics/door_anims/battle_factory.png b/graphics/door_anims/battle_factory.png index 7ed6c876b89fcf6701668add452862a571c62fec..1d74d8b58076856ad87d26e8ece5299f0ce5747c 100644 GIT binary patch delta 234 zcmVLkH5R->Q_=JO~ kQsM%E7{3$4pi=k%0C!q#D)xyq5dZ)H07*qoM6N<$f=U2l%>V!Z literal 366 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0HR`Tu-%@<1VhtT-`M>4Be@h*jZkp~0#Sb3O*?Ii5pHm!(lynfn%?Z#_|^Ts9XST1gE z;OWp#Q?R+gXjtjda-K`zs%wmbz~k~Hi4ZP%hEsp~zfJS|tOInBYKdz^NlIc#s#S7P zDv)9@GB7gGH89jQG7K>=wK6fXGB(sUFt9Q(P`LP;9YsTKeoAIqC2kFYJK~yM_#n7=4!ypU=Q16sJ zTPRF`e92uXQRhK2f@jGJZquO|f{-8%@j0bcy*mW=`2*VwJAZiEY#foz;6Y~tX!BVn z3K*D2!EMI7VXk;6@Tx#gWhb7(vMh>JkdIiApGy_okOU-2U!d*shIxLONL6|VLJQ|o8^>Bk+{&pOXP$n64o oQ)}trd+6ua@Ebk!1a|s?H@mc}+g#W~-2eap07*qoM6N<$g45WB+W-In literal 421 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0HRgOK~qZa^V{nh_rEHD^&M-s%LqarEi$r zi`zLe3(ro7NN2wIY;%vtM2573xjo^BBMJkL>{e>hwtnb(uew$Hg!_UM=XY{t6fjL$ zQq&zdaq>b14;vlBC*5{ji~mSvsiy&(F4{*A4|A z4f_3XbP0l+XkKzsQrc diff --git a/graphics/door_anims/battle_frontier_sliding.png b/graphics/door_anims/battle_frontier_sliding.png index a43cf519dda91ceaa86aa2b89c4b73e978aabc88..1359f4725b8d6061a5088ffd6efa5677705df3eb 100644 GIT binary patch delta 260 zcmV+f0sH=j1C;`h8Gi!+008Fy?~?!k05DKYR7DsmQvd(|-sbMT&E}l6-h+dSVq$wi zN@^)FT64YjVyy1}y@T$QbKYuV%|TLg#iX8JIZ6Nk0H8@kK~yM_)zGmGgD?~XP|re> z0Vr4iDHEJL!8d&pVTpwzF-um+3Yj5%`w;O@aEo#UdeUK#&wafZSHXk%QANf*neF9o z1g7>KeN6LwFA!D;F~UMDM&Q=>=MM;QZQE|c(%{lGr}FO!U~01*woi=QXGI7D_krgu z7Gj~7_uMB#6x=648~A_R$3PDad7tG%c@_h)NKFB;$W1!6x6d0NH`N|xMv)c(0000< KMNUMnLSTY0w{xNZ literal 390 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0I6<&#y$H-SO|$%%etAR34jfEWx?4=`T^GUj=@IEHAP zzj|RKZ?l02OThXGq7jXe6E+2?EN+qe&$(u{f)ICrfrC_8W4^r7KhG71MPGQfJKB{e z-eJso=KWMM-0=75`5b31mVYVCo|WCW!LdV3Ea@WC_r!{Qjt$36dabXq-L=_&YQK6z z;r|`|-|wV5bJ%`&e4-ucvYrMLXY>mdKI;Vst06Rr|u>b%7 diff --git a/graphics/door_anims/battle_palace_lobby.png b/graphics/door_anims/battle_palace_lobby.png index f106ae960d99172907dbf1fa3ca61e9ecb42222c..a4aa998d46eeb4322e164473076d799205e5b7ca 100644 GIT binary patch delta 303 zcmV+~0nq-i1HS^08Gi!+008Fy?~?!k05DKYR7C&)08&zFl$4~+y~Y3k{{R30ltE&o zVuQVlq|LM`=EYKbDG;PN7|lu`|6(!!-h(7-*tP%w0Ln>3K~yM_t&lMegD?;T_W|Tr zG|=R8G)9Wt(BLL7h{OjhrH$g_2Xtwi=3@I4T!2texN5vwdw+ckBE_tT@KD^^4IJT#s>2cp$KNAu^0pj%yU#fR$$x940nN3ZYX0}%i;aZ5gX}C*k%4RVhKO=^8x)~B)9D+DvSUC002ovPDHLkV1itn BhQ0s* literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0I63upOXra&QqxVj{_jU(+AI`l!<9bnreee;lUovJh%iYdA?60$P`FbOh z{TY7|&`+u*t`Q|Ei6yC4$wjF^iowXh$UxV?P}j&X#K6?b#MsKzOxwV~%D~{v?d1k2 c8glbfGSez?YuMW+-vbIhPgg&ebxsLQ00^m%=>Px# diff --git a/graphics/door_anims/battle_tent.png b/graphics/door_anims/battle_tent.png index a0a88e4c5fba405715e0b1441841074fbdef9119..b278e33109f5c138e7da2d54e3ef3f1fc3357411 100644 GIT binary patch delta 414 zcmV;P0b%~21g!&*8Gi!+008j2^br6605DKYR7DsmQvd(|-sbMT&E}l6-h+dSVq$wi zN@^)FT64YjVyy1}y@T$QbKYuV%|TLg#iX8JIZ6Nk0XRuSK~y-6#n7>8!!QsA;ClrX z8fYOyJ?3pXNFieeopE+skhkbyg909!A;I@H89n$F`V76(sefq;t?5#780!O_Y~2q> zlWGO@Bh}5Q%FU&$%{)w0ipt}MaH-gYsq5uE@ literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^0zllr0wfq7@kRd!QY`6?zK#qG8~eHcB(eheOiAAE zE)4uuMs|yVJoXY#Usv`gjG}BTtlYW=Al(AViGF1u8i*Bu7z|PmFkfY0V6^abaSX9I zee}Y{tiuKZY!9ki_cgKiSI#y*If1W@HS^q@yZo**%?+i&%(zN^2&$9M+s;Thi&c$}8rXb6tPamq(` zTskAaXWpsi`cn&bDx71@Tz7u$|1;^CZ_BdcB6t6m3{8G(@bq%jY2i;#)lZ1zK4+Q3 zxLB{@@k<%@BN!DUSN`LE>z+zf9h7V8d;DMS3j3^P6xOMr+wdN=JT3g+d;LRy&di6o8z<)7GA@zX9~Ck%>kT#Y3=2O5XV4xf#thn?;Iu)C z7@Ri9rig4xmu~l6U2c$dL`44^nulmN_vZug{Ym{P@AMd?Knz3$0nsTYCPd;9reJU* zNazteC+o0$>qx<(yXXEtU*)}j5GAUj?6-$Vb^!S$^oDK`CD)xOXZfG-eVOWRS01*$ Ti^=MU00000NkvXXu0mjf7)Py+ literal 504 zcmeAS@N?(olHy`uVBq!ia0vp^0zllr0wfq7@kRd!QY`6?zK#qG8~eHcB(eheOiAAE zE)4uuMs|yVJoXY#Usv`gjG}BTS_}U0dIE(6k`w*PKr|3505KS(9$>!8z`!Wr>Eak- zaeD71!@R==JgfopT%C{IadX@x#SvKfLRTo@u5O2&L%?SpTi3Q8TW3%2Q0^-RlNLTq zu=kku#Z_X5Sj{!2m8|kxuU)Xq`yHVB;of`yUj{O5sc!_FootxI7W96ZZk6Ovkas!W z>iL1(_3O94Ep_uS-nV?u_Wsht+g9aP@JG!P`}cnDzlHYIi!R^kWxlwfCsx7Bo%Neb zmGfDf!-u{bN^fEBI@h>OJuP>F(vda1n>5pAUwZmDWV&>LtfR``wr7cQ&;IS{++)Ae z{^?tJX0Zj0I~BT8jje1Lnt)xo3(R- zb;D&Lx5HaHCcXBXviXw#kBvUQ@fOjpg&TLW@&W@%wZt`|BqgyV)hf9t6-Y4{85kMp z8W`#t8HN~`Ss9pE8Cz-_7+4t?2piwZM$wR)pOTqYiCaTbUea|?GMmPXTQ@hK~Q_=VM4Em`J(?>uX3{ iLtjJU8qQbX8vX!lNHy}x-WW4rtaSYKo ze{_Ox7n7kt>wVE8hWF8e>G|e6_+2lHXWY@A!dTAtm{G*(oI&W^Z|xjS98t4tmIzh6 zcQ)pgYh2Fg`&sJD>GuV@3(xUApLghu!Fzo(e)Xn>pGPx12d#z`u)=>kM0Ru&=DitF6D?|4zAV z%X~SxDWS?oU`c~nsIBj2p&4?|^bUV9_@0!%rAXa_^~#J_7pHa^*=lht7X4bp{#b3r ze5P9^JhJ}qa-v@uhz4Q>AO?ff1I$-}j5VGvjv*T7 z&tBZfdssn$H6U$a?~{#2++J!4%#)N_qm7waZFv$n(@qqYYy4QEq2V<#-uA8}cl~N( z_p=8IuFN%VJ>_`dLF0}{?}FQ69IvI09GNe$(|^6Bd8Yr%}aVC#>4_ zZt}-Aj8cfZ}y#_!Q7Xv(T57a&i^aVu5Z+24|6(!!-h7Aq}96QGbla-v@uhz4Q>AO?ff1I$-}jAfoKjv*T7 z_g*mMI&8qh8Zh_T?7ddz9xoKFrcao+z}#T2t;mv#7aXmebyGT=jY~2%(PTcPcT19cJX zM`d~1KK5&zYt@yQSfz6KlH(TMm47$LId7f6M!Me1{$QG=kn4F)(Xs^o^(REXUFJJF zk7>hJ#|gQQ_y7LM@OWxi6Z^MM?m!o-mbgZgq$HN4S|t~y0x1R~10w@n14CUS!w>^g tD-%;I0~2in11kdqxm_o$P&DM`r(~v8;?|J=yr2yfIG(P4F6*2UngCQTf;s>I diff --git a/graphics/door_anims/battle_tower_multi_corridor.png b/graphics/door_anims/battle_tower_multi_corridor.png index 145dea7a50ceb37a94d18775bcdfa610be88964a..cb32fbc70b8323bbb77195d14fc529dd8b81feb1 100644 GIT binary patch literal 413 zcmV;O0b>4%P)|NsBq)#m^IoB-~N0KJQIbAwuHv~!Eay(tjhN+ADYG5_9!)HKb>0003f zNkl_(H;Cvh*Hqa}$zlHfN z$^vM#t8;0WXn|L2O}7JSR=X|7p;I%<_4f_UOg5HDs5u6VO#})7epi)o@B*Ng100000NkvXX Hu0mjfq_nO+ literal 554 zcmeAS@N?(olHy`uVBq!ia0vp^0ziC#1xPTw4GWwMq*&4&eH|GXHuiJ>Nn{1`nUcKS zT^RVSjO-QzdF&;gzOL*~7)9CG%s-xC76J+hBq#cnfoLFB0AesmJ-~dGfq~J<)5S5w z;`H7td$X7gc^DGx*KV))>brg3&h{5FJQumYh+3s{oLKD3`pr1xlmDzIQ5n+fnwt5W zQzONe->X`2UCy5ATfoxxQ;hfH4cgC(W@|=rZI95qs%ianOF`gzx9wjHiNxW025PT^14vC26hlq(Mytg0oh5hW>!C8<`)MX5lF!N|bK zK-a)f*T^u$z|0DWOpLV+46F`Vp1Vj&_|fXPKRU=QYE4bF4dJw43?9T@mv-hcc(3FC8MO1PW?Q^M#N zm=a3#FexF65txpM%$9BY3HBSaX6uj$sg)+f)`1#__pVy1 z;@VyZa=UUnArgS8A_6=(STWu$ACft$%%etAR34jfEWx?4=`T^G9G!lIEHAP zKRRJACzGQ<>vC4Z?d;M9yN)pNZ4`*y&?K46dndxOX6ucX8Tq{Dim%(+o@J4h_>pk$ zkFDo)&m=D?f8pRurPF3i^7>Msr}$gQHiJ`g>WhP?S6z{rwe!`s%qKVWLd$c1bBbkO z&3h`qv2d#1;Zu!L?cdi$t$K7Tj=gAip|zq=!(>G!8@s0Ci(UBbKen@8zaS^2Qq$dE z%TRZ?UL}RY|AEx)_lIJ0G-4+T7~MI_R^tDF`7V>ZM>xa%duR4KEwC+UZaI5k|DTmh z*B_MIts_7Ge--0lfky&7&Nuel{L~=ryKcS3sm+gNfxcBOag8WRNi0dVN-jzTQVd20 zMh3bDhPpy@RBzdxL|EVrqLq zN@^)FTBOzHYQ4qo?)J^q?wp*obF4XY#iZT6gUSE^0IEquK~yM_#n90a!XOL=;Otc0 z0G+@e-h3)_0$?H?&lyZ4;2CRuZ0@-GE-4g#a;JlnMbmMbWPcH~C}~mEdUw8Yajmvc z+P4eU0{95U{o3(ZMM{eKY%xZkyT*b27fG;GmLQ^LFnEGcrPCickXr_U_Q|L6t^MsE zQpapj`lxtCwBW~QC<0n6(ozJ?hg)m;VDEg)eYP=ny`{SVW7`L-?5wo_=8{ VgMp($0{{R300>D%PDHLkV1ft0fJ*=X literal 402 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0H>r5EZ;P6CAlk`w*PKr|3505KS(9$>x-WUTUZaSYKo zfAqpd!9xl>Y!B8vsIU@z$xICB mtnJ&QpXpYEfDi-(^>YXRg4W{~fJGeu0000-HI7IBY;8z$%%etAR34jfEWx?4=`T^GCDk6978nD zpS^UEm&uTa`NEk)3~P>atvR6M;nQ$K;qHN%4=*JI2hM%RtjJftx8EaoO@u*NYFI(q zn?pQvW*BZZ{8OdPG%qvXBBjs%knQIU4G&&)-{WaA-WF_sadxKhtIzY9nuG=BG)(AT z{7bM(bVXf<{fp<(1=qM6*&}anPq)9k){5~UC&#OFMyD%kwwjlY1_0fpTH+c}l9E`G zYL#4+3Zxi}42%qP4GeXS3_}b|txP~j+rYrez`&;cYzc~n-29Zxv`X9>d~cPW0D0fj L)z4*}Q$iB}idS`c diff --git a/graphics/door_anims/contest.png b/graphics/door_anims/contest.png index dc466be116c595fa1ceeed0f4542a215f7d211c3..8719b23ad4a989fea0a6a63f2261d8460621bcd8 100644 GIT binary patch delta 321 zcmV-H0lxmk1JMGI8Gi!+008Fy?~?!k05DKYR7DsmQvd(|-sbMT&E}l6-h+dSVq$wi zN@^)FT64YjVyy1}y@T$QbKYuV%|TLg#iX8JIZ6Nk0NhDLK~yM_&Co##gD?;U(7A%R z5Rc)~gUk`)z8izyLR`o|_JTJFvs6XFj^uN^G$!ACZMig&;qlfT$qQZrn$gL z(ULSkxzEy;Ue`64vBrsW!%t%QVLmH9qvo>!gCzI}M+9TMZb>#p3_Z^o^zNSJ?AiQ$n$vs?n7_$ TyLB{700000NkvXXu0mjf5N(pO literal 452 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0H>%Os~AO?ff1I$-}j60q#jv*T7 z&t7okYBmsHy|B~iyi$em!PuQ(=wG{hSuXIl~a0!x6Ck~xclFo z(gVBpC9p*uz1P8W+UsrOaxMj>DGtI5p^^Cd;Qn{G&yiU{S@yQ0Lh7USfVR%=7ci=$qdD@12m;QR<&g1>3>=Aw|}^EiTYC4*kV(vs=8u} z)wp5r@IIwvs^$bVm$3A9!dV{!Kmzb_As9!3xIC7lrS(jf8Q3zz(F%Dgr4c`Mp zn*bN;Gqe-kM=?tKm-i|5`3~DuN`_~VC8!c8{1H?M^^;5h literal 441 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0Hh4vCF+cYs0y$%%etAR34jfEWx?4=`T^GA??$IEHAP zKRe+p?_mX=)<{Mp#&?>}*IZEDHuqf{v&)r8^aWr4E|374xTJGN%GpHQuv+<(wIitQ-FqyyQ$54s*X z*hiP8oj$jwWs%AWFRMC+Hce(d6OkEFr_|kkPyZS6yQV!?E52>x5h*9$l0Sk@yicC2 z^#5tYP?50xlQCO^Fwk?VC9V-ADTyViR>?)FK#IZ0z{o(?z);u7FvP&r%EZjdz(U)= lz{Wt~$(69BShk-q={ diff --git a/graphics/door_anims/fallarbor_light_roof.png b/graphics/door_anims/fallarbor_light_roof.png index 4c81ba10e737a9ef27c55d401bca577134b96764..a4c959f8831a985f7279cde06d6b0dda4bb62eaa 100644 GIT binary patch delta 301 zcmV+|0n+}k1HA%}8Gi!+008Fy?~?!k05DKYR7DsmQr_mIw8e9joKky(L4$*fVq$wi zN@^)FT3W2EgT>ze%~Ix^G2VM1oMI_+#iU?vN;Uuh0LV#1K~yM_&CtsY!Y~X5;LOr) zP%{CJV1asrh7)kAnoF6Cj*t^@WrfZ_?YON7&lAFurB89H)PKLZcDpOL3CC^VHhs76 zxlQnG;5NOM@me!BTE=QU!E|};<)9jXuuxb8h_IL|ARk8x5VU8EIGiBDFF&KfERV2I zWDH08C=rzw`La|!W7_Mt`S=xJ z*&iwLn|1q1^Y%HnQ;zCAHruINoHsdBa<%E>6{$_vgng#_hw;r~^ayu#Sk%!lw`o`5 z5(USdhdSQQQhM{$SnJL14u{0onek1GWN?8Gi!+008Fy?~?!k05DKYR7DsmQvd(|-sbMT&E}l6-h+dSVq$wi zN@^)FT64YjVyy1}y@T$QbKYuV%|TLg#iX8JIZ6Nk0KrK_K~yM_#n8n39DfXRj8W!*b$mc|94tA| zae)1CB9HvmBzUYiSF8O~yQ`r+Po^vTu0WW0*UzZxPAqj{fZv`L)CnG_ScvNCo zunK75PwI!``x?xn!G9z8mjbWZP&S8Ktv5i0>%pHljI9<}8phTSEY{Do>t{T#pKYFh skkbWnr`FQL^&imBZ{d3A3jF8?-aRpK)BF=v3IG5A07*qoM6N<$g0l*Se*gdg literal 425 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0Hh>*a~@r+`8N$%%etAR34jfEWx?4=`T^G7fsWIEHAP zKYHOT?_mWV)(2}6^7f`J@44VuWbCfAwQFWWRrfvXkX#-U)xc^Vp-bu?zgIXjFwAv6 zY}B{-T;r)945uw3x^f;f{C?cg_+)Kp;p_~}8CvVuc1d%@+<+vbd6)CQ(?5B*=cKWZ1!32^?=#xKrnyHGLzTYu2{=S?@9?e0&= z(zOX+a*O}`+WDo|{jJu|&z)C);j(1a@~fAWzil|5FIatp>;H@P`>ZD2zD8wC3xJ+c zEpd$~Nl7e8wMs5Z1yT$~21W+D28Oyuh9L%~Rwiavrk2_U237_JcXr9lMbVI(pOTqY XiCe?k=SviU8W=oX{an^LB{Ts5POKvCk*}rXS0nnfl3$C7*!K zEpXHV9AO?ff1I$-}j5VGvjv*T7 z&t5pld00V&Eg}2`*WHy5oEW9Q-m_@@Bg_$bz?uET(%oP7{^&R&<>ddizT#(x#;?_@ zU1C+ZCh_&S_)gljY*__+%F3A}y9xm%$SlE;)#KKX)V6EQZ#{O<5qm<~stqdlw zj@r%tGrLZy-tCpUF9vB^d%C+C%&;PHVb$>iyZYV|NsB?oZjAhtgLGPq&XP?txEs^0K!Q`K~yM_#n8bG!!QT{Kz7Lp z86n7>!0`aJ$uF-IrtP=C?oeZ!MzPv_gM@Sc+2D-aEnVN?*|RIt8qJR*Op{~RBT_TT}FG$b#Zg7e@(v|@XG z@u+JBxaK}09G$Ch1|&nPkYVk?)Y^G&?P+f98Ksh!-wdH3@o@IsE_t002ovPDHLkV1nMDkG22+ literal 426 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0IM72~4hI-rn1a-v@uhz4Q>AO?ff1I$-}j61-6&Xirzgxy4r2!lc(&5 zLmqsdlQJV{ufJaHZvQ>M?C#q9-&j8N>=&Jl?e85yxU6OV_fC1=nl%$lD}Po3eWP09 z8c~vxSdwa$T$Bo=7>o>z40H_)b&U)|3{0&|%&m;gv<(cb3=Ej#`Oczf$jwj5OsmAL Up@?Z)At>NHUHx3vIVCg!0No&ubpQYW diff --git a/graphics/door_anims/lilycove_dept_store.png b/graphics/door_anims/lilycove_dept_store.png index 4f036c51db1cce8e59a6a6ce35f7560c15925720..7c64ab6da82eed8da704b662546b4b02ddad9b5c 100644 GIT binary patch delta 299 zcmV+`0o4Ak1G@r{8Gi!+008Fy?~?!k05DKYR7DsmQvd(|-sbMT&E}l6-h+dSVq$wi zN@^)FT64YjVyy1&=A_=ugVnTZ&74wm#iS7?mT&+70LDo~K~yM_)zHBWgD?yQ(9D9= z2|_0zU7!#}7&pAMy5; z*D{sX4xE-*w9NCd$g{mdEj|#D56pQ+>~l6LO^COY4#Bw#Vn+wAu=b4DS}PbCRdtHt zNqiN+tTxS_TLx9`7k28VZE}$|scl x{ta;$3h0Ugx+HS}D7Ya2g)|tTC=I`p&kJi%4I^GgaY+CG002ovPDHLkV1n6Zgs=br literal 430 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0IM!?^YBQ-MMP$%%etAR34jfEWx?4=`T^GLCt=IEHAP zzk1;yZ?gdp>xDNLJhjqJwlWqa2rU-<&v4El&R9x6ms_-PiagOE-K}1%9g2+lg21G45DW9rOU4jg^ z8O2%!6>&x%-VrPoY=&U@VDo&^S3cpqe8%_u1K)6fCzDua#2GUDh&V$!xX1@z7X3$o Ua2+mB00000Ne4wvM6N<$f+}Kn761SM literal 401 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0G+2VO0$cBWnD%(#)KYk_ w7?@g_SXddGY8x0>85kVi<9`=LLvDUbW?Cg~4VxZ*PXvXJr>mdKI;Vst0Py&PT>t<8 diff --git a/graphics/door_anims/mauville.png b/graphics/door_anims/mauville.png index 63167408ad65d2c4447ed7ad1cb220a02a51ea0f..fec5f344fba4ee8727b153750c52898ef5dff8f5 100644 GIT binary patch delta 301 zcmV+|0n+}k1HA%}8Gi!+008Fy?~?!k05DKYR7HEVz5oBT?(SOE)j_?qN`r%oVq$wi zN@^)FTGiFnq@=9o#rD;U-osI7A7p_Z(CdM_6CGYK(Mn|~_+h(K*TfTuQI%Q(w5 zyn*ANDBqibm`X-uz*KgDWf3U*eLq{?Z(@a6tuUXh+@^AyV!)C&0ab2wb$--Ymt_N{=>Qg=s5v!-9+T@v)00000NkvXXu0mjfr0tBG literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0G+-S#h6U4TLY$%%etAR34jfEWx?4=`T^GER89IEHAP zKRe+p?_mX=)<{Mp#&?>}*IZEDhu;c&>XRz4+3CmWjEqbwV+M1dweX(!Gat8uu zYd0`>oyW9lO=)SJiFgc$Q*6F-(3W`tTl9{8`du^OorLHdrijKTdmVDTSpH|V#;)D4 zdeZEm#;H|*n7E{wb+?$@a67qt%7^JcOMch1CwJ*Dj_~5&$!__NXD54M#j9XDeuG`1 zHPig`P6Pd|3fCO~mu9Lz|5h=vnNfh*TABAFu$ojztj5Ewj$&5RaJ(leB z^wY5%tb%o#d2_I3<}dtBJ{9MYNH2luk!102 Y0_M|E?x({8D*ylh07*qoM6N<$f}$C=tpET3 literal 509 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0Hn-ldI4&H{x5k`w*PKr|3505KS(9$>!8z`!W#>Ealo zasKQ@$Gm0(0oDta;@>4!TQ=wxP6%s0BGw%dXqIyzkiVgbanUc9sZ|X*MQ#5KFQ}DV z4Yih@cZ{vyK1AJdY3HjFkC%&Pd|M&4LT7WPy3qNYSk0C;!*kodEaE-x|7DJJgO01b zcVJA{u65P5`dyEz{d<}{4hVhrTaxJftW4DMo{Zr+!S@WzChyiI-|#kQt8zo?GyOllcFj*FdgwR4oOnL8&_!zL zq1~w`@0XfvSoQUU`^D-f&9)2kC!FWn6M9tF$!(Vg-wF1WN92~z4|_8I>i_vQw|++c zm9n}S*ZBJgKYk_7?@g_SXvnxYa19?85r<(i!DLXkei>9nO2EgL(R2y5}>&7boFyt I=akR{07nnK>;M1& diff --git a/graphics/door_anims/pacifidlog.png b/graphics/door_anims/pacifidlog.png index 3e05288255cf4fb19527b03c2878df97f06632ce..841c31658d649c60888ccb6ba2b517e797ccdb9f 100644 GIT binary patch delta 321 zcmV-H0lxmk1JMGI8Gi!+008Fy?~?!k05DKYR7C&)0N&=Lw7q+rq+)}MN?KwmVq$wi zN@^e=QtsxY?!{uwoH?X>7=uzVgM*7wYSnC2)-eD80NhDLK~yM_&Cs!N!!Qg5Q0ydW z0zwnWTp>xtQqlxAPABh?QCM&Q7ICi%GngPDosT*fX>$1u-hTlN`JovwrE8#Tu{CIh zR~Sr8KmiWW+M&O6)&OE}?FBIb`!q9bgJ{5NfXXBw4cz7!>HdfrG2RuA9X~sQ!e|?zrzLOfHm-^{Y=wbYRQNvc!e)WpD$QyjQeT) zQn>9vAi>DIdOAf~)fl;kt8v{+c;C+xkCU2H Tl_fKQ00000NkvXXu0mjfJF<;- literal 452 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0HnotH1JOa=-GBq#cnfoLFB0AesmJ-~bw$hhO_;uxZF z{_KT~y@w5WSOeA_I90pu0)v*xske#B4^o+qFI^QAHo>-WC1(zQ=^_{D#wP7cEI)bW zPq_Ws;5%ni&W1I6-1;snE2*n(Xi$$hY|`)DaloeCz)1bWoHVx^Gn83)17@-;X`Fvg zBFkUx@Qkp+TOYR`){0@9sBKYy-NJ8gHJj#|#eN^WuT46TeE;OjrjFj6K5;n*-aT9A zzuv09HD!jnMXR>Qe0_`S65lQt1pj!}pn9<3hNWxN)2NiC88I)}C)%x?KWBR3bdH+3 z;#I8KKctwieK6Il=KTNtGyA5)NoU>eZ7%})Q?2OC7#SED=o%R6 z8X1Ndm|B@wTA7$=8yHv_7&M$w^Fz^)o1c=IR*74~$BFYkfr8Z2)z4*}Q$iB}Hm9I~ diff --git a/graphics/door_anims/petalburg_gym.png b/graphics/door_anims/petalburg_gym.png new file mode 100644 index 0000000000000000000000000000000000000000..42a1e1dfde2db2157bd42c50b25674799c68eca1 GIT binary patch literal 289 zcmV++0p9+JP)KhL>^uRK(%$3ulnyX;06ya- zOzo5LhKS0Us^ypc=!N^yOYXRa4{(m*D*?Xj1*!#b8v&aEREt2{@bUlY=NmYPrGDU- nQ!N5s0yhVE3EJSPcl|s88&4S*v2toa00000NkvXXu0mjfj5&aT literal 0 HcmV?d00001 diff --git a/graphics/door_anims/poke_center.png b/graphics/door_anims/poke_center.png index 8658107149024abb90fd59b85dbae29fda13df90..8bf5cb146dd19441ed4d034c632a843feb8911e3 100644 GIT binary patch delta 288 zcmV+*0pI?k1F!;+8Gi!+008Fy?~?!k05DKYR7DsmQvd(|-sbMT&E}l6-h+dSVq$wi zN@^)FT64YjVyy1}y@T$QbKYuV%|TLg#iX8JIZ6Nk0J}*R< z1Gu20io^s~Ca}|`0F+29gp@THB@z{Q2I8|xf+bKo_|;RsE`PfFiJ2Rb0g{L`1KbS) zyQ|_R0Ad&*SK2{hjXWTA9{Vz8M(Ii5N$AO^&V7Gb3x0tdEk;m8i+C!_{Q`t|1lZ0P z8$1-nW`4zl>8d~5r|W!#6=1G?AFOSE|H5vKTr+uE5JY|BPgBK|P0000 z>o=#Mbc2%+gGp-+ufq1dN$g4q8YP9u_k85}=H&9e)XE6%nnoE@ z_W+l(HLrfZW;#+Mw)4D%^gf=$$#q9tUaqpgy?j+oi>O0Rt^B*1X&hY_j+gK2Zxq?* z-)45_?_0amziZn6t>0REjQyq#qsYYB<^e6HKd&sWowr76`n=}-wShoysFt`!l%yn< zq*^5xr2;7iBLgD?T?0d1Bf}5_Q!5ioD^nwF0|P4q1O08nuTV7P=BH$)RpQnV_j+|0 PD8xKn{an^LB{Ts5Hm8kG diff --git a/graphics/door_anims/pokemon_league.png b/graphics/door_anims/pokemon_league.png index cac740f561669701a81214107f4b3424fa7f3113..34419ac0ada256811ab19aece7d6f5b2fcea3344 100644 GIT binary patch delta 316 zcmV-C0mJ^i1Iz-D8Gi!+008Fy?~?!k05DKYR7DsmQuf7r?wnf9b19@+F@uAPVq$wi zN@^)FT7$*jVw|-9|L)%2#l^*>q^x`Y|8tR1rgi`T0M|)GK~yM_)zC2tgD?~Z;9MaW z@K&KGNV?Unq0*kCv(Po1XE~iYaH_|EtQkQqVSuYz2Xw7-6&Z1IFFcz>ZzEu zrPhVD3C3KtJ{bcjH9?9A;%n6PO^9<{CwPAs;^KXp9;TwLu@ZhIpAt)96A%vq0u%xQ zB;HIoiZ$d0Vl@O(K`sf12Lb(4KJP*Ks6Bwk?+A!x3Ax6wvw+;-b3QLXcx-WL))haSYKo zfAxYP*I@+_wgls}?g>l1*_OZ4i{*}UJi)o-d4}i4=v|@y0eeFA9!UQB=c44f;Oz}N zk9+LDMCy-OuIKt?_-hWc#NuZwLRI@GerJ80D*X7u<$2XhZuLsc;xswrz9M;T!=|uT z9ub0CUh^dTU5o2woa6mLQL%* zwqsMn{RhQ%`iyS{3#Z-wm=wK6rZ rGBnXPFt9Q(_`3a$0*Z#*{FKbJO57S+UZubP0l+XkK*mRX; diff --git a/graphics/door_anims/rustboro_gray.png b/graphics/door_anims/rustboro_gray.png index 2cf62b6dacfa9512b7ee585484155237b91cc865..99211c11a9641b89217ec37f97c6ff2b039671b1 100644 GIT binary patch delta 309 zcmV-50m}Zk1H}T68Gi!+008Fy?~?!k05DKYR7G>er2qf_-rnAR0001U#iU-u!}|aL0MJQ9K~yM_&C*>CgCGn5VD5x* z2e6R~47~t92avVbU!heNmhEv_4dDy4#x@#jE!1Tu-sr1oNz%x-WL)rcaSYKo zfA&%=U$X)aLqgwuKK=veStrCYG_%i`=)87IsMz$kg^|1uxwjlMn{_Sf?ddmLzM48L z&yHu_bn$BE<~^A+YNw_@*z-w>O($%{HN!nh#}=*VJ`lb~A#DAIS;72MG&Z=#SsYxH z(ZIw0mQhym^1~-Q&*li5SY4DjA@ywf=ao`_jRoeEGet;TdBnI}!&6}Gvx>6^BZ~|6 zaUSX^cYP?F6}O6`b2Zaf?%7JYM)T)<%ztM5Z~pf8Kl|d2#1^F2>ip~~Xf^o{B<>Vk zUH;RCammd;e>C2gM*#h%TH+c}l9E`GYL#4+3Zxi}42%qP4GeXS3_}b|txOH9j4ZSb m46Fer2qf_)z!VUw3M8jdxL|EVq$wi zN@^)FTFuqwi?r45=Dpt4ti7yitdwGN#iR;hAvOR20MJQ9K~yM_&C*>CgCGn5VD5x* z2e6R~47~t92avVbU!heNmhEv_4dDy4#x@#jE!1Tu-sr1oNz%AO?ff1I$-}j0>JFjv*T7 z&t8hx5W_X7(8qo!4#&6`TIHFp~En_m*R3v#v$GJ^g0OS5t@O z+40PqE?({2yeD%;?bP%Kdp=3A>4dGgX1GV`*rFBP2g3I#gstB&E0}+Z#s=3oi-U_Y z8hF^>GRi7me)xpv*&JaLtBVpRq@GRxyi)3~vA~>irU;2Ej~JJ0cnYk2R&n-VWO2bh z&O<%rt`CK?;#P5Vu4ekmJzFW)X#Sj!`Ol31&ENk1XJ6cr*n;$0ou6F=ttS70#GQhx z%YWK1F1h*VkH-7*2%z6oOI#yLQW8s2t&)pUffR$0fsui(fuXLEVTggLm8pT1v4ysQ lft7(lfzd`y6b-rgDVb@NxHT~5b4~>Xqo=E%%Q~loCIJ13ngIX+ diff --git a/graphics/door_anims/safari_zone.png b/graphics/door_anims/safari_zone.png index 89807f843f88cad27155dcd008a5f9c7f2fc6cb3..eae6a0e3e519dee004143f9dc4ba0e149691c7f4 100644 GIT binary patch delta 327 zcmV-N0l5Ck1J?qO8Gi!+008Fy?~?!k05DKYR7C&)0Osb+-rlsmy_}?+gM))wVq!r- zN@^)FT64YjVyy1H&F0O`q;tijL9~Mylxl3pMf?B&0OCnRK~yM_)sVpn0x=Lpr-k6j zGGr9-ymlZVES}>QAZF?i@sJjB_q4Uxi}RDXyWrwk2SOe{e}6K}r!{kfLnEx42Inh$ zblF;DYR$mD7Cmc?Fg!^ud?X<$%%etAR34jfEWx?4=`T^G9G!lIEHAP zzdGR{CzGLo>vFN|o0Gq9nb6!(>LbQ|VNNP%qIJP}C98-wbx+=N{*Tr@cofO*Bxhf5 zbY}VL6AjM7G3|`cwQEX_Moq~&dtjrOZkDfsU7>Exi5~u5!8F6RoGOF+la`h?3g=$x z+UZ@sNi5;*>`zAh3QPilJ3g!n&zQB8yM5Wg0QpxJHXY@#pTn>BM47>`#dYH==`{?o zO3?@WxNP#m&)R8Z*yy#*epZ|)@4Wt}PHd0V1ir6a|EKzElzTsCx-Hpo{O$K#wphdF zcQVD(xdhWVBx@Qcu+FG$RXQ@WW}dR~zukq0Cu{=xR<*=6q9i4;B-JXpC>2OC7#SED z=o%R68X1Ndm|B?{SeY7W8yHv_7zpV;e}JMPH$NpatrE9}er2qf_?(Wsz-n6u|l!JqdVq$wi zN@^)FS^xk50001-q?~($dtz#0Qd&{~000Ye(r zA~tn^>IOc0HVx(C%>)jznFDkPstfd`GYGtgR@%gy@js9+ynjIHFE$)8N3n~k#Ay|? z77b0x1^8uupyLHV6|ptuGQF_n2*dHv*cqz=M(nN;_`n;Xf4GQq@9qIj**ixV9FLHJ zI3(Z;Lx8bf0kXCc8o>MIMvA!@@vnM%kZbHvF9WDc6Z{G;!Fo_Z@NGxr3PF8}}l07*qoM6N<$ Ef+e_whyVZp literal 435 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0H{j^}rS4giG&k`w*PKr|3505KS(9$>x-WSsVNaSYKo zfA+#b-a`r^Yzbi*apEgdJNO=?RWux#E$$_C{_D=hGKSf^I>gfjD)`r4IkNa4`=?fM zjlV~yDo>kn&anB${p7qwi%mg6J9-b--4eP!|nM` zXkU37wLJ1G&|9h{t`Q|Ei6yC4$wjF^iowXh$UxV?P}j&X#K6?b)X>VnLfgQ=%D_Od g{_YnP4Y~O#nQ4`{H6$pddVoUE)78&qol`;+0Qeb`NdN!< diff --git a/graphics/door_anims/sootopolis_peaked_roof.png b/graphics/door_anims/sootopolis_peaked_roof.png index b4ccfb5f993ba33e06842e571e7cfb1813b871f5..7d8ea1f33e1710294ddbb02bdc8084127df55687 100644 GIT binary patch delta 306 zcmV-20nPri1HuB38Gi!+008Fy?~?!k05DKYR7G>er2qf_?(Wsz-n6u|l!JqdVq$wi zN@^)FS^xk50001-q?~($dtz#0Qd&{~000YeGj{qbeYWZzH=|4n+a07*qoM6N<$ Ef{~wn*#H0l literal 435 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0H{k)<<(_Hcs7ogGU8*)`Ib6BqR&cj%`uKS-RQ+3|AySILRjRYAW@p9aNme!MOO(?^+g(!2R#k|F-J~a8}LS z!MKWNUdtY?>bAo|3t6r1YhWYqJ_cJ)z4*}Q$iB}FRzdh diff --git a/graphics/door_anims/trainer_hill_lobby_elevator.png b/graphics/door_anims/trainer_hill_lobby_elevator.png index aeb7eaf26050aff021cc812dde0faf71a994fab5..bdd1c3b271d0d3c4ddd895e12fa82735e2f33258 100644 GIT binary patch delta 214 zcmcb^^qg^mWIZzj1H-fb?C_g1^}vu%3o-_)eQb|>+}g##%UOlyuf zh9t5#ee~lw;!y*Z_VQ9VmcTvVi9@$9LB&ZT=}W=^UD1|`SOI^arBk!d&b%YHEeB{l NgQu&X%Q~loCIE-4SabjY literal 348 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=0wfr|csbMpDVB6cUq=Rpjs4tz5?O(KrX+87 z7Y2SSBfG^w9(#$WuPgf#Mp0H{HEZs8exQ&*a-v@uhz4Q>AO?ff1I$-}j1o^5#}JM4 z$ve1Nd3G;sFgd2B;m|Rsk*RHSxq`sK3U*eWr%y|3_2*5Wt}M~iRP;H{PDEr0JM+zN z>qm=0&Aagv_0?^NS>!)D{*4m{k_~tJlj6JY`&l`&{HXJ%)83q z!L)tN6@O*tePCo*^IE^XaJs4_(01GbWneJ>!!2N19Pgg&ebxsLQ0F3HsQ~&?~ diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h index 3c484e39a..ff10f52ee 100644 --- a/include/constants/metatile_labels.h +++ b/include/constants/metatile_labels.h @@ -99,6 +99,7 @@ #define METATILE_PetalburgGym_SlidingDoor_Frame2 0x21A #define METATILE_PetalburgGym_SlidingDoor_Frame3 0x21B #define METATILE_PetalburgGym_SlidingDoor_Frame4 0x21C +#define METATILE_PetalburgGym_Door 0x224 // gTileset_MossdeepGym from R/S #define METATILE_RS_MossdeepGym_RedArrow_Right 0x204 @@ -128,7 +129,6 @@ // gTileset_BattleFrontier #define METATILE_BattleFrontier_Door_Elevator 0x20E -#define METATILE_BattleFrontier_Door_Corridor 0x224 #define METATILE_BattleFrontier_Door_MultiCorridor 0x2AD #define METATILE_BattleFrontier_CorridorOpenDoor_Top 0x207 #define METATILE_BattleFrontier_CorridorOpenDoor_Bottom 0x20F diff --git a/spritesheet_rules.mk b/spritesheet_rules.mk index 9fb184638..87293669c 100644 --- a/spritesheet_rules.mk +++ b/spritesheet_rules.mk @@ -674,3 +674,6 @@ $(FLDEFFGFXDIR)/secret_power_tree.4bpp: %.4bpp: %.png $(FLDEFFGFXDIR)/record_mix_lights.4bpp: %.4bpp: %.png $(GFX) $< $@ -mwidth 4 -mheight 1 + +graphics/door_anims/battle_tower_multi_corridor.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 2 -mheight 4 diff --git a/src/field_door.c b/src/field_door.c index fa813a053..70d10b753 100644 --- a/src/field_door.c +++ b/src/field_door.c @@ -74,7 +74,7 @@ static const u8 sDoorAnimTiles_PokemonLeague[] = INCBIN_U8("graphics/door_anims/ static const u16 sDoorNullPalette20[16] = {}; static const u8 sDoorAnimTiles_Pacifidlog[] = INCBIN_U8("graphics/door_anims/pacifidlog.4bpp"); static const u16 sDoorNullPalette21[16] = {}; -static const u8 sDoorAnimTiles_BattleTowerCorridor[] = INCBIN_U8("graphics/door_anims/battle_tower_corridor.4bpp"); +static const u8 sDoorAnimTiles_PetalburgGym[] = INCBIN_U8("graphics/door_anims/petalburg_gym.4bpp"); static const u16 sDoorNullPalette22[16] = {}; static const u8 sDoorAnimTiles_CyclingRoad[] = INCBIN_U8("graphics/door_anims/cycling_road.4bpp"); static const u16 sDoorNullPalette23[16] = {}; @@ -190,7 +190,7 @@ static const u8 sDoorAnimPalettes_Mauville[] = {7, 7, 7, 7, 7, 7, 7, 7}; static const u8 sDoorAnimPalettes_Verdanturf[] = {6, 6, 5, 5, 5, 5, 5, 5}; static const u8 sDoorAnimPalettes_LilycoveWooden[] = {5, 5, 5, 5, 5, 5, 5, 5}; static const u8 sDoorAnimPalettes_Contest[] = {1, 1, 1, 1, 1, 1, 1, 1}; -static const u8 sDoorAnimPalettes_BattleTowerCorridor[] = {6, 6, 6, 6, 6, 6, 6, 6}; +static const u8 sDoorAnimPalettes_PetalburgGym[] = {6, 6, 6, 6, 6, 6, 6, 6}; static const u8 sDoorAnimPalettes_CyclingRoad[] = {7, 7, 7, 7, 7, 7, 7, 7}; static const u8 sDoorAnimPalettes_LilycoveDeptStore[] = {5, 5, 5, 5, 5, 5, 5, 5}; static const u8 sDoorAnimPalettes_SafariZone[] = {9, 9, 9, 9, 9, 9, 9, 9}; @@ -244,7 +244,7 @@ static const struct DoorGraphics sDoorAnimGraphicsTable[] = {METATILE_Sootopolis_Door, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_Sootopolis, sDoorAnimPalettes_Sootopolis}, {METATILE_EverGrande_Door_PokemonLeague, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_PokemonLeague, sDoorAnimPalettes_PokemonLeague}, {METATILE_Pacifidlog_Door, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_Pacifidlog, sDoorAnimPalettes_Pacifidlog}, - {METATILE_BattleFrontier_Door_Corridor, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_BattleTowerCorridor, sDoorAnimPalettes_BattleTowerCorridor}, + {METATILE_PetalburgGym_Door, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_PetalburgGym, sDoorAnimPalettes_PetalburgGym}, {METATILE_Mauville_Door_CyclingRoad, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_CyclingRoad, sDoorAnimPalettes_CyclingRoad}, {METATILE_Lilycove_Door_DeptStore, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_LilycoveDeptStore, sDoorAnimPalettes_LilycoveDeptStore}, {METATILE_Lilycove_Door_SafariZone, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_SafariZone, sDoorAnimPalettes_SafariZone}, From c2dc4a5dea22c12ee4d84898215c28d84b5d49fb Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 18 May 2022 12:41:46 -0400 Subject: [PATCH 116/208] Some field door comments --- .../{unknown.png => unused_battle_frontier.png} | Bin src/field_door.c | 11 ++++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) rename graphics/door_anims/{unknown.png => unused_battle_frontier.png} (100%) diff --git a/graphics/door_anims/unknown.png b/graphics/door_anims/unused_battle_frontier.png similarity index 100% rename from graphics/door_anims/unknown.png rename to graphics/door_anims/unused_battle_frontier.png diff --git a/src/field_door.c b/src/field_door.c index 70d10b753..756d0dabf 100644 --- a/src/field_door.c +++ b/src/field_door.c @@ -98,7 +98,7 @@ static const u8 sDoorAnimTiles_BattleTowerOld[] = INCBIN_U8("graphics/door_anims static const u16 sDoorNullPalette32[16] = {}; static const u8 sDoorAnimTiles_BattleTowerElevator[] = INCBIN_U8("graphics/door_anims/battle_tower_elevator.4bpp"); static const u16 sDoorNullPalette33[16] = {}; -static const u8 sDoorAnimTiles_34[] = INCBIN_U8("graphics/door_anims/unknown.4bpp"); +static const u8 sDoorAnimTiles_UnusedBattleFrontier[] = INCBIN_U8("graphics/door_anims/unused_battle_frontier.4bpp"); static const u16 sDoorNullPalette34[16] = {}; static const u8 sDoorAnimTiles_BattleDome[] = INCBIN_U8("graphics/door_anims/battle_dome.4bpp"); static const u16 sDoorNullPalette35[16] = {}; @@ -202,7 +202,7 @@ static const u8 sDoorAnimPalettes_AbandonedShipRoom[] = {7, 7, 7, 7, 7, 7, 7, 7} static const u8 sDoorAnimPalettes_LilycoveDeptStoreElevator[] = {6, 6, 7, 7, 7, 7, 7, 7}; static const u8 sDoorAnimPalettes_BattleTowerOld[] = {9, 9, 9, 9, 9, 9, 9, 9}; static const u8 sDoorAnimPalettes_BattleTowerElevator[] = {7, 7, 7, 7, 7, 7, 7, 7}; -static const u8 sDoorAnimPalettes_34[] = {9, 9, 9, 9, 9, 9, 9, 9}; +static const u8 sDoorAnimPalettes_UnusedBattleFrontier[] = {9, 9, 9, 9, 9, 9, 9, 9}; static const u8 sDoorAnimPalettes_BattleDome[] = {1, 1, 1, 1, 1, 1, 1, 1}; static const u8 sDoorAnimPalettes_BattleFactory[] = {9, 9, 9, 9, 9, 9, 9, 9}; static const u8 sDoorAnimPalettes_BattleTower[] = {0, 0, 0, 0, 0, 0, 0, 0}; @@ -256,7 +256,9 @@ static const struct DoorGraphics sDoorAnimGraphicsTable[] = {METATILE_Shop_Door_Elevator, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_LilycoveDeptStoreElevator, sDoorAnimPalettes_LilycoveDeptStoreElevator}, {METATILE_Dewford_Door_BattleTower, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleTowerOld, sDoorAnimPalettes_BattleTowerOld}, {METATILE_BattleFrontier_Door_Elevator, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleTowerElevator, sDoorAnimPalettes_BattleTowerElevator}, - {0x3B0, /* TODO: Missing metatile ID */ DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_34, sDoorAnimPalettes_34}, + // The metatile for this door doesn't seem to correspond to a door in any Emerald tileset. Given the surrounding door animations, it was likely cut from the Battle Frontier. + // From the palettes array we know it uses palette 9, and the door's shadow looks correct using either the Battle Tent or Battle Frontier Outside's 9th palette. + {0x3B0, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_UnusedBattleFrontier, sDoorAnimPalettes_UnusedBattleFrontier}, {METATILE_BattleFrontierOutsideWest_Door_BattleDome, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleDome, sDoorAnimPalettes_BattleDome}, {METATILE_BattleFrontierOutsideWest_Door_BattleFactory, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleFactory, sDoorAnimPalettes_BattleFactory}, {METATILE_BattleFrontierOutsideEast_Door_BattleTower, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleTower, sDoorAnimPalettes_BattleTower}, @@ -278,6 +280,9 @@ static const struct DoorGraphics sDoorAnimGraphicsTable[] = {}, }; +// NOTE: The tiles of a door's animation must be copied to VRAM because they are not already part of any given tileset. +// This means that if there are any pre-existing tiles in this copied region that are visible when the door +// animation is played they will be overwritten. #define DOOR_TILE_START_SIZE1 (NUM_TILES_TOTAL - 8) #define DOOR_TILE_START_SIZE2 (NUM_TILES_TOTAL - 16) From 91baf086386aada0ffd33212f211738a74943c9a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 18 May 2022 22:11:51 -0400 Subject: [PATCH 117/208] Generalize usage of castformPalette --- src/battle_gfx_sfx_util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 2a690d129..ff391b24e 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -590,7 +590,7 @@ void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 battlerId) if (species == SPECIES_CASTFORM) { paletteOffset = 0x100 + battlerId * 16; - LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]); + LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette); LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerId]], paletteOffset, 0x20); } @@ -653,7 +653,7 @@ void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId) if (species == SPECIES_CASTFORM) { paletteOffset = 0x100 + battlerId * 16; - LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]); + LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette); LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerId]], paletteOffset, 0x20); } @@ -973,7 +973,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform) if (targetSpecies == SPECIES_CASTFORM) { gSprites[gBattlerSpriteIds[battlerAtk]].anims = gMonFrontAnimsPtrTable[targetSpecies]; - LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]); + LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette); LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerDef]], paletteOffset, 32); } From 0424e37252f048f3047fb5d6ff5ae690c21a892d Mon Sep 17 00:00:00 2001 From: sneed Date: Thu, 19 May 2022 14:20:34 +0300 Subject: [PATCH 118/208] Fix cherrim + castform interaction --- src/battle_gfx_sfx_util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 9dbfa7771..aeed8ab81 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -914,6 +914,8 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo { StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerAtk]], gBattleSpritesDataPtr->animationData->animArg); paletteOffset = 0x100 + battlerAtk * 16; + lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue); + LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]); LoadPalette(gBattleStruct->castformPalette[gBattleSpritesDataPtr->animationData->animArg], paletteOffset, 32); gBattleMonForms[battlerAtk] = gBattleSpritesDataPtr->animationData->animArg; if (gBattleSpritesDataPtr->battlerData[battlerAtk].transformSpecies != SPECIES_NONE) From 928d3c5a2855a0c85d7b3a6b87e8feeecf58b9ee Mon Sep 17 00:00:00 2001 From: sneed Date: Thu, 19 May 2022 15:08:03 +0300 Subject: [PATCH 119/208] change form on weather fade --- data/battle_scripts_1.s | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 354dde4f0..a9c15040d 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -6511,9 +6511,11 @@ BattleScript_LearnMoveReturn:: BattleScript_RainContinuesOrEnds:: printfromtable gRainContinuesStringIds waitmessage B_WAIT_TIME_LONG - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_RAIN_STOPPED, BattleScript_RainContinuesOrEndsEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_RAIN_STOPPED, BattleScript_RainEnds playanimation BS_ATTACKER, B_ANIM_RAIN_CONTINUES -BattleScript_RainContinuesOrEndsEnd:: + end2 +BattleScript_RainEnds:: + call BattleScript_WeatherFormChanges end2 BattleScript_DamagingWeatherContinues:: @@ -6552,6 +6554,7 @@ BattleScript_DamagingWeatherContinuesEnd:: BattleScript_SandStormHailEnds:: printfromtable gSandStormHailEndStringIds waitmessage B_WAIT_TIME_LONG + call BattleScript_WeatherFormChanges end2 BattleScript_SunlightContinues:: @@ -6563,6 +6566,7 @@ BattleScript_SunlightContinues:: BattleScript_SunlightFaded:: printstring STRINGID_SUNLIGHTFADED waitmessage B_WAIT_TIME_LONG + call BattleScript_WeatherFormChanges end2 BattleScript_OverworldWeatherStarts:: From 881e7e70ec7c14d27d30180e73981397975ef25c Mon Sep 17 00:00:00 2001 From: sneed Date: Thu, 19 May 2022 15:22:28 +0300 Subject: [PATCH 120/208] Generalize usage of castformPalette https://github.com/pret/pokeemerald/pull/1663 --- src/battle_gfx_sfx_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index aeed8ab81..2d441c7eb 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -915,7 +915,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerAtk]], gBattleSpritesDataPtr->animationData->animArg); paletteOffset = 0x100 + battlerAtk * 16; lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue); - LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]); + LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette); LoadPalette(gBattleStruct->castformPalette[gBattleSpritesDataPtr->animationData->animArg], paletteOffset, 32); gBattleMonForms[battlerAtk] = gBattleSpritesDataPtr->animationData->animArg; if (gBattleSpritesDataPtr->battlerData[battlerAtk].transformSpecies != SPECIES_NONE) From d8d31b79722cb2543d99b8c200970c46e431fa34 Mon Sep 17 00:00:00 2001 From: sneed Date: Fri, 20 May 2022 04:57:32 +0300 Subject: [PATCH 121/208] disable last used ball in bpike --- src/battle_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_interface.c b/src/battle_interface.c index 6d98d794d..e0d3b7d61 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -3309,7 +3309,7 @@ bool32 CanThrowLastUsedBall(void) #else if (!CanThrowBall()) return FALSE; - if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) + if (gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FRONTIER)) return FALSE; if (!CheckBagHasItem(gLastThrownBall, 1)) return FALSE; From 307d5d93c4bbf2d1f6a624761a53ceae8d8d32b5 Mon Sep 17 00:00:00 2001 From: hamish Date: Mon, 23 May 2022 08:53:08 -0400 Subject: [PATCH 122/208] add potlergeist animation --- data/battle_anim_scripts.s | 37 +++++++++++++- .../battle_anims/sprites/new/poltergeist.pal | 19 +++++++ include/constants/battle_anim.h | 1 + include/graphics.h | 1 + src/battle_anim_ghost.c | 49 ++++++++++++++++++- src/battle_script_commands.c | 1 + src/data/battle_anim.h | 2 + src/graphics.c | 2 + 8 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 graphics/battle_anims/sprites/new/poltergeist.pal diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index d76aff05a..f1ef78fe0 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -14193,7 +14193,42 @@ Move_LASH_OUT:: end @to do: Move_POLTERGEIST:: - end @to do: + loadspritegfx ANIM_TAG_EYE_SPARKLE + loadspritegfx ANIM_TAG_WHITE_SHADOW @Destiny Bond + loadspritegfx ANIM_TAG_QUICK_GUARD_HAND @Black Colour + loadspritegfx ANIM_TAG_IMPACT + loadspritegfx ANIM_TAG_POLTERGEIST + fadetobg BG_NIGHTMARE + waitbgfadein + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 0, 16, RGB_BLACK + waitforvisualfinish + createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, -16, -8 + createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, 16, -8 + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + waitforvisualfinish + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 16, 0, RGB_BLACK + playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER + delay 0x1 + launchtask AnimTask_DestinyBondWhiteShadow 0x5 0x2 0x0 0x24 + delay 0x30 + playsewithpan SE_M_SAND_ATTACK, SOUND_PAN_TARGET + createvisualtask AnimTask_PoltergeistItem, 2 + waitforvisualfinish + setalpha 12, 8 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x5 0x5 0x1 + launchtemplate gComplexPaletteBlendSpriteTemplate 0x2 0x7 0x7 0x5 0x1 0x0 0xa 0x0 0x0 + playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET + waitforvisualfinish + launchtask AnimTask_NightmareClone 0x2 0x0 + launchtask AnimTask_ShakeMon 0x2 0x5 0x1 0x3 0x0 0x28 0x1 + playsewithpan SE_M_NIGHTMARE, SOUND_PAN_TARGET + waitforvisualfinish + restorebg + waitbgfadein + clearmonbg 0x3 + blendoff + end Move_CORROSIVE_GAS:: end @to do: diff --git a/graphics/battle_anims/sprites/new/poltergeist.pal b/graphics/battle_anims/sprites/new/poltergeist.pal new file mode 100644 index 000000000..699ab1ffa --- /dev/null +++ b/graphics/battle_anims/sprites/new/poltergeist.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +246 246 246 +246 246 246 +213 197 230 +213 197 230 +180 148 213 +180 148 213 +180 148 213 +148 98 197 +115 65 164 +82 32 131 +82 32 131 +82 32 131 +0 0 0 +0 0 0 +0 0 0 diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index bddb727fd..52f46e46d 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -395,6 +395,7 @@ #define ANIM_TAG_OMEGA_SYMBOL (ANIM_SPRITES_START + 383) #define ANIM_TAG_PRIMAL_PARTICLES (ANIM_SPRITES_START + 384) #define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 385) +#define ANIM_TAG_POLTERGEIST (ANIM_SPRITES_START + 386) // battlers #define ANIM_ATTACKER 0 diff --git a/include/graphics.h b/include/graphics.h index 1e2a0f4d8..10e10a1c7 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4906,6 +4906,7 @@ extern const u32 gBattleAnimSpriteGfx_StonePillar[]; extern const u32 gBattleAnimSpritePal_StonePillar[]; extern const u32 gBattleAnimSpriteGfx_StraightBeam[]; extern const u32 gBattleAnimSpritePal_StraightBeam[]; +extern const u32 gBattleAnimSpritePal_Poltergeist[]; extern const u32 gBattleAnimSpriteGfx_SubstituteBack[]; extern const u32 gBattleAnimSpriteGfx_SubstituteFront[]; extern const u32 gBattleAnimSpritePal_SubstituteFront[]; diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index d9cbc919c..5ced0567b 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -2,6 +2,7 @@ #include "battle.h" #include "battle_anim.h" #include "gpu_regs.h" +#include "item_icon.h" #include "palette.h" #include "constants/rgb.h" #include "scanline_effect.h" @@ -39,6 +40,7 @@ static void AnimGhostStatusSprite_Step(struct Sprite *); static void AnimGrudgeFlame(struct Sprite *); static void AnimMonMoveCircular(struct Sprite *); static void AnimMonMoveCircular_Step(struct Sprite *); +static void AnimPoltergeistItem(struct Sprite *); static const union AffineAnimCmd sAffineAnim_ConfuseRayBallBounce[] = { @@ -270,6 +272,17 @@ const struct SpriteTemplate gFlashCannonBallMovementTemplate = .callback = AnimShadowBall }; +const struct SpriteTemplate gPoltergeistEffectTemplate = +{ + .tileTag = ANIM_TAG_POLTERGEIST, + .paletteTag = ANIM_TAG_POLTERGEIST, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_ShadowBall, + .callback = AnimPoltergeistItem, +}; + static void AnimConfuseRayBallBounce(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, TRUE); @@ -870,7 +883,8 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId) && battler != (gBattleAnimAttacker ^ 2) && IsBattlerSpriteVisible(battler)) { - if (gAnimMoveIndex == MOVE_DARK_VOID) + if (gAnimMoveIndex == MOVE_DARK_VOID + || gAnimMoveIndex == MOVE_POLTERGEIST) spriteId = CreateSprite(&gDarkVoidBlackHoleTemplate, baseX, baseY, 55); //dark void else spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55); //destiny bond @@ -1395,3 +1409,36 @@ static void AnimMonMoveCircular_Step(struct Sprite *sprite) sprite->callback = DestroySpriteAndMatrix; } } + +void AnimTask_PoltergeistItem(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + u8 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + u8 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + (GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_HEIGHT) / 2); + + task->data[0] = AddItemIconSprite(ANIM_TAG_ITEM_BAG, ANIM_TAG_ITEM_BAG, gLastUsedItem); + gSprites[task->data[0]].x = x + 4; + gSprites[task->data[0]].y = y + 4; + gSprites[task->data[0]].data[0] = x + 4; + gSprites[task->data[0]].data[1] = y + 4; + gSprites[task->data[0]].callback = AnimPoltergeistItem; + + task->data[1] = CreateSprite(&gPoltergeistEffectTemplate, x, y, 1); + gSprites[task->data[1]].data[0] = x; + gSprites[task->data[1]].data[1] = y; + + gAnimVisualTaskCount += 2; + + DestroyAnimVisualTask(taskId); +} + +static void AnimPoltergeistItem(struct Sprite *sprite) +{ + sprite->data[2] += 4; + + sprite->x = sprite->data[0] + Sin(sprite->data[2], 24); + sprite->y = sprite->data[1] + (Cos(sprite->data[2], 24) - 24); + + if (sprite->data[2] == 256) + DestroyAnimSprite(sprite); +} diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 15915c71a..6892e1766 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9448,6 +9448,7 @@ static void Cmd_various(void) else { PREPARE_ITEM_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].item); + gLastUsedItem = gBattleMons[gActiveBattler].item; gBattlescriptCurrInstr += 7; } return; diff --git a/src/data/battle_anim.h b/src/data/battle_anim.h index 5483b8f3b..62f3802a5 100644 --- a/src/data/battle_anim.h +++ b/src/data/battle_anim.h @@ -1451,6 +1451,7 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_OmegaSymbol, 0x0200, ANIM_TAG_OMEGA_SYMBOL}, {gBattleAnimSpriteGfx_PrimalParticles, 0x0180, ANIM_TAG_PRIMAL_PARTICLES}, {gBattleAnimSpriteGfx_Orbs, 0x0180, ANIM_TAG_STEEL_BEAM}, + {gBattleAnimSpriteGfx_AuraSphere, 0x200, ANIM_TAG_POLTERGEIST}, }; const struct CompressedSpritePalette gBattleAnimPaletteTable[] = @@ -1902,6 +1903,7 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_OmegaSymbol, ANIM_TAG_OMEGA_SYMBOL}, {gBattleAnimSpritePal_PrimalParticles, ANIM_TAG_PRIMAL_PARTICLES}, {gBattleAnimSpritePal_SteelBeam, ANIM_TAG_STEEL_BEAM}, + {gBattleAnimSpritePal_Poltergeist, ANIM_TAG_POLTERGEIST}, }; const struct BattleAnimBackground gBattleAnimBackgroundTable[] = diff --git a/src/graphics.c b/src/graphics.c index b735d20b1..6aae37a9f 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -269,6 +269,8 @@ const u32 gBattleAnimSpritePal_Steamroller[] = INCBIN_U32("graphics/battle_anims const u32 gBattleAnimSpriteGfx_StonePillar[] = INCBIN_U32("graphics/battle_anims/sprites/new/stone_pillar.4bpp.lz"); const u32 gBattleAnimSpritePal_StonePillar[] = INCBIN_U32("graphics/battle_anims/sprites/new/stone_pillar.gbapal.lz"); +const u32 gBattleAnimSpritePal_Poltergeist[] = INCBIN_U32("graphics/battle_anims/sprites/new/poltergeist.gbapal.lz"); + const u32 gBattleAnimSpriteGfx_StraightBeam[] = INCBIN_U32("graphics/battle_anims/sprites/new/straight_beam.4bpp.lz"); const u32 gBattleAnimSpritePal_StraightBeam[] = INCBIN_U32("graphics/battle_anims/sprites/new/straight_beam.gbapal.lz"); From c8e08edbae06a71d237e0006bb74729c71b2f9b8 Mon Sep 17 00:00:00 2001 From: sneed Date: Mon, 23 May 2022 19:10:24 +0300 Subject: [PATCH 123/208] rename item1 and item2 in BaseStats --- include/pokemon.h | 4 +- src/data/pokemon/base_stats.h | 1548 ++++++++++++++++----------------- src/pokemon.c | 12 +- 3 files changed, 782 insertions(+), 782 deletions(-) diff --git a/include/pokemon.h b/include/pokemon.h index 8039a4fdd..94a31bbe7 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -212,8 +212,8 @@ struct BaseStats /* 0x0A */ u16 evYield_Speed:2; /* 0x0B */ u16 evYield_SpAttack:2; /* 0x0B */ u16 evYield_SpDefense:2; - /* 0x0C */ u16 item1; - /* 0x0E */ u16 item2; + /* 0x0C */ u16 itemCommon; + /* 0x0E */ u16 itemRare; /* 0x10 */ u8 genderRatio; /* 0x11 */ u8 eggCycles; /* 0x12 */ u8 friendship; diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index d851dfbe1..6b6ab12aa 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -20,8 +20,8 @@ .evYield_Speed = 2, \ .evYield_SpAttack = 2, \ .evYield_SpDefense = 2, \ - .item1 = ITEM_NONE, \ - .item2 = ITEM_NONE, \ + .itemCommon = ITEM_NONE, \ + .itemRare = ITEM_NONE, \ .genderRatio = MON_GENDERLESS, \ .eggCycles = 120, \ .friendship = 0, \ @@ -56,8 +56,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -88,8 +88,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -120,8 +120,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -152,8 +152,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -184,8 +184,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -216,8 +216,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -248,8 +248,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -280,8 +280,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -312,8 +312,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 3, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -344,8 +344,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -376,8 +376,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -408,8 +408,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_SILVER_POWDER, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SILVER_POWDER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -440,8 +440,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -472,8 +472,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -504,8 +504,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_POISON_BARB, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -536,8 +536,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -568,8 +568,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -600,8 +600,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 3, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -632,8 +632,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -664,8 +664,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -696,8 +696,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -728,8 +728,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_SHARP_BEAK, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SHARP_BEAK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -760,8 +760,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -792,8 +792,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -824,8 +824,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_ORAN_BERRY, - .item2 = ITEM_LIGHT_BALL, + .itemCommon = ITEM_ORAN_BERRY, + .itemRare = ITEM_LIGHT_BALL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 10, .friendship = 70, @@ -856,8 +856,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 3, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_ORAN_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_ORAN_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 10, .friendship = 70, @@ -888,8 +888,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_QUICK_CLAW, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_QUICK_CLAW, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -920,8 +920,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_QUICK_CLAW, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_QUICK_CLAW, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -952,8 +952,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_FEMALE, .eggCycles = 20, .friendship = 70, @@ -984,8 +984,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_FEMALE, .eggCycles = 20, .friendship = 70, @@ -1016,8 +1016,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_FEMALE, .eggCycles = 20, .friendship = 70, @@ -1048,8 +1048,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_MALE, .eggCycles = 20, .friendship = 70, @@ -1080,8 +1080,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_MALE, .eggCycles = 20, .friendship = 70, @@ -1112,8 +1112,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_MALE, .eggCycles = 20, .friendship = 70, @@ -1144,8 +1144,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_LEPPA_BERRY, - .item2 = ITEM_MOON_STONE, + .itemCommon = ITEM_LEPPA_BERRY, + .itemRare = ITEM_MOON_STONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 10, .friendship = 140, @@ -1176,8 +1176,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_LEPPA_BERRY, - .item2 = ITEM_MOON_STONE, + .itemCommon = ITEM_LEPPA_BERRY, + .itemRare = ITEM_MOON_STONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 10, .friendship = 140, @@ -1208,8 +1208,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_RAWST_BERRY, - .item2 = ITEM_RAWST_BERRY, + .itemCommon = ITEM_RAWST_BERRY, + .itemRare = ITEM_RAWST_BERRY, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 20, .friendship = 70, @@ -1240,8 +1240,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_RAWST_BERRY, - .item2 = ITEM_RAWST_BERRY, + .itemCommon = ITEM_RAWST_BERRY, + .itemRare = ITEM_RAWST_BERRY, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 20, .friendship = 70, @@ -1272,8 +1272,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 10, .friendship = 70, @@ -1304,8 +1304,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 10, .friendship = 70, @@ -1336,8 +1336,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -1368,8 +1368,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -1400,8 +1400,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1432,8 +1432,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1464,8 +1464,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1496,8 +1496,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_TINY_MUSHROOM, - .item2 = ITEM_BIG_MUSHROOM, + .itemCommon = ITEM_TINY_MUSHROOM, + .itemRare = ITEM_BIG_MUSHROOM, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1528,8 +1528,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_TINY_MUSHROOM, - .item2 = ITEM_BIG_MUSHROOM, + .itemCommon = ITEM_TINY_MUSHROOM, + .itemRare = ITEM_BIG_MUSHROOM, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1560,8 +1560,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1592,8 +1592,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1624,8 +1624,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1656,8 +1656,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1688,8 +1688,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1720,8 +1720,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1752,8 +1752,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1784,8 +1784,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1816,8 +1816,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1848,8 +1848,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1880,8 +1880,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_RAWST_BERRY, - .item2 = ITEM_RAWST_BERRY, + .itemCommon = ITEM_RAWST_BERRY, + .itemRare = ITEM_RAWST_BERRY, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, @@ -1912,8 +1912,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_RAWST_BERRY, - .item2 = ITEM_RAWST_BERRY, + .itemCommon = ITEM_RAWST_BERRY, + .itemRare = ITEM_RAWST_BERRY, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, @@ -1944,8 +1944,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1976,8 +1976,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_KINGS_ROCK, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2008,8 +2008,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_KINGS_ROCK, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2040,8 +2040,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_TWISTED_SPOON, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_TWISTED_SPOON, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, @@ -2072,8 +2072,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_TWISTED_SPOON, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_TWISTED_SPOON, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, @@ -2104,8 +2104,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_TWISTED_SPOON, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_TWISTED_SPOON, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, @@ -2136,8 +2136,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, @@ -2168,8 +2168,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, @@ -2200,8 +2200,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, @@ -2232,8 +2232,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2264,8 +2264,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2296,8 +2296,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2328,8 +2328,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2360,8 +2360,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2392,8 +2392,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_EVERSTONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_EVERSTONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -2424,8 +2424,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_EVERSTONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_EVERSTONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -2456,8 +2456,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_EVERSTONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_EVERSTONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -2488,8 +2488,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2520,8 +2520,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2552,8 +2552,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_KINGS_ROCK, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2584,8 +2584,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_KINGS_ROCK, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2616,8 +2616,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_METAL_COAT, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, @@ -2648,8 +2648,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_METAL_COAT, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, @@ -2680,8 +2680,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_STICK, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_STICK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2712,8 +2712,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_SHARP_BEAK, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SHARP_BEAK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2744,8 +2744,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_SHARP_BEAK, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SHARP_BEAK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2776,8 +2776,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2808,8 +2808,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2840,8 +2840,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NUGGET, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NUGGET, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2872,8 +2872,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NUGGET, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NUGGET, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2904,8 +2904,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_PEARL, - .item2 = ITEM_BIG_PEARL, + .itemCommon = ITEM_PEARL, + .itemRare = ITEM_BIG_PEARL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2936,8 +2936,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_PEARL, - .item2 = ITEM_BIG_PEARL, + .itemCommon = ITEM_PEARL, + .itemRare = ITEM_BIG_PEARL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2968,8 +2968,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3000,8 +3000,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3032,8 +3032,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3064,8 +3064,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -3096,8 +3096,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3128,8 +3128,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3160,8 +3160,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3192,8 +3192,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3224,8 +3224,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, @@ -3256,8 +3256,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, @@ -3288,8 +3288,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3320,8 +3320,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3352,8 +3352,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_THICK_CLUB, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_THICK_CLUB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3384,8 +3384,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_THICK_CLUB, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_THICK_CLUB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3416,8 +3416,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_MALE, .eggCycles = 25, .friendship = 70, @@ -3448,8 +3448,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_MALE, .eggCycles = 25, .friendship = 70, @@ -3480,8 +3480,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3512,8 +3512,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_SMOKE_BALL, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SMOKE_BALL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3544,8 +3544,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_SMOKE_BALL, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SMOKE_BALL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3576,8 +3576,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3608,8 +3608,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3640,8 +3640,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_LUCKY_EGG, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_LUCKY_EGG, .genderRatio = MON_FEMALE, .eggCycles = 40, .friendship = 140, @@ -3672,8 +3672,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3704,8 +3704,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_FEMALE, .eggCycles = 20, .friendship = 70, @@ -3736,8 +3736,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_DRAGON_SCALE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3768,8 +3768,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_DRAGON_SCALE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3800,8 +3800,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3832,8 +3832,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3864,8 +3864,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_STARDUST, - .item2 = ITEM_STAR_PIECE, + .itemCommon = ITEM_STARDUST, + .itemRare = ITEM_STAR_PIECE, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, @@ -3896,8 +3896,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_STARDUST, - .item2 = ITEM_STAR_PIECE, + .itemCommon = ITEM_STARDUST, + .itemRare = ITEM_STAR_PIECE, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, @@ -3928,8 +3928,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_LEPPA_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_LEPPA_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -3960,8 +3960,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -3992,8 +3992,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_ASPEAR_BERRY, - .item2 = ITEM_ASPEAR_BERRY, + .itemCommon = ITEM_ASPEAR_BERRY, + .itemRare = ITEM_ASPEAR_BERRY, .genderRatio = MON_FEMALE, .eggCycles = 25, .friendship = 70, @@ -4024,8 +4024,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 25, .friendship = 70, @@ -4056,8 +4056,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_RAWST_BERRY, - .item2 = ITEM_RAWST_BERRY, + .itemCommon = ITEM_RAWST_BERRY, + .itemRare = ITEM_RAWST_BERRY, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 25, .friendship = 70, @@ -4088,8 +4088,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -4120,8 +4120,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_MALE, .eggCycles = 20, .friendship = 70, @@ -4152,8 +4152,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 5, .friendship = 70, @@ -4184,8 +4184,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 5, .friendship = 70, @@ -4216,8 +4216,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 70, @@ -4248,8 +4248,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_METAL_POWDER, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_METAL_POWDER, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, @@ -4280,8 +4280,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 35, .friendship = 70, @@ -4312,8 +4312,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 35, .friendship = 70, @@ -4344,8 +4344,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 35, .friendship = 70, @@ -4376,8 +4376,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 35, .friendship = 70, @@ -4408,8 +4408,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, @@ -4440,8 +4440,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 30, .friendship = 70, @@ -4472,8 +4472,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 30, .friendship = 70, @@ -4504,8 +4504,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 30, .friendship = 70, @@ -4536,8 +4536,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 30, .friendship = 70, @@ -4568,8 +4568,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 35, .friendship = 70, @@ -4600,8 +4600,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_LEFTOVERS, - .item2 = ITEM_LEFTOVERS, + .itemCommon = ITEM_LEFTOVERS, + .itemRare = ITEM_LEFTOVERS, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 40, .friendship = 70, @@ -4632,8 +4632,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 3, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 80, .friendship = 35, @@ -4664,8 +4664,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 80, .friendship = 35, @@ -4696,8 +4696,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 80, .friendship = 35, @@ -4728,8 +4728,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_DRAGON_SCALE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, @@ -4760,8 +4760,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_DRAGON_SCALE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, @@ -4792,8 +4792,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_DRAGON_SCALE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, @@ -4824,8 +4824,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 0, @@ -4856,8 +4856,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_LUM_BERRY, - .item2 = ITEM_LUM_BERRY, + .itemCommon = ITEM_LUM_BERRY, + .itemRare = ITEM_LUM_BERRY, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 100, @@ -4888,8 +4888,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -4920,8 +4920,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -4952,8 +4952,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -4984,8 +4984,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -5016,8 +5016,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -5048,8 +5048,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -5080,8 +5080,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -5112,8 +5112,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -5144,8 +5144,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -5176,8 +5176,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_ORAN_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_ORAN_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -5208,8 +5208,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_ORAN_BERRY, - .item2 = ITEM_SITRUS_BERRY, + .itemCommon = ITEM_ORAN_BERRY, + .itemRare = ITEM_SITRUS_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -5240,8 +5240,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -5272,8 +5272,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -5304,8 +5304,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -5336,8 +5336,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -5368,8 +5368,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -5400,8 +5400,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -5432,8 +5432,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 3, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -5464,8 +5464,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_YELLOW_SHARD, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_YELLOW_SHARD, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -5496,8 +5496,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_YELLOW_SHARD, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_YELLOW_SHARD, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -5528,8 +5528,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_ORAN_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_ORAN_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 10, .friendship = 70, @@ -5560,8 +5560,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_LEPPA_BERRY, - .item2 = ITEM_MOON_STONE, + .itemCommon = ITEM_LEPPA_BERRY, + .itemRare = ITEM_MOON_STONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 10, .friendship = 140, @@ -5592,8 +5592,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 10, .friendship = 70, @@ -5624,8 +5624,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 10, .friendship = 70, @@ -5656,8 +5656,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 10, .friendship = 70, @@ -5688,8 +5688,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -5720,8 +5720,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -5752,8 +5752,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -5784,8 +5784,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -5816,8 +5816,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -5848,8 +5848,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 3, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -5880,8 +5880,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 10, .friendship = 70, @@ -5912,8 +5912,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 10, .friendship = 70, @@ -5944,8 +5944,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -5976,8 +5976,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 3, - .item1 = ITEM_NONE, - .item2 = ITEM_KINGS_ROCK, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6008,8 +6008,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6040,8 +6040,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6072,8 +6072,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 3, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6104,8 +6104,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6136,8 +6136,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6168,8 +6168,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6200,8 +6200,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6232,8 +6232,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6264,8 +6264,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6296,8 +6296,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 35, .friendship = 70, @@ -6328,8 +6328,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 35, .friendship = 35, @@ -6360,8 +6360,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -6392,8 +6392,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 3, - .item1 = ITEM_NONE, - .item2 = ITEM_KINGS_ROCK, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6424,8 +6424,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_SPELL_TAG, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, @@ -6456,8 +6456,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 40, .friendship = 70, @@ -6488,8 +6488,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6520,8 +6520,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_PERSIM_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_PERSIM_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6552,8 +6552,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6584,8 +6584,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6616,8 +6616,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6648,8 +6648,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6680,8 +6680,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_METAL_COAT, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_METAL_COAT, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -6712,8 +6712,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 20, .friendship = 70, @@ -6744,8 +6744,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 20, .friendship = 70, @@ -6776,8 +6776,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6808,8 +6808,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -6840,8 +6840,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_ORAN_BERRY, - .item2 = ITEM_ORAN_BERRY, + .itemCommon = ITEM_ORAN_BERRY, + .itemRare = ITEM_ORAN_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6872,8 +6872,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -6904,8 +6904,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_QUICK_CLAW, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_QUICK_CLAW, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -6936,8 +6936,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6968,8 +6968,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7000,8 +7000,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7032,8 +7032,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7064,8 +7064,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7096,8 +7096,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7128,8 +7128,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_RED_SHARD, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_RED_SHARD, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 20, .friendship = 70, @@ -7160,8 +7160,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7192,8 +7192,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7224,8 +7224,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7256,8 +7256,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -7288,8 +7288,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -7320,8 +7320,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -7352,8 +7352,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -7384,8 +7384,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_DRAGON_SCALE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7416,8 +7416,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7448,8 +7448,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7480,8 +7480,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, @@ -7512,8 +7512,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7544,8 +7544,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -7576,8 +7576,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_MALE, .eggCycles = 25, .friendship = 70, @@ -7608,8 +7608,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_MALE, .eggCycles = 25, .friendship = 70, @@ -7640,8 +7640,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_ASPEAR_BERRY, - .item2 = ITEM_ASPEAR_BERRY, + .itemCommon = ITEM_ASPEAR_BERRY, + .itemRare = ITEM_ASPEAR_BERRY, .genderRatio = MON_FEMALE, .eggCycles = 25, .friendship = 70, @@ -7672,8 +7672,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 25, .friendship = 70, @@ -7704,8 +7704,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_RAWST_BERRY, - .item2 = ITEM_RAWST_BERRY, + .itemCommon = ITEM_RAWST_BERRY, + .itemRare = ITEM_RAWST_BERRY, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 25, .friendship = 70, @@ -7736,8 +7736,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_MOOMOO_MILK, - .item2 = ITEM_MOOMOO_MILK, + .itemCommon = ITEM_MOOMOO_MILK, + .itemRare = ITEM_MOOMOO_MILK, .genderRatio = MON_FEMALE, .eggCycles = 20, .friendship = 70, @@ -7768,8 +7768,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_LUCKY_EGG, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_LUCKY_EGG, .genderRatio = MON_FEMALE, .eggCycles = 40, .friendship = 140, @@ -7800,8 +7800,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 80, .friendship = 35, @@ -7832,8 +7832,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 80, .friendship = 35, @@ -7864,8 +7864,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 80, .friendship = 35, @@ -7896,8 +7896,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, @@ -7928,8 +7928,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, @@ -7960,8 +7960,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, @@ -7992,8 +7992,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 3, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 0, @@ -8024,8 +8024,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 3, - .item1 = ITEM_SACRED_ASH, - .item2 = ITEM_SACRED_ASH, + .itemCommon = ITEM_SACRED_ASH, + .itemRare = ITEM_SACRED_ASH, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 0, @@ -8056,8 +8056,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_LUM_BERRY, - .item2 = ITEM_LUM_BERRY, + .itemCommon = ITEM_LUM_BERRY, + .itemRare = ITEM_LUM_BERRY, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 100, @@ -8138,8 +8138,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -8170,8 +8170,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -8202,8 +8202,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 3, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -8234,8 +8234,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -8266,8 +8266,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -8298,8 +8298,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -8330,8 +8330,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -8362,8 +8362,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -8394,8 +8394,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, @@ -8426,8 +8426,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_PECHA_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_PECHA_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8458,8 +8458,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_PECHA_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_PECHA_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8490,8 +8490,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_ORAN_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_ORAN_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8522,8 +8522,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_ORAN_BERRY, - .item2 = ITEM_SITRUS_BERRY, + .itemCommon = ITEM_ORAN_BERRY, + .itemRare = ITEM_SITRUS_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8554,8 +8554,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8586,8 +8586,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8618,8 +8618,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_SILVER_POWDER, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SILVER_POWDER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8650,8 +8650,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8682,8 +8682,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 3, - .item1 = ITEM_NONE, - .item2 = ITEM_SILVER_POWDER, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SILVER_POWDER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8714,8 +8714,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8746,8 +8746,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8778,8 +8778,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 3, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8810,8 +8810,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8842,8 +8842,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8874,8 +8874,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8906,8 +8906,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8938,8 +8938,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8970,8 +8970,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 15, .friendship = 70, @@ -9002,8 +9002,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -9034,8 +9034,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -9066,8 +9066,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -9098,8 +9098,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -9130,8 +9130,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_CHESTO_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_CHESTO_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -9162,8 +9162,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9194,8 +9194,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9226,8 +9226,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -9258,8 +9258,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_SILVER_POWDER, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SILVER_POWDER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -9290,8 +9290,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 70, @@ -9322,8 +9322,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 70, @@ -9354,8 +9354,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_LEPPA_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_LEPPA_BERRY, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 15, .friendship = 70, @@ -9386,8 +9386,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_LEPPA_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_LEPPA_BERRY, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 15, .friendship = 70, @@ -9418,8 +9418,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_PERSIM_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_PERSIM_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9450,8 +9450,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, @@ -9482,8 +9482,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, @@ -9514,8 +9514,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9546,8 +9546,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9578,8 +9578,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, @@ -9610,8 +9610,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9642,8 +9642,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9674,8 +9674,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_HEART_SCALE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_HEART_SCALE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 20, .friendship = 70, @@ -9706,8 +9706,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -9738,8 +9738,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -9770,8 +9770,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9802,8 +9802,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9834,8 +9834,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -9866,8 +9866,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -9898,8 +9898,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_SOFT_SAND, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SOFT_SAND, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9930,8 +9930,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9962,8 +9962,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9994,8 +9994,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, @@ -10026,8 +10026,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_KINGS_ROCK, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, @@ -10058,8 +10058,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10090,8 +10090,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10122,8 +10122,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_RAWST_BERRY, - .item2 = ITEM_RAWST_BERRY, + .itemCommon = ITEM_RAWST_BERRY, + .itemRare = ITEM_RAWST_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10154,8 +10154,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_RAWST_BERRY, - .item2 = ITEM_RAWST_BERRY, + .itemCommon = ITEM_RAWST_BERRY, + .itemRare = ITEM_RAWST_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10186,8 +10186,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10218,8 +10218,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10250,8 +10250,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10282,8 +10282,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_POISON_BARB, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -10314,8 +10314,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_POISON_BARB, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -10346,8 +10346,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10378,8 +10378,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NEVER_MELT_ICE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NEVER_MELT_ICE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10410,8 +10410,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_MOON_STONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_MOON_STONE, .genderRatio = MON_GENDERLESS, .eggCycles = 25, .friendship = 70, @@ -10442,8 +10442,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_SUN_STONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SUN_STONE, .genderRatio = MON_GENDERLESS, .eggCycles = 25, .friendship = 70, @@ -10474,8 +10474,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 10, .friendship = 70, @@ -10506,8 +10506,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10538,8 +10538,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10570,8 +10570,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10602,8 +10602,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10634,8 +10634,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10666,8 +10666,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10698,8 +10698,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10730,8 +10730,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10762,8 +10762,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10794,8 +10794,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10826,8 +10826,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_SPELL_TAG, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, @@ -10858,8 +10858,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_SPELL_TAG, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, @@ -10890,8 +10890,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_POISON_BARB, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10922,8 +10922,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -10954,8 +10954,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 2, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -10986,8 +10986,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -11018,8 +11018,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_BIG_PEARL, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_BIG_PEARL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -11050,8 +11050,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_BIG_PEARL, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_BIG_PEARL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -11082,8 +11082,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -11114,8 +11114,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_CHESTO_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_CHESTO_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -11146,8 +11146,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_CHESTO_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_CHESTO_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -11178,8 +11178,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_CHESTO_BERRY, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_CHESTO_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -11210,8 +11210,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_BLUE_SHARD, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_BLUE_SHARD, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -11242,8 +11242,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -11274,8 +11274,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -11306,8 +11306,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, @@ -11338,8 +11338,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_SPELL_TAG, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, @@ -11370,8 +11370,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_SPELL_TAG, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, @@ -11402,8 +11402,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -11434,8 +11434,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -11466,8 +11466,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_GREEN_SHARD, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_GREEN_SHARD, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 40, .friendship = 70, @@ -11498,8 +11498,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_HARD_STONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_HARD_STONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 35, .friendship = 35, @@ -11530,8 +11530,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_HARD_STONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_HARD_STONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 35, .friendship = 35, @@ -11562,8 +11562,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_HARD_STONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_HARD_STONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 35, .friendship = 35, @@ -11594,8 +11594,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_MYSTIC_WATER, - .item2 = ITEM_MYSTIC_WATER, + .itemCommon = ITEM_MYSTIC_WATER, + .itemRare = ITEM_MYSTIC_WATER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -11626,8 +11626,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_MALE, .eggCycles = 15, .friendship = 70, @@ -11658,8 +11658,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_FEMALE, .eggCycles = 15, .friendship = 70, @@ -11690,8 +11690,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 30, .friendship = 70, @@ -11722,8 +11722,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 30, .friendship = 70, @@ -11754,8 +11754,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 30, .friendship = 70, @@ -11786,8 +11786,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 30, .friendship = 70, @@ -11818,8 +11818,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -11850,8 +11850,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 2, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -11882,8 +11882,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -11914,8 +11914,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_DRAGON_SCALE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, @@ -11946,8 +11946,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_DRAGON_SCALE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, @@ -11978,8 +11978,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_DRAGON_SCALE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, @@ -12010,8 +12010,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_METAL_COAT, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 40, .friendship = 35, @@ -12042,8 +12042,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_METAL_COAT, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 40, .friendship = 35, @@ -12074,8 +12074,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_METAL_COAT, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 40, .friendship = 35, @@ -12106,8 +12106,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 80, .friendship = 35, @@ -12138,8 +12138,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 3, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 80, .friendship = 35, @@ -12170,8 +12170,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 80, .friendship = 35, @@ -12202,8 +12202,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 0, @@ -12234,8 +12234,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 0, @@ -12266,8 +12266,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 0, @@ -12298,8 +12298,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 3, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_FEMALE, .eggCycles = 120, .friendship = 90, @@ -12330,8 +12330,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 3, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_MALE, .eggCycles = 120, .friendship = 90, @@ -12362,8 +12362,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 0, .evYield_SpDefense = 0, - .item1 = ITEM_STAR_PIECE, - .item2 = ITEM_STAR_PIECE, + .itemCommon = ITEM_STAR_PIECE, + .itemRare = ITEM_STAR_PIECE, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 100, @@ -12394,8 +12394,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 1, .evYield_SpDefense = 0, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 0, @@ -12426,8 +12426,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 0, .evYield_SpAttack = 1, .evYield_SpDefense = 1, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, + .itemCommon = ITEM_NONE, + .itemRare = ITEM_NONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, diff --git a/src/pokemon.c b/src/pokemon.c index 61125e362..0ee93bd5b 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -6610,26 +6610,26 @@ void SetWildMonHeldItem(void) if (rnd < chanceNoItem) return; if (rnd < chanceCommon) - SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item1); + SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemCommon); else - SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item2); + SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemRare); } } else { - if (gBaseStats[species].item1 == gBaseStats[species].item2 && gBaseStats[species].item1 != ITEM_NONE) + if (gBaseStats[species].itemCommon == gBaseStats[species].itemRare && gBaseStats[species].itemCommon != ITEM_NONE) { // Both held items are the same, 100% chance to hold item - SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item1); + SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemCommon); } else { if (rnd < chanceNoItem) return; if (rnd < chanceCommon) - SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item1); + SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemCommon); else - SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item2); + SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemRare); } } } From c316b11739654d84003d72f493a7c3967d620798 Mon Sep 17 00:00:00 2001 From: sneed Date: Tue, 24 May 2022 00:53:09 +0300 Subject: [PATCH 124/208] chanceCommon to chanceNotRare --- src/pokemon.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 0ee93bd5b..7cdad72e9 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -6587,12 +6587,12 @@ void SetWildMonHeldItem(void) u16 rnd = Random() % 100; u16 species = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES, 0); u16 chanceNoItem = 45; - u16 chanceCommon = 95; + u16 chanceNotRare = 95; if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG, 0) && GetMonAbility(&gPlayerParty[0]) == ABILITY_COMPOUND_EYES) { chanceNoItem = 20; - chanceCommon = 80; + chanceNotRare = 80; } if (gMapHeader.mapLayoutId == LAYOUT_ALTERING_CAVE) { @@ -6600,7 +6600,7 @@ void SetWildMonHeldItem(void) if (alteringCaveId != 0) { // In active Altering Cave, use special item list - if (rnd < chanceCommon) + if (rnd < chanceNotRare) return; SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &sAlteringCaveWildMonHeldItems[alteringCaveId].item); } @@ -6609,7 +6609,7 @@ void SetWildMonHeldItem(void) // In inactive Altering Cave, use normal items if (rnd < chanceNoItem) return; - if (rnd < chanceCommon) + if (rnd < chanceNotRare) SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemCommon); else SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemRare); @@ -6626,7 +6626,7 @@ void SetWildMonHeldItem(void) { if (rnd < chanceNoItem) return; - if (rnd < chanceCommon) + if (rnd < chanceNotRare) SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemCommon); else SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemRare); From 5c92062c23a1d00344a6d7478f31c7c05bbd659c Mon Sep 17 00:00:00 2001 From: sneed Date: Wed, 25 May 2022 08:37:36 +0300 Subject: [PATCH 125/208] Update pokemon_summary_screen.c --- src/pokemon_summary_screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 10c69a422..bbc8fef4c 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -2439,7 +2439,7 @@ static void Task_ShowPowerAccWindow(u8 taskId) { if (data[0] < 0) { - if (sMonSummaryScreen->currPageIndex == 2) + if (sMonSummaryScreen->currPageIndex == PSS_PAGE_BATTLE_MOVES) PutWindowTilemap(PSS_LABEL_WINDOW_MOVES_POWER_ACC); } else @@ -2492,7 +2492,7 @@ static void Task_ShowAppealJamWindow(u8 taskId) { if (data[0] < 0) { - if (sMonSummaryScreen->currPageIndex == 3 && FuncIsActiveTask(PssScrollRight) == 0) + if (sMonSummaryScreen->currPageIndex == PSS_PAGE_CONTEST_MOVES && FuncIsActiveTask(PssScrollRight) == 0) PutWindowTilemap(PSS_LABEL_WINDOW_MOVES_APPEAL_JAM); DrawContestMoveHearts(data[2]); } From a913191323287f2c27abbf2a524b492da5add3f0 Mon Sep 17 00:00:00 2001 From: sneed Date: Wed, 25 May 2022 16:07:54 +0300 Subject: [PATCH 126/208] Document DrawPagination --- src/pokemon_summary_screen.c | 64 ++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index bbc8fef4c..b2bcce6cb 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -2314,69 +2314,69 @@ u8 GetMoveSlotToReplace(void) static void DrawPagination(void) // Updates the pagination dots at the top of the summary screen { - u16 *alloced = Alloc(32); + u16 *tilemap = Alloc(8 * PSS_PAGE_COUNT); u8 i; - for (i = 0; i < 4; i++) + for (i = 0; i < PSS_PAGE_COUNT; i++) { u8 j = i * 2; if (i < sMonSummaryScreen->minPageIndex) { - alloced[j + 0] = 0x40; - alloced[j + 1] = 0x40; - alloced[j + 8] = 0x50; - alloced[j + 9] = 0x50; + tilemap[j + 0] = 0x40; + tilemap[j + 1] = 0x40; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x50; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x50; } else if (i > sMonSummaryScreen->maxPageIndex) { - alloced[j + 0] = 0x4A; - alloced[j + 1] = 0x4A; - alloced[j + 8] = 0x5A; - alloced[j + 9] = 0x5A; + tilemap[j + 0] = 0x4A; + tilemap[j + 1] = 0x4A; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x5A; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x5A; } else if (i < sMonSummaryScreen->currPageIndex) { - alloced[j + 0] = 0x46; - alloced[j + 1] = 0x47; - alloced[j + 8] = 0x56; - alloced[j + 9] = 0x57; + tilemap[j + 0] = 0x46; + tilemap[j + 1] = 0x47; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x56; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x57; } else if (i == sMonSummaryScreen->currPageIndex) { if (i != sMonSummaryScreen->maxPageIndex) { - alloced[j + 0] = 0x41; - alloced[j + 1] = 0x42; - alloced[j + 8] = 0x51; - alloced[j + 9] = 0x52; + tilemap[j + 0] = 0x41; + tilemap[j + 1] = 0x42; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x51; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x52; } else { - alloced[j + 0] = 0x4B; - alloced[j + 1] = 0x4C; - alloced[j + 8] = 0x5B; - alloced[j + 9] = 0x5C; + tilemap[j + 0] = 0x4B; + tilemap[j + 1] = 0x4C; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x5B; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x5C; } } else if (i != sMonSummaryScreen->maxPageIndex) { - alloced[j + 0] = 0x43; - alloced[j + 1] = 0x44; - alloced[j + 8] = 0x53; - alloced[j + 9] = 0x54; + tilemap[j + 0] = 0x43; + tilemap[j + 1] = 0x44; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x53; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x54; } else { - alloced[j + 0] = 0x48; - alloced[j + 1] = 0x49; - alloced[j + 8] = 0x58; - alloced[j + 9] = 0x59; + tilemap[j + 0] = 0x48; + tilemap[j + 1] = 0x49; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x58; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x59; } } - CopyToBgTilemapBufferRect_ChangePalette(3, alloced, 11, 0, 8, 2, 16); + CopyToBgTilemapBufferRect_ChangePalette(3, tilemap, 11, 0, PSS_PAGE_COUNT * 2, 2, 16); ScheduleBgCopyTilemapToVram(3); - Free(alloced); + Free(tilemap); } static void ChangeTilemap(const struct TilemapCtrl *unkStruct, u16 *dest, u8 c, bool8 d) From 1cc59acca9583453c08828b693331eb15483457f Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Wed, 25 May 2022 17:46:48 +0100 Subject: [PATCH 127/208] Static assertion for size of save structs --- include/global.h | 4 ++++ src/ereader_helpers.c | 2 ++ src/hall_of_fame.c | 2 ++ src/recorded_battle.c | 2 ++ src/save.c | 6 ++++++ 5 files changed, 16 insertions(+) diff --git a/include/global.h b/include/global.h index 89f725176..60476b13f 100644 --- a/include/global.h +++ b/include/global.h @@ -135,6 +135,10 @@ #define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT) #define NUM_ADDITIONAL_PHRASE_BYTES ROUND_BITS_TO_BYTES(NUM_ADDITIONAL_PHRASES) +// This produces an error at compile-time if expr is zero. +// It looks like file.c:line: size of array `id' is negative +#define STATIC_ASSERT(expr, id) typedef char id[(expr) ? 1 : -1]; + struct Coords8 { s8 x; diff --git a/src/ereader_helpers.c b/src/ereader_helpers.c index ac6e0e1e1..cf3ca16c3 100755 --- a/src/ereader_helpers.c +++ b/src/ereader_helpers.c @@ -15,6 +15,8 @@ #include "constants/items.h" #include "constants/trainer_hill.h" +STATIC_ASSERT(sizeof(struct TrainerHillChallenge) <= SECTOR_DATA_SIZE, TrainerHillChallengeFreeSpace); + struct SendRecvMgr { bool8 isParent; diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index d134f2265..fe19ae77b 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -52,6 +52,8 @@ struct HallofFameTeam struct HallofFameMon mon[PARTY_SIZE]; }; +STATIC_ASSERT(sizeof(struct HallofFameTeam) * HALL_OF_FAME_MAX_TEAMS <= SECTOR_DATA_SIZE * NUM_HOF_SECTORS, HallOfFameFreeSpace); + struct HofGfx { u16 state; diff --git a/src/recorded_battle.c b/src/recorded_battle.c index fd2b3a06b..951572636 100644 --- a/src/recorded_battle.c +++ b/src/recorded_battle.c @@ -67,6 +67,8 @@ struct RecordedBattleSave u32 checksum; }; +STATIC_ASSERT(sizeof(struct RecordedBattleSave) <= SECTOR_DATA_SIZE, RecordedBattleSaveFreeSpace); + EWRAM_DATA u32 gRecordedBattleRngSeed = 0; EWRAM_DATA u32 gBattlePalaceMoveSelectionRngValue = 0; EWRAM_DATA static u8 sBattleRecords[MAX_BATTLERS_COUNT][BATTLER_RECORD_SIZE] = {0}; diff --git a/src/save.c b/src/save.c index dafc20868..52cdaa5dd 100644 --- a/src/save.c +++ b/src/save.c @@ -73,6 +73,12 @@ struct SAVEBLOCK_CHUNK(struct PokemonStorage, 8), // SECTOR_ID_PKMN_STORAGE_END }; +// These will produce an error if a save struct is larger than the space +// alloted for it in the flash. +STATIC_ASSERT(sizeof(struct SaveBlock2) <= SECTOR_DATA_SIZE, SaveBlock2FreeSpace); +STATIC_ASSERT(sizeof(struct SaveBlock1) <= SECTOR_DATA_SIZE * (SECTOR_ID_SAVEBLOCK1_END - SECTOR_ID_SAVEBLOCK1_START + 1), SaveBlock1FreeSpace); +STATIC_ASSERT(sizeof(struct PokemonStorage) <= SECTOR_DATA_SIZE * (SECTOR_ID_PKMN_STORAGE_END - SECTOR_ID_PKMN_STORAGE_START + 1), PokemonStorageFreeSpace); + u16 gLastWrittenSector; u32 gLastSaveCounter; u16 gLastKnownGoodSector; From 75a44fdd796adbdf0cc4841d09fe4c9ad2066dec Mon Sep 17 00:00:00 2001 From: BlackShark Date: Fri, 27 May 2022 02:18:52 +0200 Subject: [PATCH 128/208] use more true & false constants --- src/battle_anim_ghost.c | 4 ++-- src/battle_anim_status_effects.c | 2 +- src/battle_interface.c | 4 ++-- src/battle_util.c | 2 +- src/berry_crush.c | 6 +++--- src/decoration.c | 4 ++-- src/field_message_box.c | 2 +- src/hall_of_fame.c | 6 +++--- src/intro.c | 4 ++-- src/item_menu.c | 2 +- src/mauville_old_man.c | 2 +- src/party_menu.c | 2 +- src/player_pc.c | 6 +++--- src/record_mixing.c | 2 +- src/slot_machine.c | 8 ++++---- 15 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index 02b89b965..c004ae1da 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -653,9 +653,9 @@ static void AnimTask_SpiteTargetShadow_Step1(u8 taskId) startLine = 0; if (position == 1) - task->data[10] = ScanlineEffect_InitWave(startLine, startLine + 64, 2, 6, 0, SCANLINE_EFFECT_REG_BG1HOFS, 1); + task->data[10] = ScanlineEffect_InitWave(startLine, startLine + 64, 2, 6, 0, SCANLINE_EFFECT_REG_BG1HOFS, TRUE); else - task->data[10] = ScanlineEffect_InitWave(startLine, startLine + 64, 2, 6, 0, SCANLINE_EFFECT_REG_BG2HOFS, 1); + task->data[10] = ScanlineEffect_InitWave(startLine, startLine + 64, 2, 6, 0, SCANLINE_EFFECT_REG_BG2HOFS, TRUE); task->data[15]++; break; diff --git a/src/battle_anim_status_effects.c b/src/battle_anim_status_effects.c index 47ba00c90..f56d04ccd 100644 --- a/src/battle_anim_status_effects.c +++ b/src/battle_anim_status_effects.c @@ -549,7 +549,7 @@ void LaunchStatusAnimation(u8 battlerId, u8 statusAnimId) gBattleAnimAttacker = battlerId; gBattleAnimTarget = battlerId; - LaunchBattleAnimation(gBattleAnims_StatusConditions, statusAnimId, 0); + LaunchBattleAnimation(gBattleAnims_StatusConditions, statusAnimId, FALSE); taskId = CreateTask(Task_DoStatusAnimation, 10); gTasks[taskId].data[0] = battlerId; } diff --git a/src/battle_interface.c b/src/battle_interface.c index 26209fe2d..12d367526 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -817,8 +817,8 @@ static void Debug_DrawNumber(s16 number, u16 *dest, bool8 unk) static void Debug_DrawNumberPair(s16 number1, s16 number2, u16 *arg2) { arg2[4] = 0x1E; - Debug_DrawNumber(number2, arg2, 0); - Debug_DrawNumber(number1, arg2 + 5, 1); + Debug_DrawNumber(number2, arg2, FALSE); + Debug_DrawNumber(number1, arg2 + 5, TRUE); } // Because the healthbox is too large to fit into one sprite, it is divided into two sprites. diff --git a/src/battle_util.c b/src/battle_util.c index 6bb6d9ae4..f34c39eb0 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1190,7 +1190,7 @@ u8 DoFieldEndTurnEffects(void) s32 j; for (j = i + 1; j < gBattlersCount; j++) { - if (GetWhoStrikesFirst(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], 0)) + if (GetWhoStrikesFirst(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], FALSE)) SwapTurnOrder(i, j); } } diff --git a/src/berry_crush.c b/src/berry_crush.c index e7a5df951..e6e2d8742 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -2254,7 +2254,7 @@ static u32 Cmd_PrintMessage(struct BerryCrushGame *game, u8 *args) switch (game->cmdState) { case 0: - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); if (args[1] & F_MSG_EXPAND) { StringExpandPlaceholders(gStringVar4, sMessages[args[0]]); @@ -3241,7 +3241,7 @@ static u32 Cmd_SaveGame(struct BerryCrushGame *game, u8 *args) case 2: if (!IsLinkTaskFinished()) return 0; - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, 0, 2, 1, 3); CopyWindowToVram(0, COPYWIN_FULL); CreateTask(Task_LinkFullSave, 0); @@ -3389,7 +3389,7 @@ static u32 Cmd_StopGame(struct BerryCrushGame *game, u8 *args) switch (game->cmdState) { case 0: - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); if (game->playAgainState == PLAY_AGAIN_NO_BERRIES) AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[MSG_NO_BERRIES], game->textSpeed, 0, 2, 1, 3); else diff --git a/src/decoration.c b/src/decoration.c index 7e102251a..547b05acf 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -826,7 +826,7 @@ static void ReturnToActionsMenuFromCategories(u8 taskId) { RemoveDecorationWindow(WINDOW_DECORATION_CATEGORIES); AddDecorationActionsWindow(); - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); PrintCurMainMenuDescription(); gTasks[taskId].func = HandleDecorationActionsMenuInput; } @@ -2664,7 +2664,7 @@ static void FieldCB_StopPuttingAwayDecorations(void) u8 taskId; FadeInFromBlack(); - DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, TRUE); InitDecorationActionsWindow(); taskId = CreateTask(Task_ReinitializeDecorationMenuHandler, 8); gTasks[taskId].tState = 0; diff --git a/src/field_message_box.c b/src/field_message_box.c index 74afb5677..95d0a94c9 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -33,7 +33,7 @@ static void Task_DrawFieldMessage(u8 taskId) task->tState++; break; case 1: - DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, TRUE); task->tState++; break; case 2: diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index fe19ae77b..a195bddcf 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -514,7 +514,7 @@ static void Task_Hof_InitTeamSaveData(u8 taskId) } *lastSavedTeam = *sHofMonPtr; - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, NULL, 2, 1, 3); CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_Hof_TrySaveData; @@ -724,7 +724,7 @@ static void Task_Hof_WaitAndPrintPlayerInfo(u8 taskId) { FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); HallOfFame_PrintPlayerInfo(1, 2); - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_LeagueChamp, 0, NULL, 2, 1, 3); CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_Hof_ExitOnKeyPressed; @@ -1093,7 +1093,7 @@ static void Task_HofPC_HandleExit(u8 taskId) static void Task_HofPC_PrintDataIsCorrupted(u8 taskId) { HofPCTopBar_Print(gText_AButtonExit, 8, TRUE); - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_HOFCorrupted, 0, NULL, 2, 1, 3); CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_HofPC_ExitOnButtonPress; diff --git a/src/intro.c b/src/intro.c index 827ce80be..a1d0508f4 100644 --- a/src/intro.c +++ b/src/intro.c @@ -1848,7 +1848,7 @@ static void Task_Scene3_StartGroudon(u8 taskId) { gTasks[taskId].tState = 0; gTasks[taskId].func = Task_Scene3_Groudon; - ScanlineEffect_InitWave(0, 160, 4, 4, 1, SCANLINE_EFFECT_REG_BG1HOFS, 0); + ScanlineEffect_InitWave(0, 160, 4, 4, 1, SCANLINE_EFFECT_REG_BG1HOFS, FALSE); } #define tScreenX data[1] @@ -2058,7 +2058,7 @@ static void Task_Scene3_LoadKyogre(u8 taskId) gTasks[taskId].tDelay = 16; gTasks[taskId].tZoom = 256; PanFadeAndZoomScreen(gTasks[taskId].tScreenX, gTasks[taskId].tScreenY, gTasks[taskId].tZoom, 0); - ScanlineEffect_InitWave(0, 0xA0, 4, 4, 1, SCANLINE_EFFECT_REG_BG1VOFS, 0); + ScanlineEffect_InitWave(0, 0xA0, 4, 4, 1, SCANLINE_EFFECT_REG_BG1VOFS, FALSE); } static void Task_Scene3_Kyogre(u8 taskId) diff --git a/src/item_menu.c b/src/item_menu.c index 9eaca9597..cd0bc159d 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -1344,7 +1344,7 @@ static void SwitchBagPocket(u8 taskId, s16 deltaBagPocketId, bool16 skipEraseLis DrawPocketIndicatorSquare(newPocket, TRUE); FillBgTilemapBufferRect_Palette0(2, 11, 14, 2, 15, 16); ScheduleBgCopyTilemapToVram(2); - SetBagVisualPocketId(newPocket, 1); + SetBagVisualPocketId(newPocket, TRUE); RemoveBagSprite(ITEMMENUSPRITE_BALL); AddSwitchPocketRotatingBallSprite(deltaBagPocketId); SetTaskFuncWithFollowupFunc(taskId, Task_SwitchBagPocket, gTasks[taskId].func); diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index 681a3dadf..8dbe8b485 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -445,7 +445,7 @@ static void DisableTextPrinters(struct TextPrinterTemplate * printer, u16 a1) static void DrawSongTextWindow(const u8 * str) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, str, 0, 1, 1, DisableTextPrinters); gDisableTextPrinters = TRUE; CopyWindowToVram(0, COPYWIN_FULL); diff --git a/src/party_menu.c b/src/party_menu.c index e15d001c6..cbe127bb9 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -4969,7 +4969,7 @@ static void Task_TryLearnNewMoves(u8 taskId) { u16 learnMove; - if (WaitFanfare(0) && ((JOY_NEW(A_BUTTON)) || (JOY_NEW(B_BUTTON)))) + if (WaitFanfare(FALSE) && ((JOY_NEW(A_BUTTON)) || (JOY_NEW(B_BUTTON)))) { RemoveLevelUpStatsWindow(); learnMove = MonTryLearningNewMove(&gPlayerParty[gPartyMenu.slotId], TRUE); diff --git a/src/player_pc.c b/src/player_pc.c index bf8479ce1..a5ce89da4 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -518,7 +518,7 @@ static void InitItemStorageMenu(u8 taskId, u8 var) static void ItemStorageMenuPrint(const u8 *textPtr) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, textPtr, 0, 1, 0, 0); } @@ -572,7 +572,7 @@ void CB2_PlayerPCExitBagMenu(void) static void ItemStorage_ReshowAfterBagMenu(void) { LoadMessageBoxAndBorderGfx(); - DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, TRUE); InitItemStorageMenu(CreateTask(ItemStorage_HandleReturnToProcessInput, 0), 1); FadeInFromBlack(); } @@ -1241,7 +1241,7 @@ static void ItemStorage_ReturnToMenuSelect(u8 taskId) s16 *data = gTasks[taskId].data; if (!IsDma3ManagerBusyWithBgCopy()) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); // Select Withdraw/Toss by default depending on which was just exited if (!tInTossMenu) diff --git a/src/record_mixing.c b/src/record_mixing.c index 6efded838..4365f2cb3 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -285,7 +285,7 @@ static void ReceiveExchangePacket(u32 multiplayerId) static void PrintTextOnRecordMixing(const u8 *src) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, src, 0, 1, 0, NULL); CopyWindowToVram(0, COPYWIN_FULL); } diff --git a/src/slot_machine.c b/src/slot_machine.c index 1dfa026e5..828d0c161 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -1390,7 +1390,7 @@ static bool8 SlotTask_HandleBetInput(struct Task *task) // SLOTTASK_MSG_NEED_3_COINS static bool8 SlotTask_PrintMsg_Need3Coins(struct Task *task) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouDontHaveThreeCoins, 0, 1, 0, 0); CopyWindowToVram(0, COPYWIN_FULL); sSlotMachine->state = SLOTTASK_WAIT_MSG_NEED_3_COINS; @@ -1655,7 +1655,7 @@ static bool8 SlotTask_NoMatches(struct Task *task) // SLOTTASK_ASK_QUIT static bool8 SlotTask_AskQuit(struct Task *task) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, gText_QuitTheGame, 0, 1, 0, 0); CopyWindowToVram(0, COPYWIN_FULL); CreateYesNoMenuParameterized(0x15, 7, 0x214, 0x180, 0xE, 0xF); @@ -1687,7 +1687,7 @@ static bool8 SlotTask_HandleQuitInput(struct Task *task) // SLOTTASK_MSG_MAX_COINS static bool8 SlotTask_PrintMsg_MaxCoins(struct Task *task) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouveGot9999Coins, 0, 1, 0, 0); CopyWindowToVram(0, COPYWIN_FULL); sSlotMachine->state = SLOTTASK_WAIT_MSG_MAX_COINS; @@ -1708,7 +1708,7 @@ static bool8 SlotTask_WaitMsg_MaxCoins(struct Task *task) // SLOTTASK_MSG_NO_MORE_COINS static bool8 SlotTask_PrintMsg_NoMoreCoins(struct Task *task) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouveRunOutOfCoins, 0, 1, 0, 0); CopyWindowToVram(0, COPYWIN_FULL); sSlotMachine->state = SLOTTASK_WAIT_MSG_NO_MORE_COINS; From 2e855b204a42f5845520aca1936021390c44fd94 Mon Sep 17 00:00:00 2001 From: sneed Date: Sun, 29 May 2022 04:41:59 +0300 Subject: [PATCH 129/208] ai accounts for a third type --- include/battle_ai_util.h | 2 +- include/constants/battle_ai.h | 2 ++ src/battle_ai_main.c | 37 +++++++++++------------------------ src/battle_ai_util.c | 11 ++++++++--- 4 files changed, 22 insertions(+), 30 deletions(-) diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index 0b2afebae..4f0f68b33 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -85,7 +85,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef); u8 GetMoveDamageResult(u16 move); u32 GetCurrDamageHpPercent(u8 battlerAtk, u8 battlerDef); u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); -u8 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); +u32 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); u16 *GetMovesArray(u32 battler); bool32 IsConfusionMoveEffect(u16 moveEffect); bool32 HasMove(u32 battlerId, u32 move); diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index 7d38d6dba..67f5c11b8 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -15,11 +15,13 @@ #define AI_TYPE_MOVE 4 // type effectiveness +#define AI_EFFECTIVENESS_x8 320 #define AI_EFFECTIVENESS_x4 160 #define AI_EFFECTIVENESS_x2 80 #define AI_EFFECTIVENESS_x1 40 #define AI_EFFECTIVENESS_x0_5 20 #define AI_EFFECTIVENESS_x0_25 10 +#define AI_EFFECTIVENESS_x0_125 5 #define AI_EFFECTIVENESS_x0 0 // ai weather diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 5c7d577c0..c4ad06ee5 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -555,7 +555,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) s32 moveType; u16 moveTarget = AI_GetBattlerMoveTargetType(battlerAtk, move); u16 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect, move); - u8 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); + u32 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); u32 i; u16 predictedMove = gLastMoves[battlerDef]; // TODO better move prediction @@ -600,6 +600,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case AI_EFFECTIVENESS_x0: RETURN_SCORE_MINUS(20); break; + case AI_EFFECTIVENESS_x0_125: case AI_EFFECTIVENESS_x0_25: RETURN_SCORE_MINUS(10); break; @@ -642,7 +643,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) RETURN_SCORE_MINUS(20); break; case ABILITY_WONDER_GUARD: - if (effectiveness != AI_EFFECTIVENESS_x2 && effectiveness != AI_EFFECTIVENESS_x4) + if (effectiveness < AI_EFFECTIVENESS_x2) return 0; break; case ABILITY_SAP_SIPPER: @@ -2524,33 +2525,17 @@ static s16 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) switch (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef)) { + case AI_EFFECTIVENESS_x8: + score += 8; + break; case AI_EFFECTIVENESS_x4: - if (WEATHER_HAS_EFFECT - && gBattleWeather & B_WEATHER_STRONG_WINDS - && IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) - { - if (AI_RandLessThan(176)) //Consider it supereffective instead of hypereffective. - score += 2; - else - score++; - } - else - score += 4; + score += 4; break; case AI_EFFECTIVENESS_x2: - if (WEATHER_HAS_EFFECT - && gBattleWeather & B_WEATHER_STRONG_WINDS - && IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) - { - break; // Don't increase score, consider it neutral. - } + if (AI_RandLessThan(176)) + score += 2; else - { - if (AI_RandLessThan(176)) - score += 2; - else - score++; - } + score++; break; } } @@ -2962,7 +2947,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { // move data u16 moveEffect = gBattleMoves[move].effect; - u8 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); + u32 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); u8 atkPriority = GetMovePriority(battlerAtk, move); u16 predictedMove = gLastMoves[battlerDef]; //for now bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 8ed6e0490..59acbe0b7 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -950,10 +950,9 @@ u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) return typeEffectiveness; } -u8 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) +u32 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) { - u8 damageVar; - u32 effectivenessMultiplier; + u32 damageVar, effectivenessMultiplier; gMoveResultFlags = 0; gCurrentMove = move; @@ -965,6 +964,9 @@ u8 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) default: damageVar = AI_EFFECTIVENESS_x0; break; + case UQ_4_12(0.125): + damageVar = AI_EFFECTIVENESS_x0_125; + break; case UQ_4_12(0.25): damageVar = AI_EFFECTIVENESS_x0_25; break; @@ -980,6 +982,9 @@ u8 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) case UQ_4_12(4.0): damageVar = AI_EFFECTIVENESS_x4; break; + case UQ_4_12(8.0): + damageVar = AI_EFFECTIVENESS_x8; + break; } return damageVar; From 5e6d8a77e43352487046631d6329a9c15254f7d0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 21 May 2022 15:21:50 -0400 Subject: [PATCH 130/208] Document some generic argument names --- include/battle_anim.h | 6 +- include/battle_controllers.h | 14 +- include/battle_gfx_sfx_util.h | 2 +- include/battle_interface.h | 2 +- include/battle_setup.h | 2 +- include/battle_util.h | 2 +- include/digit_obj_util.h | 4 +- include/evolution_graphics.h | 2 +- include/fldeff_misc.h | 2 +- include/list_menu.h | 8 +- include/menu.h | 2 +- include/menu_helpers.h | 6 +- include/menu_specialized.h | 2 +- include/pokemon.h | 6 +- include/pokemon_storage_system.h | 4 +- include/pokenav.h | 12 +- include/trainer_card.h | 2 +- src/bard_music.c | 4 +- src/battle_anim_effects_3.c | 245 ++++++++++++++++++++----------- src/battle_controller_player.c | 30 ++-- src/battle_controllers.c | 26 ++-- src/battle_dome.c | 49 +++---- src/battle_gfx_sfx_util.c | 6 +- src/battle_interface.c | 64 ++++---- src/battle_pyramid.c | 12 +- src/evolution_graphics.c | 162 ++++++++++---------- src/list_menu.c | 8 +- src/menu_helpers.c | 47 +++--- src/mystery_gift_client.c | 2 +- src/pokeball.c | 48 +++--- src/pokemon.c | 4 +- src/pokemon_jump.c | 4 +- src/pokemon_storage_system.c | 4 +- src/pokenav_conditions.c | 4 +- src/rotating_tile_puzzle.c | 7 +- 35 files changed, 445 insertions(+), 359 deletions(-) diff --git a/include/battle_anim.h b/include/battle_anim.h index d8b2cd4db..9d1cf7be2 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -109,7 +109,7 @@ void *LoadPointerFromVars(s16 bottom, s16 top); void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr); void InitPrioritiesForVisibleBattlers(void); void GetBattleAnimBg1Data(struct BattleAnimBgData*); -void GetBattleAnimBgData(struct BattleAnimBgData*, u32 arg1); +void GetBattleAnimBgData(struct BattleAnimBgData*, u32 bgId); u8 GetBattlerSpriteSubpriority(u8 battlerId); bool8 TranslateAnimHorizontalArc(struct Sprite *sprite); void TranslateSpriteLinearByIdFixedPoint(struct Sprite *sprite); @@ -181,7 +181,7 @@ enum u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId); bool8 IsBattlerSpritePresent(u8 battlerId); -void ClearBattleAnimBg(u32 arg0); +void ClearBattleAnimBg(u32 bgId); u8 GetAnimBattlerSpriteId(u8 wantedBattler); bool8 IsDoubleBattle(void); u8 GetBattleBgPaletteNum(void); @@ -213,7 +213,7 @@ u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, // battle_anim_utility_funcs.c void InitStatsChangeAnimation(u8); -void StartMonScrollingBgMask(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u32 *arg8, const u32 *arg9, const u32 *palette); +void StartMonScrollingBgMask(u8 taskId, int unused, u16 scrollSpeed, u8 battler, bool8 includePartner, u8 numFadeSteps, u8 fadeStepDelay, u8 duration, const u32 *gfx, const u32 *tilemap, const u32 *palette); // battle_anim_effects_1.c void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite); diff --git a/include/battle_controllers.h b/include/battle_controllers.h index 9d9fba1b4..5b6ba30bd 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -222,7 +222,7 @@ void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringId); void BtlController_EmitChooseAction(u8 bufferId, u8 action, u16 itemId); void BtlController_EmitYesNoBox(u8 bufferId); void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData); -void BtlController_EmitChooseItem(u8 bufferId, u8* arg1); +void BtlController_EmitChooseItem(u8 bufferId, u8* battlePartyOrder); void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abilityId, u8* data); void BtlController_EmitCmd23(u8 bufferId); // unused void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue); @@ -233,11 +233,11 @@ void BtlController_EmitStatusXor(u8 bufferId, u8 b); // unused void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data); void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data); // unused void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data); // unused -void BtlController_EmitCmd32(u8 bufferId, u16 size, void *c); // unused -void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2); -void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c); -void BtlController_EmitOneReturnValue(u8 bufferId, u16 arg1); -void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b); +void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data); // unused +void BtlController_EmitTwoReturnValues(u8 bufferId, u8 ret8, u16 ret16); +void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 partyId, u8 *battlePartyOrder); +void BtlController_EmitOneReturnValue(u8 bufferId, u16 ret); +void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret); void BtlController_EmitClearUnkVar(u8 bufferId); // unused void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused void BtlController_EmitClearUnkFlag(u8 bufferId); // unused @@ -254,7 +254,7 @@ void BtlController_EmitHidePartyStatusSummary(u8 bufferId); void BtlController_EmitEndBounceEffect(u8 bufferId); void BtlController_EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible); void BtlController_EmitBattleAnimation(u8 bufferId, u8 animationId, u16 argument); -void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 arg1, bool32 record); +void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 mode, bool32 record); void BtlController_EmitResetActionMoveSelection(u8 bufferId, u8 caseId); void BtlController_EmitEndLinkBattle(u8 bufferId, u8 battleOutcome); diff --git a/include/battle_gfx_sfx_util.h b/include/battle_gfx_sfx_util.h index 383facd69..2a848e3d9 100644 --- a/include/battle_gfx_sfx_util.h +++ b/include/battle_gfx_sfx_util.h @@ -19,7 +19,7 @@ void DecompressTrainerBackPic(u16 backPicId, u8 battlerId); void BattleGfxSfxDummy3(u8 gender); void FreeTrainerFrontPicPalette(u16 frontPicId); bool8 BattleLoadAllHealthBoxesGfx(u8 state); -void LoadBattleBarGfx(u8 arg0); +void LoadBattleBarGfx(u8 unused); bool8 BattleInitAllSprites(u8 *state1, u8 *battlerId); void ClearSpritesHealthboxAnimData(void); void CopyAllBattleSpritesInvisibilities(void); diff --git a/include/battle_interface.h b/include/battle_interface.h index 3145939d0..6cc02c3fc 100644 --- a/include/battle_interface.h +++ b/include/battle_interface.h @@ -74,7 +74,7 @@ void SwapHpBarsWithHpText(void); u8 CreatePartyStatusSummarySprites(u8 battler, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart); void Task_HidePartyStatusSummary(u8 taskId); void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId); -s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 arg3); +s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 unused); u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale); u8 GetHPBarLevel(s16 hp, s16 maxhp); diff --git a/include/battle_setup.h b/include/battle_setup.h index 8f78bba3c..ee2837927 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -28,7 +28,7 @@ void BattleSetup_StartLegendaryBattle(void); void StartGroudonKyogreBattle(void); void StartRegiBattle(void); u8 BattleSetup_GetTerrainId(void); -u8 GetSpecialBattleTransition(s32 arg0); +u8 GetSpecialBattleTransition(s32 id); void ChooseStarter(void); void ResetTrainerOpponentIds(void); void SetMapVarsToTrainer(void); diff --git a/include/battle_util.h b/include/battle_util.h index 914e44c04..d15d4583e 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -66,7 +66,7 @@ void PressurePPLoseOnUsingPerishSong(u8 attacker); void PressurePPLoseOnUsingImprison(u8 attacker); void MarkAllBattlersForControllerExec(void); // unused void MarkBattlerForControllerExec(u8 battlerId); -void MarkBattlerReceivedLinkData(u8 arg0); +void MarkBattlerReceivedLinkData(u8 battlerId); void CancelMultiTurnMoves(u8 battlerId); bool8 WasUnableToUseMove(u8 battlerId); void PrepareStringBattle(u16 stringId, u8 battlerId); diff --git a/include/digit_obj_util.h b/include/digit_obj_util.h index aca97e2c7..4442fb0ec 100644 --- a/include/digit_obj_util.h +++ b/include/digit_obj_util.h @@ -18,9 +18,9 @@ struct DigitObjUtilTemplate bool32 DigitObjUtil_Init(u32 count); void DigitObjUtil_Free(void); bool32 DigitObjUtil_CreatePrinter(u32 id, s32 num, const struct DigitObjUtilTemplate *template); -void DigitObjUtil_PrintNumOn(u32 id, s32 arg1); +void DigitObjUtil_PrintNumOn(u32 id, s32 num); void DigitObjUtil_DeletePrinter(u32 id); -void DigitObjUtil_HideOrShow(u32 id, bool32 arg1); +void DigitObjUtil_HideOrShow(u32 id, bool32 hide); u8 GetTilesPerImage(u32 shape, u32 size); #endif // GUARD_DIGIT_OBJ_UTIL_H diff --git a/include/evolution_graphics.h b/include/evolution_graphics.h index 61051c69a..eab5c6eb7 100644 --- a/include/evolution_graphics.h +++ b/include/evolution_graphics.h @@ -3,7 +3,7 @@ void LoadEvoSparkleSpriteAndPal(void); -u8 EvolutionSparkles_SpiralUpward(u16 arg0); +u8 EvolutionSparkles_SpiralUpward(u16 palNum); u8 EvolutionSparkles_ArcDown(void); u8 EvolutionSparkles_CircleInward(void); u8 EvolutionSparkles_SprayAndFlash(u16 species); diff --git a/include/fldeff_misc.h b/include/fldeff_misc.h index 4acca7944..38dec23b0 100644 --- a/include/fldeff_misc.h +++ b/include/fldeff_misc.h @@ -22,7 +22,7 @@ void PlaySecretBaseMusicNoteMatSound(s16 metatileId); void DoSecretBaseGlitterMatSparkle(void); bool8 FldEff_SandPillar(void); void InteractWithShieldOrTVDecoration(void); -bool8 IsLargeBreakableDecoration(u16 arg0, u8 arg1); +bool8 IsLargeBreakableDecoration(u16 metatileId, bool8 checkBase); void FldEffPoison_Start(void); bool32 FldEffPoison_IsActive(void); void DoWateringBerryTreeAnim(void); diff --git a/include/list_menu.h b/include/list_menu.h index 1c18f3dff..e70a92bab 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -98,9 +98,9 @@ struct CursorStruct extern struct ScrollArrowsTemplate gTempScrollArrowTemplate; extern struct ListMenuTemplate gMultiuseListMenuTemplate; -s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum); +s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 drawMode, u16 tileNum, u16 palNum); u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow); -u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *arg1, u16 scrollOffset, u16 selectedRow); +u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *rect, u16 scrollOffset, u16 selectedRow); s32 ListMenu_ProcessInput(u8 listTaskId); void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow); void RedrawListMenu(u8 listTaskId); @@ -111,10 +111,10 @@ void ListMenuGetCurrentItemArrayId(u8 listTaskId, u16 *arrayId); void ListMenuGetScrollAndRow(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow); u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId); void ListMenuOverrideSetColors(u8 cursorPal, u8 fillValue, u8 cursorShadowPal); -void ListMenuDefaultCursorMoveFunc(s32 arg0, u8 arg1, struct ListMenu *list); +void ListMenuDefaultCursorMoveFunc(s32 itemIndex, u8 onInit, struct ListMenu *list); s32 ListMenuGetUnkIndicatorsStructFields(u8 taskId, u8 field); void ListMenuSetUnkIndicatorsStructField(u8 taskId, u8 field, s32 value); -u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate *arrowInfo, u16 *arg1); +u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate *arrowInfo, u16 *scrollOffset); u8 AddScrollIndicatorArrowPairParameterized(u32 arrowType, s32 commonPos, s32 firstPos, s32 secondPos, s32 fullyDownThreshold, s32 tileTag, s32 palTag, u16 *currItemPtr); void RemoveScrollIndicatorArrowPair(u8 taskId); void Task_ScrollIndicatorArrowPairOnMainMenu(u8 taskId); diff --git a/include/menu.h b/include/menu.h index bf3f56aea..9a940a48a 100644 --- a/include/menu.h +++ b/include/menu.h @@ -56,7 +56,7 @@ void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram); void DisplayYesNoMenuDefaultYes(void); u32 GetPlayerTextSpeed(void); u8 GetPlayerTextSpeedDelay(void); -void Menu_LoadStdPalAt(u16 arg0); +void Menu_LoadStdPalAt(u16 offset); void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextPrinterTemplate *, u16)); void BgDmaFill(u32 bg, u8 a1, int a2, int a3); void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str); diff --git a/include/menu_helpers.h b/include/menu_helpers.h index 0e063e5c1..f9a418a93 100644 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -18,11 +18,11 @@ struct YesNoFuncTable void ResetVramOamAndBgCntRegs(void); void ResetAllBgsCoordinates(void); void SetVBlankHBlankCallbacksToNull(void); -void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 arg2, u8 arg3, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc); +void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 tileNum, u8 paletteNum, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc); bool16 RunTextPrintersRetIsActive(u8 textPrinterId); void DoYesNoFuncWithChoice(u8 taskId, const struct YesNoFuncTable *data); -void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 arg2, u8 arg3, u8 arg4, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo); -bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1); +void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 unused1, u8 unused2, u8 unused3, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo); +bool8 AdjustQuantityAccordingToDPadInput(s16 *quantity, u16 max); u8 GetLRKeysPressed(void); u8 GetLRKeysPressedAndHeld(void); bool8 IsHoldingItemAllowed(u16 itemId); diff --git a/include/menu_specialized.h b/include/menu_specialized.h index d1e30d4d6..10a211046 100644 --- a/include/menu_specialized.h +++ b/include/menu_specialized.h @@ -95,7 +95,7 @@ void ConditionGraph_Draw(struct ConditionGraph *graph); bool8 ConditionGraph_TryUpdate(struct ConditionGraph *graph); void ConditionGraph_Update(struct ConditionGraph *graph); void ConditionGraph_CalcPositions(u8 *conditions, struct UCoords16 *positions); -void ConditionGraph_SetNewPositions(struct ConditionGraph *graph, struct UCoords16 *arg1, struct UCoords16 *arg2); +void ConditionGraph_SetNewPositions(struct ConditionGraph *graph, struct UCoords16 *old, struct UCoords16 *new); // Condition menu bool8 ConditionMenu_UpdateMonEnter(struct ConditionGraph *graph, s16 *x); diff --git a/include/pokemon.h b/include/pokemon.h index 8039a4fdd..7885c2ac5 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -337,7 +337,7 @@ u8 GetBoxMonGender(struct BoxPokemon *boxMon); u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality); void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition); void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosition); -void SetMultiuseSpriteTemplateToTrainerFront(u16 arg0, u8 battlerPosition); +void SetMultiuseSpriteTemplateToTrainerFront(u16 trainerPicId, u8 battlerPosition); // These are full type signatures for GetMonData() and GetBoxMonData(), // but they are not used since some code erroneously omits the third arg. @@ -426,8 +426,8 @@ void SetWildMonHeldItem(void); bool8 IsMonShiny(struct Pokemon *mon); bool8 IsShinyOtIdPersonality(u32 otId, u32 personality); const u8 *GetTrainerPartnerName(void); -void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3); -void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3); +void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u8 panMode); +void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 panModeAnimFlag); void PokemonSummaryDoMonAnimation(struct Sprite* sprite, u16 species, bool8 oneFrame); void StopPokemonAnimationDelayTask(void); void BattleAnimateBackSprite(struct Sprite* sprite, u16 species); diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index b7fca2331..eb25c0ff2 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -26,7 +26,7 @@ struct PokemonStorage extern struct PokemonStorage *gPokemonStoragePtr; -void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 bytesToBuffer); +void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero2, s32 bytesToBuffer); u8 CountMonsInBox(u8 boxId); s16 GetFirstFreeBoxSpot(u8 boxId); u8 CountPartyAliveNonEggMonsExcept(u8 slotToIgnore); @@ -52,7 +52,7 @@ void ZeroBoxMonAt(u8 boxId, u8 boxPosition); void BoxMonAtToMon(u8 boxId, u8 boxPosition, struct Pokemon *dst); struct BoxPokemon *GetBoxedMonPtr(u8 boxId, u8 boxPosition); u8 *GetBoxNamePtr(u8 boxId); -s16 AdvanceStorageMonIndex(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3); +s16 AdvanceStorageMonIndex(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 mode); bool8 CheckFreePokemonStorageSpace(void); bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); u32 CountStorageNonEggMons(void); diff --git a/include/pokenav.h b/include/pokenav.h index d3edb1422..07beae957 100644 --- a/include/pokenav.h +++ b/include/pokenav.h @@ -356,10 +356,10 @@ void MatchCall_GetNameAndDesc(u32 idx, const u8 **desc, const u8 **name); // pokenav_main_menu.c bool32 InitPokenavMainMenu(void); void CopyPaletteIntoBufferUnfaded(const u16 *palette, u32 bufferOffset, u32 size); -void RunMainMenuLoopedTask(u32 a0); +void RunMainMenuLoopedTask(u32 state); u32 IsActiveMenuLoopTaskActive(void); -void LoadLeftHeaderGfxForIndex(u32 arg0); -void ShowLeftHeaderGfx(u32 menugfxId, bool32 arg1, bool32 isOnRightSide); +void LoadLeftHeaderGfxForIndex(u32 menuGfxId); +void ShowLeftHeaderGfx(u32 menugfxId, bool32 isMain, bool32 isOnRightSide); void PokenavFadeScreen(s32 fadeType); bool32 AreLeftHeaderSpritesMoving(void); void InitBgTemplates(const struct BgTemplate *templates, int count); @@ -373,7 +373,7 @@ void PokenavCopyPalette(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u1 void FadeToBlackExceptPrimary(void); struct Sprite *GetSpinningPokenavSprite(void); void HideSpinningPokenavSprite(void); -void UpdateRegionMapRightHeaderTiles(u32 arg0); +void UpdateRegionMapRightHeaderTiles(u32 menuGfxId); void HideMainOrSubMenuLeftHeader(u32 id, bool32 onRightSide); void SlideMenuHeaderUp(void); void PokenavFillPalette(u32 palIndex, u16 fillValue); @@ -417,8 +417,8 @@ int GetMatchCallTrainerPic(int index); const u8 *GetMatchCallFlavorText(int index, int textType); const u8 *GetMatchCallMessageText(int index, bool8 *newRematchRequest); u16 GetMatchCallOptionCursorPos(void); -u16 GetMatchCallOptionId(int arg0); -void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry * arg0, u8 *str); +u16 GetMatchCallOptionId(int optionId); +void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry *matchCallEntry, u8 *str); u8 GetMatchTableMapSectionId(int rematchIndex); int GetIndexDeltaOfNextCheckPageDown(int index); int GetIndexDeltaOfNextCheckPageUp(int index); diff --git a/include/trainer_card.h b/include/trainer_card.h index f5e73da83..f14335ae8 100644 --- a/include/trainer_card.h +++ b/include/trainer_card.h @@ -69,7 +69,7 @@ u32 CountPlayerTrainerStars(void); u8 GetTrainerCardStars(u8 cardId); void CopyTrainerCardData(struct TrainerCard *dst, struct TrainerCard *src, u8 gameVersion); void ShowPlayerTrainerCard(void (*callback)(void)); -void ShowTrainerCardInLink(u8 arg0, void (*callback)(void)); +void ShowTrainerCardInLink(u8 cardId, void (*callback)(void)); void TrainerCard_GenerateCardForLinkPlayer(struct TrainerCard *); #endif // GUARD_TRAINER_CARD_H diff --git a/src/bard_music.c b/src/bard_music.c index bdc5ac808..dd986371d 100644 --- a/src/bard_music.c +++ b/src/bard_music.c @@ -7,9 +7,9 @@ #include "data/bard_music/default_sound.h" #include "data/bard_music/length_table.h" -static s16 CalcWordPitch(int arg0, int songPos) +static s16 CalcWordPitch(int pitchIdx, int songPos) { - return sBardSoundPitchTables[arg0][songPos]; + return sBardSoundPitchTables[pitchIdx][songPos]; } const struct BardSound *GetWordSounds(u16 word) diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index f73393de4..fcd594db5 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -3717,6 +3717,26 @@ void AnimTask_SlideMonForFocusBand(u8 taskId) gTasks[taskId].func = AnimTask_SlideMonForFocusBand_Step1; } +#define IDX_ACTIVE_SPRITES 2 // Used by the sprite callback to modify the number of active sprites + +// Task data for AnimTask_SquishAndSweatDroplets +#define tState data[0] +#define tTimer data[1] +#define tActiveSprites data[IDX_ACTIVE_SPRITES] +#define tNumSquishes data[3] +#define tBaseX data[4] +#define tBaseY data[5] +#define tSubpriority data[6] +// data[7]-data[15] used by PrepareAffineAnimInTaskData +#define tBattlerSpriteId data[15] + +// Sprite data for AnimFacadeSweatDrop +#define sTimer data[0] +#define sVelocX data[1] +#define sVelocY data[2] +#define sTaskId data[3] +#define sActiveSpritesIdx data[4] + // Squishes the mon vertically and emits sweat droplets a few times. // arg 0: battler // arg 1: num squishes @@ -3728,20 +3748,20 @@ void AnimTask_SquishAndSweatDroplets(u8 taskId) if (!gBattleAnimArgs[1]) DestroyAnimVisualTask(taskId); - task->data[0] = 0; - task->data[1] = 0; - task->data[2] = 0; - task->data[3] = gBattleAnimArgs[1]; + task->tState = 0; + task->tTimer = 0; + task->tActiveSprites = 0; + task->tNumSquishes = gBattleAnimArgs[1]; if (gBattleAnimArgs[0] == ANIM_ATTACKER) battler = gBattleAnimAttacker; else battler = gBattleAnimTarget; - task->data[4] = GetBattlerSpriteCoord(battler, BATTLER_COORD_X); - task->data[5] = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y); - task->data[6] = GetBattlerSpriteSubpriority(battler); - task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); - PrepareAffineAnimInTaskData(task, task->data[15], gFacadeSquishAffineAnimCmds); + task->tBaseX = GetBattlerSpriteCoord(battler, BATTLER_COORD_X); + task->tBaseY = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y); + task->tSubpriority = GetBattlerSpriteSubpriority(battler); + task->tBattlerSpriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + PrepareAffineAnimInTaskData(task, task->tBattlerSpriteId, gFacadeSquishAffineAnimCmds); task->func = AnimTask_SquishAndSweatDroplets_Step; } @@ -3749,37 +3769,40 @@ static void AnimTask_SquishAndSweatDroplets_Step(u8 taskId) { struct Task *task = &gTasks[taskId]; - switch (task->data[0]) + switch (task->tState) { case 0: - task->data[1]++; - if (task->data[1] == 6) + task->tTimer++; + if (task->tTimer == 6) CreateSweatDroplets(taskId, TRUE); - if (task->data[1] == 18) + if (task->tTimer == 18) CreateSweatDroplets(taskId, FALSE); if (!RunAffineAnimFromTaskData(task)) { - if (--task->data[3] == 0) + if (--task->tNumSquishes == 0) { - task->data[0]++; + // Animation is finished + task->tState++; } else { - task->data[1] = 0; - PrepareAffineAnimInTaskData(task, task->data[15], gFacadeSquishAffineAnimCmds); + // Animation continues, more droplet sprites to create + task->tTimer = 0; + PrepareAffineAnimInTaskData(task, task->tBattlerSpriteId, gFacadeSquishAffineAnimCmds); } } break; case 1: - if (task->data[2] == 0) + // Wait for sprites to be destroyed before ending task + if (task->tActiveSprites == 0) DestroyAnimVisualTask(taskId); break; } } -static void CreateSweatDroplets(u8 taskId, bool8 arg1) +static void CreateSweatDroplets(u8 taskId, bool8 lowerDroplets) { u8 i; s8 xOffset, yOffset; @@ -3788,7 +3811,7 @@ static void CreateSweatDroplets(u8 taskId, bool8 arg1) s16 yCoords[2]; task = &gTasks[taskId]; - if (!arg1) + if (!lowerDroplets) { xOffset = 18; yOffset = -20; @@ -3799,39 +3822,54 @@ static void CreateSweatDroplets(u8 taskId, bool8 arg1) yOffset = 20; } - xCoords[0] = task->data[4] - xOffset; - xCoords[1] = task->data[4] - xOffset - 4; - xCoords[2] = task->data[4] + xOffset; - xCoords[3] = task->data[4] + xOffset + 4; - yCoords[0] = task->data[5] + yOffset; - yCoords[1] = task->data[5] + yOffset + 6; + xCoords[0] = task->tBaseX - xOffset; + xCoords[1] = task->tBaseX - xOffset - 4; + xCoords[2] = task->tBaseX + xOffset; + xCoords[3] = task->tBaseX + xOffset + 4; + yCoords[0] = task->tBaseY + yOffset; + yCoords[1] = task->tBaseY + yOffset + 6; for (i = 0; i < 4; i++) { - u8 spriteId = CreateSprite(&gFacadeSweatDropSpriteTemplate, xCoords[i], yCoords[i & 1], task->data[6] - 5); + u8 spriteId = CreateSprite(&gFacadeSweatDropSpriteTemplate, xCoords[i], yCoords[i & 1], task->tSubpriority - 5); if (spriteId != MAX_SPRITES) { - gSprites[spriteId].data[0] = 0; - gSprites[spriteId].data[1] = i < 2 ? -2 : 2; - gSprites[spriteId].data[2] = -1; - gSprites[spriteId].data[3] = taskId; - gSprites[spriteId].data[4] = 2; - task->data[2]++; + gSprites[spriteId].sTimer = 0; + gSprites[spriteId].sVelocX = i < 2 ? -2 : 2; // First two travel left, remaining travel right + gSprites[spriteId].sVelocY = -1; + gSprites[spriteId].sTaskId = taskId; + gSprites[spriteId].sActiveSpritesIdx = IDX_ACTIVE_SPRITES; + task->tActiveSprites++; } } } static void AnimFacadeSweatDrop(struct Sprite *sprite) { - sprite->x += sprite->data[1]; - sprite->y += sprite->data[2]; - if (++sprite->data[0] > 6) + sprite->x += sprite->sVelocX; + sprite->y += sprite->sVelocY; + if (++sprite->sTimer > 6) { - gTasks[sprite->data[3]].data[sprite->data[4]]--; + gTasks[sprite->sTaskId].data[sprite->sActiveSpritesIdx]--; DestroySprite(sprite); } } +#undef IDX_ACTIVE_SPRITES +#undef tState +#undef tTimer +#undef tActiveSprites +#undef tNumSquishes +#undef tBaseX +#undef tBaseY +#undef tSubpriority +#undef tBattlerSpriteId +#undef sTimer +#undef sVelocX +#undef sVelocY +#undef sTaskId +#undef sActiveSpritesIdx + // Blends the mon sprite's color with a rotating set of colors. // arg 0: battler // arg 1: duration @@ -3927,6 +3965,26 @@ static void AnimRoarNoiseLine_Step(struct Sprite *sprite) DestroyAnimSprite(sprite); } +#define IDX_ACTIVE_SPRITES 10 // Used by the sprite callback to modify the number of active sprites + +// Task data for AnimTask_GlareEyeDots +#define tState data[0] +#define tTimer data[1] +#define tPairNum data[2] +#define tPairMax data[5] +#define tDotOffset data[6] +#define tIsContest data[7] +#define tActiveSprites data[IDX_ACTIVE_SPRITES] +#define tStartX data[11] +#define tStartY data[12] +#define tEndX data[13] +#define tEndY data[14] + +// Sprite data for AnimGlareEyeDot +#define sTimer data[0] +#define sTaskId data[1] +#define sActiveSpritesIdx data[2] + // Makes a series of dots in a trail from the attacker to the target. // arg 0: unused void AnimTask_GlareEyeDots(u8 taskId) @@ -3935,25 +3993,25 @@ void AnimTask_GlareEyeDots(u8 taskId) if (IsContest()) { - task->data[5] = 8; - task->data[6] = 3; - task->data[7] = 1; + task->tPairMax = 8; + task->tDotOffset = 3; + task->tIsContest = TRUE; } else { - task->data[5] = 12; - task->data[6] = 3; - task->data[7] = 0; + task->tPairMax = 12; + task->tDotOffset = 3; + task->tIsContest = FALSE; } if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) - task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4; + task->tStartX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4; else - task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4; + task->tStartX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4; - task->data[12] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4; - task->data[13] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); - task->data[14] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); + task->tStartY = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4; + task->tEndX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + task->tEndY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); task->func = AnimTask_GlareEyeDots_Step; } @@ -3963,103 +4021,122 @@ static void AnimTask_GlareEyeDots_Step(u8 taskId) s16 x, y; struct Task *task = &gTasks[taskId]; - switch (task->data[0]) + switch (task->tState) { case 0: - if (++task->data[1] > 3) + // Wait to create next pair of dots + if (++task->tTimer > 3) { - task->data[1] = 0; + task->tTimer = 0; GetGlareEyeDotCoords( - task->data[11], - task->data[12], - task->data[13], - task->data[14], - task->data[5], - task->data[2], + task->tStartX, + task->tStartY, + task->tEndX, + task->tEndY, + task->tPairMax, + task->tPairNum, &x, &y); + // Create dot pair for (i = 0; i < 2; i++) { u8 spriteId = CreateSprite(&gGlareEyeDotSpriteTemplate, x, y, 35); if (spriteId != MAX_SPRITES) { - if (task->data[7] == 0) + if (!task->tIsContest) { if (i == 0) - gSprites[spriteId].x2 = gSprites[spriteId].y2 = -task->data[6]; + gSprites[spriteId].x2 = gSprites[spriteId].y2 = -task->tDotOffset; else - gSprites[spriteId].x2 = gSprites[spriteId].y2 = task->data[6]; + gSprites[spriteId].x2 = gSprites[spriteId].y2 = task->tDotOffset; } else { if (i == 0) { - gSprites[spriteId].x2 = -task->data[6]; - gSprites[spriteId].y2 = task->data[6]; + gSprites[spriteId].x2 = -task->tDotOffset; + gSprites[spriteId].y2 = task->tDotOffset; } else { - gSprites[spriteId].x2 = task->data[6]; - gSprites[spriteId].y2 = -task->data[6]; + gSprites[spriteId].x2 = task->tDotOffset; + gSprites[spriteId].y2 = -task->tDotOffset; } } - gSprites[spriteId].data[0] = 0; - gSprites[spriteId].data[1] = taskId; - gSprites[spriteId].data[2] = 10; - task->data[10]++; + gSprites[spriteId].sTimer = 0; + gSprites[spriteId].sTaskId = taskId; + gSprites[spriteId].sActiveSpritesIdx = IDX_ACTIVE_SPRITES; + task->tActiveSprites++; } } - if (task->data[2] == task->data[5]) - task->data[0]++; + if (task->tPairNum == task->tPairMax) + task->tState++; - task->data[2]++; + task->tPairNum++; } break; case 1: - if (task->data[10] == 0) + // Wait for sprites to be destroyed before ending task + if (task->tActiveSprites == 0) DestroyAnimVisualTask(taskId); break; } } -static void GetGlareEyeDotCoords(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8 arg4, u8 arg5, s16 *x, s16 *y) +static void GetGlareEyeDotCoords(s16 startX, s16 startY, s16 endX, s16 endY, u8 pairMax, u8 pairNum, s16 *x, s16 *y) { int x2; int y2; - if (arg5 == 0) + if (pairNum == 0) { - *x = arg0; - *y = arg1; + *x = startX; + *y = startY; return; } - if (arg5 >= arg4) + if (pairNum >= pairMax) { - *x = arg2; - *y = arg3; + *x = endX; + *y = endY; return; } - arg4--; - x2 = (arg0 << 8) + arg5 * (((arg2 - arg0) << 8) / arg4); - y2 = (arg1 << 8) + arg5 * (((arg3 - arg1) << 8) / arg4); + pairMax--; + x2 = (startX << 8) + pairNum * (((endX - startX) << 8) / pairMax); + y2 = (startY << 8) + pairNum * (((endY - startY) << 8) / pairMax); *x = x2 >> 8; *y = y2 >> 8; } static void AnimGlareEyeDot(struct Sprite *sprite) { - if (++sprite->data[0] > 36) + if (++sprite->sTimer > 36) { - gTasks[sprite->data[1]].data[sprite->data[2]]--; + gTasks[sprite->sTaskId].data[sprite->sActiveSpritesIdx]--; DestroySprite(sprite); } } +#undef IDX_ACTIVE_SPRITES +#undef tState +#undef tTimer +#undef tPairNum +#undef tPairMax +#undef tDotOffset +#undef tIsContest +#undef tActiveSprites +#undef tStartX +#undef tStartY +#undef tEndX +#undef tEndY +#undef sTimer +#undef sTaskId +#undef sActiveSpritesIdx + // Moves a pawprint in a straight line. // arg 0: initial x position // arg 1: initial y position diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 5b69030df..954192f0a 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -96,8 +96,8 @@ static void PlayerCmdEnd(void); static void PlayerBufferRunCommand(void); static void HandleInputChooseTarget(void); static void HandleInputChooseMove(void); -static void MoveSelectionCreateCursorAt(u8 cursorPos, u8 arg1); -static void MoveSelectionDestroyCursorAt(u8 cursorPos); +static void MoveSelectionCreateCursorAt(u8, u8); +static void MoveSelectionDestroyCursorAt(u8); static void MoveSelectionDisplayPpNumber(void); static void MoveSelectionDisplayPpString(void); static void MoveSelectionDisplayMoveType(void); @@ -106,18 +106,18 @@ static void HandleMoveSwitching(void); static void SwitchIn_HandleSoundAndEnd(void); static void WaitForMonSelection(void); static void CompleteWhenChoseItem(void); -static void Task_LaunchLvlUpAnim(u8 taskId); -static void Task_PrepareToGiveExpWithExpBar(u8 taskId); -static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8 taskId); -static void Task_GiveExpWithExpBar(u8 taskId); -static void Task_UpdateLvlInHealthbox(u8 taskId); +static void Task_LaunchLvlUpAnim(u8); +static void Task_PrepareToGiveExpWithExpBar(u8); +static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8); +static void Task_GiveExpWithExpBar(u8); +static void Task_UpdateLvlInHealthbox(u8); static void PrintLinkStandbyMsg(void); -static u32 CopyPlayerMonData(u8 monId, u8 *dst); -static void SetPlayerMonData(u8 monId); -static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit); +static u32 CopyPlayerMonData(u8, u8 *); +static void SetPlayerMonData(u8); +static void StartSendOutAnim(u8, bool8); static void DoSwitchOutAnimation(void); static void PlayerDoMoveAnimation(void); -static void Task_StartSendOutAnim(u8 taskId); +static void Task_StartSendOutAnim(u8); static void EndDrawPartyStatusSummary(void); static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = @@ -1507,11 +1507,11 @@ static void MoveSelectionDisplayMoveType(void) BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_TYPE); } -static void MoveSelectionCreateCursorAt(u8 cursorPosition, u8 arg1) +static void MoveSelectionCreateCursorAt(u8 cursorPosition, u8 baseTileNum) { u16 src[2]; - src[0] = arg1 + 1; - src[1] = arg1 + 2; + src[0] = baseTileNum + 1; + src[1] = baseTileNum + 2; CopyToBgTilemapBufferRect_ChangePalette(0, src, 9 * (cursorPosition & 1) + 1, 55 + (cursorPosition & 2), 1, 2, 0x11); CopyBgTilemapBufferToVram(0); @@ -1527,7 +1527,7 @@ static void MoveSelectionDestroyCursorAt(u8 cursorPosition) CopyBgTilemapBufferToVram(0); } -void ActionSelectionCreateCursorAt(u8 cursorPosition, u8 arg1) +void ActionSelectionCreateCursorAt(u8 cursorPosition, u8 baseTileNum) { u16 src[2]; src[0] = 1; diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 7d2717e2c..369f735f2 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -1168,13 +1168,13 @@ void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpN PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(*movePpData) + 4); } -void BtlController_EmitChooseItem(u8 bufferId, u8 *arg1) +void BtlController_EmitChooseItem(u8 bufferId, u8 *battlePartyOrder) { s32 i; sBattleBuffersTransferData[0] = CONTROLLER_OPENBAG; - for (i = 0; i < 3; i++) - sBattleBuffersTransferData[1 + i] = arg1[i]; + for (i = 0; i < PARTY_SIZE / 2; i++) + sBattleBuffersTransferData[1 + i] = battlePartyOrder[i]; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } @@ -1309,12 +1309,12 @@ void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data) PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 3); } -void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2) +void BtlController_EmitTwoReturnValues(u8 bufferId, u8 ret8, u16 ret16) { sBattleBuffersTransferData[0] = CONTROLLER_TWORETURNVALUES; - sBattleBuffersTransferData[1] = arg1; - sBattleBuffersTransferData[2] = arg2; - sBattleBuffersTransferData[3] = (arg2 & 0xFF00) >> 8; + sBattleBuffersTransferData[1] = ret8; + sBattleBuffersTransferData[2] = ret16; + sBattleBuffersTransferData[3] = (ret16 & 0xFF00) >> 8; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } @@ -1329,20 +1329,20 @@ void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 partyId, u8 *battleP PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 5); } -void BtlController_EmitOneReturnValue(u8 bufferId, u16 arg1) +void BtlController_EmitOneReturnValue(u8 bufferId, u16 ret) { sBattleBuffersTransferData[0] = CONTROLLER_ONERETURNVALUE; - sBattleBuffersTransferData[1] = arg1; - sBattleBuffersTransferData[2] = (arg1 & 0xFF00) >> 8; + sBattleBuffersTransferData[1] = ret; + sBattleBuffersTransferData[2] = (ret & 0xFF00) >> 8; sBattleBuffersTransferData[3] = 0; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b) +void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret) { sBattleBuffersTransferData[0] = CONTROLLER_ONERETURNVALUE_DUPLICATE; - sBattleBuffersTransferData[1] = b; - sBattleBuffersTransferData[2] = (b & 0xFF00) >> 8; + sBattleBuffersTransferData[1] = ret; + sBattleBuffersTransferData[2] = (ret & 0xFF00) >> 8; sBattleBuffersTransferData[3] = 0; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } diff --git a/src/battle_dome.c b/src/battle_dome.c index aadd85afd..c9614e6fc 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -73,40 +73,39 @@ struct TourneyTreeLineSection #define tMode data[2] #define tPrevTaskId data[3] -// This file's functions. -static u8 GetDomeTrainerMonIvs(u16 trainerId); -static void SwapDomeTrainers(int id1, int id2, u16 *statsArray); -static void CalcDomeMonStats(u16 species, int level, int ivs, u8 evBits, u8 nature, int *stats); -static void CreateDomeOpponentMons(u16 tournamentTrainerId); -static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 arg1); -static int SelectOpponentMonsUsingOtId(u16 tournamentTrainerId, bool8 arg1); -static int GetTypeEffectivenessPoints(int move, int species, int arg2); -static int SelectOpponentMonsFromParty(int *arr, bool8 arg1); -static void Task_ShowTourneyInfoCard(u8 taskId); -static void Task_HandleInfoCardInput(u8 taskId); -static u8 Task_GetInfoCardInput(u8 taskId); +static u8 GetDomeTrainerMonIvs(u16); +static void SwapDomeTrainers(int, int, u16 *); +static void CalcDomeMonStats(u16, int, int, u8, u8, int *); +static void CreateDomeOpponentMons(u16); +static int SelectOpponentMonsUsingPersonality(u16, bool8); +static int SelectOpponentMonsUsingOtId(u16, bool8); +static int GetTypeEffectivenessPoints(int, int, int); +static int SelectOpponentMonsFromParty(int *, bool8); +static void Task_ShowTourneyInfoCard(u8); +static void Task_HandleInfoCardInput(u8); +static u8 Task_GetInfoCardInput(u8); static void SetFacilityTrainerAndMonPtrs(void); -static int TrainerIdToTournamentId(u16 trainerId); +static int TrainerIdToTournamentId(u16); static u16 TrainerIdOfPlayerOpponent(void); -static void Task_ShowTourneyTree(u8 taskId); -static void Task_HandleStaticTourneyTreeInput(u8 taskId); +static void Task_ShowTourneyTree(u8); +static void Task_HandleStaticTourneyTreeInput(u8); static void CB2_TourneyTree(void); static void VblankCb_TourneyInfoCard(void); -static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo); -static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId); +static void DisplayMatchInfoOnCard(u8, u8); +static void DisplayTrainerInfoOnCard(u8, u8); static int BufferDomeWinString(u8, u8*); static u8 GetDomeBrainTrainerPicId(void); static u8 GetDomeBrainTrainerClass(void); -static void CopyDomeBrainTrainerName(u8 *str); -static void CopyDomeTrainerName(u8 *str, u16 trainerId); +static void CopyDomeBrainTrainerName(u8 *); +static void CopyDomeTrainerName(u8 *, u16); static void HblankCb_TourneyTree(void); static void VblankCb_TourneyTree(void); -static u8 UpdateTourneyTreeCursor(u8 taskId); -static void DecideRoundWinners(u8 roundId); -static u8 GetOpposingNPCTournamentIdByRound(u8 tournamentId, u8); +static u8 UpdateTourneyTreeCursor(u8); +static void DecideRoundWinners(u8); +static u8 GetOpposingNPCTournamentIdByRound(u8, u8); static void DrawTourneyAdvancementLine(u8, u8); -static void SpriteCb_HorizontalScrollArrow(struct Sprite *sprite); -static void SpriteCb_VerticalScrollArrow(struct Sprite *sprite); +static void SpriteCb_HorizontalScrollArrow(struct Sprite *); +static void SpriteCb_VerticalScrollArrow(struct Sprite *); static void InitDomeChallenge(void); static void GetDomeData(void); static void SetDomeData(void); @@ -130,7 +129,6 @@ static void BufferLastDomeWinnerName(void); static void InitRandomTourneyTreeResults(void); static void InitDomeTrainers(void); -// EWRAM variables. EWRAM_DATA u32 gPlayerPartyLostHP = 0; // never read static EWRAM_DATA u32 sPlayerPartyMaxHP = 0; // never read static EWRAM_DATA struct TourneyTreeInfoCard *sInfoCard = {0}; @@ -2080,7 +2078,6 @@ static const u8 sTourneyTreeLineSectionArrayCounts[DOME_TOURNAMENT_TRAINERS_COUN {ARRAY_COUNT(sLineSectionTrainer16Round1), ARRAY_COUNT(sLineSectionTrainer16Round2), ARRAY_COUNT(sLineSectionTrainer16Semifinal), ARRAY_COUNT(sLineSectionTrainer16Final)}, }; -// code void CallBattleDomeFunction(void) { sBattleDomeFunctions[gSpecialVar_0x8004](); diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 2a690d129..d0981324f 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -353,12 +353,12 @@ void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite) } } -static void UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 arg1) +static void UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 pointless) { sprite->animPaused = TRUE; sprite->callback = SpriteCallbackDummy; - if (!arg1) + if (!pointless) StartSpriteAffineAnim(sprite, 1); else StartSpriteAffineAnim(sprite, 1); @@ -783,7 +783,7 @@ bool8 BattleLoadAllHealthBoxesGfx(u8 state) return retVal; } -void LoadBattleBarGfx(u8 arg0) +void LoadBattleBarGfx(u8 unused) { LZDecompressWram(gBattleInterfaceGfx_BattleBar, gMonSpritesGfxPtr->barFontGfx); } diff --git a/src/battle_interface.c b/src/battle_interface.c index 26209fe2d..6d869df78 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -158,36 +158,36 @@ enum HEALTHBOX_GFX_FRAME_END_BAR, }; -static const u8 *GetHealthboxElementGfxPtr(u8 elementId); -static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 bgColor, u32 *windowId); +static const u8 *GetHealthboxElementGfxPtr(u8); +static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *, u32, u32, u32, u32 *); static void RemoveWindowOnHealthbox(u32 windowId); -static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent); -static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId); +static void UpdateHpTextInHealthboxInDoubles(u8, s16, u8); +static void UpdateStatusIconInHealthbox(u8); -static void TextIntoHealthboxObject(void *dest, u8 *windowTileData, s32 windowWidth); -static void SafariTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 windowWidth); -static void HpTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 windowWidth); -static void FillHealthboxObject(void *dest, u32 arg1, u32 arg2); +static void TextIntoHealthboxObject(void *, u8 *, s32); +static void SafariTextIntoHealthboxObject(void *, u8 *, u32); +static void HpTextIntoHealthboxObject(void *, u8 *, u32); +static void FillHealthboxObject(void *, u32, u32); -static void Task_HidePartyStatusSummary_BattleStart_1(u8 taskId); -static void Task_HidePartyStatusSummary_BattleStart_2(u8 taskId); -static void Task_HidePartyStatusSummary_DuringBattle(u8 taskId); +static void Task_HidePartyStatusSummary_BattleStart_1(u8); +static void Task_HidePartyStatusSummary_BattleStart_2(u8); +static void Task_HidePartyStatusSummary_DuringBattle(u8); -static void SpriteCB_HealthBoxOther(struct Sprite *sprite); -static void SpriteCB_HealthBar(struct Sprite *sprite); -static void SpriteCB_StatusSummaryBar_Enter(struct Sprite *sprite); -static void SpriteCB_StatusSummaryBar_Exit(struct Sprite *sprite); -static void SpriteCB_StatusSummaryBalls_Enter(struct Sprite *sprite); -static void SpriteCB_StatusSummaryBalls_Exit(struct Sprite *sprite); -static void SpriteCB_StatusSummaryBalls_OnSwitchout(struct Sprite *sprite); +static void SpriteCB_HealthBoxOther(struct Sprite *); +static void SpriteCB_HealthBar(struct Sprite *); +static void SpriteCB_StatusSummaryBar_Enter(struct Sprite *); +static void SpriteCB_StatusSummaryBar_Exit(struct Sprite *); +static void SpriteCB_StatusSummaryBalls_Enter(struct Sprite *); +static void SpriteCB_StatusSummaryBalls_Exit(struct Sprite *); +static void SpriteCB_StatusSummaryBalls_OnSwitchout(struct Sprite *); -static u8 GetStatusIconForBattlerId(u8 statusElementId, u8 battlerId); -static s32 CalcNewBarValue(s32 maxValue, s32 currValue, s32 receivedValue, s32 *arg3, u8 arg4, u16 arg5); -static u8 GetScaledExpFraction(s32 currValue, s32 receivedValue, s32 maxValue, u8 scale); -static void MoveBattleBarGraphically(u8 battlerId, u8 whichBar); -static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *currValue, u8 *arg4, u8 scale); -static void Debug_TestHealthBar_Helper(struct TestingBar *barInfo, s32 *arg1, u16 *arg2); +static u8 GetStatusIconForBattlerId(u8, u8); +static s32 CalcNewBarValue(s32, s32, s32, s32 *, u8, u16); +static u8 GetScaledExpFraction(s32, s32, s32, u8); +static void MoveBattleBarGraphically(u8, u8); +static u8 CalcBarFilledPixels(s32, s32, s32, s32 *, u8 *, u8); +static void Debug_TestHealthBar_Helper(struct TestingBar *, s32 *, u16 *); static const struct OamData sOamData_64x32 = { @@ -814,11 +814,11 @@ static void Debug_DrawNumber(s16 number, u16 *dest, bool8 unk) } // Unused -static void Debug_DrawNumberPair(s16 number1, s16 number2, u16 *arg2) +static void Debug_DrawNumberPair(s16 number1, s16 number2, u16 *dest) { - arg2[4] = 0x1E; - Debug_DrawNumber(number2, arg2, 0); - Debug_DrawNumber(number1, arg2 + 5, 1); + dest[4] = 0x1E; + Debug_DrawNumber(number2, dest, 0); + Debug_DrawNumber(number1, dest + 5, 1); } // Because the healthbox is too large to fit into one sprite, it is divided into two sprites. @@ -2453,19 +2453,19 @@ static s16 Debug_TestHealthBar(struct TestingBar *barInfo, s32 *currValue, u16 * return ret; } -static void Debug_TestHealthBar_Helper(struct TestingBar *barInfo, s32 *currValue, u16 *arg2) +static void Debug_TestHealthBar_Helper(struct TestingBar *barInfo, s32 *currValue, u16 *dest) { u8 sp8[6]; - u16 sp10[6]; + u16 src[6]; u8 i; CalcBarFilledPixels(barInfo->maxValue, barInfo->oldValue, barInfo->receivedValue, currValue, sp8, B_HEALTHBAR_PIXELS / 8); for (i = 0; i < 6; i++) - sp10[i] = (barInfo->unkC_0 << 12) | (barInfo->unk10 + sp8[i]); + src[i] = (barInfo->unkC_0 << 12) | (barInfo->unk10 + sp8[i]); - CpuCopy16(sp10, arg2, sizeof(sp10)); + CpuCopy16(src, dest, sizeof(src)); } static u8 GetScaledExpFraction(s32 oldValue, s32 receivedValue, s32 maxValue, u8 scale) diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c index 9039f60f2..b0bcdfd5e 100644 --- a/src/battle_pyramid.c +++ b/src/battle_pyramid.c @@ -83,18 +83,18 @@ static void ClearPyramidPartyHeldItems(void); static void SetPyramidFloorPalette(void); static void BattlePyramidStartMenu(void); static void RestorePyramidPlayerParty(void); -static void InitPyramidBagItems(u8 lvlMode); +static void InitPyramidBagItems(u8); static u8 GetPyramidFloorTemplateId(void); static u8 GetPostBattleDirectionHintTextIndex(int *, u8, u8); -static void Task_SetPyramidFloorPalette(u8 taskId); -static void MarkPyramidTrainerAsBattled(u16 trainerId); -static void GetPyramidFloorLayoutOffsets(u8 *layoutOffsets); +static void Task_SetPyramidFloorPalette(u8); +static void MarkPyramidTrainerAsBattled(u16); +static void GetPyramidFloorLayoutOffsets(u8 *); static void GetPyramidEntranceAndExitSquareIds(u8 *, u8 *); static void SetPyramidObjectPositionsUniformly(u8); static bool8 SetPyramidObjectPositionsInAndNearSquare(u8, u8); static bool8 SetPyramidObjectPositionsNearSquare(u8, u8); -static bool8 TrySetPyramidObjectEventPositionInSquare(u8 arg0, u8 *floorLayoutOffsets, u8 squareId, u8 objectEventId); -static bool8 TrySetPyramidObjectEventPositionAtCoords(bool8 objType, u8 x, u8 y, u8 *floorLayoutOffsets, u8 squareId, u8 objectEventId); +static bool8 TrySetPyramidObjectEventPositionInSquare(u8, u8 *, u8, u8); +static bool8 TrySetPyramidObjectEventPositionAtCoords(bool8, u8, u8, u8 *, u8, u8); // Const rom data. #define ABILITY_RANDOM 2 // For wild mons data. diff --git a/src/evolution_graphics.c b/src/evolution_graphics.c index 5d17cca84..a6b558195 100644 --- a/src/evolution_graphics.c +++ b/src/evolution_graphics.c @@ -92,11 +92,22 @@ static const struct SpriteTemplate sEvoSparkleSpriteTemplate = .callback = SpriteCB_Sparkle_Dummy }; -static const s16 sEvoSparkleMatrices[] = +static const u16 sEvoSparkleMatrices[] = { - 0x3C0, 0x380, 0x340, 0x300, 0x2C0, 0x280, 0x240, 0x200, 0x1C0, - 0x180, 0x140, 0x100, -4, 0x10, -3, 0x30, -2, 0x50, - -1, 0x70, 0x1, 0x70, 0x2, 0x50, 0x3, 0x30, 0x4, 0x10 + 0x3C0, 0x380, 0x340, 0x300, 0x2C0, 0x280, + 0x240, 0x200, 0x1C0, 0x180, 0x140, 0x100 +}; + +static const s16 sUnused[] = +{ + -4, 0x10, + -3, 0x30, + -2, 0x50, + -1, 0x70, + 1, 0x70, + 2, 0x50, + 3, 0x30, + 4, 0x10 }; static void SpriteCB_Sparkle_Dummy(struct Sprite *sprite) @@ -107,30 +118,33 @@ static void SpriteCB_Sparkle_Dummy(struct Sprite *sprite) static void SetEvoSparklesMatrices(void) { u16 i; - for (i = 0; i < 12; i++) - { + for (i = 0; i < ARRAY_COUNT(sEvoSparkleMatrices); i++) SetOamMatrix(20 + i, sEvoSparkleMatrices[i], 0, 0, sEvoSparkleMatrices[i]); - } } +#define sSpeed data[3] +#define sAmplitude data[5] +#define sTrigIdx data[6] +#define sTimer data[7] + static void SpriteCB_Sparkle_SpiralUpward(struct Sprite* sprite) { if (sprite->y > 8) { u8 matrixNum; - sprite->y = 88 - (sprite->data[7] * sprite->data[7]) / 80; - sprite->y2 = Sin((u8)(sprite->data[6]), sprite->data[5]) / 4; - sprite->x2 = Cos((u8)(sprite->data[6]), sprite->data[5]); - sprite->data[6] += 4; - if (sprite->data[7] & 1) - sprite->data[5]--; - sprite->data[7]++; + sprite->y = 88 - (sprite->sTimer * sprite->sTimer) / 80; + sprite->y2 = Sin((u8)sprite->sTrigIdx, sprite->sAmplitude) / 4; + sprite->x2 = Cos((u8)sprite->sTrigIdx, sprite->sAmplitude); + sprite->sTrigIdx += 4; + if (sprite->sTimer & 1) + sprite->sAmplitude--; + sprite->sTimer++; if (sprite->y2 > 0) sprite->subpriority = 1; else sprite->subpriority = 20; - matrixNum = sprite->data[5] / 4 + 20; + matrixNum = sprite->sAmplitude / 4 + 20; if (matrixNum > 31) matrixNum = 31; sprite->oam.matrixNum = matrixNum; @@ -139,17 +153,17 @@ static void SpriteCB_Sparkle_SpiralUpward(struct Sprite* sprite) DestroySprite(sprite); } -static void CreateSparkle_SpiralUpward(u8 arg0) +static void CreateSparkle_SpiralUpward(u8 trigIdx) { - u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 88, 0); - if (spriteID != MAX_SPRITES) + u8 spriteId = CreateSprite(&sEvoSparkleSpriteTemplate, DISPLAY_WIDTH / 2, 88, 0); + if (spriteId != MAX_SPRITES) { - gSprites[spriteID].data[5] = 48; - gSprites[spriteID].data[6] = arg0; - gSprites[spriteID].data[7] = 0; - gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; - gSprites[spriteID].oam.matrixNum = 31; - gSprites[spriteID].callback = SpriteCB_Sparkle_SpiralUpward; + gSprites[spriteId].sAmplitude = 48; + gSprites[spriteId].sTrigIdx = trigIdx; + gSprites[spriteId].sTimer = 0; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; + gSprites[spriteId].oam.matrixNum = 31; + gSprites[spriteId].callback = SpriteCB_Sparkle_SpiralUpward; } } @@ -157,85 +171,85 @@ static void SpriteCB_Sparkle_ArcDown(struct Sprite* sprite) { if (sprite->y < 88) { - sprite->y = 8 + (sprite->data[7] * sprite->data[7]) / 5; - sprite->y2 = Sin((u8)(sprite->data[6]), sprite->data[5]) / 4; - sprite->x2 = Cos((u8)(sprite->data[6]), sprite->data[5]); - sprite->data[5] = 8 + Sin((u8)(sprite->data[7] * 4), 40); - sprite->data[7]++; + sprite->y = 8 + (sprite->sTimer * sprite->sTimer) / 5; + sprite->y2 = Sin((u8)sprite->sTrigIdx, sprite->sAmplitude) / 4; + sprite->x2 = Cos((u8)sprite->sTrigIdx, sprite->sAmplitude); + sprite->sAmplitude = 8 + Sin((u8)(sprite->sTimer * 4), 40); + sprite->sTimer++; } else DestroySprite(sprite); } -static void CreateSparkle_ArcDown(u8 arg0) +static void CreateSparkle_ArcDown(u8 trigIdx) { - u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 8, 0); - if (spriteID != MAX_SPRITES) + u8 spriteId = CreateSprite(&sEvoSparkleSpriteTemplate, DISPLAY_WIDTH / 2, 8, 0); + if (spriteId != MAX_SPRITES) { - gSprites[spriteID].data[5] = 8; - gSprites[spriteID].data[6] = arg0; - gSprites[spriteID].data[7] = 0; - gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; - gSprites[spriteID].oam.matrixNum = 25; - gSprites[spriteID].subpriority = 1; - gSprites[spriteID].callback = SpriteCB_Sparkle_ArcDown; + gSprites[spriteId].sAmplitude = 8; + gSprites[spriteId].sTrigIdx = trigIdx; + gSprites[spriteId].sTimer = 0; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; + gSprites[spriteId].oam.matrixNum = 25; + gSprites[spriteId].subpriority = 1; + gSprites[spriteId].callback = SpriteCB_Sparkle_ArcDown; } } static void SpriteCB_Sparkle_CircleInward(struct Sprite* sprite) { - if (sprite->data[5] > 8) + if (sprite->sAmplitude > 8) { - sprite->y2 = Sin((u8)(sprite->data[6]), sprite->data[5]); - sprite->x2 = Cos((u8)(sprite->data[6]), sprite->data[5]); - sprite->data[5] -= sprite->data[3]; - sprite->data[6] += 4; + sprite->y2 = Sin((u8)sprite->sTrigIdx, sprite->sAmplitude); + sprite->x2 = Cos((u8)sprite->sTrigIdx, sprite->sAmplitude); + sprite->sAmplitude -= sprite->sSpeed; + sprite->sTrigIdx += 4; } else DestroySprite(sprite); } -static void CreateSparkle_CircleInward(u8 arg0, u8 arg1) +static void CreateSparkle_CircleInward(u8 trigIdx, u8 speed) { - u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 56, 0); - if (spriteID != MAX_SPRITES) + u8 spriteId = CreateSprite(&sEvoSparkleSpriteTemplate, DISPLAY_WIDTH / 2, 56, 0); + if (spriteId != MAX_SPRITES) { - gSprites[spriteID].data[3] = arg1; - gSprites[spriteID].data[5] = 120; - gSprites[spriteID].data[6] = arg0; - gSprites[spriteID].data[7] = 0; - gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; - gSprites[spriteID].oam.matrixNum = 31; - gSprites[spriteID].subpriority = 1; - gSprites[spriteID].callback = SpriteCB_Sparkle_CircleInward; + gSprites[spriteId].sSpeed = speed; + gSprites[spriteId].sAmplitude = 120; + gSprites[spriteId].sTrigIdx = trigIdx; + gSprites[spriteId].sTimer = 0; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; + gSprites[spriteId].oam.matrixNum = 31; + gSprites[spriteId].subpriority = 1; + gSprites[spriteId].callback = SpriteCB_Sparkle_CircleInward; } } static void SpriteCB_Sparkle_Spray(struct Sprite* sprite) { - if (!(sprite->data[7] & 3)) + if (!(sprite->sTimer & 3)) sprite->y++; - if (sprite->data[6] < 128) + if (sprite->sTrigIdx < 128) { u8 matrixNum; - sprite->y2 = -Sin((u8)(sprite->data[6]), sprite->data[5]); - sprite->x = 120 + (sprite->data[3] * sprite->data[7]) / 3; - sprite->data[6]++; - matrixNum = 31 - (sprite->data[6] * 12 / 128); - if (sprite->data[6] > 64) + sprite->y2 = -Sin((u8)sprite->sTrigIdx, sprite->sAmplitude); + sprite->x = (DISPLAY_WIDTH / 2) + (sprite->sSpeed * sprite->sTimer) / 3; + sprite->sTrigIdx++; + matrixNum = 31 - (sprite->sTrigIdx * 12 / 128); + if (sprite->sTrigIdx > 64) sprite->subpriority = 1; else { sprite->invisible = FALSE; sprite->subpriority = 20; - if (sprite->data[6] > 112 && sprite->data[6] & 1) + if (sprite->sTrigIdx > 112 && sprite->sTrigIdx & 1) sprite->invisible = TRUE; } if (matrixNum < 20) matrixNum = 20; sprite->oam.matrixNum = matrixNum; - sprite->data[7]++; + sprite->sTimer++; } else DestroySprite(sprite); @@ -243,16 +257,16 @@ static void SpriteCB_Sparkle_Spray(struct Sprite* sprite) static void CreateSparkle_Spray(u8 id) { - u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 56, 0); - if (spriteID != MAX_SPRITES) + u8 spriteId = CreateSprite(&sEvoSparkleSpriteTemplate, DISPLAY_WIDTH / 2, 56, 0); + if (spriteId != MAX_SPRITES) { - gSprites[spriteID].data[3] = 3 - (Random() % 7); - gSprites[spriteID].data[5] = 48 + (Random() & 0x3F); - gSprites[spriteID].data[7] = 0; - gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; - gSprites[spriteID].oam.matrixNum = 31; - gSprites[spriteID].subpriority = 20; - gSprites[spriteID].callback = SpriteCB_Sparkle_Spray; + gSprites[spriteId].sSpeed = 3 - (Random() % 7); + gSprites[spriteId].sAmplitude = 48 + (Random() & 0x3F); + gSprites[spriteId].sTimer = 0; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; + gSprites[spriteId].oam.matrixNum = 31; + gSprites[spriteId].subpriority = 20; + gSprites[spriteId].callback = SpriteCB_Sparkle_Spray; } } @@ -289,7 +303,7 @@ static void Task_Sparkles_SpiralUpward(u8 taskId) { u8 i; for (i = 0; i < 4; i++) - CreateSparkle_SpiralUpward((0x78 & gTasks[taskId].tTimer) * 2 + i * 64); + CreateSparkle_SpiralUpward((gTasks[taskId].tTimer & 120) * 2 + i * 64); } gTasks[taskId].tTimer++; } diff --git a/src/list_menu.c b/src/list_menu.c index ccb183891..8ba13a6cf 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -312,14 +312,14 @@ static void ListMenuDummyTask(u8 taskId) } -s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum) +s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 drawMode, u16 tileNum, u16 palNum) { switch (sMysteryGiftLinkMenu.state) { case 0: default: sMysteryGiftLinkMenu.windowId = AddWindow(windowTemplate); - switch (arg2) + switch (drawMode) { case 2: LoadUserWindowBorderGfx(sMysteryGiftLinkMenu.windowId, tileNum, palNum); @@ -346,13 +346,13 @@ s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const str } if (sMysteryGiftLinkMenu.state == 2) { - if (arg2 == 0) + if (drawMode == 0) { ClearWindowTilemap(sMysteryGiftLinkMenu.windowId); } else { - switch (arg2) + switch (drawMode) { case 0: // can never be reached, because of the if statement above ClearStdWindowAndFrame(sMysteryGiftLinkMenu.windowId, FALSE); diff --git a/src/menu_helpers.c b/src/menu_helpers.c index e9f3e571f..7decd695c 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -153,7 +153,7 @@ void DoYesNoFuncWithChoice(u8 taskId, const struct YesNoFuncTable *data) gTasks[taskId].func = Task_CallYesOrNoCallback; } -void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 arg2, u8 arg3, u8 arg4, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo) +void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 unused1, u8 unused2, u8 unused3, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo) { CreateYesNoMenu(template, tileStart, palette, 0); sYesNo = *yesNo; @@ -176,17 +176,18 @@ static void Task_CallYesOrNoCallback(u8 taskId) } } -bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1) +// Returns TRUE if the quantity was changed, FALSE if it remained the same +bool8 AdjustQuantityAccordingToDPadInput(s16 *quantity, u16 max) { - s16 valBefore = (*arg0); + s16 valBefore = *quantity; - if ((JOY_REPEAT(DPAD_ANY)) == DPAD_UP) + if (JOY_REPEAT(DPAD_ANY) == DPAD_UP) { - (*arg0)++; - if ((*arg0) > arg1) - (*arg0) = 1; + (*quantity)++; + if (*quantity > max) + *quantity = 1; - if ((*arg0) == valBefore) + if (*quantity == valBefore) { return FALSE; } @@ -196,13 +197,13 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1) return TRUE; } } - else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_DOWN) + else if (JOY_REPEAT(DPAD_ANY) == DPAD_DOWN) { - (*arg0)--; - if ((*arg0) <= 0) - (*arg0) = arg1; + (*quantity)--; + if (*quantity <= 0) + *quantity = max; - if ((*arg0) == valBefore) + if (*quantity == valBefore) { return FALSE; } @@ -212,13 +213,13 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1) return TRUE; } } - else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_RIGHT) + else if (JOY_REPEAT(DPAD_ANY) == DPAD_RIGHT) { - (*arg0) += 10; - if ((*arg0) > arg1) - (*arg0) = arg1; + *quantity += 10; + if (*quantity > max) + *quantity = max; - if ((*arg0) == valBefore) + if (*quantity == valBefore) { return FALSE; } @@ -228,13 +229,13 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1) return TRUE; } } - else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_LEFT) + else if (JOY_REPEAT(DPAD_ANY) == DPAD_LEFT) { - (*arg0) -= 10; - if ((*arg0) <= 0) - (*arg0) = 1; + *quantity -= 10; + if (*quantity <= 0) + *quantity = 1; - if ((*arg0) == valBefore) + if (*quantity == valBefore) { return FALSE; } diff --git a/src/mystery_gift_client.c b/src/mystery_gift_client.c index adf3ce8a6..9405b133c 100644 --- a/src/mystery_gift_client.c +++ b/src/mystery_gift_client.c @@ -230,7 +230,7 @@ static u32 Client_Run(struct MysteryGiftClient * client) MysteryGift_TrySaveStamp(client->recvBuffer); break; case CLI_SAVE_RAM_SCRIPT: - InitRamScript_NoObjectEvent(client->recvBuffer, 1000); + InitRamScript_NoObjectEvent(client->recvBuffer, sizeof(struct RamScriptData)); break; case CLI_RECV_EREADER_TRAINER: memcpy(&gSaveBlock2Ptr->frontier.ereaderTrainer, client->recvBuffer, sizeof(gSaveBlock2Ptr->frontier.ereaderTrainer)); diff --git a/src/pokeball.c b/src/pokeball.c index a9ccd42d6..cf7f49b7e 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -438,7 +438,7 @@ static void SpriteCB_BallThrow(struct Sprite *sprite) sprite->y2 = 0; sprite->data[5] = 0; ballId = ItemIdToBallId(GetBattlerPokeballItemId(opponentBattler)); - AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 0x1C, ballId); + AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId); sprite->data[0] = LaunchBallFadeMonTask(FALSE, opponentBattler, 14, ballId); sprite->sBattler = opponentBattler; sprite->data[7] = noOfShakes; @@ -752,7 +752,7 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite) StartSpriteAnim(sprite, 1); ballId = ItemIdToBallId(GetBattlerPokeballItemId(battlerId)); - AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 0x1C, ballId); + AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId); sprite->data[0] = LaunchBallFadeMonTask(TRUE, sprite->sBattler, 14, ballId); sprite->callback = HandleBallAnimEnd; @@ -1000,14 +1000,14 @@ static void SpriteCB_OpponentMonSendOut(struct Sprite *sprite) #undef sBattler -static u8 AnimateBallOpenParticlesForPokeball(u8 x, u8 y, u8 kindOfStars, u8 d) +static u8 AnimateBallOpenParticlesForPokeball(u8 x, u8 y, u8 kindOfStars, u8 subpriority) { - return AnimateBallOpenParticles(x, y, kindOfStars, d, BALL_POKE); + return AnimateBallOpenParticles(x, y, kindOfStars, subpriority, BALL_POKE); } -static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 battlerId, u32 arg2) +static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes) { - return LaunchBallFadeMonTask(unFadeLater, battlerId, arg2, BALL_POKE); + return LaunchBallFadeMonTask(unFadeLater, battlerId, selectedPalettes, BALL_POKE); } // Pokeball in Birch intro, and when receiving via trade @@ -1041,24 +1041,24 @@ static void SpriteCB_PokeballReleaseMon(struct Sprite *sprite) { if (sprite->data[1] == 0) { - u8 r5; - u8 r7 = sprite->data[0]; + u8 subpriority; + u8 spriteId = sprite->data[0]; u8 battlerId = sprite->data[2]; - u32 r4 = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16); + u32 selectedPalettes = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16); if (sprite->subpriority != 0) - r5 = sprite->subpriority - 1; + subpriority = sprite->subpriority - 1; else - r5 = 0; + subpriority = 0; StartSpriteAnim(sprite, 1); - AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, r5); - sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, battlerId, r4); + AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, subpriority); + sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, battlerId, selectedPalettes); sprite->callback = SpriteCB_ReleasedMonFlyOut; - gSprites[r7].invisible = FALSE; - StartSpriteAffineAnim(&gSprites[r7], BATTLER_AFFINE_EMERGE); - AnimateSprite(&gSprites[r7]); - gSprites[r7].data[1] = 0x1000; + gSprites[spriteId].invisible = FALSE; + StartSpriteAffineAnim(&gSprites[spriteId], BATTLER_AFFINE_EMERGE); + AnimateSprite(&gSprites[spriteId]); + gSprites[spriteId].data[1] = 0x1000; sprite->data[7] = 0; } else @@ -1134,19 +1134,19 @@ static void SpriteCB_TradePokeball(struct Sprite *sprite) { if (sprite->data[1] == 0) { - u8 r6; + u8 subpriority; u8 monSpriteId = sprite->data[0]; - u8 r8 = sprite->data[2]; - u32 r5 = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16); + u8 battlerId = sprite->data[2]; + u32 selectedPalettes = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16); if (sprite->subpriority != 0) - r6 = sprite->subpriority - 1; + subpriority = sprite->subpriority - 1; else - r6 = 0; + subpriority = 0; StartSpriteAnim(sprite, 1); - AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, r6); - sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, r8, r5); + AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, subpriority); + sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, battlerId, selectedPalettes); sprite->callback = SpriteCB_TradePokeballSendOff; #ifdef BUGFIX // FIX: If this is used on a sprite that has previously had an affine animation, it will not diff --git a/src/pokemon.c b/src/pokemon.c index 61125e362..af5771a6a 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5379,10 +5379,10 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit) return offset; } -static void BufferStatRoseMessage(s32 arg0) +static void BufferStatRoseMessage(s32 statIdx) { gBattlerTarget = gBattlerInMenuId; - StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[arg0]]); + StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[statIdx]]); StringCopy(gBattleTextBuff2, gText_StatRose); BattleStringExpandPlaceholdersToDisplayedString(gText_DefendersStatRose); } diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c index f6aa82391..e00f5dbc8 100755 --- a/src/pokemon_jump.c +++ b/src/pokemon_jump.c @@ -2205,7 +2205,7 @@ static bool32 AreLinkQueuesEmpty(void) return !gRfu.recvQueue.count && !gRfu.sendQueue.count; } -static int GetNumPlayersForBonus(u8 *arg0) +static int GetNumPlayersForBonus(u8 *atJumpPeak) { int i = 0; int flags = 0; @@ -2213,7 +2213,7 @@ static int GetNumPlayersForBonus(u8 *arg0) for (; i < MAX_RFU_PLAYERS; i++) { - if (arg0[i]) + if (atJumpPeak[i]) { flags |= 1 << i; count++; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 8bf12c2bd..e38d46c84 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -8476,11 +8476,11 @@ static void MultiMove_ClearIconFromBg(u8 x, u8 y) } } -static void MultiMove_InitMove(u16 x, u16 y, u16 arg2) +static void MultiMove_InitMove(u16 x, u16 y, u16 moveSteps) { sMultiMove->bgX = x; sMultiMove->bgY = y; - sMultiMove->bgMoveSteps = arg2; + sMultiMove->bgMoveSteps = moveSteps; } static u8 MultiMove_UpdateMove(void) diff --git a/src/pokenav_conditions.c b/src/pokenav_conditions.c index 94ed4e8d8..e0645bac0 100644 --- a/src/pokenav_conditions.c +++ b/src/pokenav_conditions.c @@ -332,7 +332,7 @@ u8 *CopyStringLeftAlignedToConditionData(u8 *dst, const u8 *src, s16 n) return dst; } -static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 arg3) +static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 skipPadding) { u16 boxId, monId, gender, species, level, lvlDigits; struct BoxPokemon *boxMon; @@ -412,7 +412,7 @@ static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 arg3) str_ = ConvertIntToDecimalStringN(str_, level, STR_CONV_MODE_LEFT_ALIGN, 3); lvlDigits = str_ - txtPtr; *(str_++) = CHAR_SPACE; - if (!arg3) + if (!skipPadding) { lvlDigits = 3 - lvlDigits; while (lvlDigits-- != 0) diff --git a/src/rotating_tile_puzzle.c b/src/rotating_tile_puzzle.c index 2e919f550..a95d8624e 100644 --- a/src/rotating_tile_puzzle.c +++ b/src/rotating_tile_puzzle.c @@ -81,14 +81,11 @@ static const u8 sMovement_FaceUp[] = MOVEMENT_ACTION_STEP_END }; -// This file's functions. -static void SaveRotatingTileObject(u8 eventTemplateId, u8 arg1); -static void TurnUnsavedRotatingTileObject(u8 eventTemplateId, u8 arg1); +static void SaveRotatingTileObject(u8, u8); +static void TurnUnsavedRotatingTileObject(u8, u8); -// EWRAM vars EWRAM_DATA static struct RotatingTilePuzzle *sRotatingTilePuzzle = NULL; -// code void InitRotatingTilePuzzle(bool8 isTrickHouse) { if (sRotatingTilePuzzle == NULL) From a8437493c1358f2bb7c95c4187569a12e726e13c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 31 May 2022 15:08:34 -0400 Subject: [PATCH 131/208] Document generic argument names in battle anim palettes --- data/battle_anim_scripts.s | 528 ++++++++++++++++---------------- include/battle_anim.h | 4 +- include/constants/battle_anim.h | 17 + src/battle_anim_effects_1.c | 4 +- src/battle_anim_effects_2.c | 2 +- src/battle_anim_ghost.c | 2 +- src/battle_anim_mons.c | 32 +- src/battle_anim_normal.c | 44 +-- src/battle_anim_throw.c | 2 +- src/battle_anim_utility_funcs.c | 14 +- 10 files changed, 335 insertions(+), 314 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 1cfc5230c..538286e15 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -763,7 +763,7 @@ Move_TAKE_DOWN: setalpha 12, 8 createvisualtask AnimTask_WindUpLunge, 5, ANIM_ATTACKER, -24, 8, 23, 10, 40, 10 delay 35 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_BLACK, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_BLACK, 10, RGB_BLACK, 0 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 4, -10, 0, ANIM_TARGET, 0 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET delay 1 @@ -783,14 +783,14 @@ Move_TAKE_DOWN: Move_DOUBLE_EDGE: loadspritegfx ANIM_TAG_IMPACT playsewithpan SE_M_SWIFT, SOUND_PAN_ATTACKER - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 4, 2, RGB_WHITE, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 4, 2, RGB_WHITE, 10, RGB_BLACK, 0 waitforvisualfinish delay 10 playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER waitplaysewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER, 8 createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 18, 6, 2, 4 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 16, 16, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 16, 16, RGB_WHITE createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, 0, 0, 4 delay 3 waitforvisualfinish @@ -802,7 +802,7 @@ Move_DOUBLE_EDGE: createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 1, 0 createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 4, 0, 12, 1 createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 16, 0, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 16, 0, RGB_WHITE waitforvisualfinish createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 0, 1 createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 1, 1 @@ -860,7 +860,7 @@ Move_FIRE_BLAST: call FireBlastRing call FireBlastRing delay 24 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 3, 0, 8, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 3, 0, 8, RGB_BLACK waitforvisualfinish delay 19 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 20, 1 @@ -882,7 +882,7 @@ Move_FIRE_BLAST: delay 3 call FireBlastCross waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 2, 8, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 2, 8, 0, RGB_BLACK waitforvisualfinish end FireBlastRing: @@ -941,17 +941,17 @@ Move_MEGA_PUNCH: loadspritegfx ANIM_TAG_HANDS_AND_FEET monbg ANIM_TARGET delay 2 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 0, 16, RGB_BLACK setalpha 12, 8 playsewithpan SE_M_MEGA_KICK, SOUND_PAN_TARGET createsprite gMegaPunchKickSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 0, 50 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 7, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 7, RGB_WHITE delay 50 call SetImpactBackground createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 22, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 0, RGB_WHITE - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 0, RGB_WHITE + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish clearmonbg ANIM_TARGET @@ -984,18 +984,18 @@ Move_MEGA_KICK: loadspritegfx ANIM_TAG_HANDS_AND_FEET monbg ANIM_TARGET delay 2 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 0, 16, RGB_BLACK setalpha 12, 8 playsewithpan SE_M_MEGA_KICK, SOUND_PAN_TARGET createsprite gMegaPunchKickSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 1, 50 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 7, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 7, RGB_WHITE delay 50 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET call SetImpactBackground createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 22, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 0, RGB_WHITE - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 0, RGB_WHITE + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 waitforvisualfinish clearmonbg ANIM_TARGET blendoff @@ -1054,21 +1054,21 @@ SonicBoomHit: Move_THUNDER_SHOCK: loadspritegfx ANIM_TAG_SPARK loadspritegfx ANIM_TAG_SPARK_2 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 0, 6, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 0, 6, RGB_BLACK waitforvisualfinish delay 10 createvisualtask AnimTask_ElectricBolt, 5, 0, -44, 0 playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET delay 9 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 0, 0, 13, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 0, 13, RGB_BLACK waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 0, 13, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 13, 0, RGB_BLACK waitforvisualfinish delay 20 call ElectricityEffect waitforvisualfinish delay 20 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 6, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 6, 0, RGB_BLACK waitforvisualfinish end @@ -1076,7 +1076,7 @@ Move_THUNDERBOLT: loadspritegfx ANIM_TAG_SPARK loadspritegfx ANIM_TAG_SHOCK_3 loadspritegfx ANIM_TAG_SPARK_2 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 0, 6, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 0, 6, RGB_BLACK waitforvisualfinish delay 10 createvisualtask AnimTask_ElectricBolt, 5, 24, -52, 0 @@ -1088,9 +1088,9 @@ Move_THUNDERBOLT: createvisualtask AnimTask_ElectricBolt, 5, 0, -60, 1 playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET delay 9 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 0, 0, 13, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 0, 13, RGB_BLACK waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 0, 13, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 13, 0, RGB_BLACK waitforvisualfinish delay 20 createsprite gThunderboltOrbSpriteTemplate, ANIM_TARGET, 3, 44, 0, 0, 3 @@ -1104,20 +1104,20 @@ Move_THUNDERBOLT: createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 4, 0, 0, 16, 44, 224, 40, 2, -32765 playsewithpan SE_M_HYPER_BEAM, SOUND_PAN_TARGET delay 0 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 2, 2, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 2, 2, RGB_BLACK delay 6 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 6, 6, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 6, 6, RGB_BLACK delay 6 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 2, 2, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 2, 2, RGB_BLACK delay 6 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 6, 6, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 6, 6, RGB_BLACK waitforvisualfinish delay 20 waitplaysewithpan SE_M_THUNDERBOLT2, SOUND_PAN_TARGET, 19 call ElectricityEffect waitforvisualfinish delay 20 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 6, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 6, 0, RGB_BLACK waitforvisualfinish end @@ -1125,7 +1125,7 @@ Move_THUNDER_WAVE: loadspritegfx ANIM_TAG_SPARK loadspritegfx ANIM_TAG_SPARK_2 loadspritegfx ANIM_TAG_SPARK_H - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 0, 6, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 0, 6, RGB_BLACK waitforvisualfinish delay 10 createvisualtask AnimTask_ElectricBolt, 5, 0, -48, 0 @@ -1138,7 +1138,7 @@ Move_THUNDER_WAVE: delay 4 createsprite gThunderWaveSpriteTemplate, ANIM_TARGET, 2, -16, 16 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 6, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 6, 0, RGB_BLACK waitforvisualfinish end @@ -1247,10 +1247,10 @@ Move_REVERSAL: loadspritegfx ANIM_TAG_HANDS_AND_FEET loadspritegfx ANIM_TAG_IMPACT playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 3, RGB_WHITE, 8, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 3, RGB_WHITE, 8, RGB_BLACK, 0 waitforvisualfinish delay 30 - createvisualtask AnimTask_BlendColorCycle, 2, 31, 3, 2, 0, 10, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 2, 0, 10, RGB_WHITE delay 10 playsewithpan SE_M_REVERSAL, SOUND_PAN_ATTACKER createsprite gReversalOrbSpriteTemplate, ANIM_ATTACKER, 2, 26, 0 @@ -1264,7 +1264,7 @@ Move_REVERSAL: createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 6, 4 delay 8 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_WHITE, 8, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_WHITE, 8, RGB_BLACK, 0 createsprite gFistFootSpriteTemplate, ANIM_TARGET, 4, 0, 0, 10, 1, 0 createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0, 0, ANIM_TARGET, 1 createvisualtask AnimTask_ShakeTargetBasedOnMovePowerOrDmg, 5, FALSE, 1, 8, 1, 0 @@ -1348,7 +1348,7 @@ Move_PSYCH_UP: delay 4 playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER createvisualtask AnimTask_ScaleMonAndRestore, 5, -5, -5, 10, ANIM_ATTACKER, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 9, 2, 2, 10, 0, RGB_YELLOW + createvisualtask AnimTask_BlendBattleAnimPal, 9, F_PAL_ATTACKER, 2, 10, 0, RGB_YELLOW delay 30 clearmonbg ANIM_ATK_PARTNER blendoff @@ -1446,18 +1446,18 @@ FuryCutterRight: createsprite gCuttingSliceSpriteTemplate, ANIM_ATTACKER, 2, 40, -32, 1 goto FuryCutterContinue FuryCutterMedium: - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB(9, 8, 10), 4, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB(9, 8, 10), 4, RGB_BLACK, 0 goto FuryCutterContinue2 FuryCutterStrong: - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 3, RGB(9, 8, 10), 4, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 3, RGB(9, 8, 10), 4, RGB_BLACK, 0 goto FuryCutterContinue2 FuryCutterStrongest: - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 3, RGB(9, 8, 10), 4, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 3, RGB(9, 8, 10), 4, RGB_BLACK, 0 goto FuryCutterContinue2 Move_SELF_DESTRUCT: loadspritegfx ANIM_TAG_EXPLOSION - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 0, 9, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 0, 9, RGB_RED createvisualtask AnimTask_ShakeMon2, 5, 4, 6, 0, 38, 1 createvisualtask AnimTask_ShakeMon2, 5, 5, 6, 0, 38, 1 createvisualtask AnimTask_ShakeMon2, 5, 6, 6, 0, 38, 1 @@ -1466,7 +1466,7 @@ Move_SELF_DESTRUCT: call SelfDestructExplode call SelfDestructExplode waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 9, 0, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 9, 0, RGB_RED end SelfDestructExplode: playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_ATTACKER @@ -1623,7 +1623,7 @@ RisingWaterHitEffect: Move_EXPLOSION: loadspritegfx ANIM_TAG_EXPLOSION - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 8, 9, RGB(26, 8, 8), 8, RGB_BLACK, 8 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 8, 9, RGB(26, 8, 8), 8, RGB_BLACK, 8 createvisualtask AnimTask_ShakeMon2, 5, 4, 8, 0, 40, 1 createvisualtask AnimTask_ShakeMon2, 5, 5, 8, 0, 40, 1 createvisualtask AnimTask_ShakeMon2, 5, 6, 8, 0, 40, 1 @@ -1632,9 +1632,9 @@ Move_EXPLOSION: call Explosion1 call Explosion1 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 1, 16, 16, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 1, 16, 16, RGB_WHITE delay 50 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 3, 16, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 3, 16, 0, RGB_WHITE end Explosion1: playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER @@ -1678,16 +1678,16 @@ Move_PROTECT: Move_DETECT: loadspritegfx ANIM_TAG_SPARKLE_4 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 9, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 9, RGB_BLACK waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 0, 9, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 0, 9, RGB_WHITE delay 18 playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER createsprite gSpinningSparkleSpriteTemplate, ANIM_ATTACKER, 13, 20, -20 waitforvisualfinish delay 10 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 9, 0, RGB_BLACK - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 2, 9, 0, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 9, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 2, 9, 0, RGB_WHITE waitforvisualfinish end @@ -1709,7 +1709,7 @@ Frustration_Continue: Frustration_Strongest: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER createvisualtask AnimTask_ShakeMon2, 5, ANIM_ATTACKER, 1, 0, 15, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 3, 0, 9, 31 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 3, 0, 9, RGB_RED waitforvisualfinish delay 20 playsewithpan SE_M_SWAGGER2, SOUND_PAN_ATTACKER @@ -1740,12 +1740,12 @@ Frustration_Strongest: createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 18, -18, ANIM_TARGET, 0 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 3, 9, 0, 31 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 3, 9, 0, RGB_RED goto Frustration_Continue Frustration_Strong: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER createvisualtask AnimTask_ShakeMon2, 5, ANIM_ATTACKER, 1, 0, 15, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 3, 0, 9, 31 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 3, 0, 9, RGB_RED waitforvisualfinish delay 20 playsewithpan SE_M_SWAGGER2, SOUND_PAN_ATTACKER @@ -1766,7 +1766,7 @@ Frustration_Strong: createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, -12, -6, ANIM_TARGET, 1 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 4, 0, 6, 1 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 3, 9, 0, 31 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 3, 9, 0, RGB_RED goto Frustration_Continue Frustration_Medium: playsewithpan SE_M_SWAGGER2, SOUND_PAN_ATTACKER @@ -1808,7 +1808,7 @@ Move_SAFEGUARD: createsprite gGuardRingSpriteTemplate, ANIM_ATTACKER, 2 waitforvisualfinish playsewithpan SE_SHINY, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, 10, 0, 2, 0, 10, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATK_SIDE, 0, 2, 0, 10, RGB_WHITE waitforvisualfinish clearmonbg ANIM_ATK_PARTNER blendoff @@ -1864,13 +1864,13 @@ Move_GUILLOTINE: playsewithpan SE_M_VICEGRIP, SOUND_PAN_TARGET createsprite gGuillotineSpriteTemplate, ANIM_ATTACKER, 2, 0 createsprite gGuillotineSpriteTemplate, ANIM_ATTACKER, 2, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 16, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 16, RGB_BLACK delay 9 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 23, 1 delay 46 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 4, 0, 8, 1 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 0 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET waitforvisualfinish clearmonbg ANIM_DEF_PARTNER @@ -1900,7 +1900,7 @@ Move_PAY_DAY: Move_OUTRAGE: loadspritegfx ANIM_TAG_SMALL_EMBER loopsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER, 8, 3 - createvisualtask AnimTask_BlendColorCycle, 2, 7, 2, 5, 3, 8, RGB(14, 13, 0) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG | F_PAL_ATTACKER | F_PAL_TARGET, 2, 5, 3, 8, RGB(14, 13, 0) createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 12, 6, 5, 4 delay 0 createsprite gOutrageFlameSpriteTemplate, ANIM_TARGET, 2, 0, 0, 30, 1280, 0, 3 @@ -1946,25 +1946,25 @@ Move_SPARK: loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_SPARK_2 delay 0 - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 5, 5, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG | F_PAL_ATTACKER, -31, 1, 5, 5, RGB(31, 31, 22) playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 32, 24, 190, 12, ANIM_ATTACKER, 1, 0 delay 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 80, 24, 22, 12, ANIM_ATTACKER, 1, 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 156, 24, 121, 13, ANIM_ATTACKER, 1, 1 delay 0 - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 0, 0, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG | F_PAL_ATTACKER, -31, 1, 0, 0, RGB(31, 31, 22) delay 10 - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 5, 5, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG | F_PAL_ATTACKER, -31, 1, 5, 5, RGB(31, 31, 22) playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 100, 24, 60, 10, ANIM_ATTACKER, 1, 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 170, 24, 42, 11, ANIM_ATTACKER, 1, 1 delay 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 238, 24, 165, 10, ANIM_ATTACKER, 1, 1 delay 0 - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 0, 0, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG | F_PAL_ATTACKER, -31, 1, 0, 0, RGB(31, 31, 22) delay 20 - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 7, 7, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG | F_PAL_ATTACKER, -31, 1, 7, 7, RGB(31, 31, 22) playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 4, 0, 0, 32, 12, 0, 20, 0, 0 createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 4, 0, 0, 32, 12, 64, 20, 1, 0 @@ -1976,14 +1976,14 @@ Move_SPARK: createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 4, 0, 0, 16, 12, 224, 20, 2, 0 delay 4 waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 0, 0, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG | F_PAL_ATTACKER, -31, 1, 0, 0, RGB(31, 31, 22) createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 4 delay 4 playsewithpan SE_M_HYPER_BEAM, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, 0, 0, ANIM_TARGET, 2 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 2, 4, -31, 2, 0, 6, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, -31, 2, 0, 6, RGB(31, 31, 22) call ElectricityEffect waitforvisualfinish end @@ -2014,7 +2014,7 @@ Move_ATTRACT: createsprite gRedHeartRisingSpriteTemplate, ANIM_ATTACKER, 40, 112, 256, 90 createsprite gRedHeartRisingSpriteTemplate, ANIM_ATTACKER, 40, 200, 272, 90 delay 75 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 4, 4, 0, 10, RGB(31, 25, 27) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 4, 4, 0, 10, RGB(31, 25, 27) end Move_GROWTH: @@ -2024,7 +2024,7 @@ Move_GROWTH: waitforvisualfinish end GrowthEffect: - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 8, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB_WHITE playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER createvisualtask AnimTask_ScaleMonAndRestore, 5, -3, -3, 16, ANIM_ATTACKER, 0 return @@ -2084,12 +2084,12 @@ Move_MEAN_LOOK: loadspritegfx ANIM_TAG_EYE monbg ANIM_DEF_PARTNER playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 16, RGB_BLACK loopsewithpan SE_M_CONFUSE_RAY, SOUND_PAN_TARGET, 15, 4 waitplaysewithpan SE_M_LEER, SOUND_PAN_TARGET, 85 createsprite gMeanLookEyeSpriteTemplate, ANIM_ATTACKER, 2 delay 120 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 16, 0, RGB_BLACK delay 30 clearmonbg ANIM_DEF_PARTNER waitforvisualfinish @@ -2229,7 +2229,7 @@ Move_ICY_WIND: loadspritegfx ANIM_TAG_ICE_CRYSTALS loadspritegfx ANIM_TAG_ICE_SPIKES monbg ANIM_DEF_PARTNER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 11, 4, 0, 4, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_ATK_SIDE, 4, 0, 4, RGB_BLACK fadetobg BG_ICE waitbgfadeout playsewithpan SE_M_ICY_WIND, 0 @@ -2246,7 +2246,7 @@ Move_ICY_WIND: clearmonbg ANIM_DEF_PARTNER restorebg waitbgfadeout - createvisualtask AnimTask_BlendBattleAnimPal, 10, 11, 4, 4, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_ATK_SIDE, 4, 4, 0, RGB_BLACK waitbgfadein end IcyWindSwirlingSnowballs: @@ -2601,9 +2601,9 @@ Move_EARTHQUAKE: createvisualtask AnimTask_HorizontalShake, 5, MAX_BATTLERS_COUNT, 10, 50 playsewithpan SE_M_EARTHQUAKE, 0 delay 10 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 delay 16 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 end Move_FISSURE: @@ -2614,11 +2614,11 @@ Move_FISSURE: delay 8 call FissureDirtPlumeFar delay 15 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 delay 15 call FissureDirtPlumeClose delay 15 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 delay 15 call FissureDirtPlumeFar delay 50 @@ -2846,7 +2846,7 @@ SkullBashAttack: playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER waitforvisualfinish playse SE_BANG - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 2, 0, 40, 1 createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 10, 0, 40, 1 createsprite gFlashingHitSplatSpriteTemplate, ANIM_TARGET, 4, 0, 0, ANIM_TARGET, 0 @@ -2892,7 +2892,7 @@ Move_GLARE: createvisualtask AnimTask_GlareEyeDots, 5, 0 playsewithpan SE_M_PSYBEAM2, SOUND_PAN_ATTACKER waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 5, 1, 0, 0, 16, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 5, F_PAL_BG, 0, 0, 16, RGB_BLACK waitforvisualfinish createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, -16, -8 createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, 16, -8 @@ -2901,7 +2901,7 @@ Move_GLARE: delay 2 createvisualtask AnimTask_ShakeTargetInPattern, 3, 20, 1, FALSE waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 5, 1, 0, 16, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 5, F_PAL_BG, 0, 16, 0, RGB_BLACK end Move_BARRAGE: @@ -2926,17 +2926,17 @@ SkyAttackSetUp: jumpretfalse SkyAttackSetUpAgainstOpponent goto SkyAttackSetUpAgainstPartner SkyAttackSetUpAgainstOpponent: - createvisualtask AnimTask_BlendBattleAnimPal, 10, 27, 1, 0, 12, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_ATK_SIDE | F_PAL_DEF_PARTNER, 1, 0, 12, RGB_BLACK waitforvisualfinish delay 12 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 8, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 8, 0, RGB_BLACK createvisualtask AnimTask_HorizontalShake, 5, ANIM_ATTACKER, 2, 16 loopsewithpan SE_M_STAT_INCREASE, SOUND_PAN_ATTACKER, 4, 8 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 0, 15, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 0, 15, RGB_WHITE delay 20 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 15, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 15, 0, RGB_WHITE waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 25, 1, 8, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_ATK_PARTNER | F_PAL_DEF_PARTNER, 1, 8, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -2945,13 +2945,13 @@ SkyAttackSetUpAgainstPartner: createvisualtask AnimTask_BlendBattleAnimPalExclude, 10, ANIM_TARGET, 1, 0, 12, RGB_BLACK waitforvisualfinish delay 12 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 8, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 8, 0, RGB_BLACK createvisualtask AnimTask_HorizontalShake, 5, ANIM_ATTACKER, 2, 16 playsewithpan SE_M_STAT_INCREASE, SOUND_PAN_ATTACKER delay 8 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 0, 15, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 0, 15, RGB_WHITE delay 20 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 15, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 15, 0, RGB_WHITE waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPalExclude, 10, 4, 1, 8, 0, RGB_BLACK waitforvisualfinish @@ -2963,7 +2963,7 @@ SkyAttackUnleash: loadspritegfx ANIM_TAG_BIRD call SetSkyBg monbg ANIM_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 0, 0, 16, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 0, 0, 16, RGB_WHITE delay 4 createvisualtask AnimTask_AttackerFadeToInvisible, 5, 0 waitforvisualfinish @@ -2975,7 +2975,7 @@ SkyAttackUnleash: delay 20 createvisualtask AnimTask_AttackerFadeFromInvisible, 5, 1 delay 2 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 0, 15, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 0, 15, 0, RGB_WHITE waitforvisualfinish clearmonbg ANIM_ATTACKER call UnsetSkyBg @@ -3025,7 +3025,7 @@ Move_SUPER_FANG: createsprite gSuperFangSpriteTemplate, ANIM_TARGET, 2 playsewithpan SE_M_BITE, SOUND_PAN_TARGET delay 8 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB(31, 2, 2), 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB(31, 2, 2), 14, RGB_WHITE, 14 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 7, 12, 1 waitforvisualfinish blendoff @@ -3113,7 +3113,7 @@ Move_SPITE: playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER waitbgfadein monbg ANIM_DEF_PARTNER - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 6, 0, 8, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 6, 0, 8, RGB_WHITE createvisualtask AnimTask_SpiteTargetShadow, 2 loopsewithpan SE_M_PSYBEAM, SOUND_PAN_TARGET, 20, 3 waitforvisualfinish @@ -3198,7 +3198,7 @@ Move_ENDURE: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call EndureEffect delay 8 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 11, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB_RED createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call EndureEffect delay 8 @@ -3332,9 +3332,9 @@ MagnitudeIntense: createvisualtask AnimTask_HorizontalShake, 5, MAX_BATTLERS_COUNT, 0, 50 loopsewithpan SE_M_STRENGTH, SOUND_PAN_TARGET, 8, 10 delay 10 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 delay 16 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 goto MagnitudeEnd Move_RAPID_SPIN: @@ -3361,7 +3361,7 @@ Move_MOONLIGHT: loadspritegfx ANIM_TAG_GREEN_SPARKLE loadspritegfx ANIM_TAG_BLUE_STAR setalpha 0, 16 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 16, RGB_BLACK waitforvisualfinish createsprite gMoonSpriteTemplate, ANIM_ATTACKER, 2, 120, 56 createvisualtask AnimTask_AlphaFadeIn, 3, 0, 16, 16, 0, 1 @@ -3484,12 +3484,12 @@ Move_HEAT_WAVE: Move_HAIL: loadspritegfx ANIM_TAG_HAIL loadspritegfx ANIM_TAG_ICE_CRYSTALS - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 3, 0, 6, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 3, 0, 6, RGB_BLACK waitforvisualfinish createvisualtask AnimTask_Hail, 5 loopsewithpan SE_M_HAIL, 0, 8, 10 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 3, 6, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 3, 6, 0, RGB_BLACK end Move_TORMENT: @@ -3567,7 +3567,7 @@ Move_CHARGE: loadspritegfx ANIM_TAG_ELECTRICITY monbg ANIM_ATTACKER setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 4, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 4, RGB_BLACK waitforvisualfinish createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 60, 2, 12 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER @@ -3591,7 +3591,7 @@ Move_CHARGE: createsprite gElectricPuffSpriteTemplate, ANIM_ATTACKER, 2, 0, -16, -16 playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 4, 4, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 4, 4, 0, RGB_BLACK clearmonbg ANIM_ATTACKER blendoff end @@ -3721,13 +3721,13 @@ BrickBreakNormal: playsewithpan SE_M_VITAL_THROW, SOUND_PAN_TARGET delay 20 createvisualtask AnimTask_WindUpLunge, 2, ANIM_ATTACKER, -24, 0, 24, 10, 24, 3 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 6, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 6, RGB_BLACK delay 37 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 createsprite gFistFootSpriteTemplate, ANIM_ATTACKER, 4, 0, 0, 10, 1, 0 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 6, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 6, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_TARGET end @@ -3747,7 +3747,7 @@ BrickBreakShatteredWall: playsewithpan SE_M_VITAL_THROW, SOUND_PAN_TARGET delay 20 createvisualtask AnimTask_WindUpLunge, 2, ANIM_ATTACKER, -24, 0, 24, 10, 24, 3 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 6, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 6, RGB_BLACK delay 37 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 createsprite gFistFootSpriteTemplate, ANIM_ATTACKER, 4, 0, 0, 10, 1, 0 @@ -3759,7 +3759,7 @@ BrickBreakShatteredWall: createsprite gBrickBreakWallShardSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 3, 8, 12 playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 6, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 6, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_TARGET end @@ -3798,7 +3798,7 @@ Move_ENDEAVOR: Move_ERUPTION: loadspritegfx ANIM_TAG_WARM_ROCK - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 2, 0, 4, RGB_RED + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 2, 0, 4, RGB_RED waitforvisualfinish createvisualtask AnimTask_EruptionLaunchRocks, 2 waitplaysewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER, 60 @@ -3818,7 +3818,7 @@ Move_ERUPTION: createvisualtask AnimTask_HorizontalShake, 5, MAX_BATTLERS_COUNT, 8, 60 loopsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET, 16, 12 delay 80 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 40, 31, 4, 4, 0, RGB_RED + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 40, F_PAL_BG | F_PAL_BATTLERS, 4, 4, 0, RGB_RED end Move_SKILL_SWAP: @@ -3873,13 +3873,13 @@ Move_CAMOUFLAGE: monbg ANIM_ATK_PARTNER splitbgprio ANIM_ATTACKER setalpha 16, 0 - createvisualtask AnimTask_SetCamouflageBlend, 5, 2, 3, 0, 14 + createvisualtask AnimTask_SetCamouflageBlend, 5, F_PAL_ATTACKER, 3, 0, 14 delay 16 createvisualtask AnimTask_AttackerFadeToInvisible, 2, 4 playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER waitforvisualfinish delay 8 - createvisualtask AnimTask_SetCamouflageBlend, 5, 2, 0, 0, 0 + createvisualtask AnimTask_SetCamouflageBlend, 5, F_PAL_ATTACKER, 0, 0, 0 waitforvisualfinish createvisualtask AnimTask_AttackerFadeFromInvisible, 2, 1 waitforvisualfinish @@ -3891,13 +3891,13 @@ Move_TAIL_GLOW: loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT monbg ANIM_ATTACKER setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 4, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 4, RGB_BLACK waitforvisualfinish createsprite gTailGlowOrbSpriteTemplate, ANIM_ATTACKER, 66, ANIM_ATTACKER delay 18 loopsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER, 16, 6 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 4, 4, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 4, 4, 0, RGB_BLACK clearmonbg ANIM_ATTACKER blendoff delay 1 @@ -3955,15 +3955,15 @@ Move_MIST_BALL: waitforvisualfinish playsewithpan SE_M_SAND_ATTACK, SOUND_PAN_TARGET createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 10, 0 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 1, 1, 1, RGB(23, 16, 31), 16, RGB_WHITE, 16 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_BG, 1, 1, RGB(23, 16, 31), 16, RGB_WHITE, 16 delay 0 playsewithpan SE_M_HAZE, 0 createvisualtask AnimTask_LoadMistTiles, 5 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 3, 0, 16, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 3, 0, 16, RGB_WHITE delay 8 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 4, 0, 70, 0 delay 70 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 16, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 16, 0, RGB_WHITE end Move_FEATHER_DANCE: @@ -4133,7 +4133,7 @@ Move_AROMATHERAPY: loadspritegfx ANIM_TAG_FLOWER loadspritegfx ANIM_TAG_THIN_RING loadspritegfx ANIM_TAG_SPARKLE_2 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 1, 0, 0, 7, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_BG, 0, 0, 7, RGB(13, 31, 12) delay 1 monbg ANIM_ATTACKER delay 1 @@ -4151,7 +4151,7 @@ Move_AROMATHERAPY: waitforvisualfinish clearmonbg ANIM_ATTACKER delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 1, 0, 7, 0, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_BG, 0, 7, 0, RGB(13, 31, 12) delay 1 playsewithpan SE_M_STAT_INCREASE, SOUND_PAN_ATTACKER createvisualtask AnimTask_StatusClearedEffect, 2, 1 @@ -4162,7 +4162,7 @@ Move_AROMATHERAPY: createsprite gSparklingStarsSpriteTemplate, ANIM_ATTACKER, 16, 12, -5, 0, 0, 32, 60, 1 waitforvisualfinish playsewithpan SE_SHINY, SOUND_PAN_ATTACKER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 43, 3, 10, 0, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_BG | F_PAL_ATK_SIDE | F_PAL_ANIM_1, 3, 10, 0, RGB(13, 31, 12) createsprite gBlendThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 16, 0, 0, 0, 1 waitforvisualfinish end @@ -4223,13 +4223,13 @@ Move_ODOR_SLEUTH: waitforvisualfinish clearmonbg ANIM_TARGET delay 1 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_WHITEALPHA, 16, RGB_WHITEALPHA, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_WHITEALPHA, 16, RGB_WHITEALPHA, 0 playsewithpan SE_M_LEER, SOUND_PAN_ATTACKER end Move_GRASS_WHISTLE: loadspritegfx ANIM_TAG_MUSIC_NOTES - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 4, RGB(18, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 4, RGB(18, 31, 12) waitforvisualfinish createvisualtask AnimTask_MusicNotesRainbowBlend, 2 waitforvisualfinish @@ -4260,19 +4260,19 @@ Move_GRASS_WHISTLE: delay 4 waitforvisualfinish createvisualtask AnimTask_MusicNotesClearRainbowBlend, 2 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 4, 4, 0, RGB(18, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 4, 4, 0, RGB(18, 31, 12) waitforvisualfinish end Move_TICKLE: loadspritegfx ANIM_TAG_EYE_SPARKLE - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 0, 0, 16, RGB_BLACK waitforvisualfinish createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, -16, -8 createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, 16, -8 playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 0, 16, 0, RGB_BLACK waitforvisualfinish delay 20 createvisualtask AnimTask_SwayMon, 3, 0, 6, 1280, 3, ANIM_ATTACKER @@ -4351,7 +4351,7 @@ Move_AERIAL_ACE: playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER delay 5 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 10, 1 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_BLACK, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_BLACK, 10, RGB_BLACK, 0 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET waitforvisualfinish clearmonbg ANIM_TARGET @@ -4361,7 +4361,7 @@ Move_AERIAL_ACE: Move_IRON_DEFENSE: loopsewithpan SE_SHINY, SOUND_PAN_ATTACKER, 28, 2 createvisualtask AnimTask_MetallicShine, 5, 0, 0, 0 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 8, 2, RGB_WHITEALPHA, 14, RGB_WHITEALPHA, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 8, 2, RGB_WHITEALPHA, 14, RGB_WHITEALPHA, 0 waitforvisualfinish end @@ -4414,7 +4414,7 @@ Move_VOLT_TACKLE: loadspritegfx ANIM_TAG_ELECTRICITY monbg ANIM_ATTACKER setalpha 12, 8 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 0, 8, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 0, 8, RGB_BLACK waitforvisualfinish createsprite gVoltTackleOrbSlideSpriteTemplate, ANIM_ATTACKER, 1 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER @@ -4451,7 +4451,7 @@ Move_VOLT_TACKLE: delay 2 createsprite gElectricPuffSpriteTemplate, ANIM_ATTACKER, 2, 0, -16, -16 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 8, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 8, 0, RGB_BLACK waitforvisualfinish end @@ -4547,7 +4547,7 @@ Move_SHOCK_WAVE: loadspritegfx ANIM_TAG_LIGHTNING monbg ANIM_ATTACKER setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 4, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 4, RGB_BLACK waitforvisualfinish createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 20, 0, 2 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER @@ -4561,10 +4561,10 @@ Move_SHOCK_WAVE: playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET waitforvisualfinish createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 6, 18, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 5, 1, 3, 16, 0, RGB_WHITE - createvisualtask AnimTask_BlendBattleAnimPal, 5, 4, 0, 16, 16, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 5, F_PAL_BG, 3, 16, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 5, F_PAL_TARGET, 0, 16, 16, RGB_BLACK delay 4 - createvisualtask AnimTask_BlendBattleAnimPal, 5, 4, 0, 0, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 5, F_PAL_TARGET, 0, 0, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_ATTACKER blendoff @@ -4629,7 +4629,7 @@ Move_MIND_READER: createsprite gWhiteHaloSpriteTemplate, ANIM_ATTACKER, 5 delay 40 playsewithpan SE_M_LEER, SOUND_PAN_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, 1, 1, 2, 0, 10, RGB_BLACK + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG, 1, 2, 0, 10, RGB_BLACK call MindReaderEyeSpikeEffect waitforvisualfinish clearmonbg ANIM_DEF_PARTNER @@ -4665,8 +4665,8 @@ Move_ICE_PUNCH: loadspritegfx ANIM_TAG_ICE_CRYSTALS loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_HANDS_AND_FEET - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 7, RGB_BLACK - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 9, RGB(12, 26, 31) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 7, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 9, RGB(12, 26, 31) delay 20 playsewithpan SE_M_STRING_SHOT, SOUND_PAN_TARGET createsprite gIceCrystalSpiralInwardSmall, ANIM_ATTACKER, 2, 0 @@ -4688,9 +4688,9 @@ Move_ICE_PUNCH: delay 15 call IceCrystalEffectShort delay 5 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 9, 0, RGB(12, 26, 31) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 9, 0, RGB(12, 26, 31) waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 7, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 7, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -4712,7 +4712,7 @@ Move_CONFUSION: call SetPsychicBackground setalpha 8, 8 createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 10, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 8, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB_WHITE waitforvisualfinish playsewithpan SE_M_SUPERSONIC, SOUND_PAN_TARGET createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 15, 1 @@ -4729,7 +4729,7 @@ Move_PSYCHIC: call SetPsychicBackground setalpha 8, 8 createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 10, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 8, RGB(31, 23, 0) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB(31, 23, 0) waitforvisualfinish loopsewithpan SE_M_SUPERSONIC, SOUND_PAN_TARGET, 10, 3 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 15, 1 @@ -4754,7 +4754,7 @@ FutureSight: call SetPsychicBackground setalpha 8, 8 playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 8, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB_WHITE createvisualtask AnimTask_ScaleMonAndRestore, 5, -4, -4, 15, ANIM_ATTACKER, 1 waitforvisualfinish clearmonbg ANIM_ATK_PARTNER @@ -4767,7 +4767,7 @@ Move_THUNDER: waitbgfadeout createvisualtask AnimTask_StartSlidingBg, 5, -256, 0, 1, -1 waitbgfadein - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 16, RGB_BLACK delay 16 createvisualtask AnimTask_InvertScreenColor, 2, 257, 257, 257 playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET @@ -4811,7 +4811,7 @@ Move_THUNDER: delay 2 createvisualtask AnimTask_InvertScreenColor, 2, 257, 257, 257 delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_TARGET, 2, 1, 2, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_TARGET, 2, F_PAL_BG, 2, 16, 0, RGB_BLACK waitforvisualfinish restorebg waitbgfadeout @@ -4825,7 +4825,7 @@ Move_THUNDER_PUNCH: loadspritegfx ANIM_TAG_LIGHTNING monbg ANIM_TARGET setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 16, RGB_BLACK waitforvisualfinish playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET createsprite gFistFootSpriteTemplate, ANIM_TARGET, 4, 0, 0, 8, 1, 0 @@ -4845,7 +4845,7 @@ Move_THUNDER_PUNCH: createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 15, 1 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 2 delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 16, 0, RGB_BLACK delay 20 waitforvisualfinish clearmonbg ANIM_TARGET @@ -4931,7 +4931,7 @@ Move_DRAGON_BREATH: delay 2 createsprite gDragonBreathFireSpriteTemplate, ANIM_TARGET, 2, 0, 0, 0, 0, 20 delay 2 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 1, 0, 9, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 1, 0, 9, RGB_RED createsprite gDragonBreathFireSpriteTemplate, ANIM_TARGET, 2, 0, 0, 0, 0, 20 delay 2 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 21, 1 @@ -4951,7 +4951,7 @@ Move_DRAGON_BREATH: delay 2 createsprite gDragonBreathFireSpriteTemplate, ANIM_TARGET, 2, 0, 0, 0, 0, 20 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 1, 9, 0, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 1, 9, 0, RGB_RED waitforvisualfinish clearmonbg ANIM_DEF_PARTNER end @@ -5135,7 +5135,7 @@ Move_SMOG: call SmogCloud delay 120 loopsewithpan SE_M_TOXIC, SOUND_PAN_TARGET, 18, 2 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(26, 0, 26) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(26, 0, 26) delay 10 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 15, 1 waitforvisualfinish @@ -5269,14 +5269,14 @@ Move_DRAGON_RAGE: Move_RAIN_DANCE: loadspritegfx ANIM_TAG_RAIN_DROPS playsewithpan SE_M_RAIN_DANCE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 2, 0, 4, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 2, 0, 4, RGB_BLACK waitforvisualfinish createvisualtask AnimTask_CreateRaindrops, 2, 0, 3, 120 createvisualtask AnimTask_CreateRaindrops, 2, 0, 3, 120 delay 120 delay 30 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 2, 4, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 2, 4, 0, RGB_BLACK waitforvisualfinish end @@ -5347,7 +5347,7 @@ Move_ICE_BEAM: splitbgprio ANIM_TARGET setalpha 12, 8 loadspritegfx ANIM_TAG_ICE_CRYSTALS - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 7, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 7, RGB_BLACK waitforvisualfinish createsoundtask SoundTask_LoopSEAdjustPanning, SE_M_BUBBLE_BEAM2, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 4, 4, 0, 10 createsprite gIceBeamOuterCrystalSpriteTemplate, ANIM_ATTACKER, 2, 20, 12, 0, 12, 20 @@ -5356,7 +5356,7 @@ Move_ICE_BEAM: call IceBeamCreateCrystals call IceBeamCreateCrystals call IceBeamCreateCrystals - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 4, -31, 0, 7, RGB(0, 20, 31) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_TARGET, -31, 0, 7, RGB(0, 20, 31) createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 25, 1 call IceBeamCreateCrystals call IceBeamCreateCrystals @@ -5372,9 +5372,9 @@ Move_ICE_BEAM: waitforvisualfinish delay 20 call IceCrystalEffectShort - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 4, 5, 7, 0, RGB(0, 20, 31) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_TARGET, 5, 7, 0, RGB(0, 20, 31) waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 7, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 7, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_TARGET blendoff @@ -5437,7 +5437,7 @@ SolarBeamEnd: SolarBeamSetUp: monbg ANIM_ATK_PARTNER setalpha 12, 8 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 1, 4, 0, 11, RGB(31, 31, 11) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 1, 4, 0, 11, RGB(31, 31, 11) playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER call SolarBeamAbsorbEffect waitforvisualfinish @@ -5482,7 +5482,7 @@ SolarBeamUnleash: delay 4 createsprite gSolarBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 1 delay 4 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 1, 0, 10, RGB(25, 31, 0) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 1, 0, 10, RGB(25, 31, 0) createsprite gSolarBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 2 delay 4 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 65, 1 @@ -5497,7 +5497,7 @@ SolarBeamUnleash: call SolarBeamUnleash1 call SolarBeamUnleash1 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 1, 10, 0, RGB(25, 31, 0) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 1, 10, 0, RGB(25, 31, 0) call UnsetSolarBeamBg goto SolarBeamEnd SolarBeamUnleash1: @@ -5572,7 +5572,7 @@ BlizzardAgainstPlayer: Move_POWDER_SNOW: loadspritegfx ANIM_TAG_ICE_CRYSTALS monbg ANIM_DEF_PARTNER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 1, 0, 3, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 1, 0, 3, RGB_BLACK waitforvisualfinish panse SE_M_GUST, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 call PowderSnowSnowballs @@ -5584,7 +5584,7 @@ Move_POWDER_SNOW: waitforvisualfinish clearmonbg ANIM_DEF_PARTNER delay 20 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 1, 3, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 1, 3, 0, RGB_BLACK end PowderSnowSnowballs: createsprite gPowderSnowSnowballSpriteTemplate, ANIM_ATTACKER, 40, 0, 0, 0, 0, 56, 4, 4, 1 @@ -5665,7 +5665,7 @@ Move_SIGNAL_BEAM: call SignalBeamOrbs call SignalBeamOrbs createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 3, 0, 25, 1 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 4, 8, 5, RGB_RED, 8, RGB(1, 30, 0), 8 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_TARGET, 8, 5, RGB_RED, 8, RGB(1, 30, 0), 8 call SignalBeamOrbs call SignalBeamOrbs call SignalBeamOrbs @@ -5698,7 +5698,7 @@ Move_ABSORB: monbg ANIM_DEF_PARTNER splitbgprio_foes ANIM_TARGET setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 4, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 4, RGB(13, 31, 12) waitforvisualfinish playsewithpan SE_M_ABSORB, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 2 @@ -5711,7 +5711,7 @@ Move_ABSORB: delay 15 call HealingEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 4, 0, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 4, 0, RGB(13, 31, 12) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -5751,7 +5751,7 @@ Move_MEGA_DRAIN: monbg ANIM_DEF_PARTNER splitbgprio_foes ANIM_TARGET setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 8, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 8, RGB(13, 31, 12) waitforvisualfinish playsewithpan SE_M_ABSORB, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 1 @@ -5764,7 +5764,7 @@ Move_MEGA_DRAIN: delay 15 call HealingEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 8, 0, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 8, 0, RGB(13, 31, 12) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -5812,7 +5812,7 @@ Move_GIGA_DRAIN: monbg ANIM_DEF_PARTNER splitbgprio_foes ANIM_TARGET setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 12, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 12, RGB(13, 31, 12) waitforvisualfinish playsewithpan SE_M_ABSORB, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0 @@ -5825,7 +5825,7 @@ Move_GIGA_DRAIN: delay 15 call HealingEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 12, 0, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 12, 0, RGB(13, 31, 12) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -5891,14 +5891,14 @@ Move_LEECH_LIFE: delay 2 createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 5, 1 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 7, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 7, RGB_BLACK waitforvisualfinish call AbsorbEffect waitforvisualfinish delay 15 call HealingEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 7, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 7, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -5906,7 +5906,7 @@ Move_LEECH_LIFE: Move_SYNTHESIS: loadspritegfx ANIM_TAG_SPARKLE_2 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 16, RGB(27, 31, 18) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 16, RGB(27, 31, 18) playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER call GrantingStarsEffect waitforvisualfinish @@ -5948,7 +5948,7 @@ Move_SLUDGE: createsprite gSludgeProjectileSpriteTemplate, ANIM_TARGET, 2, 20, 0, 40, 0 waitforvisualfinish createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 3, 0, 5, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 1, 2, 0, 12, RGB(30, 0, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 1, 2, 0, 12, RGB(30, 0, 31) call PoisonBubblesEffect waitforvisualfinish end @@ -5966,7 +5966,7 @@ Move_SLUDGE_BOMB: call SludgeBombProjectile call SludgeBombProjectile createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 3, 0, 15, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 1, 2, 0, 12, RGB(30, 0, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 1, 2, 0, 12, RGB(30, 0, 31) createsprite gSludgeBombHitParticleSpriteTemplate, ANIM_TARGET, 2, 42, 27, 20 createsprite gSludgeBombHitParticleSpriteTemplate, ANIM_TARGET, 2, -27, 44, 20 createsprite gSludgeBombHitParticleSpriteTemplate, ANIM_TARGET, 2, 39, -28, 20 @@ -6010,7 +6010,7 @@ Move_ACID: delay 15 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 10, 1 createvisualtask AnimTask_ShakeMon2, 5, ANIM_DEF_PARTNER, 2, 0, 10, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 20, 2, 2, 0, 12, RGB(30, 0, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_DEF_SIDE, 2, 2, 0, 12, RGB(30, 0, 31) createsprite gAcidPoisonDropletSpriteTemplate, ANIM_TARGET, 2, 0, -22, 0, 15, 55 playsewithpan SE_M_BUBBLE, SOUND_PAN_TARGET delay 10 @@ -6060,7 +6060,7 @@ Move_BONE_CLUB: delay 12 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 1 createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 5, 1 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 7, 5, 1, RGB_BLACK, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_ATTACKER | F_PAL_TARGET, 5, 1, RGB_BLACK, 10, RGB_BLACK, 0 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish clearmonbg ANIM_DEF_PARTNER @@ -6124,7 +6124,7 @@ MegahornContinue: createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -16, 4, 1, 4 waitforvisualfinish createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, -4, 1, 12, 1 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 7, 5, 1, RGB_WHITE, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_ATTACKER | F_PAL_TARGET, 5, 1, RGB_WHITE, 10, RGB_BLACK, 0 delay 10 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 11 delay 3 @@ -6266,7 +6266,7 @@ Move_CRABHAMMER: createsprite gWaterHitSplatSpriteTemplate, ANIM_ATTACKER, 4, 0, 0, ANIM_TARGET, 0 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET delay 1 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB(13, 21, 31), 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB(13, 21, 31), 10, RGB_BLACK, 0 createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -24, 0, 0, 4 waitforvisualfinish delay 8 @@ -6362,14 +6362,14 @@ Move_WHIRLPOOL: splitbgprio ANIM_TARGET setalpha 12, 8 delay 0 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 0, 7, RGB(0, 13, 23) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 0, 7, RGB(0, 13, 23) playsewithpan SE_M_WHIRLPOOL, SOUND_PAN_TARGET createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 50, 1 call WhirlpoolEffect call WhirlpoolEffect call WhirlpoolEffect delay 12 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 7, 0, RGB(0, 13, 23) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 7, 0, RGB(0, 13, 23) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER end @@ -6469,7 +6469,7 @@ Move_CROSS_CHOP: createsprite gCrossChopHandSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 1 delay 40 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_WHITE, 10, RGB_BLACK, 10 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_WHITE, 10, RGB_BLACK, 10 createsprite gCrossImpactSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 1, 20 createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 7, 0, 9, 1 waitforvisualfinish @@ -6721,7 +6721,7 @@ Move_SUNNY_DAY: loadspritegfx ANIM_TAG_SUNLIGHT monbg ANIM_ATK_PARTNER setalpha 13, 3 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 1, 0, 6, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 1, 0, 6, RGB_WHITE waitforvisualfinish panse_adjustnone SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +1, 0 call SunnyDayLightRay @@ -6729,7 +6729,7 @@ Move_SUNNY_DAY: call SunnyDayLightRay call SunnyDayLightRay waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 1, 6, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 1, 6, 0, RGB_WHITE waitforvisualfinish clearmonbg ANIM_ATK_PARTNER blendoff @@ -6929,7 +6929,7 @@ Move_MIST: call MistCloud call MistCloud delay 32 - createvisualtask AnimTask_BlendColorCycle, 2, 10, 8, 2, 0, 14, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATK_SIDE, 8, 2, 0, 14, RGB_WHITE waitforvisualfinish clearmonbg ANIM_ATK_PARTNER blendoff @@ -6945,9 +6945,9 @@ Move_HAZE: playsewithpan SE_M_HAZE, 0 createvisualtask AnimTask_HazeScrollingFog, 5 delay 30 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x780, 2, 0, 16, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BATTLERS_2, 2, 0, 16, RGB_BLACK delay 90 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x780, 1, 16, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BATTLERS_2, 1, 16, 0, RGB_BLACK end Move_FIRE_PUNCH: @@ -6956,7 +6956,7 @@ Move_FIRE_PUNCH: loadspritegfx ANIM_TAG_IMPACT monbg ANIM_DEF_PARTNER setalpha 12, 8 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 9, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 9, RGB_RED createsprite gFireSpiralInwardSpriteTemplate, ANIM_TARGET, 1, 0 createsprite gFireSpiralInwardSpriteTemplate, ANIM_TARGET, 1, 64 createsprite gFireSpiralInwardSpriteTemplate, ANIM_TARGET, 1, 128 @@ -6970,7 +6970,7 @@ Move_FIRE_PUNCH: delay 4 playsewithpan SE_M_FIRE_PUNCH, SOUND_PAN_TARGET waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 0, 9, 0, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 9, 0, RGB_RED waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -7099,7 +7099,7 @@ Move_POISON_GAS: createsprite gPoisonGasCloudSpriteTemplate, ANIM_TARGET, 0, 64, 0, 0, -32, -6, 4192, 1072, 0 delay 40 loopsewithpan SE_M_MIST, SOUND_PAN_TARGET, 28, 6 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 6, 2, 0, 12, RGB(26, 0, 26) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 6, 2, 0, 12, RGB(26, 0, 26) waitforvisualfinish blendoff clearmonbg ANIM_DEF_PARTNER @@ -7133,7 +7133,7 @@ Move_PSYBEAM: call PsybeamRings call PsybeamRings createvisualtask AnimTask_SwayMon, 5, 0, 6, 2048, 4, ANIM_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(31, 18, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(31, 18, 31) call PsybeamRings call PsybeamRings call PsybeamRings @@ -7158,7 +7158,7 @@ Move_HYPNOSIS: call HypnosisRings call HypnosisRings call HypnosisRings - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(31, 18, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(31, 18, 31) waitforvisualfinish delay 1 call UnsetPsychicBackground @@ -7178,7 +7178,7 @@ Move_PSYWAVE: createsoundtask SoundTask_LoopSEAdjustPanning, SE_M_TELEPORT, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 9, 0, 10 call PsywaveRings call PsywaveRings - createvisualtask AnimTask_BlendColorCycle, 2, 4, 1, 4, 0, 12, RGB(31, 18, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 1, 4, 0, 12, RGB(31, 18, 31) call PsywaveRings call PsywaveRings call PsywaveRings @@ -7314,7 +7314,7 @@ Move_NIGHT_SHADE: createvisualtask AnimTask_NightShadeClone, 5, 85 delay 70 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 12, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 0, 2, 0, 13, RGB_BLACK + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 0, 2, 0, 13, RGB_BLACK waitforvisualfinish clearmonbg ANIM_ATTACKER delay 1 @@ -7376,7 +7376,7 @@ Move_FOCUS_ENERGY: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call EndureEffect delay 8 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 11, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB_WHITE createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call EndureEffect delay 8 @@ -7389,7 +7389,7 @@ Move_BIDE: end BideSetUp: loopsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER, 9, 2 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 11, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB_RED createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 waitforvisualfinish end @@ -7399,7 +7399,7 @@ BideUnleash: monbg ANIM_DEF_PARTNER setalpha 12, 8 loopsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER, 9, 2 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 2, 0, 11, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 2, 0, 11, RGB_RED createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 waitforvisualfinish createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, 24, 0, 0, 4 @@ -7418,7 +7418,7 @@ BideUnleash: delay 5 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 7 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 2, 11, 0, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 2, 11, 0, RGB_RED waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -7429,7 +7429,7 @@ Move_STRING_SHOT: loadspritegfx ANIM_TAG_WEB_THREAD monbg ANIM_DEF_PARTNER delay 0 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, 1, 2, 0, 9, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, F_PAL_BG, 2, 0, 9, RGB_BLACK waitforvisualfinish loopsewithpan SE_M_STRING_SHOT, SOUND_PAN_ATTACKER, 9, 6 call StringShotThread @@ -7461,7 +7461,7 @@ Move_STRING_SHOT: clearmonbg ANIM_DEF_PARTNER delay 1 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, 1, 2, 9, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, F_PAL_BG, 2, 9, 0, RGB_BLACK end StringShotThread: @@ -7474,7 +7474,7 @@ Move_SPIDER_WEB: loadspritegfx ANIM_TAG_WEB_THREAD monbg ANIM_DEF_PARTNER delay 0 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, 1, 2, 0, 9, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, F_PAL_BG, 2, 0, 9, RGB_BLACK waitforvisualfinish splitbgprio ANIM_TARGET loopsewithpan SE_M_STRING_SHOT, SOUND_PAN_ATTACKER, 9, 6 @@ -7498,7 +7498,7 @@ Move_SPIDER_WEB: waitforvisualfinish clearmonbg ANIM_DEF_PARTNER delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, 1, 2, 9, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, F_PAL_BG, 2, 9, 0, RGB_BLACK end SpiderWebThread: @@ -7566,7 +7566,7 @@ Move_RECOVER: monbg ANIM_ATK_PARTNER setalpha 12, 8 loopsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER, 13, 3 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 6, 0, 11, RGB(31, 31, 11) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 6, 0, 11, RGB(31, 31, 11) call RecoverAbsorbEffect call RecoverAbsorbEffect call RecoverAbsorbEffect @@ -7608,7 +7608,7 @@ Move_MIMIC: setarg 7, 0xFFFF waitforvisualfinish playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 11, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 11, RGB_WHITE waitforvisualfinish clearmonbg_static ANIM_DEF_PARTNER blendoff @@ -7655,7 +7655,7 @@ CurseGhost: createsprite gCurseGhostSpriteTemplate, ANIM_TARGET, 2 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 14, 1 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 16, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_DEF_PARTNER end @@ -7673,7 +7673,7 @@ CurseStats: CurseStats1: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER createvisualtask AnimTask_DrawFallingWhiteLinesOnAttacker, 5 - createvisualtask AnimTask_BlendColorCycle, 5, 2, 4, 2, 0, 10, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 5, F_PAL_ATTACKER, 4, 2, 0, 10, RGB_RED return Move_SOFT_BOILED: @@ -7688,7 +7688,7 @@ Move_SOFT_BOILED: delay 120 delay 7 playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_ATTACKER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 10, 0, RGB(12, 24, 30) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 10, 0, RGB(12, 24, 30) createsprite gThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 3, 31, 16, 0, 1 delay 8 createsprite gThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 3, 31, 16, 0, 1 @@ -7703,7 +7703,7 @@ Move_HEAL_BELL: loadspritegfx ANIM_TAG_BELL loadspritegfx ANIM_TAG_MUSIC_NOTES_2 loadspritegfx ANIM_TAG_THIN_RING - createvisualtask AnimTask_BlendBattleAnimPal, 10, 10, 0, 0, 10, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATK_SIDE, 0, 0, 10, RGB_WHITE waitforvisualfinish createvisualtask AnimTask_LoadMusicNotesPals, 5 createsprite gBellSpriteTemplate, ANIM_ATTACKER, 2, 0, -24, 0, 1 @@ -7741,12 +7741,12 @@ Move_HEAL_BELL: loadspritegfx ANIM_TAG_THIN_RING playsewithpan SE_SHINY, SOUND_PAN_ATTACKER createvisualtask AnimTask_BlendBattleAnimPalExclude, 10, 4, 3, 10, 0, RGB(12, 24, 30) - createvisualtask AnimTask_BlendBattleAnimPal, 10, 10, 3, 10, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATK_SIDE, 3, 10, 0, RGB_WHITE createsprite gBlendThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 16, 0, 0, 0, 1 end HealBellRing: createvisualtask AnimTask_BlendBattleAnimPalExclude, 10, 4, 3, 8, 0, RGB(12, 24, 30) - createvisualtask AnimTask_BlendBattleAnimPal, 10, 10, 3, 2, 10, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATK_SIDE, 3, 2, 10, RGB_WHITE createsprite gThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 40, 0, -24, 0, 1 playsewithpan SE_M_HEAL_BELL, SOUND_PAN_ATTACKER return @@ -7759,12 +7759,12 @@ Move_FAKE_OUT: createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 5, 1 createvisualtask AnimTask_StretchTargetUp, 3 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 16, 0, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 16, 0, RGB_WHITE end Move_SCARY_FACE: loadspritegfx ANIM_TAG_EYE_SPARKLE - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 27, 3, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_ATK_SIDE | F_PAL_DEF_PARTNER, 3, 0, 16, RGB_BLACK playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER waitforvisualfinish delay 10 @@ -7776,7 +7776,7 @@ Move_SCARY_FACE: waitforvisualfinish createvisualtask AnimTask_ShakeTargetInPattern, 3, 20, 1, FALSE playsewithpan SE_M_STRING_SHOT2, SOUND_PAN_TARGET - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 27, 3, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_ATK_SIDE | F_PAL_DEF_PARTNER, 3, 16, 0, RGB_BLACK waitforvisualfinish end @@ -7920,7 +7920,7 @@ PresentHeal: Move_BATON_PASS: loadspritegfx ANIM_TAG_POKEBALL playsewithpan SE_M_BATON_PASS, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, 31, 1, 2, 0, 11, RGB(31, 22, 30) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG | F_PAL_BATTLERS, 1, 2, 0, 11, RGB(31, 22, 30) createsprite gBatonPassPokeballSpriteTemplate, ANIM_ATTACKER, 2 end @@ -7946,13 +7946,13 @@ Move_PERISH_SONG: delay 20 panse SE_M_PERISH_SONG, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 delay 80 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 0, 16, RGB_BLACK createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 4, 0 createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 5, 0 createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 6, 0 createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 7, 0 delay 100 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 16, 0, RGB_BLACK createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 4, 1 createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 5, 1 createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 6, 1 @@ -8027,7 +8027,7 @@ Move_TRI_ATTACK: delay 20 createsoundtask SoundTask_LoopSEAdjustPanning, SE_M_TRI_ATTACK, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 5, 6, 0, 7 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 16, RGB_BLACK delay 16 loadspritegfx ANIM_TAG_FIRE createsprite gLargeFlameScatterSpriteTemplate, ANIM_TARGET, 2, 0, 0, 30, 30, -1, 0 @@ -8063,7 +8063,7 @@ Move_TRI_ATTACK: waitforvisualfinish loadspritegfx ANIM_TAG_ICE_CRYSTALS call IceCrystalEffectShort - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 16, 0, RGB_BLACK waitforvisualfinish end @@ -8149,7 +8149,7 @@ Move_TRICK: Move_WISH: loadspritegfx ANIM_TAG_GOLD_STARS loadspritegfx ANIM_TAG_SPARKLE_2 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 0, 10, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 0, 10, RGB_BLACK waitforvisualfinish panse_adjustall SE_M_REFLECT, SOUND_PAN_TARGET, SOUND_PAN_ATTACKER, -3, 0 createsprite gWishStarSpriteTemplate, ANIM_ATTACKER, 40 @@ -8158,19 +8158,19 @@ Move_WISH: loopsewithpan SE_M_HEAL_BELL, SOUND_PAN_ATTACKER, 16, 3 call GrantingStarsEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 10, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 10, 0, RGB_BLACK waitforvisualfinish end Move_STOCKPILE: loadspritegfx ANIM_TAG_GRAY_ORB playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, 2, 8, 1, 0, 12, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 8, 1, 0, 12, RGB_WHITE createvisualtask AnimTask_StockpileDeformMon, 5 call StockpileAbsorb call StockpileAbsorb waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 12, 0, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 0, 12, 0, RGB_WHITE end StockpileAbsorb: createsprite gStockpileAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 55, 55, 13 @@ -8288,7 +8288,7 @@ Move_MORNING_SUN: loadspritegfx ANIM_TAG_BLUE_STAR createvisualtask AnimTask_MorningSunLightBeam, 5 delay 8 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 8, 0, 12, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 8, 0, 12, RGB_WHITE delay 14 call MorningSunStar call MorningSunStar @@ -8305,7 +8305,7 @@ Move_MORNING_SUN: call MorningSunStar call MorningSunStar call MorningSunStar - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 3, 12, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 3, 12, 0, RGB_WHITE waitforvisualfinish waitsound call HealingEffect @@ -8324,7 +8324,7 @@ Move_SWEET_SCENT: call SweetScentEffect createsprite gSweetScentPetalSpriteTemplate, ANIM_ATTACKER, 2, 55, 0 setpan SOUND_PAN_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, 20, 1, 5, 5, 13, RGB(31, 21, 21) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_DEF_SIDE, 1, 5, 5, 13, RGB(31, 21, 21) call SweetScentEffect waitforvisualfinish end @@ -8355,7 +8355,7 @@ SweetScentEffect: Move_HYPER_BEAM: loadspritegfx ANIM_TAG_ORBS - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 4, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 4, 0, 16, RGB_BLACK waitforvisualfinish delay 10 playsewithpan SE_M_HYPER_BEAM, SOUND_PAN_ATTACKER @@ -8371,7 +8371,7 @@ Move_HYPER_BEAM: call HyperBeamOrbs call HyperBeamOrbs createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 50, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 11, RGB(25, 25, 25) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 11, RGB(25, 25, 25) call HyperBeamOrbs call HyperBeamOrbs call HyperBeamOrbs @@ -8393,9 +8393,9 @@ Move_HYPER_BEAM: call HyperBeamOrbs call HyperBeamOrbs call HyperBeamOrbs - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 11, 0, RGB(25, 25, 25) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 11, 0, RGB(25, 25, 25) waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 4, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 4, 16, 0, RGB_BLACK end HyperBeamOrbs: createsprite gHyperBeamOrbSpriteTemplate, ANIM_TARGET, 2 @@ -8450,17 +8450,17 @@ CreateFlatterConfetti: Move_ROLE_PLAY: monbg ANIM_ATK_PARTNER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 16, RGB_WHITE - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 10, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 16, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 10, RGB_BLACK waitforvisualfinish playsewithpan SE_M_TRI_ATTACK, SOUND_PAN_ATTACKER waitplaysewithpan SE_M_DETECT, SOUND_PAN_ATTACKER, 30 createvisualtask AnimTask_RolePlaySilhouette, 2 waitforvisualfinish clearmonbg ANIM_ATK_PARTNER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 16, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 16, 0, RGB_WHITE delay 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 10, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 10, 0, RGB_BLACK end Move_REFRESH: @@ -8473,7 +8473,7 @@ Move_REFRESH: call GrantingStarsEffect waitforvisualfinish playsewithpan SE_SHINY, SOUND_PAN_ATTACKER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 10, 0, RGB(12, 24, 30) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 10, 0, RGB(12, 24, 30) createsprite gThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 0, 0 end @@ -8485,13 +8485,13 @@ Move_BLAZE_KICK: setalpha 12, 8 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_TARGET createsprite gSpinningHandOrFootSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 30 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 7, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 7, RGB_WHITE delay 30 playsewithpan SE_M_FIRE_PUNCH, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, 0, 0, ANIM_TARGET, 0 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 3, 0, 14, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 0, RGB_WHITE - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 0, RGB_WHITE + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 call FireSpreadEffect waitforvisualfinish clearmonbg ANIM_TARGET @@ -8510,7 +8510,7 @@ Move_HYPER_VOICE: end HyperVoiceEffect: - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 8, 0, RGB_YELLOW + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 8, 0, RGB_YELLOW createvisualtask AnimTask_ScaleMonAndRestore, 5, -5, -5, 5, ANIM_ATTACKER, 0 createsprite gHyperVoiceRingSpriteTemplate, ANIM_ATTACKER, 0, 45, 0, 0, 0, 0, 0, 1 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 6, 1 @@ -8521,14 +8521,14 @@ HyperVoiceEffect: Move_SAND_TOMB: loadspritegfx ANIM_TAG_MUD_SAND - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 0, 7, RGB(19, 17, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 0, 7, RGB(19, 17, 0) createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 43, 1 playsewithpan SE_M_SAND_TOMB, SOUND_PAN_TARGET call SandTombSwirlingDirt call SandTombSwirlingDirt call SandTombSwirlingDirt delay 22 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 7, 0, RGB(19, 17, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 7, 0, RGB(19, 17, 0) waitforvisualfinish end @@ -8627,7 +8627,7 @@ Move_DRAGON_CLAW: loadspritegfx ANIM_TAG_SMALL_EMBER loadspritegfx ANIM_TAG_CLAW_SLASH playsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 4, 0, 8, RGB(31, 19, 0) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 4, 0, 8, RGB(31, 19, 0) createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 15, 1 call DragonClawFireSpiral call DragonClawFireSpiral @@ -8664,7 +8664,7 @@ Move_DRAGON_CLAW: createsprite gFireSpinSpriteTemplate, ANIM_ATTACKER, 2, 0, 28, 512, 25, 16, 46, ANIM_ATTACKER delay 2 createsprite gFireSpinSpriteTemplate, ANIM_ATTACKER, 2, 0, 33, 464, 30, 15, -50, ANIM_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 4, 8, 0, RGB(31, 19, 0) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 4, 8, 0, RGB(31, 19, 0) waitforvisualfinish end DragonClawFireSpiral: @@ -8747,7 +8747,7 @@ Move_REVENGE: playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER createsprite gRevengeSmallScratchSpriteTemplate, ANIM_ATTACKER, 2, 10, -10 waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 4, 2, 8, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 4, 2, 8, RGB_RED waitforvisualfinish unloadspritegfx ANIM_TAG_PURPLE_SCRATCH loadspritegfx ANIM_TAG_PURPLE_SWIPE @@ -8777,7 +8777,7 @@ Move_POISON_FANG: delay 10 createvisualtask AnimTask_ShakeMon, 3, ANIM_TARGET, 3, 0, 10, 1 waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 2, 4, 0, 4, 0, 12, RGB(26, 0, 26) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 0, 4, 0, 12, RGB(26, 0, 26) call PoisonBubblesEffect waitforvisualfinish end @@ -8793,7 +8793,7 @@ Move_FRENZY_PLANT: monbg ANIM_TARGET splitbgprio ANIM_TARGET setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 1, 2, 0, 5, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_BG, 2, 0, 5, RGB_BLACK waitforvisualfinish createsprite gFrenzyPlantRootSpriteTemplate, ANIM_ATTACKER, 2, 10, 8, 2, 0, 0, 100 playsewithpan SE_M_SCRATCH, SOUND_PAN_ATTACKER @@ -8841,7 +8841,7 @@ Move_FRENZY_PLANT: createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 10, ANIM_TARGET, 1 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 1, 2, 5, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_BG, 2, 5, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_TARGET blendoff @@ -8983,7 +8983,7 @@ ReturnStrong: createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 6, 0, 8, 1 goto ReturnContinue ReturnStrongest: - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 0, 6, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 0, 6, RGB_BLACK waitforvisualfinish createsprite gVerticalDipSpriteTemplate, ANIM_ATTACKER, 2, 16, 1, ANIM_ATTACKER createvisualtask SoundTask_PlaySE2WithPanning, 5, SE_M_TAIL_WHIP, SOUND_PAN_ATTACKER @@ -9040,7 +9040,7 @@ ReturnStrongest: createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, -5, 3, ANIM_TARGET, 0 createvisualtask SoundTask_PlaySE1WithPanning, 5, SE_M_MEGA_KICK2, SOUND_PAN_TARGET waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 6, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 6, 0, RGB_BLACK goto ReturnContinue ReturnStrongestHit: createsprite gVerticalDipSpriteTemplate, ANIM_ATTACKER, 2, 4, 3, ANIM_ATTACKER @@ -9170,7 +9170,7 @@ Move_SILVER_WIND: createvisualtask AnimTask_StartSlidingBg, 5, 1536, 0, 0, -1 SilverWindContinue: delay 0 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 4, 4, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 4, 4, RGB_BLACK waitbgfadein createsprite gSilverWindBigSparkSpriteTemplate, ANIM_TARGET, 66, -32, 16, 0, 6, 2, 3, 1 createsprite gSilverWindBigSparkSpriteTemplate, ANIM_TARGET, 66, -8, 18, 64, 3, 2, 2, 1 @@ -9284,7 +9284,7 @@ Move_OVERHEAT: loadspritegfx ANIM_TAG_IMPACT monbg ANIM_DEF_PARTNER setalpha 12, 18 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 5, RGB(28, 0, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 5, RGB(28, 0, 0) waitforvisualfinish createvisualtask AnimTask_AllocBackupPalBuffer, 5 waitforvisualfinish @@ -9295,7 +9295,7 @@ Move_OVERHEAT: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER createvisualtask AnimTask_CopyPalUnfadedToBackup, 5, 1, 0 delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 1, 0, 13, RGB(28, 0, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 1, 0, 13, RGB(28, 0, 0) createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 2, 0, 15, 1 waitforvisualfinish playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER @@ -9341,12 +9341,12 @@ Move_OVERHEAT: playsewithpan SE_M_FIRE_PUNCH, SOUND_PAN_TARGET createvisualtask AnimTask_CopyPalFadedToUnfaded, 5, 1 delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, -1, 0, 13, RGB(18, 18, 18) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, -1, 0, 13, RGB(18, 18, 18) createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 3, 0, 15, 1 waitforvisualfinish createvisualtask AnimTask_CopyPalUnfadedFromBackup, 5, 0, 1 delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 5, 0, RGB(28, 0, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 5, 0, RGB(28, 0, 0) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -9354,7 +9354,7 @@ Move_OVERHEAT: delay 15 createvisualtask AnimTask_CopyPalUnfadedFromBackup, 5, 1, 0 delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 13, 0, RGB(18, 18, 18) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 0, 13, 0, RGB(18, 18, 18) waitforvisualfinish createvisualtask AnimTask_FreeBackupPalBuffer, 5 waitforvisualfinish @@ -9498,7 +9498,7 @@ Move_WATER_PULSE: monbg ANIM_TARGET splitbgprio ANIM_TARGET playsewithpan SE_M_BUBBLE3, SOUND_PAN_ATTACKER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 0, 7, RGB(0, 25, 28) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 0, 7, RGB(0, 25, 28) delay 10 createsprite gWaterPulseBubbleSpriteTemplate, ANIM_ATTACKER, 66, 100, 100, 8, 1, 20, 40, 0 createsprite gWaterPulseBubbleSpriteTemplate, ANIM_ATTACKER, 66, 20, 100, 16, 2, 10, 35, 1 @@ -9518,7 +9518,7 @@ Move_WATER_PULSE: delay 13 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 8, 18, 1 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 7, 0, RGB(0, 25, 28) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 7, 0, RGB(0, 25, 28) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER end @@ -9531,7 +9531,7 @@ Move_PSYCHO_BOOST: createvisualtask AnimTask_FadeScreenToWhite, 5 waitbgfadein delay 6 - createvisualtask AnimTask_BlendColorCycle, 2, 1, 2, 8, 0, 10, RGB_BLACK + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG, 2, 8, 0, 10, RGB_BLACK delay 0 splitbgprio ANIM_ATTACKER setalpha 8, 8 @@ -9558,7 +9558,7 @@ Move_KNOCK_OFF: playsewithpan SE_M_VITAL_THROW, SOUND_PAN_TARGET createsprite gKnockOffStrikeSpriteTemplate, ANIM_TARGET, 2, -16, -16 delay 8 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 5, 1, RGB_WHITE, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 5, 1, RGB_WHITE, 10, RGB_BLACK, 0 createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0, 0, ANIM_TARGET, 2 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -12, 10, 0, 3 @@ -9576,7 +9576,7 @@ Move_DOOM_DESIRE: delay 1 monbg ANIM_ATK_PARTNER createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, ANIM_TARGET, FALSE - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 4, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 4, RGB_BLACK waitforvisualfinish setalpha 8, 8 playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER @@ -9584,7 +9584,7 @@ Move_DOOM_DESIRE: waitforvisualfinish delay 20 createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, ANIM_TARGET, TRUE - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 4, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 4, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_ATK_PARTNER blendoff @@ -9836,7 +9836,7 @@ Move_WEATHER_BALL: waitforvisualfinish delay 15 playsewithpan SE_M_DETECT, 0 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 5, 1, RGB_WHITE, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 5, 1, RGB_WHITE, 10, RGB_BLACK, 0 waitforvisualfinish createvisualtask AnimTask_GetWeather, 2 delay 1 @@ -10218,7 +10218,7 @@ UnsetSolarBeamBg: Status_Poison: loopsewithpan SE_M_TOXIC, SOUND_PAN_TARGET, 13, 6 createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 18, 2 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 12, RGB(30, 0, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 12, RGB(30, 0, 31) end Status_Confusion: @@ -10320,13 +10320,13 @@ General_StatsChange: General_SubstituteFade: monbg ANIM_ATTACKER createvisualtask AnimTask_SubstituteFadeToInvisible, 5 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 0, 0, 16, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 0, 0, 16, RGB_WHITE waitforvisualfinish delay 1 clearmonbg ANIM_ATTACKER delay 2 blendoff - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 0, 0, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 0, 0, 0, RGB_WHITE createvisualtask AnimTask_SwapMonSpriteToFromSubstitute, 2, TRUE end @@ -10389,13 +10389,13 @@ Status_Whirlpool: splitbgprio ANIM_TARGET setalpha 12, 8 delay 0 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 0, 7, RGB(0, 13, 23) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 0, 7, RGB(0, 13, 23) playsewithpan SE_M_WHIRLPOOL, SOUND_PAN_TARGET createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 30, 1 call WhirlpoolEffect call WhirlpoolEffect delay 12 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 7, 0, RGB(0, 13, 23) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 7, 0, RGB(0, 13, 23) waitforvisualfinish stopsound clearmonbg ANIM_DEF_PARTNER @@ -10420,13 +10420,13 @@ Status_Clamp: Status_SandTomb: loadspritegfx ANIM_TAG_MUD_SAND - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 0, 7, RGB(19, 17, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 0, 7, RGB(19, 17, 0) createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 30, 1 playsewithpan SE_M_SAND_TOMB, SOUND_PAN_TARGET call SandTombSwirlingDirt call SandTombSwirlingDirt delay 22 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 7, 0, RGB(19, 17, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 7, 0, RGB(19, 17, 0) waitforvisualfinish stopsound end @@ -10448,7 +10448,7 @@ General_HeldItemEffect: call GrantingStarsEffect waitforvisualfinish playsewithpan SE_SHINY, SOUND_PAN_ATTACKER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 3, 7, 0, RGB(17, 31, 25) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 3, 7, 0, RGB(17, 31, 25) createsprite gThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 0, 0 waitforvisualfinish end @@ -10492,11 +10492,11 @@ General_SmokeballEscape: end General_FocusBand: - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 2, 7, 0, 9, RGB_RED + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_ATTACKER, 7, 0, 9, RGB_RED playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER createvisualtask AnimTask_SlideMonForFocusBand, 5, 30, 128, 0, 1, 2, 0, 1 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 2, 4, 9, 0, RGB_RED + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_ATTACKER, 4, 9, 0, RGB_RED waitforvisualfinish delay 6 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 0, 0, 0, 15 @@ -10505,13 +10505,13 @@ General_FocusBand: General_Rain: loadspritegfx ANIM_TAG_RAIN_DROPS playsewithpan SE_M_RAIN_DANCE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 2, 0, 4, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 2, 0, 4, RGB_BLACK waitforvisualfinish createvisualtask AnimTask_CreateRaindrops, 2, 0, 3, 60 createvisualtask AnimTask_CreateRaindrops, 2, 0, 3, 60 delay 50 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 2, 4, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 2, 4, 0, RGB_BLACK waitforvisualfinish end @@ -10595,7 +10595,7 @@ General_FutureSightHit: General_DoomDesireHit: createvisualtask AnimTask_SetAnimTargetToBattlerTarget, 2 loadspritegfx ANIM_TAG_EXPLOSION - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 0, 16, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 0, 16, RGB_WHITE waitforvisualfinish delay 10 createvisualtask AnimTask_DoomDesireLightBeam, 5 @@ -10622,7 +10622,7 @@ General_DoomDesireHit: playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET createsprite gExplosionSpriteTemplate, ANIM_ATTACKER, 3, 16, 16, 1, 1 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 16, 0, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 16, 0, RGB_WHITE waitforvisualfinish end @@ -10631,7 +10631,7 @@ General_FocusPunchSetUp: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call EndureEffect delay 8 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 11, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB_RED createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call EndureEffect delay 8 @@ -10644,7 +10644,7 @@ General_IngrainHeal: loadspritegfx ANIM_TAG_BLUE_STAR monbg ANIM_DEF_PARTNER setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 4, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 4, RGB(13, 31, 12) waitforvisualfinish delay 3 call AbsorbEffect @@ -10652,7 +10652,7 @@ General_IngrainHeal: delay 15 call HealingEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 4, 0, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 4, 0, RGB(13, 31, 12) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -10660,7 +10660,7 @@ General_IngrainHeal: General_WishHeal: loadspritegfx ANIM_TAG_SPARKLE_2 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 0, 10, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 0, 10, RGB_BLACK waitforvisualfinish playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER call GrantingStarsEffect @@ -10669,7 +10669,7 @@ General_WishHeal: loadspritegfx ANIM_TAG_BLUE_STAR call HealingEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 10, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 10, 0, RGB_BLACK end SnatchMoveTrySwapFromSubstitute: diff --git a/include/battle_anim.h b/include/battle_anim.h index 9d1cf7be2..c42fa033b 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -118,7 +118,7 @@ void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation); void InitSpriteDataForLinearTranslation(struct Sprite *sprite); void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode); void SetBattlerSpriteYOffsetFromRotation(u8 spriteId); -u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner, u8 targetPartner, u8 a6, u8 a7); +u32 GetBattlePalettesMask(bool8 battleBackground, bool8 attacker, bool8 target, bool8 attackerPartner, bool8 targetPartner, bool8 anim1, bool8 anim2); u32 GetBattleMonSpritePalettesMask(u8 playerLeft, u8 playerRight, u8 opponentLeft, u8 opponentRight); u8 AnimDummyReturnArg(u8 battler); s16 CloneBattlerSpriteWithBlend(u8); @@ -229,7 +229,7 @@ void DestroyAnimSpriteAfterTimer(struct Sprite *sprite); // battle_anim_smokescreen.c u8 SmokescreenImpact(s16 x, s16 y, u8 a3); -u32 UnpackSelectedBattleBgPalettes(s16); +u32 UnpackSelectedBattlePalettes(s16); u8 GetBattlerSpriteFinal_Y(u8, u16, u8); diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 2ff9318be..00ad083eb 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -413,4 +413,21 @@ #define ANIM_WEATHER_SANDSTORM 3 #define ANIM_WEATHER_HAIL 4 +// Flags given to various functions to indicate which palettes to consider. +// Handled by UnpackSelectedBattlePalettes +#define F_PAL_BG (1 << 0) +#define F_PAL_ATTACKER (1 << 1) +#define F_PAL_TARGET (1 << 2) +#define F_PAL_ATK_PARTNER (1 << 3) +#define F_PAL_DEF_PARTNER (1 << 4) +#define F_PAL_ANIM_1 (1 << 5) // Palette set for GetBattleAnimBg1Data/GetBgDataForTransform. Only used (ineffectually?) by Aromatherapy. +#define F_PAL_ANIM_2 (1 << 6) // Palette set for GetBattleAnimBgData/GetBgDataForTransform. Unused. +#define F_PAL_ATK_SIDE (F_PAL_ATTACKER | F_PAL_ATK_PARTNER) +#define F_PAL_DEF_SIDE (F_PAL_TARGET | F_PAL_DEF_PARTNER) +#define F_PAL_BATTLERS (F_PAL_ATK_SIDE | F_PAL_DEF_SIDE) +// The below are only used by AnimTask_BlendBattleAnimPal to get battler sprite palettes by position rather than by role. +// It's redundant with F_PAL_BATTLERS, because they're only ever used together to refer to all the battlers at once. +#define F_PAL_BATTLERS_2 (1 << 7 | 1 << 8 | 1 << 9 | 1 << 10) + + #endif // GUARD_CONSTANTS_BATTLE_ANIM_H diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index d460b9236..76868342f 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -4343,7 +4343,7 @@ static void AnimLockOnTarget_Step4(struct Sprite* sprite) sprite->data[1] = 0; } - BlendPalettes(GetBattleBgPalettesMask(1, 1, 1, 1, 1, 0, 0), sprite->data[1], RGB(31, 31, 31)); + BlendPalettes(GetBattlePalettesMask(TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE), sprite->data[1], RGB(31, 31, 31)); if (sprite->data[1] == 16) { int pal; @@ -4998,7 +4998,7 @@ static void AnimMoonlightSparkle_Step(struct Sprite* sprite) void AnimTask_MoonlightEndFade(u8 taskId) { - int a = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0) & 0xFFFF; + int a = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) & 0xFFFF; int b; int c; int d; diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 101b255df..9764d5522 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -3116,7 +3116,7 @@ static void AnimTask_FakeOut_Step2(u8 taskId) { gTasks[taskId].data[11] = 0x88; SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_LIGHTEN); - BlendPalettes(GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0), 16, RGB(31, 31, 31)); + BlendPalettes(GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), 16, RGB(31, 31, 31)); } else if (gTasks[taskId].data[10] > 4) { diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index 02b89b965..16af29860 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -1004,7 +1004,7 @@ static void AnimTask_CurseStretchingBlackBg_Step1(u8 taskId) right = DISPLAY_WIDTH; top = 0; bottom = 112; - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); BeginNormalPaletteFade(selectedPalettes, 0, 16, 16, RGB(0, 0, 0)); gTasks[taskId].func = AnimTask_CurseStretchingBlackBg_Step2; } diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index a03196ee1..cee50df3f 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -908,13 +908,17 @@ bool8 IsDoubleBattle(void) return IS_DOUBLE_BATTLE(); } +#define BG_ANIM_PAL_1 8 +#define BG_ANIM_PAL_2 9 +#define BG_ANIM_PAL_CONTEST 14 + void GetBattleAnimBg1Data(struct BattleAnimBgData *out) { if (IsContest()) { out->bgTiles = gBattleAnimBgTileBuffer; out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer; - out->paletteId = 14; + out->paletteId = BG_ANIM_PAL_CONTEST; out->bgId = 1; out->tilesOffset = 0; out->unused = 0; @@ -923,7 +927,7 @@ void GetBattleAnimBg1Data(struct BattleAnimBgData *out) { out->bgTiles = gBattleAnimBgTileBuffer; out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer; - out->paletteId = 8; + out->paletteId = BG_ANIM_PAL_1; out->bgId = 1; out->tilesOffset = 0x200; out->unused = 0; @@ -936,7 +940,7 @@ void GetBattleAnimBgData(struct BattleAnimBgData *out, u32 bgId) { out->bgTiles = gBattleAnimBgTileBuffer; out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer; - out->paletteId = 14; + out->paletteId = BG_ANIM_PAL_CONTEST; out->bgId = 1; out->tilesOffset = 0; out->unused = 0; @@ -949,7 +953,7 @@ void GetBattleAnimBgData(struct BattleAnimBgData *out, u32 bgId) { out->bgTiles = gBattleAnimBgTileBuffer; out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer; - out->paletteId = 9; + out->paletteId = BG_ANIM_PAL_2; out->bgId = 2; out->tilesOffset = 0x300; out->unused = 0; @@ -962,21 +966,21 @@ void GetBgDataForTransform(struct BattleAnimBgData *out, u8 battlerId) out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer; if (IsContest()) { - out->paletteId = 14; + out->paletteId = BG_ANIM_PAL_CONTEST; out->bgId = 1; out->tilesOffset = 0; out->unused = 0; } else if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) { - out->paletteId = 8; + out->paletteId = BG_ANIM_PAL_1; out->bgId = 1; out->tilesOffset = 0x200; out->unused = 0; } else { - out->paletteId = 9; + out->paletteId = BG_ANIM_PAL_2; out->bgId = 2; out->tilesOffset = 0x300; out->unused = 0; @@ -1401,7 +1405,7 @@ void SetGrayscaleOrOriginalPalette(u16 paletteNum, bool8 restoreOriginalColor) } } -u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner, u8 targetPartner, u8 a6, u8 a7) +u32 GetBattlePalettesMask(bool8 battleBackground, bool8 attacker, bool8 target, bool8 attackerPartner, bool8 targetPartner, bool8 anim1, bool8 anim2) { u32 selectedPalettes = 0; u32 shift; @@ -1409,7 +1413,7 @@ u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 atta if (battleBackground) { if (!IsContest()) - selectedPalettes = 0xe; + selectedPalettes = 0xe; // Palettes 1, 2, and 3 else selectedPalettes = 1 << GetBattleBgPaletteNum(); } @@ -1439,17 +1443,17 @@ u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 atta selectedPalettes |= 1 << shift; } } - if (a6) + if (anim1) { if (!IsContest()) - selectedPalettes |= 0x100; + selectedPalettes |= 1 << BG_ANIM_PAL_1; else - selectedPalettes |= 0x4000; + selectedPalettes |= 1 << BG_ANIM_PAL_CONTEST; } - if (a7) + if (anim2) { if (!IsContest()) - selectedPalettes |= 0x200; + selectedPalettes |= 1 << BG_ANIM_PAL_2; } return selectedPalettes; } diff --git a/src/battle_anim_normal.c b/src/battle_anim_normal.c index ebf9a588f..a92428f83 100644 --- a/src/battle_anim_normal.c +++ b/src/battle_anim_normal.c @@ -304,7 +304,7 @@ static void AnimConfusionDuck_Step(struct Sprite *sprite) // arg 4: blend color static void AnimSimplePaletteBlend(struct Sprite *sprite) { - u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gBattleAnimArgs[0]); + u32 selectedPalettes = UnpackSelectedBattlePalettes(gBattleAnimArgs[0]); BeginNormalPaletteFade(selectedPalettes, gBattleAnimArgs[1], gBattleAnimArgs[2], gBattleAnimArgs[3], gBattleAnimArgs[4]); sprite->invisible = TRUE; sprite->callback = AnimSimplePaletteBlend_Step; @@ -312,23 +312,23 @@ static void AnimSimplePaletteBlend(struct Sprite *sprite) // Unpacks a bitfield and returns a bitmask of its selected palettes. // Bits 0-6 of the selector parameter result in the following palettes being selected: -// 0: battle background palettes (BG palettes 1, 2, and 3) -// 1: gBattleAnimAttacker OBJ palette -// 2: gBattleAnimTarget OBJ palette -// 3: gBattleAnimAttacker partner OBJ palette -// 4: gBattleAnimTarget partner OBJ palette -// 5: BG palette 4 -// 6: BG palette 5 -u32 UnpackSelectedBattleBgPalettes(s16 selector) +// 0: F_PAL_BG, battle background palettes (BG palettes 1, 2, and 3) +// 1: F_PAL_ATTACKER, gBattleAnimAttacker OBJ palette +// 2: F_PAL_TARGET, gBattleAnimTarget OBJ palette +// 3: F_PAL_ATK_PARTNER, gBattleAnimAttacker partner OBJ palette +// 4: F_PAL_DEF_PARTNER, gBattleAnimTarget partner OBJ palette +// 5: F_PAL_ANIM_1, BG palette 8 (or 14, if in Contest) +// 6: F_PAL_ANIM_2, BG palette 9 +u32 UnpackSelectedBattlePalettes(s16 selector) { - u8 battleBackground = selector & 1; - u8 attacker = (selector >> 1) & 1; - u8 target = (selector >> 2) & 1; - u8 attackerPartner = (selector >> 3) & 1; - u8 targetPartner = (selector >> 4) & 1; - u8 arg5 = (selector >> 5) & 1; - u8 arg6 = (selector >> 6) & 1; - return GetBattleBgPalettesMask(battleBackground, attacker, target, attackerPartner, targetPartner, arg5, arg6); + bool8 battleBackground = selector & 1; + bool8 attacker = (selector >> 1) & 1; + bool8 target = (selector >> 2) & 1; + bool8 attackerPartner = (selector >> 3) & 1; + bool8 targetPartner = (selector >> 4) & 1; + bool8 anim1 = (selector >> 5) & 1; + bool8 anim2 = (selector >> 6) & 1; + return GetBattlePalettesMask(battleBackground, attacker, target, attackerPartner, targetPartner, anim1, anim2); } static void AnimSimplePaletteBlend_Step(struct Sprite *sprite) @@ -350,7 +350,7 @@ static void AnimComplexPaletteBlend(struct Sprite *sprite) sprite->data[6] = gBattleAnimArgs[6]; sprite->data[7] = gBattleAnimArgs[0]; - selectedPalettes = UnpackSelectedBattleBgPalettes(sprite->data[7]); + selectedPalettes = UnpackSelectedBattlePalettes(sprite->data[7]); BlendPalettes(selectedPalettes, gBattleAnimArgs[4], gBattleAnimArgs[3]); sprite->invisible = TRUE; sprite->callback = AnimComplexPaletteBlend_Step1; @@ -375,7 +375,7 @@ static void AnimComplexPaletteBlend_Step1(struct Sprite *sprite) return; } - selectedPalettes = UnpackSelectedBattleBgPalettes(sprite->data[7]); + selectedPalettes = UnpackSelectedBattlePalettes(sprite->data[7]); if (sprite->data[1] & 0x100) BlendPalettes(selectedPalettes, sprite->data[4], sprite->data[3]); else @@ -392,7 +392,7 @@ static void AnimComplexPaletteBlend_Step2(struct Sprite *sprite) if (!gPaletteFade.active) { - selectedPalettes = UnpackSelectedBattleBgPalettes(sprite->data[7]); + selectedPalettes = UnpackSelectedBattlePalettes(sprite->data[7]); BlendPalettes(selectedPalettes, 0, 0); DestroyAnimSprite(sprite); } @@ -442,7 +442,7 @@ void AnimTask_BlendColorCycle(u8 taskId) static void BlendColorCycle(u8 taskId, u8 startBlendAmount, u8 targetBlendAmount) { - u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gTasks[taskId].tPalSelector); + u32 selectedPalettes = UnpackSelectedBattlePalettes(gTasks[taskId].tPalSelector); BeginNormalPaletteFade( selectedPalettes, gTasks[taskId].tDelay, @@ -721,7 +721,7 @@ void AnimTask_InvertScreenColor(u8 taskId) u8 targetBattler = gBattleAnimTarget; if (gBattleAnimArgs[0] & 0x100) - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); if (gBattleAnimArgs[1] & 0x100) selectedPalettes |= (0x10000 << attackerBattler); diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c index bf95a319c..fa06f1a1c 100755 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -690,7 +690,7 @@ void AnimTask_SwitchOutBallEffect(u8 taskId) priority = gSprites[spriteId].oam.priority; subpriority = gSprites[spriteId].subpriority; gTasks[taskId].data[10] = AnimateBallOpenParticles(x, y + 32, priority, subpriority, ballId); - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); gTasks[taskId].data[11] = LaunchBallFadeMonTask(FALSE, gBattleAnimAttacker, selectedPalettes, ballId); gTasks[taskId].data[0]++; break; diff --git a/src/battle_anim_utility_funcs.c b/src/battle_anim_utility_funcs.c index e2c674c57..d33c0c184 100644 --- a/src/battle_anim_utility_funcs.c +++ b/src/battle_anim_utility_funcs.c @@ -47,7 +47,7 @@ const u8 gBattleAnimBgCntGet[] = {REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFS void AnimTask_BlendBattleAnimPal(u8 taskId) { - u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gBattleAnimArgs[0]); + u32 selectedPalettes = UnpackSelectedBattlePalettes(gBattleAnimArgs[0]); selectedPalettes |= GetBattleMonSpritePalettesMask((gBattleAnimArgs[0] >> 7) & 1, (gBattleAnimArgs[0] >> 8) & 1, (gBattleAnimArgs[0] >> 9) & 1, @@ -62,7 +62,7 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId) u8 animBattlers[2]; animBattlers[1] = 0xFF; - selectedPalettes = UnpackSelectedBattleBgPalettes(1); + selectedPalettes = UnpackSelectedBattlePalettes(F_PAL_BG); switch (gBattleAnimArgs[0]) { case 2: @@ -105,7 +105,7 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId) void AnimTask_SetCamouflageBlend(u8 taskId) { - u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gBattleAnimArgs[0]); + u32 selectedPalettes = UnpackSelectedBattlePalettes(gBattleAnimArgs[0]); switch (gBattleTerrain) { case BATTLE_TERRAIN_GRASS: @@ -607,7 +607,7 @@ void AnimTask_Flash(u8 taskId) SetPalettesToColor(selectedPalettes, RGB_BLACK); gTasks[taskId].data[14] = selectedPalettes >> 16; - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0) & 0xFFFF; + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) & 0xFFFF; SetPalettesToColor(selectedPalettes, RGB_WHITEALPHA); gTasks[taskId].data[15] = selectedPalettes; @@ -923,7 +923,7 @@ void AnimTask_CopyPalUnfadedToBackup(u8 taskId) if (gBattleAnimArgs[0] == 0) { - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); while ((selectedPalettes & 1) == 0) { selectedPalettes >>= 1; @@ -950,7 +950,7 @@ void AnimTask_CopyPalUnfadedFromBackup(u8 taskId) if (gBattleAnimArgs[0] == 0) { - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); while ((selectedPalettes & 1) == 0) { selectedPalettes >>= 1; @@ -977,7 +977,7 @@ void AnimTask_CopyPalFadedToUnfaded(u8 taskId) if (gBattleAnimArgs[0] == 0) { - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); while ((selectedPalettes & 1) == 0) { selectedPalettes >>= 1; From 86b436782aa756a2d9ffe14fdf1ca908178e1b9b Mon Sep 17 00:00:00 2001 From: sneed Date: Wed, 1 Jun 2022 22:01:50 +0300 Subject: [PATCH 132/208] trap move related code cleanup --- include/constants/battle.h | 3 +++ src/battle_message.c | 2 +- src/battle_script_commands.c | 8 +++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/constants/battle.h b/include/constants/battle.h index d651dab18..bcfb34c45 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -475,4 +475,7 @@ // For the second argument of GetMoveTarget, when no target override is needed #define NO_TARGET_OVERRIDE 0 +// Makes sure gWrappedStringIds and sTrappingMoves have the same size +#define TRAPPING_MOVES_COUNT 9 + #endif // GUARD_CONSTANTS_BATTLE_H diff --git a/src/battle_message.c b/src/battle_message.c index 8cf9a508b..34d020188 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1562,7 +1562,7 @@ const u16 gFirstTurnOfTwoStringIds[] = }; // Index copied from move's index in sTrappingMoves -const u16 gWrappedStringIds[] = +const u16 gWrappedStringIds[TRAPPING_MOVES_COUNT] = { STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 15915c71a..4abaf5adb 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -279,9 +279,9 @@ static const s32 sExperienceScalingFactors[] = 159767, }; -static const u16 sTrappingMoves[] = +static const u16 sTrappingMoves[TRAPPING_MOVES_COUNT] = { - MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_MAGMA_STORM, MOVE_INFESTATION, MOVE_SNAP_TRAP, 0xFFFF + MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_MAGMA_STORM, MOVE_INFESTATION, MOVE_SNAP_TRAP, }; #define STAT_CHANGE_WORKED 0 @@ -3037,10 +3037,8 @@ void SetMoveEffect(bool32 primary, u32 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect]; - for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++) + for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] < TRAPPING_MOVES_COUNT; gBattleCommunication[MULTISTRING_CHOOSER]++) { - if (gBattleCommunication[MULTISTRING_CHOOSER] > ARRAY_COUNT(sTrappingMoves) - 1) - break; if (sTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) break; } From 5934acbdc5c3584c71cde625a9d0117dd1505b4c Mon Sep 17 00:00:00 2001 From: sneed Date: Wed, 1 Jun 2022 22:21:32 +0300 Subject: [PATCH 133/208] IS_BATTLER_OF_TYPE ignores 3rd type if mystery --- include/battle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/battle.h b/include/battle.h index ea556c012..dd16ecbb0 100644 --- a/include/battle.h +++ b/include/battle.h @@ -633,7 +633,7 @@ struct BattleStruct #define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0)) #define BATTLER_DAMAGED(battlerId) ((gSpecialStatuses[battlerId].physicalDmg != 0 || gSpecialStatuses[battlerId].specialDmg != 0)) -#define IS_BATTLER_OF_TYPE(battlerId, type)((gBattleMons[battlerId].type1 == type || gBattleMons[battlerId].type2 == type || gBattleMons[battlerId].type3 == type)) +#define IS_BATTLER_OF_TYPE(battlerId, type)((gBattleMons[battlerId].type1 == type || gBattleMons[battlerId].type2 == type || (gBattleMons[battlerId].type3 != TYPE_MYSTERY && gBattleMons[battlerId].type3 == type))) #define SET_BATTLER_TYPE(battlerId, type) \ { \ gBattleMons[battlerId].type1 = type; \ From e1c57e4071c19cadd69c57420adfc97838b7cf3f Mon Sep 17 00:00:00 2001 From: sneed Date: Wed, 1 Jun 2022 22:45:50 +0300 Subject: [PATCH 134/208] move_none does not benefit from stab --- src/battle_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index d0ff7c5be..b060a15ce 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8941,7 +8941,7 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move } // check stab - if (IS_BATTLER_OF_TYPE(battlerAtk, moveType) && move != MOVE_STRUGGLE) + if (IS_BATTLER_OF_TYPE(battlerAtk, moveType) && move != MOVE_STRUGGLE && move != MOVE_NONE) { if (abilityAtk == ABILITY_ADAPTABILITY) MulModifier(&finalModifier, UQ_4_12(2.0)); From 380cb469197aee7c1495086e2da297342bea8fee Mon Sep 17 00:00:00 2001 From: sphericalice Date: Fri, 3 Jun 2022 15:04:52 +0100 Subject: [PATCH 135/208] Correct CreateRegionMapPlayerIcon's argument names Correct CreateRegionMapPlayerIcon's argument names in include/region_map.h --- include/region_map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/region_map.h b/include/region_map.h index 02d711afa..85793badc 100644 --- a/include/region_map.h +++ b/include/region_map.h @@ -99,7 +99,7 @@ u8 DoRegionMapInputCallback(void); bool8 UpdateRegionMapZoom(void); void FreeRegionMapIconResources(void); u16 GetRegionMapSecIdAt(u16 x, u16 y); -void CreateRegionMapPlayerIcon(u16 x, u16 y); +void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag); void CreateRegionMapCursor(u16 tileTag, u16 paletteTag); bool32 IsEventIslandMapSecId(u8 mapSecId); u8 *GetMapName(u8 *, u16, u16); From c60de5055d70a21328babc47f3cf1510fa46ac84 Mon Sep 17 00:00:00 2001 From: Sneed69 Date: Fri, 3 Jun 2022 17:24:57 +0300 Subject: [PATCH 136/208] remove IsMoveWithoutAnimation --- include/battle_gfx_sfx_util.h | 1 - src/battle_controller_link_opponent.c | 13 +++---------- src/battle_controller_link_partner.c | 13 +++---------- src/battle_controller_opponent.c | 11 ++--------- src/battle_controller_player.c | 13 +++---------- src/battle_controller_player_partner.c | 11 ++--------- src/battle_controller_recorded_opponent.c | 11 ++--------- src/battle_controller_recorded_player.c | 11 ++--------- src/battle_controller_wally.c | 12 ++---------- src/battle_gfx_sfx_util.c | 9 --------- 10 files changed, 19 insertions(+), 86 deletions(-) diff --git a/include/battle_gfx_sfx_util.h b/include/battle_gfx_sfx_util.h index 35e63aa75..e716fd9df 100644 --- a/include/battle_gfx_sfx_util.h +++ b/include/battle_gfx_sfx_util.h @@ -9,7 +9,6 @@ void SpriteCB_TrainerSlideIn(struct Sprite *sprite); void InitAndLaunchChosenStatusAnimation(bool8 isStatus2, u32 status); bool8 TryHandleLaunchBattleTableAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId, u16 argument); void InitAndLaunchSpecialAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId); -bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn); bool8 IsBattleSEPlaying(u8 battlerId); void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 battlerId); void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId); diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 12276df7b..2ef3077d7 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -1399,16 +1399,9 @@ static void LinkOpponentHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - LinkOpponentBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = LinkOpponentDoMoveAnimation; - BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr); - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = LinkOpponentDoMoveAnimation; + BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr); } } diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 278f5a192..1dadd9a44 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -1231,16 +1231,9 @@ static void LinkPartnerHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - LinkPartnerBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = LinkPartnerDoMoveAnimation; - BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr); - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = LinkPartnerDoMoveAnimation; + BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr); } } diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 35e774341..f3b8352bb 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1461,15 +1461,8 @@ static void OpponentHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - OpponentBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = OpponentDoMoveAnimation; - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = OpponentDoMoveAnimation; } } diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 0e01eb549..9db7020bd 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2662,16 +2662,9 @@ static void PlayerHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // Always returns FALSE. - { - PlayerBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = PlayerDoMoveAnimation; - BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr); - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = PlayerDoMoveAnimation; + BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr); } } diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 0b7a95406..984a647f8 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1428,15 +1428,8 @@ static void PlayerPartnerHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - PlayerPartnerBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = PlayerPartnerDoMoveAnimation; - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = PlayerPartnerDoMoveAnimation; } } diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 69bffb45c..8968617ca 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -1327,15 +1327,8 @@ static void RecordedOpponentHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - RecordedOpponentBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = RecordedOpponentDoMoveAnimation; - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = RecordedOpponentDoMoveAnimation; } } diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index f81b24620..157bcf942 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -1331,15 +1331,8 @@ static void RecordedPlayerHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - RecordedPlayerBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = RecordedPlayerDoMoveAnimation; - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = RecordedPlayerDoMoveAnimation; } } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index 076187297..5cd282b5b 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1114,16 +1114,8 @@ static void WallyHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - WallyBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = WallyDoMoveAnimation; - } - + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = WallyDoMoveAnimation; } static void WallyDoMoveAnimation(void) diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 2d441c7eb..df5fa69ac 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -526,15 +526,6 @@ static void Task_ClearBitWhenSpecialAnimDone(u8 taskId) #undef tBattlerId -// Great function to include newly added moves that don't have animation yet. -bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn) -{ - if (moveId >= (MOVES_COUNT - 1)) - return TRUE; - else - return FALSE; -} - // Check if SE has finished or 30 calls, whichever comes first bool8 IsBattleSEPlaying(u8 battlerId) { From d03756dfd29e245bd80d729f40dc4a4410af0ba7 Mon Sep 17 00:00:00 2001 From: sphericalice Date: Fri, 3 Jun 2022 15:42:53 +0100 Subject: [PATCH 137/208] Use the TRY_FREE_AND_SET_NULL macro where appropriate --- src/battle_factory_screen.c | 3 +-- src/easy_chat.c | 9 +++------ src/field_region_map.c | 5 +---- src/hall_of_fame.c | 18 ++++++------------ src/pokemon_storage_system.c | 3 +-- src/pokenav.c | 3 +-- src/region_map.c | 6 +----- src/rotating_tile_puzzle.c | 3 +-- src/slot_machine.c | 24 ++++++++---------------- src/union_room_chat.c | 3 +-- 10 files changed, 24 insertions(+), 53 deletions(-) diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 787dc4740..88e934759 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -1131,8 +1131,7 @@ static void CB2_InitSelectScreen(void) switch (gMain.state) { case 0: - if (sFactorySelectMons != NULL) - FREE_AND_SET_NULL(sFactorySelectMons); + TRY_FREE_AND_SET_NULL(sFactorySelectMons); SetHBlankCallback(NULL); SetVBlankCallback(NULL); CpuFill32(0, (void *)VRAM, VRAM_SIZE); diff --git a/src/easy_chat.c b/src/easy_chat.c index 734fd4f18..4d6006f1c 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -1672,8 +1672,7 @@ static bool8 InitEasyChatScreenStruct(u8 type, u16 *words, u8 displayedPersonTyp static void FreeEasyChatScreenStruct(void) { - if (sEasyChatScreen != NULL) - FREE_AND_SET_NULL(sEasyChatScreen); + TRY_FREE_AND_SET_NULL(sEasyChatScreen); } // Returns the function ID of the action to take as a result of player's input. @@ -3075,8 +3074,7 @@ static bool8 LoadEasyChatScreen(void) static void FreeEasyChatScreenControl(void) { - if (sScreenControl) - FREE_AND_SET_NULL(sScreenControl); + TRY_FREE_AND_SET_NULL(sScreenControl); } static void StartEasyChatFunction(u16 funcId) @@ -5573,8 +5571,7 @@ static bool8 InitEasyChatScreenWordData(void) static void FreeEasyChatScreenWordData(void) { - if (sWordData) - FREE_AND_SET_NULL(sWordData); + TRY_FREE_AND_SET_NULL(sWordData); } static void SetUnlockedEasyChatGroups(void) diff --git a/src/field_region_map.c b/src/field_region_map.c index 26ae736a6..adf5e4ed7 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -192,10 +192,7 @@ static void FieldUpdateRegionMap(void) { FreeRegionMapIconResources(); SetMainCallback2(sFieldRegionMapHandler->callback); - if (sFieldRegionMapHandler != NULL) - { - FREE_AND_SET_NULL(sFieldRegionMapHandler); - } + TRY_FREE_AND_SET_NULL(sFieldRegionMapHandler); FreeAllWindowBuffers(); } break; diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index a195bddcf..38f096af8 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -529,10 +529,8 @@ static void Task_Hof_TrySaveData(u8 taskId) UnsetBgTilemapBuffer(3); FreeAllWindowBuffers(); - if (sHofGfxPtr != NULL) - FREE_AND_SET_NULL(sHofGfxPtr); - if (sHofMonPtr != NULL) - FREE_AND_SET_NULL(sHofMonPtr); + TRY_FREE_AND_SET_NULL(sHofGfxPtr); + TRY_FREE_AND_SET_NULL(sHofMonPtr); DestroyTask(taskId); } @@ -773,10 +771,8 @@ static void Task_Hof_HandleExit(u8 taskId) ResetBgsAndClearDma3BusyFlags(0); DestroyTask(taskId); - if (sHofGfxPtr != NULL) - FREE_AND_SET_NULL(sHofGfxPtr); - if (sHofMonPtr != NULL) - FREE_AND_SET_NULL(sHofMonPtr); + TRY_FREE_AND_SET_NULL(sHofGfxPtr); + TRY_FREE_AND_SET_NULL(sHofMonPtr); StartCredits(); } @@ -1081,10 +1077,8 @@ static void Task_HofPC_HandleExit(u8 taskId) ResetBgsAndClearDma3BusyFlags(0); DestroyTask(taskId); - if (sHofGfxPtr != NULL) - FREE_AND_SET_NULL(sHofGfxPtr); - if (sHofMonPtr != NULL) - FREE_AND_SET_NULL(sHofMonPtr); + TRY_FREE_AND_SET_NULL(sHofGfxPtr); + TRY_FREE_AND_SET_NULL(sHofMonPtr); ReturnFromHallOfFamePC(); } diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 8f80b0b37..a0eca498e 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -5417,8 +5417,7 @@ static bool32 WaitForWallpaperGfxLoad(void) if (IsDma3ManagerBusyWithBgCopy()) return FALSE; - if (sStorage->wallpaperTiles != NULL) - FREE_AND_SET_NULL(sStorage->wallpaperTiles); + TRY_FREE_AND_SET_NULL(sStorage->wallpaperTiles); return TRUE; } diff --git a/src/pokenav.c b/src/pokenav.c index f9a6614a8..04e87f38c 100644 --- a/src/pokenav.c +++ b/src/pokenav.c @@ -557,8 +557,7 @@ void *GetSubstructPtr(u32 index) void FreePokenavSubstruct(u32 index) { - if (gPokenavResources->substructPtrs[index] != NULL) - FREE_AND_SET_NULL(gPokenavResources->substructPtrs[index]); + TRY_FREE_AND_SET_NULL(gPokenavResources->substructPtrs[index]); } u32 GetPokenavMode(void) diff --git a/src/region_map.c b/src/region_map.c index 5b3b8b008..a4db1cb04 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -2024,11 +2024,7 @@ static void CB_ExitFlyMap(void) { SetMainCallback2(CB2_ReturnToPartyMenuFromFlyMap); } - if (sFlyMap != NULL) - { - free(sFlyMap); - sFlyMap = NULL; - } + TRY_FREE_AND_SET_NULL(sFlyMap); FreeAllWindowBuffers(); } break; diff --git a/src/rotating_tile_puzzle.c b/src/rotating_tile_puzzle.c index 2e919f550..b8912aa3d 100644 --- a/src/rotating_tile_puzzle.c +++ b/src/rotating_tile_puzzle.c @@ -101,8 +101,7 @@ void FreeRotatingTilePuzzle(void) { u8 id; - if (sRotatingTilePuzzle != NULL) - FREE_AND_SET_NULL(sRotatingTilePuzzle); + TRY_FREE_AND_SET_NULL(sRotatingTilePuzzle); id = GetObjectEventIdByLocalIdAndMap(OBJ_EVENT_ID_PLAYER, 0, 0); ObjectEventClearHeldMovementIfFinished(&gObjectEvents[id]); diff --git a/src/slot_machine.c b/src/slot_machine.c index 828d0c161..4796a5684 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -1756,14 +1756,10 @@ static bool8 SlotTask_FreeDataStructures(struct Task *task) FREE_AND_SET_NULL(sImageTable_DigitalDisplay_Number); FREE_AND_SET_NULL(sImageTable_DigitalDisplay_Pokeball); FREE_AND_SET_NULL(sImageTable_DigitalDisplay_DPad); - if (sImageTable_ReelTimePikachu != NULL) - FREE_AND_SET_NULL(sImageTable_ReelTimePikachu); - if (sImageTable_ReelTimeMachineAntennae != NULL) - FREE_AND_SET_NULL(sImageTable_ReelTimeMachineAntennae); - if (sImageTable_ReelTimeMachine != NULL) - FREE_AND_SET_NULL(sImageTable_ReelTimeMachine); - if (sImageTable_BrokenReelTimeMachine != NULL) - FREE_AND_SET_NULL(sImageTable_BrokenReelTimeMachine); + TRY_FREE_AND_SET_NULL(sImageTable_ReelTimePikachu); + TRY_FREE_AND_SET_NULL(sImageTable_ReelTimeMachineAntennae); + TRY_FREE_AND_SET_NULL(sImageTable_ReelTimeMachine); + TRY_FREE_AND_SET_NULL(sImageTable_BrokenReelTimeMachine); FREE_AND_SET_NULL(sMenuGfx); FREE_AND_SET_NULL(sSelectedPikaPowerTile); FREE_AND_SET_NULL(sReelOverlay_Tilemap); @@ -4178,8 +4174,7 @@ static void CreateReelTimePikachuSprite(void) static void DestroyReelTimePikachuSprite(void) { DestroySprite(&gSprites[sSlotMachine->reelTimePikachuSpriteId]); - if (sImageTable_ReelTimePikachu != NULL) - FREE_AND_SET_NULL(sImageTable_ReelTimePikachu); + TRY_FREE_AND_SET_NULL(sImageTable_ReelTimePikachu); } static void SpriteCB_ReelTimePikachu(struct Sprite *sprite) @@ -4308,10 +4303,8 @@ static void DestroyReelTimeMachineSprites(void) for (i = 0; i < ARRAY_COUNT(sSlotMachine->reelTimeMachineSpriteIds); i++) DestroySprite(&gSprites[sSlotMachine->reelTimeMachineSpriteIds[i]]); - if (sImageTable_ReelTimeMachineAntennae != NULL) - FREE_AND_SET_NULL(sImageTable_ReelTimeMachineAntennae); - if (sImageTable_ReelTimeMachine != NULL) - FREE_AND_SET_NULL(sImageTable_ReelTimeMachine); + TRY_FREE_AND_SET_NULL(sImageTable_ReelTimeMachineAntennae); + TRY_FREE_AND_SET_NULL(sImageTable_ReelTimeMachine); for (i = 0; i < ARRAY_COUNT(sSlotMachine->reelTimeNumberSpriteIds); i++) DestroySprite(&gSprites[sSlotMachine->reelTimeNumberSpriteIds[i]]); @@ -4328,8 +4321,7 @@ static void DestroyReelTimeShadowSprites(void) static void DestroyBrokenReelTimeMachineSprite(void) { DestroySprite(&gSprites[sSlotMachine->reelTimeBrokenMachineSpriteId]); - if (sImageTable_BrokenReelTimeMachine != NULL) - FREE_AND_SET_NULL(sImageTable_BrokenReelTimeMachine); + TRY_FREE_AND_SET_NULL(sImageTable_BrokenReelTimeMachine); } #define sDelayTimer data[0] diff --git a/src/union_room_chat.c b/src/union_room_chat.c index 9890bc1f8..f8513b9f4 100755 --- a/src/union_room_chat.c +++ b/src/union_room_chat.c @@ -2160,8 +2160,7 @@ static bool32 IsDisplaySubtask0Active(void) static void FreeDisplay(void) { FreeSprites(); - if (sDisplay) - FREE_AND_SET_NULL(sDisplay); + TRY_FREE_AND_SET_NULL(sDisplay); FreeAllWindowBuffers(); gScanlineEffect.state = 3; From 284e46927a3584ec6ffdc0be61f237fee3773b6a Mon Sep 17 00:00:00 2001 From: sphericalice Date: Fri, 3 Jun 2022 15:56:11 +0100 Subject: [PATCH 138/208] Use the FREE_AND_SET_NULL macro where appropriate --- src/battle_anim_utility_funcs.c | 3 +-- src/battle_main.c | 9 +++------ src/evolution_scene.c | 6 ++---- src/mystery_gift_client.c | 3 +-- src/mystery_gift_server.c | 3 +-- src/mystery_gift_view.c | 6 ++---- 6 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/battle_anim_utility_funcs.c b/src/battle_anim_utility_funcs.c index e2c674c57..aae8d6b5d 100644 --- a/src/battle_anim_utility_funcs.c +++ b/src/battle_anim_utility_funcs.c @@ -594,8 +594,7 @@ static void StatsChangeAnimation_Step3(u8 taskId) if (gTasks[taskId].data[6] == 1) gSprites[gTasks[taskId].data[7]].oam.priority++; - Free(sAnimStatsChangeData); - sAnimStatsChangeData = NULL; + FREE_AND_SET_NULL(sAnimStatsChangeData); DestroyAnimVisualTask(taskId); break; } diff --git a/src/battle_main.c b/src/battle_main.c index 682849af7..f61d5eaae 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -1498,8 +1498,7 @@ static void CB2_PreInitMultiBattle(void) gBattleTypeFlags = *savedBattleTypeFlags; gMain.savedCallback = *savedCallback; SetMainCallback2(CB2_InitBattleInternal); - Free(sMultiPartnerPartyBuffer); - sMultiPartnerPartyBuffer = NULL; + FREE_AND_SET_NULL(sMultiPartnerPartyBuffer); } } else if (gReceivedRemoteLinkPlayers == 0) @@ -1507,8 +1506,7 @@ static void CB2_PreInitMultiBattle(void) gBattleTypeFlags = *savedBattleTypeFlags; gMain.savedCallback = *savedCallback; SetMainCallback2(CB2_InitBattleInternal); - Free(sMultiPartnerPartyBuffer); - sMultiPartnerPartyBuffer = NULL; + FREE_AND_SET_NULL(sMultiPartnerPartyBuffer); } break; } @@ -1544,8 +1542,7 @@ static void CB2_PreInitIngamePlayerPartnerBattle(void) gBattleTypeFlags = *savedBattleTypeFlags; gMain.savedCallback = *savedCallback; SetMainCallback2(CB2_InitBattleInternal); - Free(sMultiPartnerPartyBuffer); - sMultiPartnerPartyBuffer = NULL; + FREE_AND_SET_NULL(sMultiPartnerPartyBuffer); } break; } diff --git a/src/evolution_scene.c b/src/evolution_scene.c index bde11ddb5..eb458d39d 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -816,8 +816,7 @@ static void Task_EvolutionScene(u8 taskId) DestroyTask(taskId); FreeMonSpritesGfx(); - Free(sEvoStructPtr); - sEvoStructPtr = NULL; + FREE_AND_SET_NULL(sEvoStructPtr); FreeAllWindowBuffers(); SetMainCallback2(gCB2_AfterEvolution); } @@ -1223,8 +1222,7 @@ static void Task_TradeEvolutionScene(u8 taskId) if (!IsTextPrinterActive(0)) { DestroyTask(taskId); - Free(sEvoStructPtr); - sEvoStructPtr = NULL; + FREE_AND_SET_NULL(sEvoStructPtr); gTextFlags.useAlternateDownArrow = 0; SetMainCallback2(gCB2_AfterEvolution); } diff --git a/src/mystery_gift_client.c b/src/mystery_gift_client.c index adf3ce8a6..eeebec5d6 100644 --- a/src/mystery_gift_client.c +++ b/src/mystery_gift_client.c @@ -44,8 +44,7 @@ u32 MysteryGiftClient_Run(u16 * endVal) { *endVal = sClient->param; MysteryGiftClient_Free(sClient); - Free(sClient); - sClient = NULL; + FREE_AND_SET_NULL(sClient); } return result; } diff --git a/src/mystery_gift_server.c b/src/mystery_gift_server.c index 0e0acb642..891870659 100644 --- a/src/mystery_gift_server.c +++ b/src/mystery_gift_server.c @@ -44,8 +44,7 @@ u32 MysterGiftServer_Run(u16 * endVal) { *endVal = sServer->param; MysteryGiftServer_Free(sServer); - Free(sServer); - sServer = NULL; + FREE_AND_SET_NULL(sServer); } return result; } diff --git a/src/mystery_gift_view.c b/src/mystery_gift_view.c index 3047a219e..ff34c8853 100644 --- a/src/mystery_gift_view.c +++ b/src/mystery_gift_view.c @@ -207,8 +207,7 @@ void WonderCard_Destroy(void) if (sWonderCardData != NULL) { *sWonderCardData = (struct WonderCardData){}; - Free(sWonderCardData); - sWonderCardData = NULL; + FREE_AND_SET_NULL(sWonderCardData); } } @@ -660,8 +659,7 @@ void WonderNews_Destroy(void) if (sWonderNewsData != NULL) { *sWonderNewsData = (struct WonderNewsData){}; - Free(sWonderNewsData); - sWonderNewsData = NULL; + FREE_AND_SET_NULL(sWonderNewsData); } } From af6bf17930204aa140243cbbbfbf0ff25a8cc353 Mon Sep 17 00:00:00 2001 From: sneed Date: Fri, 3 Jun 2022 21:04:14 +0300 Subject: [PATCH 139/208] Include config.h in siirtc.c --- src/siirtc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/siirtc.c b/src/siirtc.c index 5f4fc0a23..0e598f717 100644 --- a/src/siirtc.c +++ b/src/siirtc.c @@ -4,6 +4,7 @@ #include "gba/gba.h" #include "siirtc.h" +#include "config.h" #define STATUS_INTFE 0x02 // frequency interrupt enable #define STATUS_INTME 0x08 // per-minute interrupt enable From 34438e6bc4537dda15f8f1a15e5e23553a2bc854 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 1 Jun 2022 12:41:57 -0400 Subject: [PATCH 140/208] Continue documenting generic arguments --- data/battle_anim_scripts.s | 18 +- gflib/bg.h | 2 +- gflib/sprite.c | 9 +- gflib/sprite.h | 2 +- gflib/text.c | 8 +- include/battle_anim.h | 18 +- include/battle_interface.h | 2 +- include/constants/battle_string_ids.h | 2 + include/contest.h | 8 +- include/decompress.h | 2 +- include/field_camera.h | 8 +- include/field_player_avatar.h | 42 ++-- include/field_special_scene.h | 8 +- include/fldeff.h | 4 +- include/fldeff_misc.h | 4 +- include/gba/m4a_internal.h | 2 +- include/intro_credits_graphics.h | 6 +- include/link.h | 2 +- include/main_menu.h | 2 +- include/mauville_old_man.h | 4 +- include/menu.h | 12 +- include/overworld.h | 6 +- include/pokeball.h | 4 +- include/pokemon.h | 4 +- include/pokenav.h | 2 +- include/scanline_effect.h | 2 +- include/trade.h | 4 +- src/battle_anim_effects_1.c | 92 ++++---- src/battle_anim_effects_3.c | 2 +- src/battle_anim_fire.c | 274 +++++++++++++--------- src/battle_anim_mons.c | 8 +- src/battle_anim_psychic.c | 4 +- src/battle_anim_smokescreen.c | 66 +++--- src/battle_anim_throw.c | 8 +- src/battle_dome.c | 99 ++++---- src/battle_interface.c | 36 +-- src/battle_message.c | 6 +- src/battle_script_commands.c | 2 +- src/berry_blender.c | 2 +- src/contest.c | 24 +- src/credits.c | 6 +- src/decompress.c | 6 +- src/dodrio_berry_picking.c | 6 +- src/event_object_movement.c | 16 +- src/field_camera.c | 6 +- src/field_player_avatar.c | 146 ++++++------ src/field_special_scene.c | 202 +++++++++------- src/field_specials.c | 56 ++--- src/field_weather.c | 6 +- src/field_weather_effect.c | 57 +++-- src/intro_credits_graphics.c | 3 +- src/item_use.c | 44 ++-- src/link.c | 12 +- src/main_menu.c | 39 ++-- src/mauville_old_man.c | 2 +- src/menu.c | 8 +- src/mystery_event_script.c | 35 +-- src/overworld.c | 6 +- src/palette.c | 56 ++--- src/player_pc.c | 108 ++++----- src/pokeball.c | 155 ++++++++----- src/pokedex.c | 12 +- src/pokedex_area_region_map.c | 4 +- src/pokemon.c | 10 +- src/pokemon_jump.c | 3 +- src/pokemon_summary_screen.c | 128 +++++------ src/pokenav.c | 10 +- src/pokenav_list.c | 318 +++++++++++++------------- src/slot_machine.c | 40 ++-- src/trade.c | 8 +- src/tv.c | 4 +- 71 files changed, 1246 insertions(+), 1076 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 538286e15..eff53de84 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -5031,17 +5031,17 @@ Move_LIGHT_SCREEN: end SpecialScreenSparkle: - createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 23, 0, ANIM_ATTACKER, 1 + createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 23, 0, ANIM_ATTACKER, TRUE delay 6 - createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 31, -8, ANIM_ATTACKER, 1 + createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 31, -8, ANIM_ATTACKER, TRUE delay 5 - createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 30, 20, ANIM_ATTACKER, 1 + createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 30, 20, ANIM_ATTACKER, TRUE delay 7 - createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 10, -15, ANIM_ATTACKER, 1 + createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 10, -15, ANIM_ATTACKER, TRUE delay 6 - createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 20, 10, ANIM_ATTACKER, 1 + createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 20, 10, ANIM_ATTACKER, TRUE delay 6 - createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 10, 18, ANIM_ATTACKER, 1 + createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 10, 18, ANIM_ATTACKER, TRUE return Move_MIRROR_COAT: @@ -5064,11 +5064,11 @@ Move_REFLECT: waitplaysewithpan SE_M_REFLECT, SOUND_PAN_ATTACKER, 15 createsprite gReflectWallSpriteTemplate, ANIM_ATTACKER, 1, 40, 0, ANIM_TAG_BLUE_LIGHT_WALL delay 20 - createsprite gReflectSparkleSpriteTemplate, ANIM_ATTACKER, 2, 30, 0, ANIM_ATTACKER, 1 + createsprite gReflectSparkleSpriteTemplate, ANIM_ATTACKER, 2, 30, 0, ANIM_ATTACKER, TRUE delay 7 - createsprite gReflectSparkleSpriteTemplate, ANIM_ATTACKER, 2, 19, -12, ANIM_ATTACKER, 1 + createsprite gReflectSparkleSpriteTemplate, ANIM_ATTACKER, 2, 19, -12, ANIM_ATTACKER, TRUE delay 7 - createsprite gReflectSparkleSpriteTemplate, ANIM_ATTACKER, 2, 10, 20, ANIM_ATTACKER, 1 + createsprite gReflectSparkleSpriteTemplate, ANIM_ATTACKER, 2, 10, 20, ANIM_ATTACKER, TRUE waitforvisualfinish delay 1 blendoff diff --git a/gflib/bg.h b/gflib/bg.h index d8b5a5404..02ff07369 100644 --- a/gflib/bg.h +++ b/gflib/bg.h @@ -76,7 +76,7 @@ s32 ChangeBgY(u8 bg, s32 value, u8 op); s32 ChangeBgY_ScreenOff(u8 bg, s32 value, u8 op); s32 GetBgY(u8 bg); void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle); -u8 Unused_AdjustBgMosaic(u8 a1, u8 a2); +u8 Unused_AdjustBgMosaic(u8 val, u8 mode); void SetBgTilemapBuffer(u8 bg, void *tilemap); void UnsetBgTilemapBuffer(u8 bg); void* GetBgTilemapBuffer(u8 bg); diff --git a/gflib/sprite.c b/gflib/sprite.c index f05fe76f2..e5bf89063 100644 --- a/gflib/sprite.c +++ b/gflib/sprite.c @@ -94,7 +94,7 @@ static void ApplyAffineAnimFrame(u8 matrixNum, struct AffineAnimFrameCmd *frameC static u8 IndexOfSpriteTileTag(u16 tag); static void AllocSpriteTileRange(u16 tag, u16 start, u16 count); static void DoLoadSpritePalette(const u16 *src, u16 paletteOffset); -static void UpdateSpriteMatrixAnchorPos(struct Sprite* sprite, s32 a1, s32 a2); +static void UpdateSpriteMatrixAnchorPos(struct Sprite*, s32, s32); typedef void (*AnimFunc)(struct Sprite *); typedef void (*AnimCmdFunc)(struct Sprite *); @@ -632,14 +632,11 @@ void DestroySprite(struct Sprite *sprite) } } -void ResetOamRange(u8 a, u8 b) +void ResetOamRange(u8 start, u8 end) { u8 i; - - for (i = a; i < b; i++) - { + for (i = start; i < end; i++) gMain.oamBuffer[i] = *(struct OamData *)&gDummyOamData; - } } void LoadOam(void) diff --git a/gflib/sprite.h b/gflib/sprite.h index e53737981..f7ef16532 100644 --- a/gflib/sprite.h +++ b/gflib/sprite.h @@ -270,7 +270,7 @@ u8 CreateSpriteAtEnd(const struct SpriteTemplate *template, s16 x, s16 y, u8 sub u8 CreateInvisibleSprite(void (*callback)(struct Sprite *)); u8 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority); void DestroySprite(struct Sprite *sprite); -void ResetOamRange(u8 a, u8 b); +void ResetOamRange(u8 start, u8 end); void LoadOam(void); void SetOamMatrix(u8 matrixNum, u16 a, u16 b, u16 c, u16 d); void CalcCenterToCornerVec(struct Sprite *sprite, u8 shape, u8 size, u8 affineMode); diff --git a/gflib/text.c b/gflib/text.c index 557c11704..c400c0582 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -326,14 +326,14 @@ void RunTextPrinters(void) { if (sTextPrinters[i].active) { - u16 temp = RenderFont(&sTextPrinters[i]); - switch (temp) + u16 renderCmd = RenderFont(&sTextPrinters[i]); + switch (renderCmd) { case RENDER_PRINT: CopyWindowToVram(sTextPrinters[i].printerTemplate.windowId, COPYWIN_GFX); case RENDER_UPDATE: - if (sTextPrinters[i].callback != 0) - sTextPrinters[i].callback(&sTextPrinters[i].printerTemplate, temp); + if (sTextPrinters[i].callback != NULL) + sTextPrinters[i].callback(&sTextPrinters[i].printerTemplate, renderCmd); break; case RENDER_FINISH: sTextPrinters[i].active = FALSE; diff --git a/include/battle_anim.h b/include/battle_anim.h index c42fa033b..c98766ea8 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -62,7 +62,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible) bool8 IsContest(void); s8 BattleAnimAdjustPanning(s8 pan); s8 BattleAnimAdjustPanning2(s8 pan); -s16 KeepPanInRange(s16 a, int oldPan); +s16 KeepPanInRange(s16 panArg, int oldPan); s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan); void RelocateBattleBgPal(u16 paletteNum, u16 *dest, u32 offset, bool8 largeScreen); void ResetBattleAnimBg(bool8); @@ -91,14 +91,14 @@ bool8 AnimTranslateLinear(struct Sprite *sprite); void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite); u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId); void InitAnimLinearTranslationWithSpeed(struct Sprite *sprite); -u16 ArcTan2Neg(s16 a, s16 b); -void TrySetSpriteRotScale(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation); +u16 ArcTan2Neg(s16 x, s16 y); +void TrySetSpriteRotScale(struct Sprite *sprite, bool8 recalcCenterVector, s16 xScale, s16 yScale, u16 rotation); void RunStoredCallbackWhenAffineAnimEnds(struct Sprite *sprite); void TranslateSpriteLinearAndFlicker(struct Sprite *sprite); void SetSpriteCoordsToAnimAttackerCoords(struct Sprite *sprite); void RunStoredCallbackWhenAnimEnds(struct Sprite *sprite); -void SetAnimSpriteInitialXOffset(struct Sprite *sprite, s16 a2); -s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 a2); +void SetAnimSpriteInitialXOffset(struct Sprite *sprite, s16 xOffset); +s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr); u8 GetBattlerYCoordWithElevation(u8 battlerId); void WaitAnimForDuration(struct Sprite *sprite); void AnimTravelDiagonally(struct Sprite *sprite); @@ -129,7 +129,7 @@ void AnimLoadCompressedBgGfx(u32, const u32*, u32); void UpdateAnimBg3ScreenSize(bool8); void TranslateSpriteInGrowingCircle(struct Sprite *); void SetBattlerSpriteYOffsetFromYScale(u8 spriteId); -void PrepareEruptAnimTaskData(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7); +void PrepareEruptAnimTaskData(struct Task *task, u8 spriteId, s16 xScaleStart, s16 yScaleStart, s16 xScaleEnd, s16 yScaleEnd, u16 duration); u8 UpdateEruptAnimTask(struct Task *task); void DestroyAnimSpriteAndDisableBlend(struct Sprite *); void AnimLoadCompressedBgTilemap(u32 bgId, const void *src); @@ -146,7 +146,7 @@ void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union Aff bool8 RunAffineAnimFromTaskData(struct Task *task); void AnimThrowProjectile(struct Sprite *sprite); void GetBgDataForTransform(struct BattleAnimBgData *dest, u8 battlerId); -u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm); +u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm); void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite); void TradeMenuBouncePartySprites(struct Sprite *sprite); void DestroyAnimVisualTaskAndDisableBlend(u8 taskId); @@ -209,7 +209,7 @@ void AnimTask_HorizontalShake(u8 taskId); void TryShinyAnimation(u8 battler, struct Pokemon *mon); u8 ItemIdToBallId(u16 itemId); u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId); -u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, u8 ballId); +u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 spritePalNum, u32 selectedPalettes, u8 ballId); // battle_anim_utility_funcs.c void InitStatsChangeAnimation(u8); @@ -227,7 +227,7 @@ void AnimWaterPulseRing(struct Sprite *sprite); void DestroyAnimSpriteAfterTimer(struct Sprite *sprite); // battle_anim_smokescreen.c -u8 SmokescreenImpact(s16 x, s16 y, u8 a3); +u8 SmokescreenImpact(s16 x, s16 y, bool8 persist); u32 UnpackSelectedBattlePalettes(s16); diff --git a/include/battle_interface.h b/include/battle_interface.h index 6cc02c3fc..c4816e8da 100644 --- a/include/battle_interface.h +++ b/include/battle_interface.h @@ -71,7 +71,7 @@ void UpdateOamPriorityInAllHealthboxes(u8 priority); void InitBattlerHealthboxCoords(u8 battler); void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent); void SwapHpBarsWithHpText(void); -u8 CreatePartyStatusSummarySprites(u8 battler, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart); +u8 CreatePartyStatusSummarySprites(u8 battler, struct HpAndStatus *partyInfo, bool8 skipPlayer, bool8 isBattleStart); void Task_HidePartyStatusSummary(u8 taskId); void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId); s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 unused); diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index d5d0698b9..ae18b61ef 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -599,4 +599,6 @@ #define B_MSG_REF_DRAW 7 #define B_MSG_REF_COMMENCE_BATTLE 8 +#define NUM_TRAPPING_MOVES 6 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H diff --git a/include/contest.h b/include/contest.h index e7acb5a11..c5dc232d5 100644 --- a/include/contest.h +++ b/include/contest.h @@ -340,11 +340,11 @@ void SetLinkAIContestants(u8 contestType, u8 rank, bool32 isPostgame); u8 GetContestEntryEligibility(struct Pokemon *pkmn); void CalculateRound1Points(u8 contestCategory); bool8 IsSpeciesNotUnown(u16 species); -bool8 Contest_IsMonsTurnDisabled(u8 a); +bool8 Contest_IsMonsTurnDisabled(u8 contestant); void SaveLinkContestResults(void); -void SortContestants(bool8 a); -void SetContestantEffectStringID(u8 a, u8 b); -void SetContestantEffectStringID2(u8 a, u8 b); +void SortContestants(bool8 useRanking); +void SetContestantEffectStringID(u8 contestant, u8 effectStringId); +void SetContestantEffectStringID2(u8 contestant, u8 effectStringId); void SetStartledString(u8 contestant, u8 jam); void MakeContestantNervous(u8 p); s8 Contest_GetMoveExcitement(u16 move); diff --git a/include/decompress.h b/include/decompress.h index 02412defb..14906211c 100644 --- a/include/decompress.h +++ b/include/decompress.h @@ -13,7 +13,7 @@ void LoadCompressedSpriteSheetOverrideBuffer(const struct CompressedSpriteSheet bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet* src); void LoadCompressedSpritePalette(const struct CompressedSpritePalette *src); -void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *a, void *buffer); +void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *src, void *buffer); bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette *src); void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void* buffer, s32 species); diff --git a/include/field_camera.h b/include/field_camera.h index b245fca84..6e8af1a53 100644 --- a/include/field_camera.h +++ b/include/field_camera.h @@ -17,14 +17,14 @@ extern u16 gTotalCameraPixelOffsetY; void DrawWholeMapView(void); void CurrentMapDrawMetatileAt(int x, int y); -void GetCameraOffsetWithPan(s16 *a0, s16 *a1); +void GetCameraOffsetWithPan(s16 *x, s16 *y); void DrawDoorMetatileAt(int x, int y, u16 *arr); void ResetFieldCamera(void); void ResetCameraUpdateInfo(void); -u32 InitCameraUpdateCallback(u8 a); +u32 InitCameraUpdateCallback(u8 trackedSpriteId); void CameraUpdate(void); -void SetCameraPanningCallback(void (*a)(void)); -void SetCameraPanning(s16 a, s16 b); +void SetCameraPanningCallback(void (*callback)(void)); +void SetCameraPanning(s16 horizontal, s16 vertical); void InstallCameraPanAheadCallback(void); void UpdateCameraPanning(void); void FieldUpdateBgTilemapScroll(void); diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index d382de08c..2bf2df269 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -11,29 +11,29 @@ void PlayerGetDestCoords(s16 *, s16 *); u8 GetPlayerFacingDirection(void); u8 GetPlayerMovementDirection(void); u8 PlayerGetCopyableMovement(void); -void PlayerWalkNormal(u8); -void PlayerWalkFast(u8); -void PlayerRideWaterCurrent(u8); -void PlayerWalkFaster(u8); -void PlayerOnBikeCollide(u8); -void PlayerFaceDirection(u8 a); -void PlayerTurnInPlace(u8 a); -void PlayerJumpLedge(u8 a); -void PlayerIdleWheelie(u8 a); -void PlayerStartWheelie(u8 a); -void PlayerEndWheelie(u8 a); -void PlayerStandingHoppingWheelie(u8 a); -void PlayerMovingHoppingWheelie(u8 a); -void PlayerLedgeHoppingWheelie(u8 a); -void PlayerAcroTurnJump(u8 a); -void PlayerSetAnimId(u8 a, u8 b); +void PlayerWalkNormal(u8 direction); +void PlayerWalkFast(u8 direction); +void PlayerRideWaterCurrent(u8 direction); +void PlayerWalkFaster(u8 direction); +void PlayerOnBikeCollide(u8 direction); +void PlayerFaceDirection(u8 direction); +void PlayerTurnInPlace(u8 direction); +void PlayerJumpLedge(u8 direction); +void PlayerIdleWheelie(u8 direction); +void PlayerStartWheelie(u8 direction); +void PlayerEndWheelie(u8 direction); +void PlayerStandingHoppingWheelie(u8 direction); +void PlayerMovingHoppingWheelie(u8 direction); +void PlayerLedgeHoppingWheelie(u8 direction); +void PlayerAcroTurnJump(u8 direction); +void PlayerSetAnimId(u8 movementActionId, u8 copyableMovement); bool8 IsPlayerCollidingWithFarawayIslandMew(u8 direction); void PlayerOnBikeCollideWithFarawayIslandMew(u8 direction); -u8 CheckForObjectEventCollision(struct ObjectEvent *a, s16 b, s16 c, u8 d, u8 e); +u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior); u8 PlayerGetElevation(void); -void SetPlayerAvatarTransitionFlags(u16 a); +void SetPlayerAvatarTransitionFlags(u16 transitionFlags); void CancelPlayerForcedMovement(void); -void InitPlayerAvatar(s16 a, s16 b, u8 c, u8 d); +void InitPlayerAvatar(s16 x, s16 y, u8 direction, u8 gender); void PlayerFreeze(void); void StopPlayerAvatar(void); void SetSpinStartFacingDir(u8); @@ -41,8 +41,8 @@ void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8); void SetPlayerAvatarFieldMove(void); u8 GetPlayerAvatarGraphicsIdByCurrentState(void); -void SetPlayerAvatarStateMask(u8 a); -u8 GetPlayerAvatarGraphicsIdByStateId(u8 a); +void SetPlayerAvatarStateMask(u8 flags); +u8 GetPlayerAvatarGraphicsIdByStateId(u8 state); u8 GetJumpSpecialMovementAction(u32); bool8 PartyHasMonWithSurf(void); bool8 IsPlayerFacingSurfableFishableWater(void); diff --git a/include/field_special_scene.h b/include/field_special_scene.h index 3f701f41b..111723c83 100644 --- a/include/field_special_scene.h +++ b/include/field_special_scene.h @@ -1,14 +1,8 @@ #ifndef GUARD_FIELD_SPECIAL_SCENE_H #define GUARD_FIELD_SPECIAL_SCENE_H -s16 GetTruckCameraBobbingY(int a1); -s16 GetTruckBoxMovement(int a1); -void Task_Truck1(u8 taskId); -void Task_Truck2(u8 taskId); -void Task_Truck3(u8 taskId); -void Task_HandleTruckSequence(u8 taskId); void ExecuteTruckSequence(void); -void EndTruckSequence(u8); +void EndTruckSequence(u8 taskId); void FieldCB_ShowPortholeView(void); #endif // GUARD_FIELD_SPECIAL_SCENE_H diff --git a/include/fldeff.h b/include/fldeff.h index 597ce6f47..0ad0e3d60 100644 --- a/include/fldeff.h +++ b/include/fldeff.h @@ -25,8 +25,8 @@ void ChooseMonForSoftboiled(u8 taskId); // flash bool8 SetUpFieldMove_Flash(void); void CB2_DoChangeMap(void); -bool8 GetMapPairFadeToType(u8 a1, u8 a2); -bool8 GetMapPairFadeFromType(u8 a1, u8 a2); +bool8 GetMapPairFadeToType(u8 _fromType, u8 _toType); +bool8 GetMapPairFadeFromType(u8 _fromType, u8 _toType); // strength bool8 SetUpFieldMove_Strength(void); diff --git a/include/fldeff_misc.h b/include/fldeff_misc.h index 38dec23b0..61078466d 100644 --- a/include/fldeff_misc.h +++ b/include/fldeff_misc.h @@ -1,8 +1,8 @@ #ifndef GUARD_FLDEFF_MISC_H #define GUARD_FLDEFF_MISC_H -void ComputerScreenOpenEffect(u16 a0, u16 a1, u8 a2); -void ComputerScreenCloseEffect(u16 a0, u16 a1, u8 a2); +void ComputerScreenOpenEffect(u16 increment, u16 unused, u8 priority); +void ComputerScreenCloseEffect(u16 increment, u16 unused, u8 priority); bool8 IsComputerScreenOpenEffectActive(void); bool8 IsComputerScreenCloseEffectActive(void); bool8 SetUpFieldMove_SecretPower(void); diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h index a057c2da6..40a25ba05 100644 --- a/include/gba/m4a_internal.h +++ b/include/gba/m4a_internal.h @@ -423,7 +423,7 @@ void Clear64byte(void *addr); void SoundInit(struct SoundInfo *soundInfo); void MPlayExtender(struct CgbChannel *cgbChans); void m4aSoundMode(u32 mode); -void MPlayOpen(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track, u8 a3); +void MPlayOpen(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *tracks, u8 trackCount); void CgbSound(void); void CgbOscOff(u8); void CgbModVol(struct CgbChannel *chan); diff --git a/include/intro_credits_graphics.h b/include/intro_credits_graphics.h index bed30ffe8..c6f4a73c5 100644 --- a/include/intro_credits_graphics.h +++ b/include/intro_credits_graphics.h @@ -33,11 +33,11 @@ extern const struct CompressedSpriteSheet gSpriteSheet_CreditsRivalBrendan[]; extern const struct CompressedSpriteSheet gSpriteSheet_CreditsRivalMay[]; extern const struct SpritePalette gSpritePalettes_Credits[]; -void LoadIntroPart2Graphics(u8 scene); -void SetIntroPart2BgCnt(u8 a); +void LoadIntroPart2Graphics(u8 scenery); +void SetIntroPart2BgCnt(u8 scenery); void LoadCreditsSceneGraphics(u8); void SetCreditsSceneBgCnt(u8); -u8 CreateBicycleBgAnimationTask(u8 a, u16 b, u16 c, u16 d); +u8 CreateBicycleBgAnimationTask(u8 mode, u16 bg1Speed, u16 bg2Speed, u16 bg3Speed); void CycleSceneryPalette(u8); u8 CreateIntroBrendanSprite(s16 x, s16 y); u8 CreateIntroMaySprite(s16 x, s16 y); diff --git a/include/link.h b/include/link.h index 96a76e120..120c25784 100644 --- a/include/link.h +++ b/include/link.h @@ -300,7 +300,7 @@ void LocalLinkPlayerToBlock(void); void LinkPlayerFromBlock(u32 who); bool32 Link_AnyPartnersPlayingFRLG_JP(void); void ResetLinkPlayerCount(void); -void SaveLinkPlayers(u8 a0); +void SaveLinkPlayers(u8 playerCount); void SetWirelessCommType0(void); bool32 IsLinkRecvQueueAtOverworldMax(void); diff --git a/include/main_menu.h b/include/main_menu.h index 1944f4ecc..5f92719d5 100644 --- a/include/main_menu.h +++ b/include/main_menu.h @@ -2,6 +2,6 @@ #define GUARD_MAIN_MENU_H void CB2_InitMainMenu(void); -void CreateYesNoMenuParameterized(u8 a, u8 b, u16 c, u16 d, u8 e, u8 f); +void CreateYesNoMenuParameterized(u8 x, u8 y, u16 baseTileNum, u16 baseBlock, u8 yesNoPalNum, u8 winPalNum); #endif // GUARD_MAIN_MENU_H diff --git a/include/mauville_old_man.h b/include/mauville_old_man.h index b22294f1b..9e5986ee8 100644 --- a/include/mauville_old_man.h +++ b/include/mauville_old_man.h @@ -7,8 +7,8 @@ void SetMauvilleOldMan(void); u8 GetCurrentMauvilleOldMan(void); void SetMauvilleOldManObjEventGfx(void); void SanitizeMauvilleOldManForRuby(OldMan *dest); -void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 r1, u32 r6); -void SanitizeReceivedEmeraldOldMan(union OldMan * oldMan, u32 unused, u32 a2); +void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 version, u32 language); +void SanitizeReceivedEmeraldOldMan(union OldMan * oldMan, u32 version, u32 language); void ResetMauvilleOldManFlag(void); #endif // GUARD_MAUVILLE_OLD_MAN_H diff --git a/include/menu.h b/include/menu.h index 9a940a48a..c38e87cbd 100644 --- a/include/menu.h +++ b/include/menu.h @@ -57,8 +57,8 @@ void DisplayYesNoMenuDefaultYes(void); u32 GetPlayerTextSpeed(void); u8 GetPlayerTextSpeedDelay(void); void Menu_LoadStdPalAt(u16 offset); -void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextPrinterTemplate *, u16)); -void BgDmaFill(u32 bg, u8 a1, int a2, int a3); +void AddTextPrinterWithCallbackForMessage(bool8 canSpeedUp, void (*callback)(struct TextPrinterTemplate *, u16)); +void BgDmaFill(u32 bg, u8 value, int offset, int size); void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str); void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram); void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock); @@ -69,7 +69,7 @@ u8 InitMenuInUpperLeftCornerNormal(u8 windowId, u8 numItems, u8 initialCursorPos u8 Menu_GetCursorPos(void); s8 Menu_ProcessInput(void); s8 Menu_ProcessInputNoWrap(void); -void BlitMenuInfoIcon(u8 winId, u8 a2, u16 x, u16 y); +void BlitMenuInfoIcon(u8 windowId, u8 iconId, u16 x, u16 y); void ResetTempTileDataBuffers(void); void *DecompressAndCopyTileDataToVram(u8 bgId, const void *src, u32 size, u16 offset, u8 mode); bool8 FreeTempTileDataBuffersIfPossible(void); @@ -81,14 +81,14 @@ s8 ProcessMenuInput_other(void); void DoScheduledBgTilemapCopiesToVram(void); void ClearScheduledBgCopiesToVram(void); void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str); -void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 a2, u8 a3); +void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileNum, u8 paletteNum); void PrintMenuActionTextsInUpperLeftCorner(u8 windowId, u8 optionsNo, const struct MenuAction *actions, const u8 *actionIds); void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram); void *malloc_and_decompress(const void *src, u32 *sizeOut); u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode); void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress); -void PrintMenuActionTexts(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8); -void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8); +void PrintMenuActionTexts(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds); +void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth, u8 horizontalCount, u8 verticalCount, const struct MenuAction *menuActions, const u8 *actionIds); u8 InitMenuActionGrid(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos); u8 ChangeMenuGridCursorPosition(s8 deltaX, s8 deltaY); u8 GetStartMenuWindowId(void); diff --git a/include/overworld.h b/include/overworld.h index b8794ea70..adaa6aad0 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -77,7 +77,7 @@ void SetWarpDestinationToMapWarp(s8 mapGroup, s8 mapNum, s8 warpId); void SetDynamicWarp(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId); void SetDynamicWarpWithCoords(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void SetWarpDestinationToDynamicWarp(u8 unused); -void SetWarpDestinationToHealLocation(u8 a1); +void SetWarpDestinationToHealLocation(u8 healLocationId); void SetWarpDestinationToLastHealLocation(void); void SetLastHealLocationWarp(u8 healLocationId); void UpdateEscapeWarp(s16 x, s16 y); @@ -86,7 +86,7 @@ void SetWarpDestinationToEscapeWarp(void); void SetFixedDiveWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void SetFixedHoleWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void SetWarpDestinationToFixedHoleWarp(s16 x, s16 y); -void SetContinueGameWarpToHealLocation(u8 a1); +void SetContinueGameWarpToHealLocation(u8 healLocationId); void SetContinueGameWarpToDynamicWarp(int unused); const struct MapConnection *GetMapConnection(u8 dir); bool8 SetDiveWarpEmerge(u16 x, u16 y); @@ -130,7 +130,7 @@ void CB1_Overworld(void); void CB2_OverworldBasic(void); void CB2_Overworld(void); void SetMainCallback1(void (*cb)(void)); -void SetUnusedCallback(void *a0); +void SetUnusedCallback(void *func); void CB2_NewGame(void); void CB2_WhiteOut(void); void CB2_LoadMap(void); diff --git a/include/pokeball.h b/include/pokeball.h index 297788db1..1149791b8 100644 --- a/include/pokeball.h +++ b/include/pokeball.h @@ -34,8 +34,8 @@ extern const struct SpriteTemplate gBallSpriteTemplates[]; #define POKEBALL_OPPONENT_SENDOUT 0xFE u8 DoPokeballSendOutAnimation(s16 pan, u8 kindOfThrow); -void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 battler, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 g, u32 h, u16 species); -u8 CreateTradePokeballSprite(u8 a, u8 b, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 g, u32 h); +void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 delay, u32 fadePalettes, u16 species); +u8 CreateTradePokeballSprite(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 delay, u32 fadePalettes); void StartHealthboxSlideIn(u8 battler); void DoHitAnimHealthboxEffect(u8 battler); void LoadBallGfx(u8 ballId); diff --git a/include/pokemon.h b/include/pokemon.h index 7885c2ac5..0da71e78e 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -381,11 +381,11 @@ u16 SpeciesToNationalPokedexNum(u16 species); u16 SpeciesToHoennPokedexNum(u16 species); u16 HoennToNationalOrder(u16 hoennNum); u16 SpeciesToCryId(u16 species); -void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, u8 a4); +void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, bool8 isFrontPic); void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies); u8 GetPlayerFlankId(void); u16 GetLinkTrainerFlankId(u8 id); -s32 GetBattlerMultiplayerId(u16 a1); +s32 GetBattlerMultiplayerId(u16 id); u8 GetTrainerEncounterMusicId(u16 trainerOpponentId); u16 ModifyStatByNature(u8 nature, u16 n, u8 statIndex); void AdjustFriendship(struct Pokemon *mon, u8 event); diff --git a/include/pokenav.h b/include/pokenav.h index 07beae957..593c68489 100644 --- a/include/pokenav.h +++ b/include/pokenav.h @@ -412,7 +412,7 @@ int GetNumberRegistered(void); struct PokenavMatchCallEntry *GetMatchCallList(void); u16 GetMatchCallMapSec(int); bool32 ShouldDrawRematchPokeballIcon(int index); -void ClearRematchPokeballIcon(u16 windowId, u32 a1); +void ClearRematchPokeballIcon(u16 windowId, u32 tileOffset); int GetMatchCallTrainerPic(int index); const u8 *GetMatchCallFlavorText(int index, int textType); const u8 *GetMatchCallMessageText(int index, bool8 *newRematchRequest); diff --git a/include/scanline_effect.h b/include/scanline_effect.h index 5bd8b5546..ae534d969 100644 --- a/include/scanline_effect.h +++ b/include/scanline_effect.h @@ -43,6 +43,6 @@ void ScanlineEffect_Stop(void); void ScanlineEffect_Clear(void); void ScanlineEffect_SetParams(struct ScanlineEffectParams); void ScanlineEffect_InitHBlankDmaTransfer(void); -u8 ScanlineEffect_InitWave(u8 startLine, u8 endLine, u8 frequency, u8 amplitude, u8 delayInterval, u8 regOffset, bool8 a7); +u8 ScanlineEffect_InitWave(u8 startLine, u8 endLine, u8 frequency, u8 amplitude, u8 delayInterval, u8 regOffset, bool8 applyBattleBgOffsets); #endif // GUARD_SCANLINE_EFFECT_H diff --git a/include/trade.h b/include/trade.h index a0cb320a8..27b5ee8bd 100644 --- a/include/trade.h +++ b/include/trade.h @@ -12,8 +12,8 @@ extern const struct WindowTemplate gTradeEvolutionSceneYesNoWindowTemplate; s32 GetGameProgressForLinkTrade(void); void CB2_StartCreateTradeMenu(void); void CB2_LinkTrade(void); -int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData a0, u16, u16, u8); -int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData a0, struct RfuGameCompatibilityData a1, u16 a2, u16 a3, u8 a4, u16 a5, u8 a6); +int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isEventLegal); +int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isEventLegal); int CanSpinTradeMon(struct Pokemon*, u16); void InitTradeSequenceBgGpuRegs(void); void LinkTradeDrawWindow(void); diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 76868342f..cd9cb8b30 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -128,7 +128,7 @@ static void AnimHornHit_Step(struct Sprite *); static void AnimSuperFang(struct Sprite *); static void AnimWavyMusicNotes(struct Sprite *); static void AnimWavyMusicNotes_Step(struct Sprite *); -static void AnimWavyMusicNotesGetNextPos(s16, s16, s16 *, s16 *, s8); +static void AnimWavyMusicNotes_CalcVelocity(s16, s16, s16 *, s16 *, s8); static void AnimFlyingMusicNotes(struct Sprite *); static void AnimFlyingMusicNotes_Step(struct Sprite *); static void AnimBellyDrumHand(struct Sprite *); @@ -5279,79 +5279,87 @@ void AnimTask_MusicNotesClearRainbowBlend(u8 taskId) DestroyAnimVisualTask(taskId); } +#define sMoveTimer data[0] +#define sBlendTableIdx data[1] +#define sBlendTimer data[2] +#define sBlendCycleTime data[3] +#define sX data[4] +#define sY data[5] +#define sVelocX data[6] +#define sVelocY data[7] + static void AnimWavyMusicNotes(struct Sprite* sprite) { u8 index; - u8 a; - u8 b; + u8 x, y; SetSpriteCoordsToAnimAttackerCoords(sprite); StartSpriteAnim(sprite, gBattleAnimArgs[0]); if ((index = IndexOfSpritePaletteTag(gParticlesColorBlendTable[gBattleAnimArgs[1]][0])) != 0xFF) sprite->oam.paletteNum = index; - sprite->data[1] = gBattleAnimArgs[1]; - sprite->data[2] = 0; - sprite->data[3] = gBattleAnimArgs[2]; + sprite->sBlendTableIdx = gBattleAnimArgs[1]; + sprite->sBlendTimer = 0; + sprite->sBlendCycleTime = gBattleAnimArgs[2]; if (IsContest()) { - a = 48; - b = 40; + x = 48; + y = 40; } else { - a = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); - b = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); + x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); } - sprite->data[4] = sprite->x << 4; - sprite->data[5] = sprite->y << 4; - AnimWavyMusicNotesGetNextPos(a - sprite->x, b - sprite->y, &sprite->data[6], &sprite->data[7], 40); + sprite->sX = sprite->x << 4; + sprite->sY = sprite->y << 4; + AnimWavyMusicNotes_CalcVelocity(x - sprite->x, y - sprite->y, &sprite->sVelocX, &sprite->sVelocY, 40); sprite->callback = AnimWavyMusicNotes_Step; } -static void AnimWavyMusicNotesGetNextPos(s16 a, s16 b, s16* c, s16* d, s8 e) +static void AnimWavyMusicNotes_CalcVelocity(s16 x, s16 y, s16* velocX, s16* velocY, s8 xSpeedFactor) { - int f; - int g; - if (a < 0) - e = -e; + int x2; + int time; + if (x < 0) + xSpeedFactor = -xSpeedFactor; - f = a << 8; - g = f / e; - if (g == 0) - g = 1; + x2 = x << 8; + time = x2 / xSpeedFactor; + if (time == 0) + time = 1; - *c = f / g; - *d = (b << 8) / g; + *velocX = x2 / time; + *velocY = (y << 8) / time; } static void AnimWavyMusicNotes_Step(struct Sprite* sprite) { - s16 y, yDelta; + s16 y, trigIdx; u8 index; - sprite->data[0]++; - yDelta = sprite->data[0] * 5 - ((sprite->data[0] * 5 / 256) << 8); - sprite->data[4] += sprite->data[6]; - sprite->data[5] += sprite->data[7]; - sprite->x = sprite->data[4] >> 4; - sprite->y = sprite->data[5] >> 4; - sprite->y2 = Sin(yDelta, 15); + sprite->sMoveTimer++; + trigIdx = sprite->sMoveTimer * 5 - ((sprite->sMoveTimer * 5 / 256) << 8); + sprite->sX += sprite->sVelocX; + sprite->sY += sprite->sVelocY; + sprite->x = sprite->sX >> 4; + sprite->y = sprite->sY >> 4; + sprite->y2 = Sin(trigIdx, 15); y = sprite->y; - if (sprite->x < -16 || sprite->x > 256 || y < -16 || y > 128) + if (sprite->x < -16 || sprite->x > DISPLAY_WIDTH + 16 || y < -16 || y > DISPLAY_HEIGHT - 32) { DestroySpriteAndMatrix(sprite); } else { - if (sprite->data[3] && ++sprite->data[2] > sprite->data[3]) + if (sprite->sBlendCycleTime && ++sprite->sBlendTimer > sprite->sBlendCycleTime) { - sprite->data[2] = 0; - if (++sprite->data[1] > 3) - sprite->data[1] = 0; + sprite->sBlendTimer = 0; + if (++sprite->sBlendTableIdx > (int)ARRAY_COUNT(gParticlesColorBlendTable) - 1) + sprite->sBlendTableIdx = 0; - index = IndexOfSpritePaletteTag(gParticlesColorBlendTable[sprite->data[1]][0]); + index = IndexOfSpritePaletteTag(gParticlesColorBlendTable[sprite->sBlendTableIdx][0]); if (index != 0xFF) sprite->oam.paletteNum = index; } @@ -5467,7 +5475,7 @@ void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite) static void AnimThoughtBubble(struct Sprite* sprite) { - u8 a; + u8 animNum; u8 battler; if (gBattleAnimArgs[0] == 0) battler = gBattleAnimAttacker; @@ -5475,10 +5483,10 @@ static void AnimThoughtBubble(struct Sprite* sprite) battler = gBattleAnimTarget; SetSpriteNextToMonHead(battler, sprite); - a = (GetBattlerSide(battler) == B_SIDE_PLAYER) ? 0 : 1; + animNum = (GetBattlerSide(battler) == B_SIDE_PLAYER) ? 0 : 1; sprite->data[0] = gBattleAnimArgs[1]; - sprite->data[1] = a + 2; - StartSpriteAnim(sprite, a); + sprite->data[1] = animNum + 2; + StartSpriteAnim(sprite, animNum); StoreSpriteCallbackInData6(sprite, AnimThoughtBubble_Step); sprite->callback = RunStoredCallbackWhenAnimEnds; } diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index fcd594db5..3b4f6729f 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -1213,7 +1213,7 @@ void AnimTask_SmokescreenImpact(u8 taskId) SmokescreenImpact( GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + 8, GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + 8, - 0); + FALSE); DestroyAnimVisualTask(taskId); } diff --git a/src/battle_anim_fire.c b/src/battle_anim_fire.c index 8ecb60713..b523a3771 100644 --- a/src/battle_anim_fire.c +++ b/src/battle_anim_fire.c @@ -26,18 +26,18 @@ static void AnimFireCross(struct Sprite *); static void AnimFireSpiralOutward(struct Sprite *); static void AnimFireSpiralOutward_Step1(struct Sprite *); static void AnimFireSpiralOutward_Step2(struct Sprite *); -static void AnimTask_EruptionLaunchRocks_Step(u8 taskId); -static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 a3); +static void AnimTask_EruptionLaunchRocks_Step(u8); +static void CreateEruptionLaunchRocks(u8, u8, u8); static void AnimEruptionLaunchRock(struct Sprite *); -static u16 GetEruptionLaunchRockInitialYPos(u8 spriteId); -static void InitEruptionLaunchRockCoordData(struct Sprite *sprite, s16 x, s16 y); +static u16 GetEruptionLaunchRockInitialYPos(u8); +static void InitEruptionLaunchRockCoordData(struct Sprite *, s16, s16); static void UpdateEruptionLaunchRockPos(struct Sprite *); static void AnimEruptionFallingRock(struct Sprite *); static void AnimEruptionFallingRock_Step(struct Sprite *); static void AnimWillOWispOrb(struct Sprite *); static void AnimWillOWispOrb_Step(struct Sprite *); static void AnimWillOWispFire(struct Sprite *); -static void AnimTask_MoveHeatWaveTargets_Step(u8 taskId); +static void AnimTask_MoveHeatWaveTargets_Step(u8); static const union AnimCmd sAnim_FireSpiralSpread_0[] = { @@ -355,7 +355,7 @@ const struct SpriteTemplate gEruptionLaunchRockSpriteTemplate = .callback = AnimEruptionLaunchRock, }; -static const s16 sEruptionLaunchRockCoords[][2] = +static const s16 sEruptionLaunchRockSpeeds[][2] = { {-2, -5}, {-1, -1}, @@ -770,22 +770,43 @@ static void AnimFireSpiralOutward_Step2(struct Sprite *sprite) DestroyAnimSprite(sprite); } +#define IDX_ACTIVE_SPRITES 6 // Used by the sprite callback to modify the number of active sprites + +#define tState data[0] +#define tTimer1 data[1] +#define tTimer2 data[2] +#define tTimer3 data[3] +#define tAttackerY data[4] +#define tAttackerSide data[5] +#define tActiveSprites data[IDX_ACTIVE_SPRITES] +// data[8]-data[15] used by PrepareEruptAnimTaskData / UpdateEruptAnimTask +#define tAttackerSpriteId data[15] + +#define sSpeedDelay data[0] +#define sLaunchStage data[1] +#define sX data[2] +#define sY data[3] +#define sSpeedX data[4] +#define sSpeedY data[5] +#define sTaskId data[6] +#define sActiveSpritesIdx data[7] + // Animates first stage of Eruption where the attacker squishes and launches rocks away from themself void AnimTask_EruptionLaunchRocks(u8 taskId) { struct Task *task = &gTasks[taskId]; - task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER); + task->tAttackerSpriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); - task->data[0] = 0; - task->data[1] = 0; - task->data[2] = 0; - task->data[3] = 0; - task->data[4] = gSprites[task->data[15]].y; - task->data[5] = GetBattlerSide(gBattleAnimAttacker); - task->data[6] = 0; + task->tState = 0; + task->tTimer1 = 0; + task->tTimer2 = 0; + task->tTimer3 = 0; + task->tAttackerY = gSprites[task->tAttackerSpriteId].y; + task->tAttackerSide = GetBattlerSide(gBattleAnimAttacker); + task->tActiveSprites = 0; - PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL); + PrepareBattlerSpriteForRotScale(task->tAttackerSpriteId, ST_OAM_OBJ_NORMAL); task->func = AnimTask_EruptionLaunchRocks_Step; } @@ -794,102 +815,102 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) { struct Task *task = &gTasks[taskId]; - switch (task->data[0]) + switch (task->tState) { case 0: - PrepareEruptAnimTaskData(task, task->data[15], 0x100, 0x100, 0xE0, 0x200, 32); - task->data[0]++; + PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0x100, 0x100, 0xE0, 0x200, 32); + task->tState++; case 1: - if (++task->data[1] > 1) + if (++task->tTimer1 > 1) { - task->data[1] = 0; + task->tTimer1 = 0; - if (++task->data[2] & 0x1) - gSprites[task->data[15]].x2 = 3; + if (++task->tTimer2 & 1) + gSprites[task->tAttackerSpriteId].x2 = 3; else - gSprites[task->data[15]].x2 = -3; + gSprites[task->tAttackerSpriteId].x2 = -3; } - if (task->data[5] != B_SIDE_PLAYER) + if (task->tAttackerSide != B_SIDE_PLAYER) { - if (++task->data[3] > 4) + if (++task->tTimer3 > 4) { - task->data[3] = 0; - gSprites[task->data[15]].y++; + task->tTimer3 = 0; + gSprites[task->tAttackerSpriteId].y++; } } if(!UpdateEruptAnimTask(task)) { - SetBattlerSpriteYOffsetFromYScale(task->data[15]); - gSprites[task->data[15]].x2 = 0; + SetBattlerSpriteYOffsetFromYScale(task->tAttackerSpriteId); + gSprites[task->tAttackerSpriteId].x2 = 0; - task->data[1] = 0; - task->data[2] = 0; - task->data[3] = 0; - task->data[0]++; + task->tTimer1 = 0; + task->tTimer2 = 0; + task->tTimer3 = 0; + task->tState++; } break; case 2: - if (++task->data[1] > 4) + if (++task->tTimer1 > 4) { - if (task->data[5] != B_SIDE_PLAYER) - PrepareEruptAnimTaskData(task, task->data[15], 0xE0, 0x200, 0x180, 0xF0, 6); + if (task->tAttackerSide != B_SIDE_PLAYER) + PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0xE0, 0x200, 0x180, 0xF0, 6); else - PrepareEruptAnimTaskData(task, task->data[15], 0xE0, 0x200, 0x180, 0xC0, 6); + PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0xE0, 0x200, 0x180, 0xC0, 6); - task->data[1] = 0; - task->data[0]++; + task->tTimer1 = 0; + task->tState++; } break; case 3: if (!UpdateEruptAnimTask(task)) { - CreateEruptionLaunchRocks(task->data[15], taskId, 6); - task->data[0]++; + CreateEruptionLaunchRocks(task->tAttackerSpriteId, taskId, IDX_ACTIVE_SPRITES); + task->tState++; } break; case 4: - if (++task->data[1] > 1) + if (++task->tTimer1 > 1) { - task->data[1] = 0; + task->tTimer1 = 0; - if (++task->data[2] & 1) - gSprites[task->data[15]].y2 += 3; + if (++task->tTimer2 & 1) + gSprites[task->tAttackerSpriteId].y2 += 3; else - gSprites[task->data[15]].y2 -= 3; + gSprites[task->tAttackerSpriteId].y2 -= 3; } - if (++task->data[3] > 0x18) + if (++task->tTimer3 > 24) { - if (task->data[5] != B_SIDE_PLAYER) - PrepareEruptAnimTaskData(task, task->data[15], 0x180, 0xF0, 0x100, 0x100, 8); + if (task->tAttackerSide != B_SIDE_PLAYER) + PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0x180, 0xF0, 0x100, 0x100, 8); else - PrepareEruptAnimTaskData(task, task->data[15], 0x180, 0xC0, 0x100, 0x100, 8); + PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0x180, 0xC0, 0x100, 0x100, 8); - if (task->data[2] & 1) - gSprites[task->data[15]].y2 -= 3; + if (task->tTimer2 & 1) + gSprites[task->tAttackerSpriteId].y2 -= 3; - task->data[1] = 0; - task->data[2] = 0; - task->data[3] = 0; - task->data[0]++; + task->tTimer1 = 0; + task->tTimer2 = 0; + task->tTimer3 = 0; + task->tState++; } break; case 5: - if (task->data[5] != B_SIDE_PLAYER) - gSprites[task->data[15]].y--; + if (task->tAttackerSide != B_SIDE_PLAYER) + gSprites[task->tAttackerSpriteId].y--; if (!UpdateEruptAnimTask(task)) { - gSprites[task->data[15]].y = task->data[4]; - ResetSpriteRotScale(task->data[15]); - task->data[2] = 0; - task->data[0]++; + gSprites[task->tAttackerSpriteId].y = task->tAttackerY; + ResetSpriteRotScale(task->tAttackerSpriteId); + task->tTimer2 = 0; + task->tState++; } break; case 6: - if (!task->data[6]) + if (task->tActiveSprites == 0) DestroyAnimVisualTask(taskId); break; default: @@ -897,7 +918,7 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) } } -static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 a3) +static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 activeSpritesIdx) { u16 i, j; s8 sign; @@ -907,12 +928,12 @@ static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 a3) if(!GetBattlerSide(gBattleAnimAttacker)) { - x -= 0xC; + x -= 12; sign = 1; } else { - x += 0x10; + x += 16; sign = -1; } @@ -920,18 +941,18 @@ static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 a3) { u8 spriteId = CreateSprite(&gEruptionLaunchRockSpriteTemplate, x, y, 2); - if (spriteId != 0x40) + if (spriteId != MAX_SPRITES) { gSprites[spriteId].oam.tileNum += j * 4 + 0x40; if (++j >= 5) j = 0; - InitEruptionLaunchRockCoordData(&gSprites[spriteId], sEruptionLaunchRockCoords[i][0] * sign, sEruptionLaunchRockCoords[i][1]); - gSprites[spriteId].data[6] = taskId; - gSprites[spriteId].data[7] = a3; + InitEruptionLaunchRockCoordData(&gSprites[spriteId], sEruptionLaunchRockSpeeds[i][0] * sign, sEruptionLaunchRockSpeeds[i][1]); + gSprites[spriteId].sTaskId = taskId; + gSprites[spriteId].sActiveSpritesIdx = activeSpritesIdx; - gTasks[taskId].data[a3]++; + gTasks[taskId].data[activeSpritesIdx]++; } } } @@ -942,7 +963,7 @@ static void AnimEruptionLaunchRock(struct Sprite *sprite) if (sprite->invisible) { - gTasks[sprite->data[6]].data[sprite->data[7]]--; + gTasks[sprite->sTaskId].data[sprite->sActiveSpritesIdx]--; DestroySprite(sprite); } } @@ -959,46 +980,71 @@ static u16 GetEruptionLaunchRockInitialYPos(u8 spriteId) return y; } -static void InitEruptionLaunchRockCoordData(struct Sprite *sprite, s16 x, s16 y) +static void InitEruptionLaunchRockCoordData(struct Sprite *sprite, s16 speedX, s16 speedY) { - sprite->data[0] = 0; - sprite->data[1] = 0; - sprite->data[2] = (u16)sprite->x * 8; - sprite->data[3] = (u16)sprite->y * 8; - sprite->data[4] = x * 8; - sprite->data[5] = y * 8; + sprite->sSpeedDelay = 0; + sprite->sLaunchStage = 0; + sprite->sX = (u16)sprite->x * 8; + sprite->sY = (u16)sprite->y * 8; + sprite->sSpeedX = speedX * 8; + sprite->sSpeedY = speedY * 8; } static void UpdateEruptionLaunchRockPos(struct Sprite *sprite) { - int var1; - if (++sprite->data[0] > 2) + int extraLaunchSpeed; + if (++sprite->sSpeedDelay > 2) { - sprite->data[0] = 0; - ++sprite->data[1]; - var1 = (u16)sprite->data[1] * (u16)sprite->data[1]; - sprite->data[3] += var1; + sprite->sSpeedDelay = 0; + ++sprite->sLaunchStage; + extraLaunchSpeed = (u16)sprite->sLaunchStage * (u16)sprite->sLaunchStage; + sprite->sY += extraLaunchSpeed; } - sprite->data[2] += sprite->data[4]; - sprite->x = sprite->data[2] >> 3; - sprite->data[3] += sprite->data[5]; - sprite->y = sprite->data[3] >> 3; + sprite->sX += sprite->sSpeedX; + sprite->x = sprite->sX >> 3; + sprite->sY += sprite->sSpeedY; + sprite->y = sprite->sY >> 3; - if (sprite->x < -8 || sprite->x > 0xf8 || sprite->y < -8 || sprite->y > 120) + if (sprite->x < -8 || sprite->x > DISPLAY_WIDTH + 8 || sprite->y < -8 || sprite->y > 120) sprite->invisible = TRUE; } +#undef IDX_ACTIVE_SPRITES +#undef tState +#undef tTimer1 +#undef tTimer2 +#undef tTimer3 +#undef tAttackerY +#undef tAttackerSide +#undef tActiveSprites +#undef tAttackerSpriteId +#undef sSpeedDelay +#undef sLaunchStage +#undef sX +#undef sY +#undef sSpeedX +#undef sSpeedY +#undef sTaskId +#undef sActiveSpritesIdx + +#define sState data[0] +#define sBounceTimer data[1] +#define sBounceDir data[2] +#define sEndTimer data[3] +#define sFallDelay data[6] +#define sTargetY data[7] + static void AnimEruptionFallingRock(struct Sprite *sprite) { sprite->x = gBattleAnimArgs[0]; sprite->y = gBattleAnimArgs[1]; - sprite->data[0] = 0; - sprite->data[1] = 0; - sprite->data[2] = 0; - sprite->data[6] = gBattleAnimArgs[2]; - sprite->data[7] = gBattleAnimArgs[3]; + sprite->sState = 0; + sprite->sBounceTimer = 0; + sprite->sBounceDir = 0; + sprite->sFallDelay = gBattleAnimArgs[2]; + sprite->sTargetY = gBattleAnimArgs[3]; sprite->oam.tileNum += gBattleAnimArgs[4] * 16; sprite->callback = AnimEruptionFallingRock_Step; @@ -1006,47 +1052,51 @@ static void AnimEruptionFallingRock(struct Sprite *sprite) static void AnimEruptionFallingRock_Step(struct Sprite *sprite) { - switch (sprite->data[0]) + switch (sprite->sState) { case 0: - if (sprite->data[6] != 0) + // Wait to begin falling + if (sprite->sFallDelay != 0) { - sprite->data[6]--; + sprite->sFallDelay--; return; } - sprite->data[0]++; + sprite->sState++; // fall through case 1: + // Rock is falling sprite->y += 8; - if (sprite->y >= sprite->data[7]) + if (sprite->y >= sprite->sTargetY) { - sprite->y = sprite->data[7]; - sprite->data[0]++; + sprite->y = sprite->sTargetY; + sprite->sState++; } break; case 2: - if (++sprite->data[1] > 1) + // Bounce up and down on landing spot + if (++sprite->sBounceTimer > 1) { - sprite->data[1] = 0; - if ((++sprite->data[2] & 1) != 0) - { + sprite->sBounceTimer = 0; + if ((++sprite->sBounceDir & 1) != 0) sprite->y2 = -3; - } else - { sprite->y2 = 3; - } } - if (++sprite->data[3] > 16) - { + if (++sprite->sEndTimer > 16) DestroyAnimSprite(sprite); - } break; } } +#undef sState +#undef sBounceTimer +#undef sBounceDir +#undef sEndTimer +#undef sFallDelay +#undef sTargetY + static void AnimWillOWispOrb(struct Sprite *sprite) { switch (sprite->data[0]) diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index cee50df3f..2fbe858d7 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -1365,14 +1365,14 @@ void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite) CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); } -static u16 ArcTan2_(s16 a, s16 b) +static u16 ArcTan2_(s16 x, s16 y) { - return ArcTan2(a, b); + return ArcTan2(x, y); } -u16 ArcTan2Neg(s16 a, s16 b) +u16 ArcTan2Neg(s16 x, s16 y) { - u16 var = ArcTan2_(a, b); + u16 var = ArcTan2_(x, y); return -var; } diff --git a/src/battle_anim_psychic.c b/src/battle_anim_psychic.c index a7faa7658..aebf76cc0 100644 --- a/src/battle_anim_psychic.c +++ b/src/battle_anim_psychic.c @@ -583,9 +583,9 @@ static void AnimWallSparkle(struct Sprite *sprite) { if (sprite->data[0] == 0) { - int arg3 = gBattleAnimArgs[3]; + bool32 ignoreOffsets = gBattleAnimArgs[3]; bool8 respectMonPicOffsets = FALSE; - if (arg3 == 0) + if (!ignoreOffsets) respectMonPicOffsets = TRUE; if (!IsContest() && IsDoubleBattle()) diff --git a/src/battle_anim_smokescreen.c b/src/battle_anim_smokescreen.c index 0819796d2..c7be8d41c 100644 --- a/src/battle_anim_smokescreen.c +++ b/src/battle_anim_smokescreen.c @@ -7,8 +7,13 @@ #include "util.h" #include "constants/battle_palace.h" -static void SmokescreenImpact_Callback(struct Sprite *); -static void SpriteCB_DestroySprite(struct Sprite *sprite); +#define TAG_SMOKESCREEN 55019 + +#define PALTAG_SHADOW 55039 +#define GFXTAG_SHADOW 55129 + +static void SpriteCB_SmokescreenImpactMain(struct Sprite *); +static void SpriteCB_SmokescreenImpact(struct Sprite *); // The below data for smokescreen starts and ends with some data that belongs to battle_gfx_sfx_util.c @@ -43,12 +48,12 @@ const u8 gBattlePalaceNatureToMoveTarget[NUM_NATURES] = static const struct CompressedSpriteSheet sSmokescreenImpactSpriteSheet = { - .data = gSmokescreenImpactTiles, .size = 0x180, .tag = 55019 + .data = gSmokescreenImpactTiles, .size = 0x180, .tag = TAG_SMOKESCREEN }; static const struct CompressedSpritePalette sSmokescreenImpactSpritePalette = { - .data = gSmokescreenImpactPalette, .tag = 55019 + .data = gSmokescreenImpactPalette, .tag = TAG_SMOKESCREEN }; static const struct OamData sOamData_SmokescreenImpact = @@ -110,18 +115,18 @@ static const union AnimCmd *const sAnims_SmokescreenImpact[] = static const struct SpriteTemplate sSmokescreenImpactSpriteTemplate = { - .tileTag = 55019, - .paletteTag = 55019, + .tileTag = TAG_SMOKESCREEN, + .paletteTag = TAG_SMOKESCREEN, .oam = &sOamData_SmokescreenImpact, .anims = sAnims_SmokescreenImpact, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = SpriteCB_DestroySprite + .callback = SpriteCB_SmokescreenImpact }; const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow = { - .data = gEnemyMonShadow_Gfx, .size = 0x80, .tag = 55129 + .data = gEnemyMonShadow_Gfx, .size = 0x80, .tag = GFXTAG_SHADOW }; static const struct OamData sOamData_EnemyShadow = @@ -143,8 +148,8 @@ static const struct OamData sOamData_EnemyShadow = const struct SpriteTemplate gSpriteTemplate_EnemyShadow = { - .tileTag = 55129, - .paletteTag = 55039, + .tileTag = GFXTAG_SHADOW, + .paletteTag = PALTAG_SHADOW, .oam = &sOamData_EnemyShadow, .anims = gDummySpriteAnimTable, .images = NULL, @@ -152,7 +157,12 @@ const struct SpriteTemplate gSpriteTemplate_EnemyShadow = .callback = SpriteCB_SetInvisible }; -u8 SmokescreenImpact(s16 x, s16 y, u8 a3) +#define sActiveSprites data[0] +#define sPersist data[1] + +#define sMainSpriteId data[0] + +u8 SmokescreenImpact(s16 x, s16 y, bool8 persist) { u8 mainSpriteId; u8 spriteId1, spriteId2, spriteId3, spriteId4; @@ -164,54 +174,58 @@ u8 SmokescreenImpact(s16 x, s16 y, u8 a3) LoadCompressedSpritePaletteUsingHeap(&sSmokescreenImpactSpritePalette); } - mainSpriteId = CreateInvisibleSpriteWithCallback(SmokescreenImpact_Callback); + mainSpriteId = CreateInvisibleSpriteWithCallback(SpriteCB_SmokescreenImpactMain); mainSprite = &gSprites[mainSpriteId]; - mainSprite->data[1] = a3; + mainSprite->sPersist = persist; + // Top left sprite spriteId1 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x - 16, y - 16, 2); - gSprites[spriteId1].data[0] = mainSpriteId; - mainSprite->data[0]++; + gSprites[spriteId1].sMainSpriteId = mainSpriteId; + mainSprite->sActiveSprites++; AnimateSprite(&gSprites[spriteId1]); + // Top right sprite spriteId2 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x, y - 16, 2); - gSprites[spriteId2].data[0] = mainSpriteId; - mainSprite->data[0]++; + gSprites[spriteId2].sMainSpriteId = mainSpriteId; + mainSprite->sActiveSprites++; StartSpriteAnim(&gSprites[spriteId2], 1); AnimateSprite(&gSprites[spriteId2]); + // Bottom left sprite spriteId3 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x - 16, y, 2); - gSprites[spriteId3].data[0] = mainSpriteId; - mainSprite->data[0]++; + gSprites[spriteId3].sMainSpriteId = mainSpriteId; + mainSprite->sActiveSprites++; StartSpriteAnim(&gSprites[spriteId3], 2); AnimateSprite(&gSprites[spriteId3]); + // Bottom right sprite spriteId4 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x, y, 2); - gSprites[spriteId4].data[0] = mainSpriteId; - mainSprite->data[0]++; + gSprites[spriteId4].sMainSpriteId = mainSpriteId; + mainSprite->sActiveSprites++; StartSpriteAnim(&gSprites[spriteId4], 3); AnimateSprite(&gSprites[spriteId4]); return mainSpriteId; } -static void SmokescreenImpact_Callback(struct Sprite *sprite) +static void SpriteCB_SmokescreenImpactMain(struct Sprite *sprite) { - if (!sprite->data[0]) + if (sprite->sActiveSprites == 0) { FreeSpriteTilesByTag(sSmokescreenImpactSpriteSheet.tag); FreeSpritePaletteByTag(sSmokescreenImpactSpritePalette.tag); - if (!sprite->data[1]) + if (!sprite->sPersist) DestroySprite(sprite); else sprite->callback = SpriteCallbackDummy; } } -static void SpriteCB_DestroySprite(struct Sprite *sprite) +static void SpriteCB_SmokescreenImpact(struct Sprite *sprite) { if (sprite->animEnded) { - gSprites[sprite->data[0]].data[0]--; + gSprites[sprite->sMainSpriteId].sActiveSprites--; DestroySprite(sprite); } } diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c index fa06f1a1c..2f095a043 100755 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -2018,24 +2018,24 @@ static void DestroyBallOpenAnimationParticle(struct Sprite *sprite) #define tPaletteHi data[11] #define tBallId data[15] -u8 LaunchBallFadeMonTask(bool8 unfadeLater, u8 battler, u32 selectedPalettes, u8 ballId) +u8 LaunchBallFadeMonTask(bool8 unfadeLater, u8 spritePalNum, u32 selectedPalettes, u8 ballId) { u8 taskId; taskId = CreateTask(Task_FadeMon_ToBallColor, 5); gTasks[taskId].tBallId = ballId; - gTasks[taskId].tPalOffset = battler; + gTasks[taskId].tPalOffset = spritePalNum; gTasks[taskId].tPaletteLo = selectedPalettes; gTasks[taskId].tPaletteHi = selectedPalettes >> 16; if (!unfadeLater) { - BlendPalette(battler * 16 + 0x100, 16, 0, gBallOpenFadeColors[ballId]); + BlendPalette(spritePalNum * 16 + 0x100, 16, 0, gBallOpenFadeColors[ballId]); gTasks[taskId].tdCoeff = 1; } else { - BlendPalette(battler * 16 + 0x100, 16, 16, gBallOpenFadeColors[ballId]); + BlendPalette(spritePalNum * 16 + 0x100, 16, 16, gBallOpenFadeColors[ballId]); gTasks[taskId].tCoeff = 16; gTasks[taskId].tdCoeff = -1; gTasks[taskId].func = Task_FadeMon_ToNormal; diff --git a/src/battle_dome.c b/src/battle_dome.c index c9614e6fc..2f86e707d 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -73,12 +73,16 @@ struct TourneyTreeLineSection #define tMode data[2] #define tPrevTaskId data[3] +#define EFFECTIVENESS_MODE_GOOD 0 +#define EFFECTIVENESS_MODE_BAD 1 +#define EFFECTIVENESS_MODE_AI_VS_AI 2 + static u8 GetDomeTrainerMonIvs(u16); static void SwapDomeTrainers(int, int, u16 *); static void CalcDomeMonStats(u16, int, int, u8, u8, int *); static void CreateDomeOpponentMons(u16); -static int SelectOpponentMonsUsingPersonality(u16, bool8); -static int SelectOpponentMonsUsingOtId(u16, bool8); +static int SelectOpponentMons_Good(u16, bool8); +static int SelectOpponentMons_Bad(u16, bool8); static int GetTypeEffectivenessPoints(int, int, int); static int SelectOpponentMonsFromParty(int *, bool8); static void Task_ShowTourneyInfoCard(u8); @@ -2589,28 +2593,33 @@ static void CreateDomeOpponentMons(u16 tournamentTrainerId) } } +// Returns a bitmask representing which 2 of the trainer's 3 pokemon to select. +// The choice is calculated solely depending on the type effectiveness of their +// movesets against the player's pokemon. +// There is a 50% chance of either a "good" or "bad" selection mode being used. +// In the good mode movesets are preferred which are more effective against the +// player, and in the bad mode the opposite is true. If all 3 pokemon tie, the +// other mode will be tried. If they tie again, the pokemon selection is random. int GetDomeTrainerSelectedMons(u16 tournamentTrainerId) { int selectedMonBits; if (Random() & 1) { - selectedMonBits = SelectOpponentMonsUsingPersonality(tournamentTrainerId, FALSE); + selectedMonBits = SelectOpponentMons_Good(tournamentTrainerId, FALSE); if (selectedMonBits == 0) - selectedMonBits = SelectOpponentMonsUsingOtId(tournamentTrainerId, TRUE); + selectedMonBits = SelectOpponentMons_Bad(tournamentTrainerId, TRUE); } else { - selectedMonBits = SelectOpponentMonsUsingOtId(tournamentTrainerId, FALSE); + selectedMonBits = SelectOpponentMons_Bad(tournamentTrainerId, FALSE); if (selectedMonBits == 0) - selectedMonBits = SelectOpponentMonsUsingPersonality(tournamentTrainerId, TRUE); + selectedMonBits = SelectOpponentMons_Good(tournamentTrainerId, TRUE); } return selectedMonBits; } -// Could probably use a better name once GetTypeEffectivenessPoints is clarified -// Personality seems to be used to select a different weighting system for type effectiveness points -static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 allowRandom) +static int SelectOpponentMons_Good(u16 tournamentTrainerId, bool8 allowRandom) { int i, moveId, playerMonId; int partyMovePoints[FRONTIER_PARTY_SIZE]; @@ -2625,12 +2634,12 @@ static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 all if (DOME_TRAINERS[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN) { partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveId), - GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), MON_DATA_PERSONALITY); + GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_GOOD); } else { partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveId], - GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), MON_DATA_PERSONALITY); + GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_GOOD); } } } @@ -2638,8 +2647,8 @@ static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 all return SelectOpponentMonsFromParty(partyMovePoints, allowRandom); } -// See above function, identical but uses MON_DATA_OT_ID -static int SelectOpponentMonsUsingOtId(u16 tournamentTrainerId, bool8 allowRandom) +// Identical to function above, but uses EFFECTIVENESS_MODE_BAD +static int SelectOpponentMons_Bad(u16 tournamentTrainerId, bool8 allowRandom) { int i, moveId, playerMonId; int partyMovePoints[FRONTIER_PARTY_SIZE]; @@ -2654,12 +2663,12 @@ static int SelectOpponentMonsUsingOtId(u16 tournamentTrainerId, bool8 allowRando if (DOME_TRAINERS[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN) { partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveId), - GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), MON_DATA_OT_ID); + GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_BAD); } else { partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveId], - GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), MON_DATA_OT_ID); + GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_BAD); } } } @@ -2732,7 +2741,7 @@ static int SelectOpponentMonsFromParty(int *partyMovePoints, bool8 allowRandom) #define TYPE_x2 40 #define TYPE_x4 80 -static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2) +static int GetTypeEffectivenessPoints(int move, int targetSpecies, int mode) { int defType1, defType2, defAbility, moveType; int i = 0; @@ -2748,11 +2757,20 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2) if (defAbility == ABILITY_LEVITATE && moveType == TYPE_GROUND) { - if (arg2 == 1) + // They likely meant to return here, as 8 is the number of points normally used in this mode for moves with no effect. + // Because there's no return the value instead gets interpreted by the switch, and the number of points becomes 0. + if (mode == EFFECTIVENESS_MODE_BAD) + { typePower = 8; + #ifdef BUGFIX + return; + #endif + } } else { + // Calculate a "type power" value to determine the benefit of using this type move against the target. + // This value will then be used to get the number of points to assign to the move. while (TYPE_EFFECT_ATK_TYPE(i) != TYPE_ENDTABLE) { if (TYPE_EFFECT_ATK_TYPE(i) == TYPE_FORESIGHT) @@ -2764,33 +2782,30 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2) { // BUG: the value of TYPE_x2 does not exist in gTypeEffectiveness, so if defAbility is ABILITY_WONDER_GUARD, the conditional always fails #ifndef BUGFIX - if (TYPE_EFFECT_DEF_TYPE(i) == defType1) - if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_x2) || defAbility != ABILITY_WONDER_GUARD) - typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10; - if (TYPE_EFFECT_DEF_TYPE(i) == defType2 && defType1 != defType2) - if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_x2) || defAbility != ABILITY_WONDER_GUARD) - typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10; + #define WONDER_GUARD_EFFECTIVENESS TYPE_x2 #else + #define WONDER_GUARD_EFFECTIVENESS TYPE_MUL_SUPER_EFFECTIVE + #endif if (TYPE_EFFECT_DEF_TYPE(i) == defType1) - if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE) || defAbility != ABILITY_WONDER_GUARD) + if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == WONDER_GUARD_EFFECTIVENESS) || defAbility != ABILITY_WONDER_GUARD) typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10; if (TYPE_EFFECT_DEF_TYPE(i) == defType2 && defType1 != defType2) - if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE) || defAbility != ABILITY_WONDER_GUARD) + if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == WONDER_GUARD_EFFECTIVENESS) || defAbility != ABILITY_WONDER_GUARD) typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10; - #endif } i += 3; } } - switch (arg2) + switch (mode) { - case 0: + case EFFECTIVENESS_MODE_GOOD: + // Weights moves that more effective. switch (typePower) { - case TYPE_x0_50: - case TYPE_x0_25: case TYPE_x0: + case TYPE_x0_25: + case TYPE_x0_50: default: typePower = 0; break; @@ -2805,22 +2820,24 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2) break; } break; - case 1: + case EFFECTIVENESS_MODE_BAD: + // Weights moves that are less effective. + // Odd that there's no limit on this being used, even the Frontier Brain could end up using this. switch (typePower) { - default: - case TYPE_x1: - typePower = 0; + case TYPE_x0: + typePower = 8; break; case TYPE_x0_25: typePower = 4; break; - case TYPE_x0: - typePower = 8; - break; case TYPE_x0_50: typePower = 2; break; + default: + case TYPE_x1: + typePower = 0; + break; case TYPE_x2: typePower = -2; break; @@ -2829,7 +2846,9 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2) break; } break; - case 2: + case EFFECTIVENESS_MODE_AI_VS_AI: + // Used as part of calculating the winner in a battle between two AIs. + // Weights moves that are more effective much more strongly in both directions. switch (typePower) { case TYPE_x0: @@ -5987,7 +6006,7 @@ static void DecideRoundWinners(u8 roundId) for (monId2 = 0; monId2 < FRONTIER_PARTY_SIZE; monId2++) { points1 += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentId1][monId1]].moves[moveSlot], - gFacilityTrainerMons[DOME_MONS[tournamentId2][monId2]].species, 2); + gFacilityTrainerMons[DOME_MONS[tournamentId2][monId2]].species, EFFECTIVENESS_MODE_AI_VS_AI); } } species = gFacilityTrainerMons[DOME_MONS[tournamentId1][monId1]].species; @@ -6010,7 +6029,7 @@ static void DecideRoundWinners(u8 roundId) for (monId2 = 0; monId2 < FRONTIER_PARTY_SIZE; monId2++) { points2 += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentId2][monId1]].moves[moveSlot], - gFacilityTrainerMons[DOME_MONS[tournamentId1][monId2]].species, 2); + gFacilityTrainerMons[DOME_MONS[tournamentId1][monId2]].species, EFFECTIVENESS_MODE_AI_VS_AI); } } species = gFacilityTrainerMons[DOME_MONS[tournamentId2][monId1]].species; diff --git a/src/battle_interface.c b/src/battle_interface.c index 6d869df78..dbcab4a9c 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -817,8 +817,8 @@ static void Debug_DrawNumber(s16 number, u16 *dest, bool8 unk) static void Debug_DrawNumberPair(s16 number1, s16 number2, u16 *dest) { dest[4] = 0x1E; - Debug_DrawNumber(number2, dest, 0); - Debug_DrawNumber(number1, dest + 5, 1); + Debug_DrawNumber(number2, dest, FALSE); + Debug_DrawNumber(number1, dest + 5, TRUE); } // Because the healthbox is too large to fit into one sprite, it is divided into two sprites. @@ -1420,7 +1420,7 @@ void SwapHpBarsWithHpText(void) #define tIsBattleStart data[10] #define tBlend data[15] -u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart) +u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo, bool8 skipPlayer, bool8 isBattleStart) { bool8 isOpponent; s16 bar_X, bar_Y, bar_pos2_X, bar_data0; @@ -1429,7 +1429,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo, u8 ballIconSpritesIds[PARTY_SIZE]; u8 taskId; - if (!arg2 || GetBattlerPosition(battlerId) != B_POSITION_OPPONENT_RIGHT) + if (!skipPlayer || GetBattlerPosition(battlerId) != B_POSITION_OPPONENT_RIGHT) { if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) { @@ -1442,7 +1442,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo, { isOpponent = TRUE; - if (!arg2 || !IsDoubleBattle()) + if (!skipPlayer || !IsDoubleBattle()) bar_X = 104, bar_Y = 40; else bar_X = 104, bar_Y = 16; @@ -2383,7 +2383,7 @@ static s32 CalcNewBarValue(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *c return ret; } -static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *currValue, u8 *arg4, u8 scale) +static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *currValue, u8 *pixelsArray, u8 scale) { u8 pixels, filledPixels, totalPixels; u8 i; @@ -2397,7 +2397,7 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 totalPixels = scale * 8; for (i = 0; i < scale; i++) - arg4[i] = 0; + pixelsArray[i] = 0; if (maxValue < totalPixels) pixels = (*currValue * totalPixels / maxValue) >> 8; @@ -2408,7 +2408,7 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 if (filledPixels == 0 && newValue > 0) { - arg4[0] = 1; + pixelsArray[0] = 1; filledPixels = 1; } else @@ -2417,11 +2417,11 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 { if (pixels >= 8) { - arg4[i] = 8; + pixelsArray[i] = 8; } else { - arg4[i] = pixels; + pixelsArray[i] = pixels; break; } pixels -= 8; @@ -2433,7 +2433,7 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 // Unused // These two functions seem as if they were made for testing the health bar. -static s16 Debug_TestHealthBar(struct TestingBar *barInfo, s32 *currValue, u16 *arg2, s32 arg3) +static s16 Debug_TestHealthBar(struct TestingBar *barInfo, s32 *currValue, u16 *dest, s32 unused) { s16 ret, var; @@ -2441,29 +2441,29 @@ static s16 Debug_TestHealthBar(struct TestingBar *barInfo, s32 *currValue, u16 * barInfo->oldValue, barInfo->receivedValue, currValue, B_HEALTHBAR_PIXELS / 8, 1); - Debug_TestHealthBar_Helper(barInfo, currValue, arg2); + Debug_TestHealthBar_Helper(barInfo, currValue, dest); if (barInfo->maxValue < B_HEALTHBAR_PIXELS) var = *currValue >> 8; else var = *currValue; - DummiedOutFunction(barInfo->maxValue, var, arg3); + DummiedOutFunction(barInfo->maxValue, var, unused); return ret; } static void Debug_TestHealthBar_Helper(struct TestingBar *barInfo, s32 *currValue, u16 *dest) { - u8 sp8[6]; + u8 pixels[6]; u16 src[6]; u8 i; CalcBarFilledPixels(barInfo->maxValue, barInfo->oldValue, - barInfo->receivedValue, currValue, sp8, B_HEALTHBAR_PIXELS / 8); + barInfo->receivedValue, currValue, pixels, B_HEALTHBAR_PIXELS / 8); for (i = 0; i < 6; i++) - src[i] = (barInfo->unkC_0 << 12) | (barInfo->unk10 + sp8[i]); + src[i] = (barInfo->unkC_0 << 12) | (barInfo->unk10 + pixels[i]); CpuCopy16(src, dest, sizeof(src)); } @@ -2546,9 +2546,9 @@ static void RemoveWindowOnHealthbox(u32 windowId) RemoveWindow(windowId); } -static void FillHealthboxObject(void *dest, u32 arg1, u32 arg2) +static void FillHealthboxObject(void *dest, u32 valMult, u32 numTiles) { - CpuFill32(0x11111111 * arg1, dest, arg2 * TILE_SIZE_4BPP); + CpuFill32(0x11111111 * valMult, dest, numTiles * TILE_SIZE_4BPP); } static void HpTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 windowWidth) diff --git a/src/battle_message.c b/src/battle_message.c index 9d1b88ba7..2776c952b 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1035,7 +1035,7 @@ const u16 gFirstTurnOfTwoStringIds[] = }; // Index copied from move's index in gTrappingMoves -const u16 gWrappedStringIds[] = +const u16 gWrappedStringIds[NUM_TRAPPING_MOVES] = { STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP @@ -1253,7 +1253,7 @@ const u16 gCaughtMonStringIds[] = [B_MSG_LANETTES_BOX_FULL] = STRINGID_PKMNBOXLANETTESPCFULL, }; -const u16 gTrappingMoves[] = +const u16 gTrappingMoves[NUM_TRAPPING_MOVES + 1] = { MOVE_BIND, MOVE_WRAP, @@ -1261,7 +1261,7 @@ const u16 gTrappingMoves[] = MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, - 0xFFFF + 0xFFFF // Never read }; const u8 gText_PkmnIsEvolving[] = _("What?\n{STR_VAR_1} is evolving!"); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 3c8bbfdee..4f31f0f01 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2596,7 +2596,7 @@ void SetMoveEffect(bool8 primary, u8 certain) for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++) { - if (gBattleCommunication[MULTISTRING_CHOOSER] > 4) + if (gBattleCommunication[MULTISTRING_CHOOSER] >= NUM_TRAPPING_MOVES - 1) break; if (gTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) break; diff --git a/src/berry_blender.c b/src/berry_blender.c index 27ea641ce..9e510f7b3 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -2238,7 +2238,7 @@ static void CB2_PlayBlender(void) UpdatePaletteFade(); } -static void Blender_DummiedOutFunc(s16 a0, s16 a1) +static void Blender_DummiedOutFunc(s16 bgX, s16 bgY) { } diff --git a/src/contest.c b/src/contest.c index ced9f90cd..68bb52114 100644 --- a/src/contest.c +++ b/src/contest.c @@ -93,7 +93,7 @@ static void Task_ContestReturnToField(u8); static void FieldCB_ContestReturnToField(void); static bool8 IsPlayerLinkLeader(void); static void PrintContestantTrainerName(u8); -static void PrintContestantTrainerNameWithColor(u8 a0, u8 a1); +static void PrintContestantTrainerNameWithColor(u8, u8); static void PrintContestantMonName(u8); static void PrintContestantMonNameWithColor(u8, u8); static u8 CreateJudgeSprite(void); @@ -3186,14 +3186,14 @@ static u16 GetMoveEffectSymbolTileOffset(u16 move, u8 contestant) return offset; } -static void PrintContestMoveDescription(u16 a) +static void PrintContestMoveDescription(u16 move) { u8 category; u16 categoryTile; u8 numHearts; // The contest category icon is implemented as a 5x2 group of tiles. - category = gContestMoves[a].contestCategory; + category = gContestMoves[move].contestCategory; if (category == CONTEST_CATEGORY_COOL) categoryTile = 0x4040; else if (category == CONTEST_CATEGORY_BEAUTY) @@ -3209,27 +3209,27 @@ static void PrintContestMoveDescription(u16 a) ContestBG_FillBoxWithIncrementingTile(0, categoryTile + 0x10, 0x0b, 0x20, 0x05, 0x01, 0x11, 0x01); // Appeal hearts - if (gContestEffects[gContestMoves[a].effect].appeal == 0xFF) + if (gContestEffects[gContestMoves[move].effect].appeal == 0xFF) numHearts = 0; else - numHearts = gContestEffects[gContestMoves[a].effect].appeal / 10; + numHearts = gContestEffects[gContestMoves[move].effect].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[gContestMoves[a].effect].jam == 0xFF) + if (gContestEffects[gContestMoves[move].effect].jam == 0xFF) numHearts = 0; else - numHearts = gContestEffects[gContestMoves[a].effect].jam / 10; + numHearts = gContestEffects[gContestMoves[move].effect].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[gContestMoves[a].effect]); + Contest_PrintTextToBg0WindowStd(WIN_MOVE_DESCRIPTION, gContestEffectDescriptionPointers[gContestMoves[move].effect]); Contest_PrintTextToBg0WindowStd(WIN_SLASH, gText_Slash); } @@ -4537,14 +4537,14 @@ static void CalculateAppealMoveImpact(u8 contestant) eContestantStatus[contestant].contestantAnimTarget = i; } -void SetContestantEffectStringID(u8 a, u8 b) +void SetContestantEffectStringID(u8 contestant, u8 effectStringId) { - eContestantStatus[a].effectStringId = b; + eContestantStatus[contestant].effectStringId = effectStringId; } -void SetContestantEffectStringID2(u8 a, u8 b) +void SetContestantEffectStringID2(u8 contestant, u8 effectStringId) { - eContestantStatus[a].effectStringId2 = b; + eContestantStatus[contestant].effectStringId2 = effectStringId; } void SetStartledString(u8 contestant, u8 jam) diff --git a/src/credits.c b/src/credits.c index 43c8d6628..33362fb38 100644 --- a/src/credits.c +++ b/src/credits.c @@ -1285,18 +1285,18 @@ static void ResetCreditsTasks(u8 taskId) gIntroCredits_MovingSceneryState = INTROCRED_SCENERY_DESTROY; } -static void LoadTheEndScreen(u16 arg0, u16 arg1, u16 palOffset) +static void LoadTheEndScreen(u16 tileOffsetLoad, u16 tileOffsetWrite, u16 palOffset) { u16 baseTile; u16 i; - LZ77UnCompVram(sCreditsCopyrightEnd_Gfx, (void *)(VRAM + arg0)); + LZ77UnCompVram(sCreditsCopyrightEnd_Gfx, (void *)(VRAM + tileOffsetLoad)); LoadPalette(gIntroCopyright_Pal, palOffset, sizeof(gIntroCopyright_Pal)); baseTile = (palOffset / 16) << 12; for (i = 0; i < 32 * 32; i++) - ((u16 *) (VRAM + arg1))[i] = baseTile + 1; + ((u16 *) (VRAM + tileOffsetWrite))[i] = baseTile + 1; } static u16 GetLetterMapTile(u8 baseTiles) diff --git a/src/decompress.c b/src/decompress.c index b74d4e814..92c840a63 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -51,13 +51,13 @@ void LoadCompressedSpritePalette(const struct CompressedSpritePalette *src) LoadSpritePalette(&dest); } -void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *a, void *buffer) +void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *src, void *buffer) { struct SpritePalette dest; - LZ77UnCompWram(a->data, buffer); + LZ77UnCompWram(src->data, buffer); dest.data = buffer; - dest.tag = a->tag; + dest.tag = src->tag; LoadSpritePalette(&dest); } diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 691ca6b2a..620fe59e5 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -2879,10 +2879,10 @@ static u8 TryGivePrize(void) return PRIZE_RECEIVED; } -static u32 IncrementWithLimit(u32 a, u32 max) +static u32 IncrementWithLimit(u32 num, u32 max) { - if (a < max) - return a + 1; + if (num < max) + return num + 1; else return max; } diff --git a/src/event_object_movement.c b/src/event_object_movement.c index eb699e89f..07ce2ed08 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -164,7 +164,7 @@ static void CreateLevitateMovementTask(struct ObjectEvent *); static void DestroyLevitateMovementTask(u8); static bool8 NpcTakeStep(struct Sprite *); static bool8 IsElevationMismatchAt(u8, s16, s16); -static bool8 AreElevationsCompatible(u8 a, u8 b); +static bool8 AreElevationsCompatible(u8, u8); static const struct SpriteFrameImage sPicTable_PechaBerryTree[]; @@ -7837,7 +7837,7 @@ void GroundEffect_FlowingWater(struct ObjectEvent *objEvent, struct Sprite *spri StartFieldEffectForObjectEvent(FLDEFF_FEET_IN_FLOWING_WATER, objEvent); } -static void (*const sGroundEffectTracksFuncs[])(struct ObjectEvent *objEvent, struct Sprite *sprite, u8 a) = { +static void (*const sGroundEffectTracksFuncs[])(struct ObjectEvent *objEvent, struct Sprite *sprite, bool8 isDeepSand) = { [TRACKS_NONE] = DoTracksGroundEffect_None, [TRACKS_FOOT] = DoTracksGroundEffect_Footprints, [TRACKS_BIKE_TIRE] = DoTracksGroundEffect_BikeTireTracks, @@ -7846,20 +7846,20 @@ static void (*const sGroundEffectTracksFuncs[])(struct ObjectEvent *objEvent, st void GroundEffect_SandTracks(struct ObjectEvent *objEvent, struct Sprite *sprite) { const struct ObjectEventGraphicsInfo *info = GetObjectEventGraphicsInfo(objEvent->graphicsId); - sGroundEffectTracksFuncs[info->tracks](objEvent, sprite, 0); + sGroundEffectTracksFuncs[info->tracks](objEvent, sprite, FALSE); } void GroundEffect_DeepSandTracks(struct ObjectEvent *objEvent, struct Sprite *sprite) { const struct ObjectEventGraphicsInfo *info = GetObjectEventGraphicsInfo(objEvent->graphicsId); - sGroundEffectTracksFuncs[info->tracks](objEvent, sprite, 1); + sGroundEffectTracksFuncs[info->tracks](objEvent, sprite, TRUE); } -static void DoTracksGroundEffect_None(struct ObjectEvent *objEvent, struct Sprite *sprite, u8 a) +static void DoTracksGroundEffect_None(struct ObjectEvent *objEvent, struct Sprite *sprite, bool8 isDeepSand) { } -static void DoTracksGroundEffect_Footprints(struct ObjectEvent *objEvent, struct Sprite *sprite, u8 a) +static void DoTracksGroundEffect_Footprints(struct ObjectEvent *objEvent, struct Sprite *sprite, bool8 isDeepSand) { // First half-word is a Field Effect script id. (gFieldEffectScriptPointers) u16 sandFootprints_FieldEffectData[2] = { @@ -7872,10 +7872,10 @@ static void DoTracksGroundEffect_Footprints(struct ObjectEvent *objEvent, struct gFieldEffectArguments[2] = 149; gFieldEffectArguments[3] = 2; gFieldEffectArguments[4] = objEvent->facingDirection; - FieldEffectStart(sandFootprints_FieldEffectData[a]); + FieldEffectStart(sandFootprints_FieldEffectData[isDeepSand]); } -static void DoTracksGroundEffect_BikeTireTracks(struct ObjectEvent *objEvent, struct Sprite *sprite, u8 a) +static void DoTracksGroundEffect_BikeTireTracks(struct ObjectEvent *objEvent, struct Sprite *sprite, bool8 isDeepSand) { // Specifies which bike track shape to show next. // For example, when the bike turns from up to right, it will show diff --git a/src/field_camera.c b/src/field_camera.c index 0a00dcbee..4ccf70db9 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -437,10 +437,10 @@ void SetCameraPanningCallback(void (*callback)(void)) sFieldCameraPanningCallback = callback; } -void SetCameraPanning(s16 a, s16 b) +void SetCameraPanning(s16 horizontal, s16 vertical) { - sHorizontalCameraPan = a; - sVerticalCameraPan = b + 32; + sHorizontalCameraPan = horizontal; + sVerticalCameraPan = vertical + 32; } void InstallCameraPanAheadCallback(void) diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 964a62187..b374e132d 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -79,13 +79,13 @@ static bool8 TryPushBoulder(s16, s16, u8); static void CheckAcroBikeCollision(s16, s16, u8, u8 *); static void DoPlayerAvatarTransition(void); -static void PlayerAvatarTransition_Dummy(struct ObjectEvent *a); -static void PlayerAvatarTransition_Normal(struct ObjectEvent *a); -static void PlayerAvatarTransition_MachBike(struct ObjectEvent *a); -static void PlayerAvatarTransition_AcroBike(struct ObjectEvent *a); -static void PlayerAvatarTransition_Surfing(struct ObjectEvent *a); -static void PlayerAvatarTransition_Underwater(struct ObjectEvent *a); -static void PlayerAvatarTransition_ReturnToField(struct ObjectEvent *a); +static void PlayerAvatarTransition_Dummy(struct ObjectEvent *); +static void PlayerAvatarTransition_Normal(struct ObjectEvent *); +static void PlayerAvatarTransition_MachBike(struct ObjectEvent *); +static void PlayerAvatarTransition_AcroBike(struct ObjectEvent *); +static void PlayerAvatarTransition_Surfing(struct ObjectEvent *); +static void PlayerAvatarTransition_Underwater(struct ObjectEvent *); +static void PlayerAvatarTransition_ReturnToField(struct ObjectEvent *); static bool8 PlayerAnimIsMultiFrameStationary(void); static bool8 PlayerAnimIsMultiFrameStationaryAndStateNotTurning(void); @@ -96,51 +96,51 @@ static void PlayerRun(u8); static void PlayerNotOnBikeCollide(u8); static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8); -static void PlayCollisionSoundIfNotFacingWarp(u8 a); +static void PlayCollisionSoundIfNotFacingWarp(u8); static void HideShowWarpArrow(struct ObjectEvent *); static void StartStrengthAnim(u8, u8); -static void Task_PushBoulder(u8 taskId); -static bool8 PushBoulder_Start(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject); -static bool8 PushBoulder_Move(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject); -static bool8 PushBoulder_End(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject); +static void Task_PushBoulder(u8); +static bool8 PushBoulder_Start(struct Task *, struct ObjectEvent *, struct ObjectEvent *); +static bool8 PushBoulder_Move(struct Task *, struct ObjectEvent *, struct ObjectEvent *); +static bool8 PushBoulder_End(struct Task *, struct ObjectEvent *, struct ObjectEvent *); static void DoPlayerMatJump(void); -static void DoPlayerAvatarSecretBaseMatJump(u8 taskId); -static u8 PlayerAvatar_DoSecretBaseMatJump(struct Task *task, struct ObjectEvent *objectEvent); +static void DoPlayerAvatarSecretBaseMatJump(u8); +static u8 PlayerAvatar_DoSecretBaseMatJump(struct Task *, struct ObjectEvent *); static void DoPlayerMatSpin(void); -static void PlayerAvatar_DoSecretBaseMatSpin(u8 taskId); -static bool8 PlayerAvatar_SecretBaseMatSpinStep0(struct Task *task, struct ObjectEvent *objectEvent); -static bool8 PlayerAvatar_SecretBaseMatSpinStep1(struct Task *task, struct ObjectEvent *objectEvent); -static bool8 PlayerAvatar_SecretBaseMatSpinStep2(struct Task *task, struct ObjectEvent *objectEvent); -static bool8 PlayerAvatar_SecretBaseMatSpinStep3(struct Task *task, struct ObjectEvent *objectEvent); +static void PlayerAvatar_DoSecretBaseMatSpin(u8); +static bool8 PlayerAvatar_SecretBaseMatSpinStep0(struct Task *, struct ObjectEvent *); +static bool8 PlayerAvatar_SecretBaseMatSpinStep1(struct Task *, struct ObjectEvent *); +static bool8 PlayerAvatar_SecretBaseMatSpinStep2(struct Task *, struct ObjectEvent *); +static bool8 PlayerAvatar_SecretBaseMatSpinStep3(struct Task *, struct ObjectEvent *); static void CreateStopSurfingTask(u8); -static void Task_StopSurfingInit(u8 taskId); -static void Task_WaitStopSurfing(u8 taskId); +static void Task_StopSurfingInit(u8); +static void Task_WaitStopSurfing(u8); -static void Task_Fishing(u8 taskId); -static u8 Fishing_Init(struct Task *task); -static u8 Fishing_GetRodOut(struct Task *task); -static u8 Fishing_WaitBeforeDots(struct Task *task); -static u8 Fishing_InitDots(struct Task *task); -static u8 Fishing_ShowDots(struct Task *task); -static u8 Fishing_CheckForBite(struct Task *task); -static u8 Fishing_GotBite(struct Task *task); -static u8 Fishing_WaitForA(struct Task *task); -static u8 Fishing_CheckMoreDots(struct Task *task); -static u8 Fishing_MonOnHook(struct Task *task); -static u8 Fishing_StartEncounter(struct Task *task); -static u8 Fishing_NotEvenNibble(struct Task *task); -static u8 Fishing_GotAway(struct Task *task); -static u8 Fishing_NoMon(struct Task *task); -static u8 Fishing_PutRodAway(struct Task *task); -static u8 Fishing_EndNoMon(struct Task *task); +static void Task_Fishing(u8); +static u8 Fishing_Init(struct Task *); +static u8 Fishing_GetRodOut(struct Task *); +static u8 Fishing_WaitBeforeDots(struct Task *); +static u8 Fishing_InitDots(struct Task *); +static u8 Fishing_ShowDots(struct Task *); +static u8 Fishing_CheckForBite(struct Task *); +static u8 Fishing_GotBite(struct Task *); +static u8 Fishing_WaitForA(struct Task *); +static u8 Fishing_CheckMoreDots(struct Task *); +static u8 Fishing_MonOnHook(struct Task *); +static u8 Fishing_StartEncounter(struct Task *); +static u8 Fishing_NotEvenNibble(struct Task *); +static u8 Fishing_GotAway(struct Task *); +static u8 Fishing_NoMon(struct Task *); +static u8 Fishing_PutRodAway(struct Task *); +static u8 Fishing_EndNoMon(struct Task *); static void AlignFishingAnimationFrames(void); -static u8 TrySpinPlayerForWarp(struct ObjectEvent *object, s16 *a1); +static u8 TrySpinPlayerForWarp(struct ObjectEvent *, s16 *); static bool8 (*const sForcedMovementTestFuncs[NUM_FORCED_MOVEMENTS])(u8) = { @@ -1445,68 +1445,68 @@ static void HideShowWarpArrow(struct ObjectEvent *objectEvent) /* Strength */ -static void StartStrengthAnim(u8 a, u8 b) +#define tState data[0] +#define tBoulderObjId data[1] +#define tDirection data[2] + +static void StartStrengthAnim(u8 objectEventId, u8 direction) { u8 taskId = CreateTask(Task_PushBoulder, 0xFF); - gTasks[taskId].data[1] = a; - gTasks[taskId].data[2] = b; + gTasks[taskId].tBoulderObjId = objectEventId; + gTasks[taskId].tDirection = direction; Task_PushBoulder(taskId); } static void Task_PushBoulder(u8 taskId) { - while (sPushBoulderFuncs[gTasks[taskId].data[0]](&gTasks[taskId], + while (sPushBoulderFuncs[gTasks[taskId].tState](&gTasks[taskId], &gObjectEvents[gPlayerAvatar.objectEventId], - &gObjectEvents[gTasks[taskId].data[1]])) + &gObjectEvents[gTasks[taskId].tBoulderObjId])) ; } -static bool8 PushBoulder_Start(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject) +static bool8 PushBoulder_Start(struct Task *task, struct ObjectEvent *player, struct ObjectEvent *boulder) { ScriptContext2_Enable(); gPlayerAvatar.preventStep = TRUE; - task->data[0]++; + task->tState++; return FALSE; } -static bool8 PushBoulder_Move(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject) +static bool8 PushBoulder_Move(struct Task *task, struct ObjectEvent *player, struct ObjectEvent *boulder) { - if (ObjectEventIsHeldMovementActive(playerObject)) - { - ObjectEventClearHeldMovementIfFinished(playerObject); - } + if (ObjectEventIsHeldMovementActive(player)) + ObjectEventClearHeldMovementIfFinished(player); - if (ObjectEventIsHeldMovementActive(strengthObject)) - { - ObjectEventClearHeldMovementIfFinished(strengthObject); - } + if (ObjectEventIsHeldMovementActive(boulder)) + ObjectEventClearHeldMovementIfFinished(boulder); - if (!ObjectEventIsMovementOverridden(playerObject) - && !ObjectEventIsMovementOverridden(strengthObject)) + if (!ObjectEventIsMovementOverridden(player) + && !ObjectEventIsMovementOverridden(boulder)) { - ObjectEventClearHeldMovementIfFinished(playerObject); - ObjectEventClearHeldMovementIfFinished(strengthObject); - ObjectEventSetHeldMovement(playerObject, GetWalkInPlaceNormalMovementAction((u8)task->data[2])); - ObjectEventSetHeldMovement(strengthObject, GetWalkSlowMovementAction((u8)task->data[2])); - gFieldEffectArguments[0] = strengthObject->currentCoords.x; - gFieldEffectArguments[1] = strengthObject->currentCoords.y; - gFieldEffectArguments[2] = strengthObject->previousElevation; - gFieldEffectArguments[3] = gSprites[strengthObject->spriteId].oam.priority; + ObjectEventClearHeldMovementIfFinished(player); + ObjectEventClearHeldMovementIfFinished(boulder); + ObjectEventSetHeldMovement(player, GetWalkInPlaceNormalMovementAction((u8)task->tDirection)); + ObjectEventSetHeldMovement(boulder, GetWalkSlowMovementAction((u8)task->tDirection)); + gFieldEffectArguments[0] = boulder->currentCoords.x; + gFieldEffectArguments[1] = boulder->currentCoords.y; + gFieldEffectArguments[2] = boulder->previousElevation; + gFieldEffectArguments[3] = gSprites[boulder->spriteId].oam.priority; FieldEffectStart(FLDEFF_DUST); PlaySE(SE_M_STRENGTH); - task->data[0]++; + task->tState++; } return FALSE; } -static bool8 PushBoulder_End(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject) +static bool8 PushBoulder_End(struct Task *task, struct ObjectEvent *player, struct ObjectEvent *boulder) { - if (ObjectEventCheckHeldMovementStatus(playerObject) - && ObjectEventCheckHeldMovementStatus(strengthObject)) + if (ObjectEventCheckHeldMovementStatus(player) + && ObjectEventCheckHeldMovementStatus(boulder)) { - ObjectEventClearHeldMovementIfFinished(playerObject); - ObjectEventClearHeldMovementIfFinished(strengthObject); + ObjectEventClearHeldMovementIfFinished(player); + ObjectEventClearHeldMovementIfFinished(boulder); gPlayerAvatar.preventStep = FALSE; ScriptContext2_Disable(); DestroyTask(FindTaskIdByFunc(Task_PushBoulder)); @@ -1514,6 +1514,10 @@ static bool8 PushBoulder_End(struct Task *task, struct ObjectEvent *playerObject return FALSE; } +#undef tState +#undef tBoulderObjId +#undef tDirection + /* Some field effect */ static void DoPlayerMatJump(void) diff --git a/src/field_special_scene.c b/src/field_special_scene.c index d8b9eb05d..31e75613e 100644 --- a/src/field_special_scene.c +++ b/src/field_special_scene.c @@ -19,7 +19,19 @@ #include "constants/songs.h" #include "constants/metatile_labels.h" -#define SECONDS(value) ((signed) (60.0 * value + 0.5)) +// Most of the boxes in the moving truck are map tiles, with the +// exception of three boxes that are map events that jostle around +// while the truck is driving. In addition, their sprite's placement +// is slightly offset to make them look less perfectly stacked. +// Box 1 (LOCALID_TRUCK_BOX_TOP) +#define BOX1_X_OFFSET 3 +#define BOX1_Y_OFFSET 3 +// Box 2 (LOCALID_TRUCK_BOX_BOTTOM_L) +#define BOX2_X_OFFSET 0 +#define BOX2_Y_OFFSET -3 +// Box 3 (LOCALID_TRUCK_BOX_BOTTOM_R) +#define BOX3_X_OFFSET -3 +#define BOX3_Y_OFFSET 0 // porthole states enum @@ -30,8 +42,7 @@ enum EXIT_PORTHOLE, }; -//. rodata -static const s8 gTruckCamera_HorizontalTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, -1, -1, -1, 0}; +static const s8 sTruckCamera_HorizontalTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, -1, -1, -1, 0}; static const u8 sSSTidalSailEastMovementScript[] = { @@ -45,175 +56,194 @@ static const u8 sSSTidalSailWestMovementScript[] = MOVEMENT_ACTION_STEP_END }; -// .text static void Task_Truck3(u8); -s16 GetTruckCameraBobbingY(int a1) +static s16 GetTruckCameraBobbingY(int time) { - if (!(a1 % 120)) + if (!(time % 120)) return -1; - else if ((a1 % 10) <= 4) + else if ((time % 10) <= 4) return 1; return 0; } -s16 GetTruckBoxMovement(int a1) // for the box movement? +// Determines the frequency that the truck boxes bounce at. +// The return value of this function is multiplied and added +// to the boxes resting y offset, the result of which is that +// when it returns 0 they remain vertically still and when it +// returns -1 they jump upward. +// Box 1 has 30 added to the time so it jumps earlier, and +// box 2 has the return value multiplied by less, so it doesn't +// jump as high. +static s16 GetTruckBoxYMovement(int time) { - if (!((a1 + 120) % 180)) + if (!((time + 120) % 180)) return -1; return 0; } -void Task_Truck1(u8 taskId) +#define tTimer data[0] + +static void Task_Truck1(u8 taskId) { s16 *data = gTasks[taskId].data; s16 cameraXpan = 0, cameraYpan = 0; - s16 box1, box2, box3; + s16 yBox1, yBox2, yBox3; - box1 = GetTruckBoxMovement(data[0] + 30) * 4; - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3); - box2 = GetTruckBoxMovement(data[0]) * 2; - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3); - box3 = GetTruckBoxMovement(data[0]) * 4; - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3); + yBox1 = GetTruckBoxYMovement(tTimer + 30) * 4; + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX1_X_OFFSET - cameraXpan, BOX1_Y_OFFSET + yBox1); + yBox2 = GetTruckBoxYMovement(tTimer) * 2; + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX2_X_OFFSET - cameraXpan, BOX2_Y_OFFSET + yBox2); + yBox3 = GetTruckBoxYMovement(tTimer) * 4; + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX3_X_OFFSET - cameraXpan, BOX3_Y_OFFSET + yBox3); - if (++data[0] == SECONDS(500)) // this will never run - data[0] = 0; // reset the timer if it gets stuck. + // Arbitrary timer limit that won't be reached + if (++tTimer == 30000) + tTimer = 0; - cameraYpan = GetTruckCameraBobbingY(data[0]); + cameraYpan = GetTruckCameraBobbingY(tTimer); SetCameraPanning(cameraXpan, cameraYpan); } -void Task_Truck2(u8 taskId) +#undef tTimer + +#define tTimerHorizontal data[0] +#define tMoveStep data[1] +#define tTimerVertical data[2] + +static void Task_Truck2(u8 taskId) { s16 *data = gTasks[taskId].data; - s16 cameraYpan; - s16 cameraXpan; - s16 box1; - s16 box2; - s16 box3; + s16 cameraYpan, cameraXpan; + s16 yBox1, yBox2, yBox3; - data[0]++; - data[2]++; + tTimerHorizontal++; + tTimerVertical++; - if (data[0] > 5) + if (tTimerHorizontal > 5) { - data[0] = 0; - data[1]++; + tTimerHorizontal = 0; + tMoveStep++; } - if ((u16)data[1] == 19) + if ((u16)tMoveStep == ARRAY_COUNT(sTruckCamera_HorizontalTable)) { + // Never reached, the task function is changed below before finishing the table DestroyTask(taskId); } else { - if (gTruckCamera_HorizontalTable[data[1]] == 2) + if (sTruckCamera_HorizontalTable[tMoveStep] == 2) gTasks[taskId].func = Task_Truck3; - cameraXpan = gTruckCamera_HorizontalTable[data[1]]; - cameraYpan = GetTruckCameraBobbingY(data[2]); + cameraXpan = sTruckCamera_HorizontalTable[tMoveStep]; + cameraYpan = GetTruckCameraBobbingY(tTimerVertical); SetCameraPanning(cameraXpan, cameraYpan); - box1 = GetTruckBoxMovement(data[2] + 30) * 4; - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3); - box2 = GetTruckBoxMovement(data[2]) * 2; - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3); - box3 = GetTruckBoxMovement(data[2]) * 4; - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3); + yBox1 = GetTruckBoxYMovement(tTimerVertical + 30) * 4; + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX1_X_OFFSET - cameraXpan, BOX1_Y_OFFSET + yBox1); + yBox2 = GetTruckBoxYMovement(tTimerVertical) * 2; + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX2_X_OFFSET - cameraXpan, BOX2_Y_OFFSET + yBox2); + yBox3 = GetTruckBoxYMovement(tTimerVertical) * 4; + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX3_X_OFFSET - cameraXpan, BOX3_Y_OFFSET + yBox3); } } static void Task_Truck3(u8 taskId) { s16 *data = gTasks[taskId].data; - s16 cameraXpan; - s16 cameraYpan; + s16 cameraXpan, cameraYpan; - data[0]++; + tTimerHorizontal++; - if (data[0] > 5) + if (tTimerHorizontal > 5) { - data[0] = 0; - data[1]++; + tTimerHorizontal = 0; + tMoveStep++; } - if ((u16)data[1] == 19) + if ((u16)tMoveStep == ARRAY_COUNT(sTruckCamera_HorizontalTable)) { DestroyTask(taskId); } else { - cameraXpan = gTruckCamera_HorizontalTable[data[1]]; + cameraXpan = sTruckCamera_HorizontalTable[tMoveStep]; cameraYpan = 0; SetCameraPanning(cameraXpan, 0); - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, cameraYpan + 3); - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, cameraYpan - 3); - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, cameraYpan); + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX1_X_OFFSET - cameraXpan, BOX1_Y_OFFSET + cameraYpan); + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX2_X_OFFSET - cameraXpan, BOX2_Y_OFFSET + cameraYpan); + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX3_X_OFFSET - cameraXpan, BOX3_Y_OFFSET + cameraYpan); } } -void Task_HandleTruckSequence(u8 taskId) +#undef tTimerHorizontal +#undef tMoveStep +#undef tTimerVertical + +#define tState data[0] +#define tTimer data[1] +#define tTaskId1 data[2] +#define tTaskId2 data[3] + +static void Task_HandleTruckSequence(u8 taskId) { s16 *data = gTasks[taskId].data; - switch (data[0]) + switch (tState) { - /* - Each case has a timer which is handled with data[1], incrementing - until it reaches the if function's condition, which sets the next task up. - */ case 0: - data[1]++; - if (data[1] == SECONDS(1.5)) + tTimer++; + if (tTimer == 90) { SetCameraPanningCallback(NULL); - data[1] = 0; // reset the timer. - data[2] = CreateTask(Task_Truck1, 0xA); - data[0] = 1; // run the next case. + tTimer = 0; + tTaskId1 = CreateTask(Task_Truck1, 0xA); + tState = 1; PlaySE(SE_TRUCK_MOVE); } break; case 1: - data[1]++; - if (data[1] == SECONDS(2.5)) + tTimer++; + if (tTimer == 150) { FadeInFromBlack(); - data[1] = 0; - data[0] = 2; + tTimer = 0; + tState = 2; } break; case 2: - data[1]++; - if (!gPaletteFade.active && data[1] > SECONDS(5)) + tTimer++; + if (!gPaletteFade.active && tTimer > 300) { - data[1] = 0; - DestroyTask(data[2]); - data[3] = CreateTask(Task_Truck2, 0xA); - data[0] = 3; + tTimer = 0; + DestroyTask(tTaskId1); + tTaskId2 = CreateTask(Task_Truck2, 0xA); + tState = 3; PlaySE(SE_TRUCK_STOP); } break; case 3: - if (!gTasks[data[3]].isActive) // is Truck2 no longer active (is Truck3 active?) + if (!gTasks[tTaskId2].isActive) { + // Task_Truck2 / Task_Truck3 has finished InstallCameraPanAheadCallback(); - data[1] = 0; - data[0] = 4; + tTimer = 0; + tState = 4; } break; case 4: - data[1]++; - if (data[1] == 90) + tTimer++; + if (tTimer == 90) { PlaySE(SE_TRUCK_UNLOAD); - data[1] = 0; - data[0] = 5; + tTimer = 0; + tState = 5; } break; case 5: - data[1]++; - if (data[1] == 120) + tTimer++; + if (tTimer == 120) { MapGridSetMetatileIdAt(4 + MAP_OFFSET, 1 + MAP_OFFSET, METATILE_InsideOfTruck_ExitLight_Top); MapGridSetMetatileIdAt(4 + MAP_OFFSET, 2 + MAP_OFFSET, METATILE_InsideOfTruck_ExitLight_Mid); @@ -242,9 +272,9 @@ void EndTruckSequence(u8 taskId) { if (!FuncIsActiveTask(Task_HandleTruckSequence)) { - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3, 3); - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 0, -3); - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3, 0); + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX1_X_OFFSET, BOX1_Y_OFFSET); + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX2_X_OFFSET, BOX2_Y_OFFSET); + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX3_X_OFFSET, BOX3_Y_OFFSET); } } @@ -259,7 +289,7 @@ bool8 TrySetPortholeWarpDestination(void) } else { - SetWarpDestination(mapGroup, mapNum, -1, x, y); + SetWarpDestination(mapGroup, mapNum, WARP_ID_NONE, x, y); return TRUE; } } diff --git a/src/field_specials.c b/src/field_specials.c index a4cdafafc..4ed2a2e03 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -90,44 +90,44 @@ void SetPlayerGotFirstFans(void); u16 GetNumFansOfPlayerInTrainerFanClub(void); static void RecordCyclingRoadResults(u32, u8); -static void LoadLinkPartnerObjectEventSpritePalette(u8 graphicsId, u8 localEventId, u8 paletteNum); -static void Task_PetalburgGymSlideOpenRoomDoors(u8 taskId); -static void PetalburgGymSetDoorMetatiles(u8 roomNumber, u16 metatileId); +static void LoadLinkPartnerObjectEventSpritePalette(u8, u8, u8); +static void Task_PetalburgGymSlideOpenRoomDoors(u8); +static void PetalburgGymSetDoorMetatiles(u8, u16); static void Task_PCTurnOnEffect(u8); static void PCTurnOnEffect_0(struct Task *); static void PCTurnOnEffect_1(s16, s8, s8); static void PCTurnOffEffect(void); static void Task_LotteryCornerComputerEffect(u8); static void LotteryCornerComputerEffect(struct Task *); -static void Task_ShakeCamera(u8 taskId); -static void StopCameraShake(u8 taskId); -static void Task_MoveElevator(u8 taskId); -static void MoveElevatorWindowLights(u16 floorDelta, bool8 descending); -static void Task_MoveElevatorWindowLights(u8 taskId); -static void Task_ShowScrollableMultichoice(u8 taskId); -static void FillFrontierExchangeCornerWindowAndItemIcon(u16 menu, u16 selection); -static void ShowBattleFrontierTutorWindow(u8 menu, u16 selection); +static void Task_ShakeCamera(u8); +static void StopCameraShake(u8); +static void Task_MoveElevator(u8); +static void MoveElevatorWindowLights(u16, bool8); +static void Task_MoveElevatorWindowLights(u8); +static void Task_ShowScrollableMultichoice(u8); +static void FillFrontierExchangeCornerWindowAndItemIcon(u16, u16); +static void ShowBattleFrontierTutorWindow(u8, u16); static void InitScrollableMultichoice(void); -static void ScrollableMultichoice_ProcessInput(u8 taskId); -static void ScrollableMultichoice_UpdateScrollArrows(u8 taskId); -static void ScrollableMultichoice_MoveCursor(s32 itemIndex, bool8 onInit, struct ListMenu *list); -static void HideFrontierExchangeCornerItemIcon(u16 menu, u16 unused); -static void ShowBattleFrontierTutorMoveDescription(u8 menu, u16 selection); -static void CloseScrollableMultichoice(u8 taskId); -static void ScrollableMultichoice_RemoveScrollArrows(u8 taskId); -static void Task_ScrollableMultichoice_WaitReturnToList(u8 taskId); -static void Task_ScrollableMultichoice_ReturnToList(u8 taskId); -static void ShowFrontierExchangeCornerItemIcon(u16 item); -static void Task_DeoxysRockInteraction(u8 taskId); -static void ChangeDeoxysRockLevel(u8 a0); -static void WaitForDeoxysRockMovement(u8 taskId); -static void Task_LinkRetireStatusWithBattleTowerPartner(u8 taskId); -static void Task_LoopWingFlapSE(u8 taskId); -static void Task_CloseBattlePikeCurtain(u8 taskId); +static void ScrollableMultichoice_ProcessInput(u8); +static void ScrollableMultichoice_UpdateScrollArrows(u8); +static void ScrollableMultichoice_MoveCursor(s32, bool8, struct ListMenu *); +static void HideFrontierExchangeCornerItemIcon(u16, u16); +static void ShowBattleFrontierTutorMoveDescription(u8, u16); +static void CloseScrollableMultichoice(u8); +static void ScrollableMultichoice_RemoveScrollArrows(u8); +static void Task_ScrollableMultichoice_WaitReturnToList(u8); +static void Task_ScrollableMultichoice_ReturnToList(u8); +static void ShowFrontierExchangeCornerItemIcon(u16); +static void Task_DeoxysRockInteraction(u8); +static void ChangeDeoxysRockLevel(u8); +static void WaitForDeoxysRockMovement(u8); +static void Task_LinkRetireStatusWithBattleTowerPartner(u8); +static void Task_LoopWingFlapSE(u8); +static void Task_CloseBattlePikeCurtain(u8); static u8 DidPlayerGetFirstFans(void); static void SetInitialFansOfPlayer(void); static u16 PlayerGainRandomTrainerFan(void); -static void BufferFanClubTrainerName_(struct LinkBattleRecords *linkRecords, u8 a, u8 b); +static void BufferFanClubTrainerName_(struct LinkBattleRecords *, u8, u8); void Special_ShowDiploma(void) { diff --git a/src/field_weather.c b/src/field_weather.c index cd3436441..a9d007e16 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -863,10 +863,10 @@ void LoadCustomWeatherSpritePalette(const u16 *palette) UpdateSpritePaletteWithWeather(gWeatherPtr->weatherPicSpritePalIndex); } -static void LoadDroughtWeatherPalette(u8 *gammaIndexPtr, u8 *a1) +static void LoadDroughtWeatherPalette(u8 *palsIndex, u8 *palsOffset) { - *gammaIndexPtr = 0x20; - *a1 = 0x20; + *palsIndex = 0x20; + *palsOffset = 0x20; } void ResetDroughtWeatherPaletteLoading(void) diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 2b87557c2..c10867062 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -14,11 +14,9 @@ #include "trig.h" #include "gpu_regs.h" -// EWRAM EWRAM_DATA static u8 gCurrentAbnormalWeather = 0; EWRAM_DATA static u16 gUnusedWeatherRelated = 0; -// CONST const u16 gCloudsWeatherPalette[] = INCBIN_U16("graphics/weather/cloud.gbapal"); const u16 gSandstormWeatherPalette[] = INCBIN_U16("graphics/weather/sandstorm.gbapal"); const u8 gWeatherFogDiagonalTiles[] = INCBIN_U8("graphics/weather/fog_diagonal.4bpp"); @@ -2427,34 +2425,39 @@ static void UpdateBubbleSprite(struct Sprite *sprite) //------------------------------------------------------------------------------ // Unused function. -static void UnusedSetCurrentAbnormalWeather(u32 a0, u32 a1) +static void UnusedSetCurrentAbnormalWeather(u32 weather, u32 unknown) { - gCurrentAbnormalWeather = a0; - gUnusedWeatherRelated = a1; + gCurrentAbnormalWeather = weather; + gUnusedWeatherRelated = unknown; } +#define tState data[0] +#define tWeatherA data[1] +#define tWeatherB data[2] +#define tDelay data[15] + static void Task_DoAbnormalWeather(u8 taskId) { s16 *data = gTasks[taskId].data; - switch (data[0]) + switch (tState) { case 0: - if (data[15]-- <= 0) + if (tDelay-- <= 0) { - SetNextWeather(data[1]); - gCurrentAbnormalWeather = data[1]; - data[15] = 600; - data[0]++; + SetNextWeather(tWeatherA); + gCurrentAbnormalWeather = tWeatherA; + tDelay = 600; + tState++; } break; case 1: - if (data[15]-- <= 0) + if (tDelay-- <= 0) { - SetNextWeather(data[2]); - gCurrentAbnormalWeather = data[2]; - data[15] = 600; - data[0] = 0; + SetNextWeather(tWeatherB); + gCurrentAbnormalWeather = tWeatherB; + tDelay = 600; + tState = 0; } break; } @@ -2465,25 +2468,33 @@ static void CreateAbnormalWeatherTask(void) u8 taskId = CreateTask(Task_DoAbnormalWeather, 0); s16 *data = gTasks[taskId].data; - data[15] = 600; + tDelay = 600; if (gCurrentAbnormalWeather == WEATHER_DOWNPOUR) { - data[1] = WEATHER_DROUGHT; - data[2] = WEATHER_DOWNPOUR; + // Currently Downpour, next will be Drought + tWeatherA = WEATHER_DROUGHT; + tWeatherB = WEATHER_DOWNPOUR; } else if (gCurrentAbnormalWeather == WEATHER_DROUGHT) { - data[1] = WEATHER_DOWNPOUR; - data[2] = WEATHER_DROUGHT; + // Currently Drought, next will be Downpour + tWeatherA = WEATHER_DOWNPOUR; + tWeatherB = WEATHER_DROUGHT; } else { + // Default to starting with Downpour gCurrentAbnormalWeather = WEATHER_DOWNPOUR; - data[1] = WEATHER_DROUGHT; - data[2] = WEATHER_DOWNPOUR; + tWeatherA = WEATHER_DROUGHT; + tWeatherB = WEATHER_DOWNPOUR; } } +#undef tState +#undef tWeatherA +#undef tWeatherB +#undef tDelay + static u8 TranslateWeatherNum(u8); static void UpdateRainCounter(u8, u8); diff --git a/src/intro_credits_graphics.c b/src/intro_credits_graphics.c index e7039e02b..0942e82f1 100644 --- a/src/intro_credits_graphics.c +++ b/src/intro_credits_graphics.c @@ -757,10 +757,9 @@ void LoadIntroPart2Graphics(u8 scenery) gReservedSpritePaletteCount = 8; } -// Note: This is only called with a=1. +// Note: This is only called with scenery=1. void SetIntroPart2BgCnt(u8 scenery) { - // Only called with scenery = 1 switch (scenery) { default: diff --git a/src/item_use.c b/src/item_use.c index c03ede61b..af8f2504f 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -42,33 +42,33 @@ #include "constants/items.h" #include "constants/songs.h" -static void SetUpItemUseCallback(u8 taskId); +static void SetUpItemUseCallback(u8); static void FieldCB_UseItemOnField(void); -static void Task_CallItemUseOnFieldCallback(u8 taskId); -static void Task_UseItemfinder(u8 taskId); -static void Task_CloseItemfinderMessage(u8 taskId); -static void Task_HiddenItemNearby(u8 taskId); -static void Task_StandingOnHiddenItem(u8 taskId); +static void Task_CallItemUseOnFieldCallback(u8); +static void Task_UseItemfinder(u8); +static void Task_CloseItemfinderMessage(u8); +static void Task_HiddenItemNearby(u8); +static void Task_StandingOnHiddenItem(u8); static bool8 ItemfinderCheckForHiddenItems(const struct MapEvents *, u8); -static u8 GetDirectionToHiddenItem(s16 distanceX, s16 distanceY); -static void PlayerFaceHiddenItem(u8 a); -static void CheckForHiddenItemsInMapConnection(u8 taskId); -static void Task_OpenRegisteredPokeblockCase(u8 taskId); -static void ItemUseOnFieldCB_Bike(u8 taskId); +static u8 GetDirectionToHiddenItem(s16, s16); +static void PlayerFaceHiddenItem(u8); +static void CheckForHiddenItemsInMapConnection(u8); +static void Task_OpenRegisteredPokeblockCase(u8); +static void ItemUseOnFieldCB_Bike(u8); static void ItemUseOnFieldCB_Rod(u8); static void ItemUseOnFieldCB_Itemfinder(u8); -static void ItemUseOnFieldCB_Berry(u8 taskId); -static void ItemUseOnFieldCB_WailmerPailBerry(u8 taskId); -static void ItemUseOnFieldCB_WailmerPailSudowoodo(u8 taskId); +static void ItemUseOnFieldCB_Berry(u8); +static void ItemUseOnFieldCB_WailmerPailBerry(u8); +static void ItemUseOnFieldCB_WailmerPailSudowoodo(u8); static bool8 TryToWaterSudowoodo(void); -static void BootUpSoundTMHM(u8 taskId); -static void Task_ShowTMHMContainedMessage(u8 taskId); -static void UseTMHMYesNo(u8 taskId); -static void UseTMHM(u8 taskId); -static void Task_StartUseRepel(u8 taskId); -static void Task_UseRepel(u8 taskId); -static void Task_CloseCantUseKeyItemMessage(u8 taskId); -static void SetDistanceOfClosestHiddenItem(u8 taskId, s16 x, s16 y); +static void BootUpSoundTMHM(u8); +static void Task_ShowTMHMContainedMessage(u8); +static void UseTMHMYesNo(u8); +static void UseTMHM(u8); +static void Task_StartUseRepel(u8); +static void Task_UseRepel(u8); +static void Task_CloseCantUseKeyItemMessage(u8); +static void SetDistanceOfClosestHiddenItem(u8, s16, s16); static void CB2_OpenPokeblockFromBag(void); // EWRAM variables diff --git a/src/link.c b/src/link.c index aa9a0d73d..e88cde55a 100644 --- a/src/link.c +++ b/src/link.c @@ -120,18 +120,18 @@ static EWRAM_DATA void *sLinkErrorBgTilemapBuffer = NULL; static void InitLocalLinkPlayer(void); static void VBlankCB_LinkError(void); static void CB2_LinkTest(void); -static void ProcessRecvCmds(u8 unused); +static void ProcessRecvCmds(u8); static void LinkCB_SendHeldKeys(void); static void ResetBlockSend(void); -static bool32 InitBlockSend(const void *src, size_t size); +static bool32 InitBlockSend(const void *, size_t); static void LinkCB_BlockSendBegin(void); static void LinkCB_BlockSend(void); static void LinkCB_BlockSendEnd(void); -static void SetBlockReceivedFlag(u8 who); -static u16 LinkTestCalcBlockChecksum(const u16 *src, u16 size); -static void LinkTest_PrintHex(u32 pos, u8 a0, u8 a1, u8 a2); +static void SetBlockReceivedFlag(u8); +static u16 LinkTestCalcBlockChecksum(const u16 *, u16); +static void LinkTest_PrintHex(u32, u8, u8, u8); static void LinkCB_RequestPlayerDataExchange(void); -static void Task_PrintTestData(u8 taskId); +static void Task_PrintTestData(u8); static void LinkCB_ReadyCloseLink(void); static void LinkCB_WaitCloseLink(void); diff --git a/src/main_menu.c b/src/main_menu.c index ed6158a9c..361118e54 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -198,7 +198,7 @@ static void NewGameBirchSpeech_ShowDialogueWindow(u8, u8); static void NewGameBirchSpeech_ClearWindow(u8); static void Task_NewGameBirchSpeech_ThisIsAPokemon(u8); static void Task_NewGameBirchSpeech_MainSpeech(u8); -static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 a); +static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *, u16); static void Task_NewGameBirchSpeech_AndYouAre(u8); static void Task_NewGameBirchSpeechSub_WaitForLotad(u8); static void Task_NewGameBirchSpeech_StartBirchLotadPlatformFade(u8); @@ -1371,7 +1371,7 @@ static void Task_NewGameBirchSpeechSub_InitPokeBall(u8 taskId) gSprites[spriteId].invisible = FALSE; gSprites[spriteId].data[0] = 0; - CreatePokeballSpriteToReleaseMon(spriteId, gSprites[spriteId].oam.paletteNum, 112, 58, 0, 0, 32, 0x0000FFFF, SPECIES_LOTAD); + CreatePokeballSpriteToReleaseMon(spriteId, gSprites[spriteId].oam.paletteNum, 112, 58, 0, 0, 32, PALETTES_BG, SPECIES_LOTAD); gTasks[taskId].func = Task_NewGameBirchSpeechSub_WaitForLotad; gTasks[sBirchSpeechMainTaskId].tTimer = 0; } @@ -2221,9 +2221,9 @@ static void ClearMainMenuWindowTilemap(const struct WindowTemplate *template) CopyBgTilemapBufferToVram(template->bg); } -static void NewGameBirchSpeech_ClearGenderWindowTilemap(u8 a, u8 b, u8 c, u8 d, u8 e, u8 unused) +static void NewGameBirchSpeech_ClearGenderWindowTilemap(u8 bg, u8 x, u8 y, u8 width, u8 height, u8 unused) { - FillBgTilemapBufferRect(a, 0, b + 0xFF, c + 0xFF, d + 2, e + 2, 2); + FillBgTilemapBufferRect(bg, 0, x + 255, y + 255, width + 2, height + 2, 2); } static void NewGameBirchSpeech_ClearGenderWindow(u8 windowId, bool8 copyToVram) @@ -2247,7 +2247,7 @@ static void NewGameBirchSpeech_ClearWindow(u8 windowId) CopyWindowToVram(windowId, COPYWIN_GFX); } -static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 a) +static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 renderCmd) { // Wait for Birch's "This is a Pokémon" text to reach the pause // Then start the PokéBall release (if it hasn't been started already) @@ -2273,21 +2273,22 @@ static void NewGameBirchSpeech_ShowDialogueWindow(u8 windowId, u8 copyToVram) CopyWindowToVram(windowId, 3); } -static void NewGameBirchSpeech_CreateDialogueWindowBorder(u8 a, u8 b, u8 c, u8 d, u8 e, u8 f) +static void NewGameBirchSpeech_CreateDialogueWindowBorder(u8 bg, u8 x, u8 y, u8 width, u8 height, u8 palNum) { - FillBgTilemapBufferRect(a, 0xFD, b-2, c-1, 1, 1, f); - FillBgTilemapBufferRect(a, 0xFF, b-1, c-1, 1, 1, f); - FillBgTilemapBufferRect(a, 0x100, b, c-1, d, 1, f); - FillBgTilemapBufferRect(a, 0x101, b+d-1, c-1, 1, 1, f); - FillBgTilemapBufferRect(a, 0x102, b+d, c-1, 1, 1, f); - FillBgTilemapBufferRect(a, 0x103, b-2, c, 1, 5, f); - FillBgTilemapBufferRect(a, 0x105, b-1, c, d+1, 5, f); - FillBgTilemapBufferRect(a, 0x106, b+d, c, 1, 5, f); - FillBgTilemapBufferRect(a, BG_TILE_V_FLIP(0xFD), b-2, c+e, 1, 1, f); - FillBgTilemapBufferRect(a, BG_TILE_V_FLIP(0xFF), b-1, c+e, 1, 1, f); - FillBgTilemapBufferRect(a, BG_TILE_V_FLIP(0x100), b, c+e, d-1, 1, f); - FillBgTilemapBufferRect(a, BG_TILE_V_FLIP(0x101), b+d-1, c+e, 1, 1, f); - FillBgTilemapBufferRect(a, BG_TILE_V_FLIP(0x102), b+d, c+e, 1, 1, f); + FillBgTilemapBufferRect(bg, 0xFD, x-2, y-1, 1, 1, palNum); + FillBgTilemapBufferRect(bg, 0xFF, x-1, y-1, 1, 1, palNum); + FillBgTilemapBufferRect(bg, 0x100, x, y-1, width, 1, palNum); + FillBgTilemapBufferRect(bg, 0x101, x+width-1, y-1, 1, 1, palNum); + FillBgTilemapBufferRect(bg, 0x102, x+width, y-1, 1, 1, palNum); + FillBgTilemapBufferRect(bg, 0x103, x-2, y, 1, 5, palNum); + FillBgTilemapBufferRect(bg, 0x105, x-1, y, width+1, 5, palNum); + FillBgTilemapBufferRect(bg, 0x106, x+width, y, 1, 5, palNum); + + FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(0xFD), x-2, y+height, 1, 1, palNum); + FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(0xFF), x-1, y+height, 1, 1, palNum); + FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(0x100), x, y+height, width-1, 1, palNum); + FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(0x101), x+width-1, y+height, 1, 1, palNum); + FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(0x102), x+width, y+height, 1, 1, palNum); } static void Task_NewGameBirchSpeech_ReturnFromNamingScreenShowTextbox(u8 taskId) diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index 681a3dadf..637bf2c7f 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -438,7 +438,7 @@ static void EnableTextPrinters(void) gDisableTextPrinters = FALSE; } -static void DisableTextPrinters(struct TextPrinterTemplate * printer, u16 a1) +static void DisableTextPrinters(struct TextPrinterTemplate * printer, u16 renderCmd) { gDisableTextPrinters = TRUE; } diff --git a/src/menu.c b/src/menu.c index 49baddded..c4540942b 100644 --- a/src/menu.c +++ b/src/menu.c @@ -542,9 +542,9 @@ void RemoveMapNamePopUpWindow(void) } } -void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextPrinterTemplate *, u16)) +void AddTextPrinterWithCallbackForMessage(bool8 canSpeedUp, void (*callback)(struct TextPrinterTemplate *, u16)) { - gTextFlags.canABSpeedUpPrint = a1; + gTextFlags.canABSpeedUpPrint = canSpeedUp; AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), callback, 2, 1, 3); } @@ -1245,9 +1245,9 @@ static void PrintMenuActionGridText(u8 windowId, u8 fontId, u8 left, u8 top, u8 } // Unused -static void PrintMenuActionGridTextAtTop(u8 windowId, u8 fontId, u8 a2, u8 a3, u8 a4, u8 a5, const struct MenuAction *menuActions) +static void PrintMenuActionGridTextAtTop(u8 windowId, u8 fontId, u8 width, u8 height, u8 columns, u8 rows, const struct MenuAction *menuActions) { - PrintMenuActionGridText(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 0, a2, a3, a4, a5, menuActions); + PrintMenuActionGridText(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 0, width, height, columns, rows, menuActions); } void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth, u8 horizontalCount, u8 verticalCount, const struct MenuAction *menuActions, const u8 *actionIds) diff --git a/src/mystery_event_script.c b/src/mystery_event_script.c index 5f08c6294..e0f789bcb 100644 --- a/src/mystery_event_script.c +++ b/src/mystery_event_script.c @@ -19,8 +19,8 @@ extern ScrCmdFunc gMysteryEventScriptCmdTable[]; extern ScrCmdFunc gMysteryEventScriptCmdTableEnd[]; -#define LANGUAGE_MASK 0x1 -#define VERSION_MASK 0x200 +// 0x1 in FireRed, 0x2 in LeafGreen, 0x80 in Ruby, 0x100 in Sapphire +#define VERSION_MASK (1 << 9) #define mScriptBase data[0] #define mOffset data[1] @@ -29,18 +29,21 @@ extern ScrCmdFunc gMysteryEventScriptCmdTableEnd[]; EWRAM_DATA static struct ScriptContext sMysteryEventScriptContext = {0}; -static bool32 CheckCompatibility(u16 a1, u32 a2, u16 a3, u32 a4) +static bool32 CheckCompatibility(u16 unk0, u32 unk1, u16 unk2, u32 version) { - if (!(a1 & LANGUAGE_MASK)) + // 0x1 in English FRLG, 0x2 in English RS, 0x4 in German RS + if (!(unk0 & 0x1)) return FALSE; - if (!(a2 & LANGUAGE_MASK)) + // Same as above + if (!(unk1 & 0x1)) return FALSE; - if (!(a3 & 0x4)) + // 0x1 in FRLG, 0x4 in RS + if (!(unk2 & 0x4)) return FALSE; - if (!(a4 & VERSION_MASK)) + if (!(version & VERSION_MASK)) return FALSE; return TRUE; @@ -174,18 +177,18 @@ bool8 MEScrCmd_end(struct ScriptContext *ctx) bool8 MEScrCmd_checkcompat(struct ScriptContext *ctx) { - u16 v1; - u32 v2; - u16 v3; - u32 v4; + u16 unk0; + u32 unk1; + u16 unk2; + u32 version; ctx->mOffset = ScriptReadWord(ctx); - v1 = ScriptReadHalfword(ctx); - v2 = ScriptReadWord(ctx); - v3 = ScriptReadHalfword(ctx); - v4 = ScriptReadWord(ctx); + unk0 = ScriptReadHalfword(ctx); + unk1 = ScriptReadWord(ctx); + unk2 = ScriptReadHalfword(ctx); + version = ScriptReadWord(ctx); - if (CheckCompatibility(v1, v2, v3, v4) == TRUE) + if (CheckCompatibility(unk0, unk1, unk2, version) == TRUE) ctx->mValid = TRUE; else SetIncompatible(); diff --git a/src/overworld.c b/src/overworld.c index ba6eaa167..dc7eda422 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -2477,9 +2477,9 @@ static u16 KeyInterCB_ReadButtons(u32 key) return LINK_KEY_CODE_EMPTY; } -static u16 GetDirectionForDpadKey(u16 a1) +static u16 GetDirectionForDpadKey(u16 key) { - switch (a1) + switch (key) { case LINK_KEY_CODE_DPAD_RIGHT: return FACING_RIGHT; @@ -2598,7 +2598,7 @@ static u16 KeyInterCB_Ready(u32 keyOrPlayerId) } } -static u16 KeyInterCB_SetReady(u32 a1) +static u16 KeyInterCB_SetReady(u32 key) { SetKeyInterceptCallback(KeyInterCB_Ready); return LINK_KEY_CODE_READY; diff --git a/src/palette.c b/src/palette.c index 9fec449bc..23ad02b73 100644 --- a/src/palette.c +++ b/src/palette.c @@ -237,63 +237,63 @@ static void PaletteStruct_Run(u8 a1, u32 *unkFlags) } } -static void PaletteStruct_Copy(struct PaletteStruct *a1, u32 *unkFlags) +static void PaletteStruct_Copy(struct PaletteStruct *palStruct, u32 *unkFlags) { s32 srcIndex; s32 srcCount; u8 i = 0; - u16 srcOffset = a1->srcIndex * a1->template->size; + u16 srcOffset = palStruct->srcIndex * palStruct->template->size; - if (!a1->template->pst_field_8_0) + if (!palStruct->template->pst_field_8_0) { - while (i < a1->template->size) + while (i < palStruct->template->size) { - gPlttBufferUnfaded[a1->destOffset] = a1->template->src[srcOffset]; - gPlttBufferFaded[a1->destOffset] = a1->template->src[srcOffset]; + gPlttBufferUnfaded[palStruct->destOffset] = palStruct->template->src[srcOffset]; + gPlttBufferFaded[palStruct->destOffset] = palStruct->template->src[srcOffset]; i++; - a1->destOffset++; + palStruct->destOffset++; srcOffset++; } } else { - while (i < a1->template->size) + while (i < palStruct->template->size) { - gPlttBufferFaded[a1->destOffset] = a1->template->src[srcOffset]; + gPlttBufferFaded[palStruct->destOffset] = palStruct->template->src[srcOffset]; i++; - a1->destOffset++; + palStruct->destOffset++; srcOffset++; } } - a1->destOffset = a1->baseDestOffset; - a1->countdown1 = a1->template->time1; - a1->srcIndex++; + palStruct->destOffset = palStruct->baseDestOffset; + palStruct->countdown1 = palStruct->template->time1; + palStruct->srcIndex++; - srcIndex = a1->srcIndex; - srcCount = a1->template->srcCount; + srcIndex = palStruct->srcIndex; + srcCount = palStruct->template->srcCount; if (srcIndex >= srcCount) { - if (a1->countdown2) - a1->countdown2--; - a1->srcIndex = 0; + if (palStruct->countdown2) + palStruct->countdown2--; + palStruct->srcIndex = 0; } - *unkFlags |= 1 << (a1->baseDestOffset >> 4); + *unkFlags |= 1 << (palStruct->baseDestOffset >> 4); } -static void PaletteStruct_Blend(struct PaletteStruct *a1, u32 *unkFlags) +static void PaletteStruct_Blend(struct PaletteStruct *palStruct, u32 *unkFlags) { - if (gPaletteFade.active && ((1 << (a1->baseDestOffset >> 4)) & gPaletteFade_selectedPalettes)) + if (gPaletteFade.active && ((1 << (palStruct->baseDestOffset >> 4)) & gPaletteFade_selectedPalettes)) { - if (!a1->template->pst_field_8_0) + if (!palStruct->template->pst_field_8_0) { if (gPaletteFade.delayCounter != gPaletteFade_delay) { BlendPalette( - a1->baseDestOffset, - a1->template->size, + palStruct->baseDestOffset, + palStruct->template->size, gPaletteFade.y, gPaletteFade.blendColor); } @@ -302,13 +302,13 @@ static void PaletteStruct_Blend(struct PaletteStruct *a1, u32 *unkFlags) { if (!gPaletteFade.delayCounter) { - if (a1->countdown1 != a1->template->time1) + if (palStruct->countdown1 != palStruct->template->time1) { - u32 srcOffset = a1->srcIndex * a1->template->size; + u32 srcOffset = palStruct->srcIndex * palStruct->template->size; u8 i; - for (i = 0; i < a1->template->size; i++) - gPlttBufferFaded[a1->baseDestOffset + i] = a1->template->src[srcOffset + i]; + for (i = 0; i < palStruct->template->size; i++) + gPlttBufferFaded[palStruct->baseDestOffset + i] = palStruct->template->src[srcOffset + i]; } } } diff --git a/src/player_pc.c b/src/player_pc.c index bf8479ce1..9e3d7b166 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -97,84 +97,84 @@ struct ItemStorageMenu u8 swapLineSpriteIds[SWAP_LINE_LENGTH]; }; -static void InitPlayerPCMenu(u8 taskId); -static void PlayerPCProcessMenuInput(u8 taskId); -static void InitItemStorageMenu(u8 taskId, u8 var); +static void InitPlayerPCMenu(u8); +static void PlayerPCProcessMenuInput(u8); +static void InitItemStorageMenu(u8, u8); static u8 GetMailboxMailCount(void); static void Mailbox_CompactMailList(void); -static void Mailbox_DrawMailboxMenu(u8 taskId); -static void Mailbox_ProcessInput(u8 taskId); -static void Mailbox_PrintWhatToDoWithPlayerMailText(u8 taskId); +static void Mailbox_DrawMailboxMenu(u8); +static void Mailbox_ProcessInput(u8); +static void Mailbox_PrintWhatToDoWithPlayerMailText(u8); static void Mailbox_ReturnToPlayerPC(u8); -static void Mailbox_PrintMailOptions(u8 taskId); -static void Mailbox_MailOptionsProcessInput(u8 taskId); +static void Mailbox_PrintMailOptions(u8); +static void Mailbox_MailOptionsProcessInput(u8); -static void PlayerPC_ItemStorage(u8 taskId); -static void PlayerPC_Mailbox(u8 taskId); -static void PlayerPC_Decoration(u8 var); -static void PlayerPC_TurnOff(u8 taskId); +static void PlayerPC_ItemStorage(u8); +static void PlayerPC_Mailbox(u8); +static void PlayerPC_Decoration(u8); +static void PlayerPC_TurnOff(u8); -static void Mailbox_DoMailMoveToBag(u8 taskId); -static void Mailbox_DoMailRead(u8 taskId); -static void Mailbox_MoveToBag(u8 taskId); -static void Mailbox_Give(u8 taskId); -static void Mailbox_Cancel(u8 taskId); +static void Mailbox_DoMailMoveToBag(u8); +static void Mailbox_DoMailRead(u8); +static void Mailbox_MoveToBag(u8); +static void Mailbox_Give(u8); +static void Mailbox_Cancel(u8); -static void Mailbox_CancelMoveToBag(u8 taskId); -static void Mailbox_HandleConfirmMoveToBag(u8 taskId); -static void Mailbox_AskConfirmMoveToBag(u8 taskId); -static void Mailbox_DoGiveMailPokeMenu(u8 taskId); -static void Mailbox_NoPokemonForMail(u8 taskId); +static void Mailbox_CancelMoveToBag(u8); +static void Mailbox_HandleConfirmMoveToBag(u8); +static void Mailbox_AskConfirmMoveToBag(u8); +static void Mailbox_DoGiveMailPokeMenu(u8); +static void Mailbox_NoPokemonForMail(u8); -static void Mailbox_FadeAndReadMail(u8 taskId); +static void Mailbox_FadeAndReadMail(u8); static void Mailbox_ReturnToFieldFromReadMail(void); static void Mailbox_ReshowAfterMail(void); -static void Mailbox_HandleReturnToProcessInput(u8 taskId); +static void Mailbox_HandleReturnToProcessInput(u8); static void Mailbox_UpdateMailListAfterDeposit(void); -static void ItemStorage_Withdraw(u8 taskId); -static void ItemStorage_Deposit(u8 taskId); -static void ItemStorage_Toss(u8 taskId); -static void ItemStorage_Exit(u8 taskId); -static void ItemStorage_TossItemYes(u8 taskId); -static void ItemStorage_TossItemNo(u8 taskId); +static void ItemStorage_Withdraw(u8); +static void ItemStorage_Deposit(u8); +static void ItemStorage_Toss(u8); +static void ItemStorage_Exit(u8); +static void ItemStorage_TossItemYes(u8); +static void ItemStorage_TossItemNo(u8); static void ItemStorageMenuPrint(const u8 *); -static void ItemStorageMenuProcessInput(u8 taskId); +static void ItemStorageMenuProcessInput(u8); static void SetPlayerPCListCount(u8); -static void ItemStorage_HandleReturnToProcessInput(u8 taskId); +static void ItemStorage_HandleReturnToProcessInput(u8); -static void ItemStorage_Enter(u8 taskId, bool8 toss); -static void ItemStorage_CreateListMenu(u8 taskId); -static void ItemStorage_ProcessInput(u8 taskId); -static void Task_ItemStorage_Deposit(u8 taskId); +static void ItemStorage_Enter(u8, bool8); +static void ItemStorage_CreateListMenu(u8); +static void ItemStorage_ProcessInput(u8); +static void Task_ItemStorage_Deposit(u8); static void ItemStorage_ReshowAfterBagMenu(void); -static void ItemStorage_DoItemWithdraw(u8 taskId); -static void ItemStorage_DoItemToss(u8 taskid); -static void ItemStorage_HandleQuantityRolling(u8 taskid); -static void ItemStorage_ExitItemList(u8 taskId); -static void ItemStorage_StartItemSwap(u8 taskId); -static void ItemStorage_DoItemAction(u8 taskId); -static void ItemStorage_FinishItemSwap(u8 taskId, bool8 a); -static void ItemStorage_HandleRemoveItem(u8 taskId); -static void ItemStorage_HandleErrorMessageInput(u8 taskId); -static void ItemStorage_ReturnToListInput(u8 taskId); +static void ItemStorage_DoItemWithdraw(u8); +static void ItemStorage_DoItemToss(u8); +static void ItemStorage_HandleQuantityRolling(u8); +static void ItemStorage_ExitItemList(u8); +static void ItemStorage_StartItemSwap(u8); +static void ItemStorage_DoItemAction(u8); +static void ItemStorage_FinishItemSwap(u8, bool8); +static void ItemStorage_HandleRemoveItem(u8); +static void ItemStorage_HandleErrorMessageInput(u8); +static void ItemStorage_ReturnToListInput(u8); static const u8* ItemStorage_GetMessage(u16); -static void CopyItemName_PlayerPC(u8 *string, u16 itemId); +static void CopyItemName_PlayerPC(u8 *, u16); static void ItemStorage_Init(void); -static void ItemStorage_DrawSwapArrow(u8 y, u8, u8 speed); +static void ItemStorage_DrawSwapArrow(u8, u8, u8); static void ItemStorage_RemoveWindow(u8); static void ItemStorage_UpdateSwapLinePos(u8); -static void ItemStorage_ProcessItemSwapInput(u8 taskId); +static void ItemStorage_ProcessItemSwapInput(u8); static void ItemStorage_EraseItemIcon(void); -static void ItemStorage_DrawItemIcon(u16 itemId); -static void ItemStorage_PrintDescription(s32 id); -static void ItemStorage_EraseMainMenu(u8 taskId); -static void ItemStorage_MoveCursor(s32 id, bool8 b, struct ListMenu * thisMenu); -static void ItemStorage_PrintMenuItem(u8 windowId, u32 id, u8 yOffset); +static void ItemStorage_DrawItemIcon(u16); +static void ItemStorage_PrintDescription(s32); +static void ItemStorage_EraseMainMenu(u8); +static void ItemStorage_MoveCursor(s32, bool8, struct ListMenu *); +static void ItemStorage_PrintMenuItem(u8, u32, u8); static EWRAM_DATA const u8 *sTopMenuOptionOrder = NULL; static EWRAM_DATA u8 sTopMenuNumOptions = 0; diff --git a/src/pokeball.c b/src/pokeball.c index cf7f49b7e..f203633a5 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -1005,32 +1005,45 @@ static u8 AnimateBallOpenParticlesForPokeball(u8 x, u8 y, u8 kindOfStars, u8 sub return AnimateBallOpenParticles(x, y, kindOfStars, subpriority, BALL_POKE); } -static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes) +static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 spritePalNum, u32 selectedPalettes) { - return LaunchBallFadeMonTask(unFadeLater, battlerId, selectedPalettes, BALL_POKE); + return LaunchBallFadeMonTask(unFadeLater, spritePalNum, selectedPalettes, BALL_POKE); } +// Sprite data for the pokemon +#define sSpecies data[7] + +// Sprite data for the pokeball +#define sMonSpriteId data[0] +#define sDelay data[1] +#define sMonPalNum data[2] +#define sFadePalsLo data[3] +#define sFadePalsHi data[4] +#define sFinalMonX data[5] +#define sFinalMonY data[6] +#define sTrigIdx data[7] + // Pokeball in Birch intro, and when receiving via trade -void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 battlerId, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 g, u32 h, u16 species) +void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 delay, u32 fadePalettes, u16 species) { u8 spriteId; - LoadCompressedSpriteSheetUsingHeap(&gBallSpriteSheets[0]); - LoadCompressedSpritePaletteUsingHeap(&gBallSpritePalettes[0]); - spriteId = CreateSprite(&gBallSpriteTemplates[0], x, y, subpriortiy); + LoadCompressedSpriteSheetUsingHeap(&gBallSpriteSheets[BALL_POKE]); + LoadCompressedSpritePaletteUsingHeap(&gBallSpritePalettes[BALL_POKE]); + spriteId = CreateSprite(&gBallSpriteTemplates[BALL_POKE], x, y, subpriortiy); - gSprites[spriteId].data[0] = monSpriteId; - gSprites[spriteId].data[5] = gSprites[monSpriteId].x; - gSprites[spriteId].data[6] = gSprites[monSpriteId].y; + gSprites[spriteId].sMonSpriteId = monSpriteId; + gSprites[spriteId].sFinalMonX = gSprites[monSpriteId].x; + gSprites[spriteId].sFinalMonY = gSprites[monSpriteId].y; gSprites[monSpriteId].x = x; gSprites[monSpriteId].y = y; - gSprites[monSpriteId].data[7] = species; + gSprites[monSpriteId].sSpecies = species; - gSprites[spriteId].data[1] = g; - gSprites[spriteId].data[2] = battlerId; - gSprites[spriteId].data[3] = h; - gSprites[spriteId].data[4] = h >> 0x10; + gSprites[spriteId].sDelay = delay; + gSprites[spriteId].sMonPalNum = monPalNum; + gSprites[spriteId].sFadePalsLo = fadePalettes; + gSprites[spriteId].sFadePalsHi = fadePalettes >> 16; gSprites[spriteId].oam.priority = oamPriority; gSprites[spriteId].callback = SpriteCB_PokeballReleaseMon; @@ -1039,12 +1052,12 @@ void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 battlerId, u8 x, u8 y, static void SpriteCB_PokeballReleaseMon(struct Sprite *sprite) { - if (sprite->data[1] == 0) + if (sprite->sDelay == 0) { u8 subpriority; - u8 spriteId = sprite->data[0]; - u8 battlerId = sprite->data[2]; - u32 selectedPalettes = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16); + u8 spriteId = sprite->sMonSpriteId; + u8 monPalNum = sprite->sMonPalNum; + u32 selectedPalettes = (u16)sprite->sFadePalsLo | ((u16)sprite->sFadePalsHi << 16); if (sprite->subpriority != 0) subpriority = sprite->subpriority - 1; @@ -1053,78 +1066,89 @@ static void SpriteCB_PokeballReleaseMon(struct Sprite *sprite) StartSpriteAnim(sprite, 1); AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, subpriority); - sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, battlerId, selectedPalettes); + // sDelay re-used to store task id but never read + sprite->sDelay = LaunchBallFadeMonTaskForPokeball(1, monPalNum, selectedPalettes); sprite->callback = SpriteCB_ReleasedMonFlyOut; gSprites[spriteId].invisible = FALSE; StartSpriteAffineAnim(&gSprites[spriteId], BATTLER_AFFINE_EMERGE); AnimateSprite(&gSprites[spriteId]); gSprites[spriteId].data[1] = 0x1000; - sprite->data[7] = 0; + sprite->sTrigIdx = 0; } else { - sprite->data[1]--; + sprite->sDelay--; } } static void SpriteCB_ReleasedMonFlyOut(struct Sprite *sprite) { - bool8 r12 = FALSE; - bool8 r6 = FALSE; - u8 monSpriteId = sprite->data[0]; - u16 var1; - u16 var2; + bool8 emergeAnimFinished = FALSE; + bool8 atFinalPosition = FALSE; + u8 monSpriteId = sprite->sMonSpriteId; + u16 x, y; if (sprite->animEnded) sprite->invisible = TRUE; + if (gSprites[monSpriteId].affineAnimEnded) { StartSpriteAffineAnim(&gSprites[monSpriteId], BATTLER_AFFINE_NORMAL); - r12 = TRUE; + emergeAnimFinished = TRUE; } - var1 = (sprite->data[5] - sprite->x) * sprite->data[7] / 128 + sprite->x; - var2 = (sprite->data[6] - sprite->y) * sprite->data[7] / 128 + sprite->y; - gSprites[monSpriteId].x = var1; - gSprites[monSpriteId].y = var2; - if (sprite->data[7] < 128) - { - s16 sine = -(gSineTable[(u8)sprite->data[7]] / 8); - sprite->data[7] += 4; + x = (sprite->sFinalMonX - sprite->x) * sprite->sTrigIdx / 128 + sprite->x; + y = (sprite->sFinalMonY - sprite->y) * sprite->sTrigIdx / 128 + sprite->y; + gSprites[monSpriteId].x = x; + gSprites[monSpriteId].y = y; + + if (sprite->sTrigIdx < 128) + { + s16 sine = -(gSineTable[(u8)sprite->sTrigIdx] / 8); + + sprite->sTrigIdx += 4; gSprites[monSpriteId].x2 = sine; gSprites[monSpriteId].y2 = sine; } else { - gSprites[monSpriteId].x = sprite->data[5]; - gSprites[monSpriteId].y = sprite->data[6]; + gSprites[monSpriteId].x = sprite->sFinalMonX; + gSprites[monSpriteId].y = sprite->sFinalMonY; gSprites[monSpriteId].x2 = 0; gSprites[monSpriteId].y2 = 0; - r6 = TRUE; + atFinalPosition = TRUE; } - if (sprite->animEnded && r12 && r6) + if (sprite->animEnded && emergeAnimFinished && atFinalPosition) { - if (gSprites[monSpriteId].data[7] == SPECIES_EGG) - DoMonFrontSpriteAnimation(&gSprites[monSpriteId], gSprites[monSpriteId].data[7], TRUE, 0); + if (gSprites[monSpriteId].sSpecies == SPECIES_EGG) + DoMonFrontSpriteAnimation(&gSprites[monSpriteId], gSprites[monSpriteId].sSpecies, TRUE, 0); else - DoMonFrontSpriteAnimation(&gSprites[monSpriteId], gSprites[monSpriteId].data[7], FALSE, 0); + DoMonFrontSpriteAnimation(&gSprites[monSpriteId], gSprites[monSpriteId].sSpecies, FALSE, 0); DestroySpriteAndFreeResources(sprite); } } -u8 CreateTradePokeballSprite(u8 a, u8 b, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 g, u32 h) +#undef sSpecies +#undef sFinalMonX +#undef sFinalMonY +#undef sTrigIdx + + +#define sTimer data[5] + +u8 CreateTradePokeballSprite(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 delay, u32 fadePalettes) { u8 spriteId; - LoadCompressedSpriteSheetUsingHeap(&gBallSpriteSheets[0]); - LoadCompressedSpritePaletteUsingHeap(&gBallSpritePalettes[0]); - spriteId = CreateSprite(&gBallSpriteTemplates[0], x, y, subPriority); - gSprites[spriteId].data[0] = a; - gSprites[spriteId].data[1] = g; - gSprites[spriteId].data[2] = b; - gSprites[spriteId].data[3] = h; - gSprites[spriteId].data[4] = h >> 16; + LoadCompressedSpriteSheetUsingHeap(&gBallSpriteSheets[BALL_POKE]); + LoadCompressedSpritePaletteUsingHeap(&gBallSpritePalettes[BALL_POKE]); + spriteId = CreateSprite(&gBallSpriteTemplates[BALL_POKE], x, y, subPriority); + gSprites[spriteId].sMonSpriteId = monSpriteId; + gSprites[spriteId].sDelay = delay; + gSprites[spriteId].sMonPalNum = monPalNum; + gSprites[spriteId].sFadePalsLo = fadePalettes; + gSprites[spriteId].sFadePalsHi = fadePalettes >> 16; gSprites[spriteId].oam.priority = oamPriority; gSprites[spriteId].callback = SpriteCB_TradePokeball; return spriteId; @@ -1132,12 +1156,12 @@ u8 CreateTradePokeballSprite(u8 a, u8 b, u8 x, u8 y, u8 oamPriority, u8 subPrior static void SpriteCB_TradePokeball(struct Sprite *sprite) { - if (sprite->data[1] == 0) + if (sprite->sDelay == 0) { u8 subpriority; - u8 monSpriteId = sprite->data[0]; - u8 battlerId = sprite->data[2]; - u32 selectedPalettes = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16); + u8 monSpriteId = sprite->sMonSpriteId; + u8 monPalNum = sprite->sMonPalNum; + u32 selectedPalettes = (u16)sprite->sFadePalsLo | ((u16)sprite->sFadePalsHi << 16); if (sprite->subpriority != 0) subpriority = sprite->subpriority - 1; @@ -1146,7 +1170,8 @@ static void SpriteCB_TradePokeball(struct Sprite *sprite) StartSpriteAnim(sprite, 1); AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, subpriority); - sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, battlerId, selectedPalettes); + // sDelay re-used to store task id but never read + sprite->sDelay = LaunchBallFadeMonTaskForPokeball(1, monPalNum, selectedPalettes); sprite->callback = SpriteCB_TradePokeballSendOff; #ifdef BUGFIX // FIX: If this is used on a sprite that has previously had an affine animation, it will not @@ -1159,7 +1184,7 @@ static void SpriteCB_TradePokeball(struct Sprite *sprite) } else { - sprite->data[1]--; + sprite->sDelay--; } } @@ -1167,15 +1192,16 @@ static void SpriteCB_TradePokeballSendOff(struct Sprite *sprite) { u8 monSpriteId; - sprite->data[5]++; - if (sprite->data[5] == 11) + sprite->sTimer++; + if (sprite->sTimer == 11) PlaySE(SE_BALL_TRADE); - monSpriteId = sprite->data[0]; + + monSpriteId = sprite->sMonSpriteId; if (gSprites[monSpriteId].affineAnimEnded) { StartSpriteAnim(sprite, 2); gSprites[monSpriteId].invisible = TRUE; - sprite->data[5] = 0; + sprite->sTimer = 0; sprite->callback = SpriteCB_TradePokeballEnd; } else @@ -1191,6 +1217,13 @@ static void SpriteCB_TradePokeballEnd(struct Sprite *sprite) sprite->callback = SpriteCallbackDummy; } +#undef sMonSpriteId +#undef sDelay +#undef sMonPalNum +#undef sFadePalsLo +#undef sFadePalsHi +#undef sTimer + static void Unref_DestroySpriteAndFreeResources(struct Sprite *sprite) { DestroySpriteAndFreeResources(sprite); diff --git a/src/pokedex.c b/src/pokedex.c index 206782e59..b247c8c8d 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -4428,37 +4428,37 @@ bool16 HasAllMons(void) return TRUE; } -static void ResetOtherVideoRegisters(u16 a) +static void ResetOtherVideoRegisters(u16 regBits) { - if (!(a & DISPCNT_BG0_ON)) + if (!(regBits & DISPCNT_BG0_ON)) { ClearGpuRegBits(0, DISPCNT_BG0_ON); SetGpuReg(REG_OFFSET_BG0CNT, 0); SetGpuReg(REG_OFFSET_BG0HOFS, 0); SetGpuReg(REG_OFFSET_BG0VOFS, 0); } - if (!(a & DISPCNT_BG1_ON)) + if (!(regBits & DISPCNT_BG1_ON)) { ClearGpuRegBits(0, DISPCNT_BG1_ON); SetGpuReg(REG_OFFSET_BG1CNT, 0); SetGpuReg(REG_OFFSET_BG1HOFS, 0); SetGpuReg(REG_OFFSET_BG1VOFS, 0); } - if (!(a & DISPCNT_BG2_ON)) + if (!(regBits & DISPCNT_BG2_ON)) { ClearGpuRegBits(0, DISPCNT_BG2_ON); SetGpuReg(REG_OFFSET_BG2CNT, 0); SetGpuReg(REG_OFFSET_BG2HOFS, 0); SetGpuReg(REG_OFFSET_BG2VOFS, 0); } - if (!(a & DISPCNT_BG3_ON)) + if (!(regBits & DISPCNT_BG3_ON)) { ClearGpuRegBits(0, DISPCNT_BG3_ON); SetGpuReg(REG_OFFSET_BG3CNT, 0); SetGpuReg(REG_OFFSET_BG3HOFS, 0); SetGpuReg(REG_OFFSET_BG3VOFS, 0); } - if (!(a & DISPCNT_OBJ_ON)) + if (!(regBits & DISPCNT_OBJ_ON)) { ClearGpuRegBits(0, DISPCNT_OBJ_ON); ResetSpriteData(); diff --git a/src/pokedex_area_region_map.c b/src/pokedex_area_region_map.c index 4926c019d..ff32f8eef 100644 --- a/src/pokedex_area_region_map.c +++ b/src/pokedex_area_region_map.c @@ -63,7 +63,7 @@ void FreePokedexAreaMapBgNum(void) TRY_FREE_AND_SET_NULL(sPokedexAreaMapBgNum); } -void PokedexAreaMapChangeBgY(u32 a0) +void PokedexAreaMapChangeBgY(u32 move) { - ChangeBgY(*sPokedexAreaMapBgNum, a0 * 0x100, BG_COORD_SET); + ChangeBgY(*sPokedexAreaMapBgNum, move * 0x100, BG_COORD_SET); } diff --git a/src/pokemon.c b/src/pokemon.c index af5771a6a..db0febe26 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5798,13 +5798,13 @@ u16 GetLinkTrainerFlankId(u8 linkPlayerId) return flankId; } -s32 GetBattlerMultiplayerId(u16 a1) +s32 GetBattlerMultiplayerId(u16 id) { - s32 id; - for (id = 0; id < MAX_LINK_PLAYERS; id++) - if (gLinkPlayers[id].id == a1) + s32 multiplayerId; + for (multiplayerId = 0; multiplayerId < MAX_LINK_PLAYERS; multiplayerId++) + if (gLinkPlayers[multiplayerId].id == id) break; - return id; + return multiplayerId; } u8 GetTrainerEncounterMusicId(u16 trainerOpponentId) diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c index e00f5dbc8..32333ee67 100755 --- a/src/pokemon_jump.c +++ b/src/pokemon_jump.c @@ -3612,7 +3612,6 @@ static u32 AddMessageWindow(u32 left, u32 top, u32 width, u32 height) static void CreatePokeJumpYesNoMenu(u16 left, u16 top, u8 cursorPos) { struct WindowTemplate window; - u8 a = cursorPos; window.bg = BG_INTERFACE; window.tilemapLeft = left; @@ -3622,7 +3621,7 @@ static void CreatePokeJumpYesNoMenu(u16 left, u16 top, u8 cursorPos) window.paletteNum = 2; window.baseBlock = 0x2B; - CreateYesNoMenu(&window, 1, 0xD, a); + CreateYesNoMenu(&window, 1, 0xD, cursorPos); } // "Points" for jump score and "times" for number of jumps in a row diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 10c69a422..e33e79460 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -195,62 +195,62 @@ static bool8 LoadGraphics(void); static void CB2_InitSummaryScreen(void); static void InitBGs(void); static bool8 DecompressGraphics(void); -static void CopyMonToSummaryStruct(struct Pokemon* a); -static bool8 ExtractMonDataToSummaryStruct(struct Pokemon* a); +static void CopyMonToSummaryStruct(struct Pokemon*); +static bool8 ExtractMonDataToSummaryStruct(struct Pokemon*); static void SetDefaultTilemaps(void); -static void CloseSummaryScreen(u8 taskId); -static void Task_HandleInput(u8 taskId); -static void ChangeSummaryPokemon(u8 taskId, s8 a); -static void Task_ChangeSummaryMon(u8 taskId); -static s8 AdvanceMonIndex(s8 delta); -static s8 AdvanceMultiBattleMonIndex(s8 delta); -static bool8 IsValidToViewInMulti(struct Pokemon* mon); -static void ChangePage(u8 taskId, s8 a); -static void PssScrollRight(u8 taskId); -static void PssScrollRightEnd(u8 taskId); -static void PssScrollLeft(u8 taskId); -static void PssScrollLeftEnd(u8 taskId); +static void CloseSummaryScreen(u8); +static void Task_HandleInput(u8); +static void ChangeSummaryPokemon(u8, s8); +static void Task_ChangeSummaryMon(u8); +static s8 AdvanceMonIndex(s8); +static s8 AdvanceMultiBattleMonIndex(s8); +static bool8 IsValidToViewInMulti(struct Pokemon*); +static void ChangePage(u8, s8); +static void PssScrollRight(u8); +static void PssScrollRightEnd(u8); +static void PssScrollLeft(u8); +static void PssScrollLeftEnd(u8); static void TryDrawExperienceProgressBar(void); -static void SwitchToMoveSelection(u8 taskId); -static void Task_HandleInput_MoveSelect(u8 taskId); +static void SwitchToMoveSelection(u8); +static void Task_HandleInput_MoveSelect(u8); static bool8 HasMoreThanOneMove(void); -static void ChangeSelectedMove(s16 *taskData, s8 direction, u8 *moveIndexPtr); -static void CloseMoveSelectMode(u8 taskId); -static void SwitchToMovePositionSwitchMode(u8 a); -static void Task_HandleInput_MovePositionSwitch(u8 taskId); -static void ExitMovePositionSwitchMode(u8 taskId, bool8 swapMoves); -static void SwapMonMoves(struct Pokemon *mon, u8 moveIndex1, u8 moveIndex2); -static void SwapBoxMonMoves(struct BoxPokemon *mon, u8 moveIndex1, u8 moveIndex2); -static void Task_SetHandleReplaceMoveInput(u8 taskId); -static void Task_HandleReplaceMoveInput(u8 taskId); +static void ChangeSelectedMove(s16 *, s8, u8 *); +static void CloseMoveSelectMode(u8); +static void SwitchToMovePositionSwitchMode(u8); +static void Task_HandleInput_MovePositionSwitch(u8); +static void ExitMovePositionSwitchMode(u8, bool8); +static void SwapMonMoves(struct Pokemon *, u8, u8); +static void SwapBoxMonMoves(struct BoxPokemon *, u8, u8); +static void Task_SetHandleReplaceMoveInput(u8); +static void Task_HandleReplaceMoveInput(u8); static bool8 CanReplaceMove(void); -static void ShowCantForgetHMsWindow(u8 taskId); -static void Task_HandleInputCantForgetHMsMoves(u8 taskId); +static void ShowCantForgetHMsWindow(u8); +static void Task_HandleInputCantForgetHMsMoves(u8); static void DrawPagination(void); -static void HandlePowerAccTilemap(u16 a, s16 b); -static void Task_ShowPowerAccWindow(u8 taskId); -static void HandleAppealJamTilemap(u16 a, s16 b, u16 c); -static void Task_ShowAppealJamWindow(u8 taskId); -static void HandleStatusTilemap(u16 a, s16 b); -static void Task_ShowStatusWindow(u8 taskId); -static void TilemapFiveMovesDisplay(u16 *dst, u16 palette, bool8 remove); -static void DrawPokerusCuredSymbol(struct Pokemon* mon); -static void DrawExperienceProgressBar(struct Pokemon* mon); -static void DrawContestMoveHearts(u16 move); +static void HandlePowerAccTilemap(u16, s16); +static void Task_ShowPowerAccWindow(u8); +static void HandleAppealJamTilemap(u16, s16, u16); +static void Task_ShowAppealJamWindow(u8); +static void HandleStatusTilemap(u16, s16); +static void Task_ShowStatusWindow(u8); +static void TilemapFiveMovesDisplay(u16 *, u16, bool8); +static void DrawPokerusCuredSymbol(struct Pokemon*); +static void DrawExperienceProgressBar(struct Pokemon*); +static void DrawContestMoveHearts(u16); static void LimitEggSummaryPageDisplay(void); static void ResetWindows(void); static void PrintMonInfo(void); static void PrintNotEggInfo(void); static void PrintEggInfo(void); -static void PrintGenderSymbol(struct Pokemon *mon, u16 a); +static void PrintGenderSymbol(struct Pokemon *, u16); static void PrintPageNamesAndStats(void); -static void PutPageWindowTilemaps(u8 a); -static void ClearPageWindowTilemaps(u8 a); -static void RemoveWindowByIndex(u8 a); -static void PrintPageSpecificText(u8 a); -static void CreateTextPrinterTask(u8 a); +static void PutPageWindowTilemaps(u8); +static void ClearPageWindowTilemaps(u8); +static void RemoveWindowByIndex(u8); +static void PrintPageSpecificText(u8); +static void CreateTextPrinterTask(u8); static void PrintInfoPageText(void); -static void Task_PrintInfoPage(u8 taskId); +static void Task_PrintInfoPage(u8); static void PrintMonOTName(void); static void PrintMonOTID(void); static void PrintMonAbilityName(void); @@ -258,7 +258,7 @@ static void PrintMonAbilityDescription(void); static void BufferMonTrainerMemo(void); static void PrintMonTrainerMemo(void); static void BufferNatureString(void); -static void GetMetLevelString(u8 *a); +static void GetMetLevelString(u8 *); static bool8 DoesMonOTMatchOwner(void); static bool8 DidMonComeFromGBAGames(void); static bool8 IsInGamePartnerMon(void); @@ -266,7 +266,7 @@ static void PrintEggOTName(void); static void PrintEggOTID(void); static void PrintEggState(void); static void PrintEggMemo(void); -static void Task_PrintSkillsPage(u8 taskId); +static void Task_PrintSkillsPage(u8); static void PrintHeldItemName(void); static void PrintSkillsPageText(void); static void PrintRibbonCount(void); @@ -276,18 +276,18 @@ static void BufferRightColumnStats(void); static void PrintRightColumnStats(void); static void PrintExpPointsNextLevel(void); static void PrintBattleMoves(void); -static void Task_PrintBattleMoves(u8 taskId); -static void PrintMoveNameAndPP(u8 a); +static void Task_PrintBattleMoves(u8); +static void PrintMoveNameAndPP(u8); static void PrintContestMoves(void); -static void Task_PrintContestMoves(u8 taskId); -static void PrintContestMoveDescription(u8 a); -static void PrintMoveDetails(u16 a); +static void Task_PrintContestMoves(u8); +static void PrintContestMoveDescription(u8); +static void PrintMoveDetails(u16); static void PrintNewMoveDetailsOrCancelText(void); static void AddAndFillMoveNamesWindow(void); -static void SwapMovesNamesPP(u8 moveIndex1, u8 moveIndex2); +static void SwapMovesNamesPP(u8, u8); static void PrintHMMovesCantBeForgotten(void); static void ResetSpriteIds(void); -static void SetSpriteInvisibility(u8 spriteArrayId, bool8 invisible); +static void SetSpriteInvisibility(u8, bool8); static void HidePageSpecificSprites(void); static void SetTypeIcons(void); static void CreateMoveTypeIcons(void); @@ -295,20 +295,20 @@ static void SetMonTypeIcons(void); static void SetMoveTypeIcons(void); static void SetContestMoveTypeIcons(void); static void SetNewMoveTypeIcon(void); -static void SwapMovesTypeSprites(u8 moveIndex1, u8 moveIndex2); -static u8 LoadMonGfxAndSprite(struct Pokemon *a, s16 *b); -static u8 CreateMonSprite(struct Pokemon *unused); +static void SwapMovesTypeSprites(u8, u8); +static u8 LoadMonGfxAndSprite(struct Pokemon *, s16 *); +static u8 CreateMonSprite(struct Pokemon *); static void SpriteCB_Pokemon(struct Sprite *); static void StopPokemonAnimations(void); -static void CreateMonMarkingsSprite(struct Pokemon *mon); -static void RemoveAndCreateMonMarkingsSprite(struct Pokemon *mon); -static void CreateCaughtBallSprite(struct Pokemon *mon); +static void CreateMonMarkingsSprite(struct Pokemon *); +static void RemoveAndCreateMonMarkingsSprite(struct Pokemon *); +static void CreateCaughtBallSprite(struct Pokemon *); static void CreateSetStatusSprite(void); -static void CreateMoveSelectorSprites(u8 idArrayStart); -static void SpriteCb_MoveSelector(struct Sprite *sprite); -static void DestroyMoveSelectorSprites(u8 firstArrayId); -static void SetMainMoveSelectorColor(u8 whichColor); -static void KeepMoveSelectorVisible(u8 firstSpriteId); +static void CreateMoveSelectorSprites(u8); +static void SpriteCb_MoveSelector(struct Sprite *); +static void DestroyMoveSelectorSprites(u8); +static void SetMainMoveSelectorColor(u8); +static void KeepMoveSelectorVisible(u8); static void SummaryScreen_DestroyAnimDelayTask(void); // const rom data diff --git a/src/pokenav.c b/src/pokenav.c index f9a6614a8..5e8727c64 100644 --- a/src/pokenav.c +++ b/src/pokenav.c @@ -37,16 +37,16 @@ struct PokenavCallbacks static u32 GetCurrentMenuCB(void); static u32 IsActiveMenuLoopTaskActive_(void); -static bool32 SetActivePokenavMenu(u32 menuId); +static bool32 SetActivePokenavMenu(u32); static bool32 AnyMonHasRibbon(void); -static void InitPokenavResources(struct PokenavResources *a0); +static void InitPokenavResources(struct PokenavResources *); static void InitKeys_(void); static void FreePokenavResources(void); static void VBlankCB_Pokenav(void); static void CB2_Pokenav(void); -static void Task_RunLoopedTask_LinkMode(u8 a0); -static void Task_RunLoopedTask(u8 taskId); -static void Task_Pokenav(u8 taskId); +static void Task_RunLoopedTask_LinkMode(u8); +static void Task_RunLoopedTask(u8); +static void Task_Pokenav(u8); static void CB2_InitPokenavForTutorial(void); const struct PokenavCallbacks PokenavMenuCallbacks[15] = diff --git a/src/pokenav_list.c b/src/pokenav_list.c index bdba1d2c0..350a78504 100644 --- a/src/pokenav_list.c +++ b/src/pokenav_list.c @@ -40,7 +40,7 @@ struct PokenavListWindowState { struct PokenavListSub { struct PokenavListMenuWindow listWindow; - u32 unk10; + u32 printStart; u32 printIndex; u32 itemSize; void * listPtr; @@ -59,7 +59,7 @@ struct PokenavListSub struct PokenavList { - struct PokenavListSub list; + struct PokenavListSub sub; u8 tilemapBuffer[BG_SCREEN_SIZE]; struct PokenavListWindowState windowState; s32 eraseIndex; @@ -100,12 +100,12 @@ static EWRAM_DATA u32 sMoveWindowDownIndex = 0; // Read, but pointlessly bool32 CreatePokenavList(const struct BgTemplate *bgTemplate, struct PokenavListTemplate *listTemplate, s32 tileOffset) { - struct PokenavList *structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_LIST, sizeof(struct PokenavList)); - if (structPtr == NULL) + struct PokenavList *list = AllocSubstruct(POKENAV_SUBSTRUCT_LIST, sizeof(struct PokenavList)); + if (list == NULL) return FALSE; - InitPokenavListWindowState(&structPtr->windowState, listTemplate); - if (!CopyPokenavListMenuTemplate(&structPtr->list, bgTemplate, listTemplate, tileOffset)) + InitPokenavListWindowState(&list->windowState, listTemplate); + if (!CopyPokenavListMenuTemplate(&list->sub, bgTemplate, listTemplate, tileOffset)) return FALSE; CreateLoopedTask(LoopedTask_CreatePokenavList, 6); @@ -119,31 +119,31 @@ bool32 IsCreatePokenavListTaskActive(void) void DestroyPokenavList(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - DestroyListArrows(&structPtr->list); - RemoveWindow(structPtr->list.listWindow.windowId); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + DestroyListArrows(&list->sub); + RemoveWindow(list->sub.listWindow.windowId); FreePokenavSubstruct(POKENAV_SUBSTRUCT_LIST); } static u32 LoopedTask_CreatePokenavList(s32 state) { - struct PokenavList *structPtr; + struct PokenavList *list; if (IsDma3ManagerBusyWithBgCopy()) return LT_PAUSE; - structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); switch (state) { case 0: - InitPokenavListBg(structPtr); + InitPokenavListBg(list); return LT_INC_AND_PAUSE; case 1: - InitPokenavListWindow(&structPtr->list.listWindow); + InitPokenavListWindow(&list->sub.listWindow); return LT_INC_AND_PAUSE; case 2: - InitListItems(&structPtr->windowState, &structPtr->list); + InitListItems(&list->windowState, &list->sub); return LT_INC_AND_PAUSE; case 3: if (IsPrintListItemsTaskActive()) @@ -156,24 +156,24 @@ static u32 LoopedTask_CreatePokenavList(s32 state) return LT_INC_AND_CONTINUE; } case 4: - CreateListArrowSprites(&structPtr->windowState, &structPtr->list); + CreateListArrowSprites(&list->windowState, &list->sub); return LT_FINISH; default: return LT_FINISH; } } -static void InitPokenavListBg(struct PokenavList *a0) +static void InitPokenavListBg(struct PokenavList *list) { - u16 tileNum = (a0->list.listWindow.fillValue << 12) | a0->list.listWindow.tileOffset; - BgDmaFill(a0->list.listWindow.bg, PIXEL_FILL(1), a0->list.listWindow.tileOffset, 1); - BgDmaFill(a0->list.listWindow.bg, PIXEL_FILL(4), a0->list.listWindow.tileOffset + 1, 1); - SetBgTilemapBuffer(a0->list.listWindow.bg, a0->tilemapBuffer); - FillBgTilemapBufferRect_Palette0(a0->list.listWindow.bg, tileNum, 0, 0, 32, 32); - ChangeBgY(a0->list.listWindow.bg, 0, BG_COORD_SET); - ChangeBgX(a0->list.listWindow.bg, 0, BG_COORD_SET); - ChangeBgY(a0->list.listWindow.bg, a0->list.listWindow.y << 11, BG_COORD_SUB); - CopyBgTilemapBufferToVram(a0->list.listWindow.bg); + u16 tileNum = (list->sub.listWindow.fillValue << 12) | list->sub.listWindow.tileOffset; + BgDmaFill(list->sub.listWindow.bg, PIXEL_FILL(1), list->sub.listWindow.tileOffset, 1); + BgDmaFill(list->sub.listWindow.bg, PIXEL_FILL(4), list->sub.listWindow.tileOffset + 1, 1); + SetBgTilemapBuffer(list->sub.listWindow.bg, list->tilemapBuffer); + FillBgTilemapBufferRect_Palette0(list->sub.listWindow.bg, tileNum, 0, 0, 32, 32); + ChangeBgY(list->sub.listWindow.bg, 0, BG_COORD_SET); + ChangeBgX(list->sub.listWindow.bg, 0, BG_COORD_SET); + ChangeBgY(list->sub.listWindow.bg, list->sub.listWindow.y << 11, BG_COORD_SUB); + CopyBgTilemapBufferToVram(list->sub.listWindow.bg); } static void InitPokenavListWindow(struct PokenavListMenuWindow *listWindow) @@ -183,16 +183,16 @@ static void InitPokenavListWindow(struct PokenavListMenuWindow *listWindow) CopyWindowToVram(listWindow->windowId, COPYWIN_MAP); } -static void InitListItems(struct PokenavListWindowState *windowState, struct PokenavListSub *a1) +static void InitListItems(struct PokenavListWindowState *windowState, struct PokenavListSub *subPtr) { s32 numToPrint = windowState->listLength - windowState->windowTopIndex; if (numToPrint > windowState->entriesOnscreen) numToPrint = windowState->entriesOnscreen; - PrintListItems(windowState->listPtr, windowState->windowTopIndex, numToPrint, windowState->listItemSize, 0, a1); + PrintListItems(windowState->listPtr, windowState->windowTopIndex, numToPrint, windowState->listItemSize, 0, subPtr); } -static void PrintListItems(void * listPtr, u32 topIndex, u32 numItems, u32 itemSize, u32 a4, struct PokenavListSub *list) +static void PrintListItems(void * listPtr, u32 topIndex, u32 numItems, u32 itemSize, u32 printStart, struct PokenavListSub *list) { if (numItems == 0) return; @@ -202,7 +202,7 @@ static void PrintListItems(void * listPtr, u32 topIndex, u32 numItems, u32 itemS list->listWindow.numPrinted = 0; list->listWindow.numToPrint = numItems; list->printIndex = topIndex; - list->unk10 = a4; + list->printStart = printStart; CreateLoopedTask(LoopedTask_PrintListItems, 5); } @@ -214,31 +214,31 @@ static bool32 IsPrintListItemsTaskActive(void) static u32 LoopedTask_PrintListItems(s32 state) { u32 row; - struct PokenavListSub *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavListSub *listSub = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); switch (state) { case 0: - row = (structPtr->listWindow.unkA + structPtr->listWindow.numPrinted + structPtr->unk10) & 0xF; - structPtr->bufferItemFunc(structPtr->listPtr, structPtr->itemTextBuffer); - if (structPtr->iconDrawFunc != NULL) - structPtr->iconDrawFunc(structPtr->listWindow.windowId, structPtr->printIndex, row); + row = (listSub->listWindow.unkA + listSub->listWindow.numPrinted + listSub->printStart) & 0xF; + listSub->bufferItemFunc(listSub->listPtr, listSub->itemTextBuffer); + if (listSub->iconDrawFunc != NULL) + listSub->iconDrawFunc(listSub->listWindow.windowId, listSub->printIndex, row); - AddTextPrinterParameterized(structPtr->listWindow.windowId, structPtr->listWindow.fontId, structPtr->itemTextBuffer, 8, (row << 4) + 1, TEXT_SKIP_DRAW, NULL); - if (++structPtr->listWindow.numPrinted >= structPtr->listWindow.numToPrint) + AddTextPrinterParameterized(listSub->listWindow.windowId, listSub->listWindow.fontId, listSub->itemTextBuffer, 8, (row << 4) + 1, TEXT_SKIP_DRAW, NULL); + if (++listSub->listWindow.numPrinted >= listSub->listWindow.numToPrint) { // Finished printing items. If icons were being drawn, draw the // window tilemap and graphics. Otherwise just do the graphics - if (structPtr->iconDrawFunc != NULL) - CopyWindowToVram(structPtr->listWindow.windowId, COPYWIN_FULL); + if (listSub->iconDrawFunc != NULL) + CopyWindowToVram(listSub->listWindow.windowId, COPYWIN_FULL); else - CopyWindowToVram(structPtr->listWindow.windowId, COPYWIN_GFX); + CopyWindowToVram(listSub->listWindow.windowId, COPYWIN_GFX); return LT_INC_AND_PAUSE; } else { - structPtr->listPtr += structPtr->itemSize; - structPtr->printIndex++; + listSub->listPtr += listSub->itemSize; + listSub->printIndex++; return LT_CONTINUE; } case 1: @@ -251,42 +251,42 @@ static u32 LoopedTask_PrintListItems(s32 state) static bool32 ShouldShowUpArrow(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - return (structPtr->windowState.windowTopIndex != 0); + return (list->windowState.windowTopIndex != 0); } static bool32 ShouldShowDownArrow(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - struct PokenavListWindowState *subPtr = &structPtr->windowState; + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavListWindowState *windowState = &list->windowState; - return (subPtr->windowTopIndex + subPtr->entriesOnscreen < subPtr->listLength); + return (windowState->windowTopIndex + windowState->entriesOnscreen < windowState->listLength); } static void MoveListWindow(s32 delta, bool32 printItems) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - struct PokenavListWindowState *subPtr = &structPtr->windowState; + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavListWindowState *windowState = &list->windowState; if (delta < 0) { - if (subPtr->windowTopIndex + delta < 0) - delta = -1 * subPtr->windowTopIndex; + if (windowState->windowTopIndex + delta < 0) + delta = -1 * windowState->windowTopIndex; if (printItems) - PrintListItems(subPtr->listPtr, subPtr->windowTopIndex + delta, delta * -1, subPtr->listItemSize, delta, &structPtr->list); + PrintListItems(windowState->listPtr, windowState->windowTopIndex + delta, delta * -1, windowState->listItemSize, delta, &list->sub); } else if (printItems) { - s32 index = sMoveWindowDownIndex = subPtr->windowTopIndex + subPtr->entriesOnscreen; - if (index + delta >= subPtr->listLength) - delta = subPtr->listLength - index; + s32 index = sMoveWindowDownIndex = windowState->windowTopIndex + windowState->entriesOnscreen; + if (index + delta >= windowState->listLength) + delta = windowState->listLength - index; - PrintListItems(subPtr->listPtr, index, delta, subPtr->listItemSize, subPtr->entriesOnscreen, &structPtr->list); + PrintListItems(windowState->listPtr, index, delta, windowState->listItemSize, windowState->entriesOnscreen, &list->sub); } - CreateMoveListWindowTask(delta, &structPtr->list); - subPtr->windowTopIndex += delta; + CreateMoveListWindowTask(delta, &list->sub); + windowState->windowTopIndex += delta; } static void CreateMoveListWindowTask(s32 delta, struct PokenavListSub *list) @@ -305,8 +305,8 @@ static u32 LoopedTask_MoveListWindow(s32 state) { s32 oldY, newY; bool32 finished; - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - struct PokenavListSub *subPtr = &structPtr->list; + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavListSub *subPtr = &list->sub; switch (state) { @@ -342,23 +342,23 @@ static u32 LoopedTask_MoveListWindow(s32 state) bool32 PokenavList_IsMoveWindowTaskActive(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - return IsLoopedTaskActive(structPtr->list.loopedTaskId); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + return IsLoopedTaskActive(list->sub.loopedTaskId); } static struct PokenavListWindowState *GetPokenavListWindowState(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - return &structPtr->windowState; + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + return &list->windowState; } int PokenavList_MoveCursorUp(void) { - struct PokenavListWindowState *structPtr = GetPokenavListWindowState(); + struct PokenavListWindowState *windowState = GetPokenavListWindowState(); - if (structPtr->selectedIndexOffset != 0) + if (windowState->selectedIndexOffset != 0) { - structPtr->selectedIndexOffset--; + windowState->selectedIndexOffset--; return 1; } if (ShouldShowUpArrow()) @@ -371,13 +371,13 @@ int PokenavList_MoveCursorUp(void) int PokenavList_MoveCursorDown(void) { - struct PokenavListWindowState *structPtr = GetPokenavListWindowState(); + struct PokenavListWindowState *windowState = GetPokenavListWindowState(); - if (structPtr->windowTopIndex + structPtr->selectedIndexOffset >= structPtr->listLength - 1) + if (windowState->windowTopIndex + windowState->selectedIndexOffset >= windowState->listLength - 1) return 0; - if (structPtr->selectedIndexOffset < structPtr->entriesOnscreen - 1) + if (windowState->selectedIndexOffset < windowState->entriesOnscreen - 1) { - structPtr->selectedIndexOffset++; + windowState->selectedIndexOffset++; return 1; } if (ShouldShowDownArrow()) @@ -391,20 +391,20 @@ int PokenavList_MoveCursorDown(void) int PokenavList_PageUp(void) { s32 scroll; - struct PokenavListWindowState *structPtr = GetPokenavListWindowState(); + struct PokenavListWindowState *windowState = GetPokenavListWindowState(); if (ShouldShowUpArrow()) { - if (structPtr->windowTopIndex >= structPtr->entriesOnscreen) - scroll = structPtr->entriesOnscreen; + if (windowState->windowTopIndex >= windowState->entriesOnscreen) + scroll = windowState->entriesOnscreen; else - scroll = structPtr->windowTopIndex; + scroll = windowState->windowTopIndex; MoveListWindow(scroll * -1, TRUE); return 2; } - else if (structPtr->selectedIndexOffset != 0) + else if (windowState->selectedIndexOffset != 0) { - structPtr->selectedIndexOffset = 0; + windowState->selectedIndexOffset = 0; return 1; } return 0; @@ -412,112 +412,112 @@ int PokenavList_PageUp(void) int PokenavList_PageDown(void) { - struct PokenavListWindowState *structPtr = GetPokenavListWindowState(); + struct PokenavListWindowState *windowState = GetPokenavListWindowState(); if (ShouldShowDownArrow()) { - s32 windowBottomIndex = structPtr->windowTopIndex + structPtr->entriesOnscreen; - s32 scroll = structPtr->entriesOffscreen - structPtr->windowTopIndex; + s32 windowBottomIndex = windowState->windowTopIndex + windowState->entriesOnscreen; + s32 scroll = windowState->entriesOffscreen - windowState->windowTopIndex; - if (windowBottomIndex <= structPtr->entriesOffscreen) - scroll = structPtr->entriesOnscreen; + if (windowBottomIndex <= windowState->entriesOffscreen) + scroll = windowState->entriesOnscreen; MoveListWindow(scroll, TRUE); return 2; } else { s32 cursor, lastVisibleIndex; - if (structPtr->listLength >= structPtr->entriesOnscreen) + if (windowState->listLength >= windowState->entriesOnscreen) { - cursor = structPtr->selectedIndexOffset; - lastVisibleIndex = structPtr->entriesOnscreen; + cursor = windowState->selectedIndexOffset; + lastVisibleIndex = windowState->entriesOnscreen; } else { - cursor = structPtr->selectedIndexOffset; - lastVisibleIndex = structPtr->listLength; + cursor = windowState->selectedIndexOffset; + lastVisibleIndex = windowState->listLength; } lastVisibleIndex -= 1; if (cursor >= lastVisibleIndex) return 0; - structPtr->selectedIndexOffset = lastVisibleIndex; + windowState->selectedIndexOffset = lastVisibleIndex; return 1; } } u32 PokenavList_GetSelectedIndex(void) { - struct PokenavListWindowState *structPtr = GetPokenavListWindowState(); + struct PokenavListWindowState *windowState = GetPokenavListWindowState(); - return structPtr->windowTopIndex + structPtr->selectedIndexOffset; + return windowState->windowTopIndex + windowState->selectedIndexOffset; } u32 PokenavList_GetTopIndex(void) { - struct PokenavListWindowState *structPtr = GetPokenavListWindowState(); + struct PokenavListWindowState *windowState = GetPokenavListWindowState(); - return structPtr->windowTopIndex; + return windowState->windowTopIndex; } void PokenavList_EraseListForCheckPage(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - structPtr->eraseIndex = 0; - structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_EraseListForCheckPage, 6); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + list->eraseIndex = 0; + list->loopedTaskId = CreateLoopedTask(LoopedTask_EraseListForCheckPage, 6); } void PrintCheckPageInfo(s16 delta) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - structPtr->windowState.windowTopIndex += delta; - structPtr->eraseIndex = 0; - structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_PrintCheckPageInfo, 6); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + list->windowState.windowTopIndex += delta; + list->eraseIndex = 0; + list->loopedTaskId = CreateLoopedTask(LoopedTask_PrintCheckPageInfo, 6); } void PokenavList_ReshowListFromCheckPage(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - structPtr->eraseIndex = 0; - structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_ReshowListFromCheckPage, 6); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + list->eraseIndex = 0; + list->loopedTaskId = CreateLoopedTask(LoopedTask_ReshowListFromCheckPage, 6); } bool32 PokenavList_IsTaskActive(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - return IsLoopedTaskActive(structPtr->loopedTaskId); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + return IsLoopedTaskActive(list->loopedTaskId); } void PokenavList_DrawCurrentItemIcon(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - struct PokenavListWindowState *subPtr = &structPtr->windowState; - structPtr->list.iconDrawFunc(structPtr->list.listWindow.windowId, subPtr->windowTopIndex + subPtr->selectedIndexOffset, (structPtr->list.listWindow.unkA + subPtr->selectedIndexOffset) & 0xF); - CopyWindowToVram(structPtr->list.listWindow.windowId, COPYWIN_MAP); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavListWindowState *windowState = &list->windowState; + list->sub.iconDrawFunc(list->sub.listWindow.windowId, windowState->windowTopIndex + windowState->selectedIndexOffset, (list->sub.listWindow.unkA + windowState->selectedIndexOffset) & 0xF); + CopyWindowToVram(list->sub.listWindow.windowId, COPYWIN_MAP); } static u32 LoopedTask_EraseListForCheckPage(s32 state) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); switch (state) { case 0: - ToggleListArrows(&structPtr->list, 1); + ToggleListArrows(&list->sub, 1); // fall-through case 1: - if (structPtr->eraseIndex != structPtr->windowState.selectedIndexOffset) - EraseListEntry(&structPtr->list.listWindow, structPtr->eraseIndex, 1); + if (list->eraseIndex != list->windowState.selectedIndexOffset) + EraseListEntry(&list->sub.listWindow, list->eraseIndex, 1); - structPtr->eraseIndex++; + list->eraseIndex++; return LT_INC_AND_PAUSE; case 2: if (!IsDma3ManagerBusyWithBgCopy()) { - if (structPtr->eraseIndex != structPtr->windowState.entriesOnscreen) + if (list->eraseIndex != list->windowState.entriesOnscreen) return LT_SET_STATE(1); - if (structPtr->windowState.selectedIndexOffset != 0) - EraseListEntry(&structPtr->list.listWindow, structPtr->eraseIndex, structPtr->windowState.selectedIndexOffset); + if (list->windowState.selectedIndexOffset != 0) + EraseListEntry(&list->sub.listWindow, list->eraseIndex, list->windowState.selectedIndexOffset); return LT_INC_AND_PAUSE; } @@ -525,9 +525,9 @@ static u32 LoopedTask_EraseListForCheckPage(s32 state) case 3: if (!IsDma3ManagerBusyWithBgCopy()) { - if (structPtr->windowState.selectedIndexOffset != 0) + if (list->windowState.selectedIndexOffset != 0) { - MoveListWindow(structPtr->windowState.selectedIndexOffset, FALSE); + MoveListWindow(list->windowState.selectedIndexOffset, FALSE); return LT_INC_AND_PAUSE; } return LT_FINISH; @@ -537,7 +537,7 @@ static u32 LoopedTask_EraseListForCheckPage(s32 state) if (PokenavList_IsMoveWindowTaskActive()) return LT_PAUSE; - structPtr->windowState.selectedIndexOffset = 0; + list->windowState.selectedIndexOffset = 0; return LT_FINISH; } return LT_FINISH; @@ -545,35 +545,35 @@ static u32 LoopedTask_EraseListForCheckPage(s32 state) static u32 LoopedTask_PrintCheckPageInfo(s32 state) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); if (IsDma3ManagerBusyWithBgCopy()) return LT_PAUSE; switch (state) { case 0: - PrintCheckPageTrainerName(&structPtr->windowState, &structPtr->list); + PrintCheckPageTrainerName(&list->windowState, &list->sub); break; case 1: - PrintMatchCallFieldNames(&structPtr->list, 0); + PrintMatchCallFieldNames(&list->sub, 0); break; case 2: - PrintMatchCallFlavorText(&structPtr->windowState, &structPtr->list, CHECK_PAGE_STRATEGY); + PrintMatchCallFlavorText(&list->windowState, &list->sub, CHECK_PAGE_STRATEGY); break; case 3: - PrintMatchCallFieldNames(&structPtr->list, 1); + PrintMatchCallFieldNames(&list->sub, 1); break; case 4: - PrintMatchCallFlavorText(&structPtr->windowState, &structPtr->list, CHECK_PAGE_POKEMON); + PrintMatchCallFlavorText(&list->windowState, &list->sub, CHECK_PAGE_POKEMON); break; case 5: - PrintMatchCallFieldNames(&structPtr->list, 2); + PrintMatchCallFieldNames(&list->sub, 2); break; case 6: - PrintMatchCallFlavorText(&structPtr->windowState, &structPtr->list, CHECK_PAGE_INTRO_1); + PrintMatchCallFlavorText(&list->windowState, &list->sub, CHECK_PAGE_INTRO_1); break; case 7: - PrintMatchCallFlavorText(&structPtr->windowState, &structPtr->list, CHECK_PAGE_INTRO_2); + PrintMatchCallFlavorText(&list->windowState, &list->sub, CHECK_PAGE_INTRO_2); break; default: return LT_FINISH; @@ -583,30 +583,30 @@ static u32 LoopedTask_PrintCheckPageInfo(s32 state) static u32 LoopedTask_ReshowListFromCheckPage(s32 state) { - struct PokenavList *structPtr; + struct PokenavList *list; struct PokenavListWindowState *windowState; - struct PokenavListSub *subPtr0; + struct PokenavListSub *subPtr; s32 r5, *ptr; if (IsDma3ManagerBusyWithBgCopy()) return LT_PAUSE; - structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - windowState = &structPtr->windowState; - subPtr0 = &structPtr->list; + list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + windowState = &list->windowState; + subPtr = &list->sub; switch (state) { case 0: // Rewrite the name of the trainer whose check page was just being viewed. // This is done to erase the red background it had. - PrintMatchCallListTrainerName(windowState, subPtr0); + PrintMatchCallListTrainerName(windowState, subPtr); return LT_INC_AND_PAUSE; case 1: - ptr = &structPtr->eraseIndex; - if (++(*ptr) < structPtr->windowState.entriesOnscreen) + ptr = &list->eraseIndex; + if (++(*ptr) < list->windowState.entriesOnscreen) { - EraseListEntry(&subPtr0->listWindow, *ptr, 1); + EraseListEntry(&subPtr->listWindow, *ptr, 1); return LT_PAUSE; } @@ -617,7 +617,7 @@ static u32 LoopedTask_ReshowListFromCheckPage(s32 state) { s32 r4 = windowState->windowTopIndex; r5 = -r4; - EraseListEntry(&subPtr0->listWindow, r5, r4); + EraseListEntry(&subPtr->listWindow, r5, r4); windowState->selectedIndexOffset = r4; *ptr = r5; return LT_INC_AND_PAUSE; @@ -629,7 +629,7 @@ static u32 LoopedTask_ReshowListFromCheckPage(s32 state) { s32 r4 = windowState->windowTopIndex + windowState->entriesOnscreen - windowState->listLength; r5 = -r4; - EraseListEntry(&subPtr0->listWindow, r5, r4); + EraseListEntry(&subPtr->listWindow, r5, r4); windowState->selectedIndexOffset = r4; *ptr = r5; return LT_INC_AND_PAUSE; @@ -637,55 +637,55 @@ static u32 LoopedTask_ReshowListFromCheckPage(s32 state) } return LT_SET_STATE(4); case 2: - MoveListWindow(structPtr->eraseIndex, FALSE); + MoveListWindow(list->eraseIndex, FALSE); return LT_INC_AND_PAUSE; case 3: if (!PokenavList_IsMoveWindowTaskActive()) { - structPtr->eraseIndex = 0; + list->eraseIndex = 0; return LT_INC_AND_CONTINUE; } return LT_PAUSE; case 4: - PrintListItems(windowState->listPtr, windowState->windowTopIndex + structPtr->eraseIndex, 1, windowState->listItemSize, structPtr->eraseIndex, &structPtr->list); + PrintListItems(windowState->listPtr, windowState->windowTopIndex + list->eraseIndex, 1, windowState->listItemSize, list->eraseIndex, &list->sub); return LT_INC_AND_PAUSE; case 5: if (IsPrintListItemsTaskActive()) return LT_PAUSE; - if (++structPtr->eraseIndex >= windowState->listLength || structPtr->eraseIndex >= windowState->entriesOnscreen) + if (++list->eraseIndex >= windowState->listLength || list->eraseIndex >= windowState->entriesOnscreen) return LT_INC_AND_CONTINUE; return LT_SET_STATE(4); case 6: - ToggleListArrows(subPtr0, 0); + ToggleListArrows(subPtr, 0); return LT_FINISH; } return LT_FINISH; } -static void EraseListEntry(struct PokenavListMenuWindow *listWindow, s32 a1, s32 a2) +static void EraseListEntry(struct PokenavListMenuWindow *listWindow, s32 offset, s32 entries) { u8 *tileData = (u8*)GetWindowAttribute(listWindow->windowId, WINDOW_TILE_DATA); u32 width = listWindow->width * 64; - a1 = (listWindow->unkA + a1) & 0xF; - if (a1 + a2 <= 16) + offset = (listWindow->unkA + offset) & 0xF; + if (offset + entries <= 16) { - CpuFastFill8(PIXEL_FILL(1), tileData + a1 * width, a2 * width); + CpuFastFill8(PIXEL_FILL(1), tileData + offset * width, entries * width); CopyWindowToVram(listWindow->windowId, COPYWIN_GFX); } else { - u32 v3 = 16 - a1; - u32 v4 = a2 - v3; + u32 v3 = 16 - offset; + u32 v4 = entries - v3; - CpuFastFill8(PIXEL_FILL(1), tileData + a1 * width, v3 * width); + CpuFastFill8(PIXEL_FILL(1), tileData + offset * width, v3 * width); CpuFastFill8(PIXEL_FILL(1), tileData, v4 * width); CopyWindowToVram(listWindow->windowId, COPYWIN_GFX); } - for (a2--; a2 != -1; a1 = (a1 + 1) & 0xF, a2--) - ClearRematchPokeballIcon(listWindow->windowId, a1); + for (entries--; entries != -1; offset = (offset + 1) & 0xF, entries--) + ClearRematchPokeballIcon(listWindow->windowId, offset); CopyWindowToVram(listWindow->windowId, COPYWIN_MAP); } @@ -744,7 +744,7 @@ static void PrintMatchCallFieldNames(struct PokenavListSub *list, u32 fieldId) CopyWindowRectToVram(list->listWindow.windowId, COPYWIN_GFX, 0, top << 1, list->listWindow.width, 2); } -static void PrintMatchCallFlavorText(struct PokenavListWindowState *a0, struct PokenavListSub *list, u32 checkPageEntry) +static void PrintMatchCallFlavorText(struct PokenavListWindowState *windowState, struct PokenavListSub *list, u32 checkPageEntry) { // lines 1, 3, and 5 are the field names printed by PrintMatchCallFieldNames static const u8 lineOffsets[CHECK_PAGE_ENTRY_COUNT] = { @@ -755,7 +755,7 @@ static void PrintMatchCallFlavorText(struct PokenavListWindowState *a0, struct P }; u32 r6 = (list->listWindow.unkA + lineOffsets[checkPageEntry]) & 0xF; - const u8 *str = GetMatchCallFlavorText(a0->windowTopIndex, checkPageEntry); + const u8 *str = GetMatchCallFlavorText(windowState->windowTopIndex, checkPageEntry); if (str != NULL) { @@ -894,8 +894,8 @@ static void ToggleListArrows(struct PokenavListSub *list, bool32 invisible) static void SpriteCB_RightArrow(struct Sprite *sprite) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - sprite->y2 = structPtr->windowState.selectedIndexOffset << 4; + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + sprite->y2 = list->windowState.selectedIndexOffset << 4; } #define sTimer data[0] @@ -940,9 +940,9 @@ static void SpriteCB_UpArrow(struct Sprite *sprite) void PokenavList_ToggleVerticalArrows(bool32 invisible) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - structPtr->list.upArrow->sInvisible = invisible; - structPtr->list.downArrow->sInvisible = invisible; + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + list->sub.upArrow->sInvisible = invisible; + list->sub.downArrow->sInvisible = invisible; } #undef sTimer diff --git a/src/slot_machine.c b/src/slot_machine.c index 1dfa026e5..60b53f5a4 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -3865,21 +3865,15 @@ static void ReelTime_EndFailure(struct Task *task) static void LoadReelTimeWindowTilemap(s16 a0, s16 a1) { s16 i; - for (i = 4; i < 15; i++) - { LoadBgTilemap(1, &sReelTimeWindow_Tilemap[a1 + (i - 4) * 20], 2, 32 * i + a0); - } } static void ClearReelTimeWindowTilemap(s16 a0) { u8 i; - for (i = 4; i < 15; i++) - { LoadBgTilemap(1, sEmptyTilemap, 2, 32 * i + a0); - } } #undef tState @@ -4116,32 +4110,44 @@ static void CreateCreditPayoutNumberSprites(void) CreateCoinNumberSprite(x, 23, TRUE, i); } -static void CreateCoinNumberSprite(s16 x, s16 y, bool8 isPayout, s16 a3) +#define sIsPayout data[0] +#define sDigitMin data[1] +#define sDigitMax data[2] +#define sCurNum data[3] // Only used to determine whether the sprite has already been updated to show the correct digit + +static void CreateCoinNumberSprite(s16 x, s16 y, bool8 isPayout, s16 digitMult) { struct Sprite *sprite = &gSprites[CreateSprite(&sSpriteTemplate_CoinNumber, x, y, 13)]; sprite->oam.priority = 2; - sprite->data[0] = isPayout; - sprite->data[1] = a3; - sprite->data[2] = a3 * 10; - sprite->data[3] = -1; + sprite->sIsPayout = isPayout; + sprite->sDigitMin = digitMult; + sprite->sDigitMax = digitMult * 10; + sprite->sCurNum = -1; } static void SpriteCB_CoinNumber(struct Sprite *sprite) { u16 tag = sSlotMachine->coins; - if (sprite->data[0]) + if (sprite->sIsPayout) tag = sSlotMachine->payout; - if (sprite->data[3] != tag) + if (sprite->sCurNum != tag) { - sprite->data[3] = tag; - tag %= (u16)sprite->data[2]; - tag /= (u16)sprite->data[1]; - tag += 7; + // Convert total to current digit + sprite->sCurNum = tag; + tag %= (u16)sprite->sDigitMax; + tag /= (u16)sprite->sDigitMin; + + tag += GFXTAG_NUM_0; sprite->sheetTileStart = GetSpriteTileStartByTag(tag); SetSpriteSheetFrameTileNum(sprite); } } +#undef sIsPayout +#undef sDigitMin +#undef sDigitMax +#undef sCurNum + static void CreateReelBackgroundSprite(void) { u8 spriteId = CreateSprite(&sSpriteTemplate_ReelBackground, 88, 72, 15); diff --git a/src/trade.c b/src/trade.c index dd0851bbd..5e311f313 100644 --- a/src/trade.c +++ b/src/trade.c @@ -2435,7 +2435,7 @@ static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isEventLegal) return FALSE; } -int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, u8 isEventLegal) +int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isEventLegal) { bool8 playerHasNationalDex = player.hasNationalDex; bool8 playerIsChampion = player.isChampion; @@ -2496,7 +2496,7 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf return UR_TRADE_MSG_NONE; } -int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, u8 isEventLegal) +int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isEventLegal) { bool8 hasNationalDex = player.hasNationalDex; @@ -3744,7 +3744,7 @@ static bool8 AnimateTradeSequenceCable(void) gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].x2 = 0; gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].y2 = 0; StartSpriteAnim(&gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]], 0); - CreatePokeballSpriteToReleaseMon(sTradeData->monSpriteIds[TRADE_PARTNER], gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].oam.paletteNum, 120, 84, 2, 1, 20, 0xFFFFF, sTradeData->monSpecies[TRADE_PARTNER]); + CreatePokeballSpriteToReleaseMon(sTradeData->monSpriteIds[TRADE_PARTNER], gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].oam.paletteNum, 120, 84, 2, 1, 20, PALETTES_BG | (0xF << 16), sTradeData->monSpecies[TRADE_PARTNER]); FreeSpriteOamMatrix(&gSprites[sTradeData->bouncingPokeballSpriteId]); DestroySprite(&gSprites[sTradeData->bouncingPokeballSpriteId]); sTradeData->state++; @@ -4244,7 +4244,7 @@ static bool8 AnimateTradeSequenceWireless(void) gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].x2 = 0; gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].y2 = 0; StartSpriteAnim(&gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]], 0); - CreatePokeballSpriteToReleaseMon(sTradeData->monSpriteIds[TRADE_PARTNER], gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].oam.paletteNum, 120, 84, 2, 1, 20, 0xFFFFF, sTradeData->monSpecies[TRADE_PARTNER]); + CreatePokeballSpriteToReleaseMon(sTradeData->monSpriteIds[TRADE_PARTNER], gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].oam.paletteNum, 120, 84, 2, 1, 20, PALETTES_BG | (0xF << 16), sTradeData->monSpecies[TRADE_PARTNER]); FreeSpriteOamMatrix(&gSprites[sTradeData->bouncingPokeballSpriteId]); DestroySprite(&gSprites[sTradeData->bouncingPokeballSpriteId]); sTradeData->state++; diff --git a/src/tv.c b/src/tv.c index b9d064026..2c8233a2f 100644 --- a/src/tv.c +++ b/src/tv.c @@ -1449,7 +1449,7 @@ static void InterviewAfter_BravoTrainerPokemonProfile(void) } } -void BravoTrainerPokemonProfile_BeforeInterview1(u16 a0) +void BravoTrainerPokemonProfile_BeforeInterview1(u16 move) { TVShow *show = &gSaveBlock1Ptr->tvShows[LAST_TVSHOW_IDX]; InterviewBefore_BravoTrainerPkmnProfile(); @@ -1457,7 +1457,7 @@ void BravoTrainerPokemonProfile_BeforeInterview1(u16 a0) if (sCurTVShowSlot != -1) { DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, LAST_TVSHOW_IDX); - show->bravoTrainer.move = a0; + show->bravoTrainer.move = move; show->bravoTrainer.kind = TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE; } } From bc2dbd772ea61afe228683e4c83b6cbd82b21b70 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 3 Jun 2022 16:18:34 -0400 Subject: [PATCH 141/208] Add warning to NUM_OBJ_EVENT_GFX --- include/constants/event_objects.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 6b99f19bd..8278c6a66 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -241,6 +241,15 @@ #define OBJ_EVENT_GFX_LUGIA 237 #define OBJ_EVENT_GFX_HOOH 238 +// NOTE: By default, the max value for NUM_OBJ_EVENT_GFX is 239. +// +// Object event graphics ids are 1 byte in size (max value of 255), and the dynamic +// graphics ids that start after NUM_OBJ_EVENT_GFX reach this limit. No graphics id +// uses the value 239 itself, so removing the "+ 1" in OBJ_EVENT_GFX_VARS would +// allow increasing NUM_OBJ_EVENT_GFX to 240. There are also a handful of unused +// object graphics that can be removed. If more graphics are needed, anything that +// stores graphics ids will need to be increased in size. See wiki entry below: +// https://github.com/pret/pokeemerald/wiki/Feature-Branches#overworld-expansion #define NUM_OBJ_EVENT_GFX 239 From f419fc3ae77acf136c7e3c1367b4e8bbb2f3779b Mon Sep 17 00:00:00 2001 From: sneed Date: Sat, 4 Jun 2022 18:36:18 +0300 Subject: [PATCH 142/208] fix terrain move softlock --- data/battle_scripts_1.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a9c15040d..5ffe483b5 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2390,7 +2390,7 @@ BattleScript_EffectPsychicTerrain: waitanimation printfromtable gTerrainStringIds waitmessage B_WAIT_TIME_LONG - playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG + playanimation BS_ATTACKER, B_ANIM_RESTORE_BG call BattleScript_TerrainSeedLoop jumpifabilitypresent ABILITY_MIMICRY, BattleScript_ApplyMimicry goto BattleScript_MoveEnd From bf1025ac16620c9e148af609b7266d569f5d0836 Mon Sep 17 00:00:00 2001 From: sneed Date: Sun, 5 Jun 2022 05:09:06 +0300 Subject: [PATCH 143/208] Update battle_util.c --- src/battle_util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/battle_util.c b/src/battle_util.c index d0ff7c5be..ebd7917d4 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1696,6 +1696,7 @@ bool32 IsHealBlockPreventingMove(u32 battler, u32 move) case EFFECT_DREAM_EATER: #endif case EFFECT_MORNING_SUN: + case EFFECT_SYNTHESIS: case EFFECT_MOONLIGHT: case EFFECT_RESTORE_HP: case EFFECT_REST: From 1d19c0dc9fc44e1c3e3d51969daa82b3f6377790 Mon Sep 17 00:00:00 2001 From: sneed Date: Sun, 5 Jun 2022 16:38:37 +0300 Subject: [PATCH 144/208] Update battle_util.c --- src/battle_util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/battle_util.c b/src/battle_util.c index ebd7917d4..3504c0a52 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1704,6 +1704,7 @@ bool32 IsHealBlockPreventingMove(u32 battler, u32 move) case EFFECT_HEALING_WISH: case EFFECT_WISH: case EFFECT_HEAL_PULSE: + case EFFECT_JUNGLE_HEALING: return TRUE; default: return FALSE; From b33a8b0cb430d1636d7416a8a42a2753316c5fa9 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 5 Jun 2022 11:09:04 -0400 Subject: [PATCH 145/208] move ai score calc to STATE_TURN_START_RECORD so AI can consider move selection for item use --- include/battle.h | 2 + include/battle_ai_main.h | 2 +- include/battle_ai_util.h | 3 +- include/constants/battle.h | 2 + src/battle_ai_main.c | 165 ++++++++++++++----------- src/battle_ai_switch_items.c | 68 ++++++++-- src/battle_ai_util.c | 33 +++-- src/battle_controller_opponent.c | 7 +- src/battle_controller_player_partner.c | 4 +- src/battle_main.c | 5 + 10 files changed, 187 insertions(+), 104 deletions(-) diff --git a/include/battle.h b/include/battle.h index 5d0b0596d..bcf018d0f 100644 --- a/include/battle.h +++ b/include/battle.h @@ -584,6 +584,8 @@ struct BattleStruct bool8 spriteIgnore0Hp; struct Illusion illusion[MAX_BATTLERS_COUNT]; s8 aiFinalScore[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // AI, target, moves to make debugging easier + u8 aiMoveOrAction[MAX_BATTLERS_COUNT]; + u8 aiChosenTarget[MAX_BATTLERS_COUNT]; u8 soulheartBattlerId; u8 friskedBattler; // Frisk needs to identify 2 battlers in double battles. bool8 friskedAbility; // If identifies two mons, show the ability pop-up only once. diff --git a/include/battle_ai_main.h b/include/battle_ai_main.h index 185281749..fcb31a9b2 100644 --- a/include/battle_ai_main.h +++ b/include/battle_ai_main.h @@ -19,7 +19,7 @@ return score; \ } - +u8 ComputeBattleAiScores(u8 battler); void BattleAI_SetupItems(void); void BattleAI_SetupFlags(void); void BattleAI_SetupAIData(u8 defaultScoreMoves); diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index 7cc42e74a..437c475f7 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -20,6 +20,7 @@ void ClearBattlerItemEffectHistory(u8 battlerId); void SaveBattlerData(u8 battlerId); void SetBattlerData(u8 battlerId); void RestoreBattlerData(u8 battlerId); +u16 GetAIChosenMove(u8 battlerId); bool32 WillAIStrikeFirst(void); u32 GetTotalBaseStat(u32 species); @@ -27,7 +28,7 @@ bool32 IsTruantMonVulnerable(u32 battlerAI, u32 opposingBattler); bool32 AtMaxHp(u8 battler); u32 GetHealthPercentage(u8 battler); bool32 IsBattlerTrapped(u8 battler, bool8 switching); -u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2); +u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2, u16 consideredMove); bool32 CanTargetFaintAi(u8 battlerDef, u8 battlerAtk); bool32 CanMoveFaintBattler(u16 move, u8 battlerDef, u8 battlerAtk, u8 nHits); bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgMod); diff --git a/include/constants/battle.h b/include/constants/battle.h index d651dab18..71252ae34 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -81,6 +81,8 @@ #define WILD_DOUBLE_BATTLE ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER)))) #define BATTLE_TWO_VS_ONE_OPPONENT ((gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gTrainerBattleOpponent_B == 0xFFFF)) +#define BATTLE_TYPE_HAS_AI (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER) + // Battle Outcome defines #define B_OUTCOME_WON 1 diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 6601862ed..dc3bd6b26 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -174,11 +174,12 @@ void BattleAI_SetupFlags(void) AI_THINKING_STRUCT->aiFlags |= AI_FLAG_DOUBLE_BATTLE; // Act smart in doubles and don't attack your partner. } +// sBattler_AI set in ComputeBattleAiScores void BattleAI_SetupAIData(u8 defaultScoreMoves) { s32 i, move, dmg; u8 moveLimitations; - + // Clear AI data but preserve the flags. u32 flags = AI_THINKING_STRUCT->aiFlags; memset(AI_THINKING_STRUCT, 0, sizeof(struct AI_ThinkingStruct)); @@ -204,8 +205,9 @@ void BattleAI_SetupAIData(u8 defaultScoreMoves) AI_THINKING_STRUCT->score[i] = 0; } - sBattler_AI = gActiveBattler; + //sBattler_AI = gActiveBattler; gBattlerTarget = SetRandomTarget(sBattler_AI); + gBattleStruct->aiChosenTarget[sBattler_AI] = gBattlerTarget; } u8 BattleAI_ChooseMoveOrAction(void) @@ -226,53 +228,73 @@ u8 BattleAI_ChooseMoveOrAction(void) return ret; } +// damages/other info computed in GetAIDataAndCalcDmg +u8 ComputeBattleAiScores(u8 battler) +{ + sBattler_AI = battler; + BattleAI_SetupAIData(0xF); + return BattleAI_ChooseMoveOrAction(); +} + +static void SetBattlerAiData(u8 battlerId) +{ + AI_DATA->abilities[battlerId] = AI_GetAbility(battlerId); + AI_DATA->items[battlerId] = gBattleMons[battlerId].item; + AI_DATA->holdEffects[battlerId] = AI_GetHoldEffect(battlerId); + AI_DATA->holdEffectParams[battlerId] = GetBattlerHoldEffectParam(battlerId); + AI_DATA->predictedMoves[battlerId] = gLastMoves[battlerId]; + AI_DATA->hpPercents[battlerId] = GetHealthPercentage(battlerId); + AI_DATA->moveLimitations[battlerId] = CheckMoveLimitations(battlerId, 0, 0xFF); +} + void GetAiLogicData(void) { u32 battlerAtk, battlerDef, i, move; u8 effectiveness; s32 dmg; + memset(AI_DATA, 0, sizeof(struct AiLogicData)); + if (!(gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER) && !IsWildMonSmart())) return; - memset(AI_DATA, 0, sizeof(struct AiLogicData)); - for (battlerAtk = 0; battlerAtk < MAX_BATTLERS_COUNT; battlerAtk++) + // get/assume all battler data + for (i = 0; i < gBattlersCount; i++) { - if (IsBattlerAlive(battlerAtk)) { - AI_DATA->abilities[battlerAtk] = AI_GetAbility(battlerAtk); - AI_DATA->items[battlerAtk] = gBattleMons[battlerAtk].item; - AI_DATA->holdEffects[battlerAtk] = AI_GetHoldEffect(battlerAtk); - AI_DATA->holdEffectParams[battlerAtk] = GetBattlerHoldEffectParam(battlerAtk); - AI_DATA->predictedMoves[battlerAtk] = gLastMoves[battlerAtk]; - AI_DATA->hpPercents[battlerAtk] = GetHealthPercentage(battlerAtk); - AI_DATA->moveLimitations[battlerAtk] = CheckMoveLimitations(battlerAtk, 0, MOVE_LIMITATIONS_ALL); + if (IsBattlerAlive(i)) { + SetBattlerAiData(i); + } + } + + // simulate AI damage + for (battlerAtk = 0; battlerAtk < gBattlersCount; battlerAtk++) + { + if (!IsBattlerAlive(battlerAtk) + || !IsBattlerAIControlled(battlerAtk)) { + continue; + } + for (battlerDef = 0; battlerDef < gBattlersCount; battlerDef++) + { + if (battlerAtk == battlerDef) + continue; - // Simulate dmg for all AI moves against all other targets - for (battlerDef = 0; battlerDef < gBattlersCount; battlerDef++) + RecordKnownMove(battlerDef, gLastMoves[battlerDef]); + for (i = 0; i < MAX_MON_MOVES; i++) { - if (battlerAtk == battlerDef) - continue; + dmg = 0; + effectiveness = AI_EFFECTIVENESS_x0; + move = gBattleMons[battlerAtk].moves[i]; - RecordKnownMove(battlerDef, gLastMoves[battlerDef]); - for (i = 0; i < MAX_MON_MOVES; i++) - { - dmg = 0; - effectiveness = AI_EFFECTIVENESS_x0; - move = gBattleMons[battlerAtk].moves[i]; - if (move != 0 - && move != 0xFFFF - && gBattleMoves[move].power != 0 - && !(AI_DATA->moveLimitations[battlerAtk] & gBitTable[i])) - { - dmg = AI_CalcDamage(move, battlerAtk, battlerDef, &effectiveness); - if (dmg == 0) - dmg = 1; - } - - AI_DATA->simulatedDmg[battlerAtk][battlerDef][i] = dmg; - AI_DATA->effectiveness[battlerAtk][battlerDef][i] = effectiveness; + if (move != 0 + && move != 0xFFFF + //&& gBattleMoves[move].power != 0 /* we want to get effectiveness of status moves */ + && !(AI_DATA->moveLimitations[battlerAtk] & gBitTable[i])) { + dmg = AI_CalcDamage(move, battlerAtk, battlerDef, &effectiveness); } + + AI_DATA->simulatedDmg[battlerAtk][battlerDef][i] = dmg; + AI_DATA->effectiveness[battlerAtk][battlerDef][i] = effectiveness; } } } @@ -495,6 +517,7 @@ static u8 ChooseMoveOrAction_Doubles(void) } gBattlerTarget = mostViableTargetsArray[Random() % mostViableTargetsNo]; + gBattleStruct->aiChosenTarget[sBattler_AI] = gBattlerTarget; return actionOrMoveIndex[gBattlerTarget]; } @@ -556,7 +579,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) u16 moveEffect = gBattleMoves[move].effect; s32 moveType; u16 moveTarget = AI_GetBattlerMoveTargetType(battlerAtk, move); - u16 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect, move); + u16 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, move); u8 effectiveness = AI_DATA->effectiveness[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); u32 i; @@ -593,7 +616,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } // check off screen - if (IsSemiInvulnerable(battlerDef, move) && moveEffect != EFFECT_SEMI_INVULNERABLE && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) + if (IsSemiInvulnerable(battlerDef, move) && moveEffect != EFFECT_SEMI_INVULNERABLE && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) RETURN_SCORE_MINUS(20); // if target off screen and we go first, don't use move // check if negates type @@ -1292,7 +1315,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) && (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB) && !PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker should go first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker should go first { if (gLastMoves[battlerDef] == MOVE_NONE || gLastMoves[battlerDef] == 0xFFFF) score -= 10; // no anticipated move to disable @@ -1312,7 +1335,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) && (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB) && !DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker should go first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker should go first { if (gLastMoves[battlerDef] == MOVE_NONE || gLastMoves[battlerDef] == 0xFFFF) score -= 10; // no anticipated move to encore @@ -1755,7 +1778,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_SPITE: case EFFECT_MIMIC: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker should go first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker should go first { if (gLastMoves[battlerDef] == MOVE_NONE || gLastMoves[battlerDef] == 0xFFFF) @@ -1912,7 +1935,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (isDoubleBattle) { if (IsHazardMoveEffect(gBattleMoves[AI_DATA->partnerMove].effect) // partner is going to set up hazards - && AI_WhoStrikesFirst(BATTLE_PARTNER(battlerAtk), battlerAtk) == AI_IS_FASTER) // partner is going to set up before the potential Defog + && AI_WhoStrikesFirst(BATTLE_PARTNER(battlerAtk), battlerAtk, AI_DATA->partnerMove) == AI_IS_FASTER) // partner is going to set up before the potential Defog { score -= 10; break; // Don't use Defog if partner is going to set up hazards @@ -1950,7 +1973,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_SEMI_INVULNERABLE: if (predictedMove != MOVE_NONE - && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER + && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER && gBattleMoves[predictedMove].effect == EFFECT_SEMI_INVULNERABLE) score -= 10; // Don't Fly/dig/etc if opponent is going to fly/dig/etc after you @@ -2131,7 +2154,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_ME_FIRST: if (predictedMove != MOVE_NONE) { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) score -= 10; // Target is predicted to go first, Me First will fail else return AI_CheckBadMove(battlerAtk, battlerDef, predictedMove, score); @@ -2320,7 +2343,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_ELECTRIFY: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER //|| GetMoveTypeSpecial(battlerDef, predictedMove) == TYPE_ELECTRIC // Move will already be electric type || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; @@ -2349,7 +2372,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_INSTRUCT: { u16 instructedMove; - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) instructedMove = predictedMove; else instructedMove = gLastMoves[battlerDef]; @@ -2389,21 +2412,21 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_QUASH: if (!isDoubleBattle - || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER + || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_AFTER_YOU: if (!IsTargetingPartner(battlerAtk, battlerDef) || !isDoubleBattle - || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER + || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_SUCKER_PUNCH: if (predictedMove != MOVE_NONE) { - if (IS_MOVE_STATUS(predictedMove) || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Opponent going first + if (IS_MOVE_STATUS(predictedMove) || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) // Opponent going first score -= 10; } break; @@ -2455,7 +2478,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score--; // don't want to move last break; case EFFECT_FLAIL: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER // Opponent should go first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER // Opponent should go first || AI_DATA->hpPercents[battlerAtk] > 50) score -= 4; break; @@ -2604,7 +2627,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // Ally decided to use Frost Breath on us. we must have Anger Point as our ability if (AI_DATA->abilities[battlerAtk] == ABILITY_ANGER_POINT) { - if (AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner) == AI_IS_SLOWER) // Partner moving first + if (AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner, move) == AI_IS_SLOWER) // Partner moving first { // discourage raising our attack since it's about to be maxed out if (IsAttackBoostMoveEffect(effect)) @@ -2871,7 +2894,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_INSTRUCT: { u16 instructedMove; - if (AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner) == AI_IS_FASTER) + if (AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner, move) == AI_IS_FASTER) instructedMove = AI_DATA->partnerMove; else instructedMove = gLastMoves[battlerAtkPartner]; @@ -2885,8 +2908,8 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_AFTER_YOU: - if (AI_WhoStrikesFirst(battlerAtkPartner, FOE(battlerAtkPartner) == AI_IS_SLOWER) // Opponent mon 1 goes before partner - || AI_WhoStrikesFirst(battlerAtkPartner, BATTLE_PARTNER(FOE(battlerAtkPartner)) == AI_IS_SLOWER)) // Opponent mon 2 goes before partner + if (AI_WhoStrikesFirst(battlerAtkPartner, FOE(battlerAtkPartner), AI_DATA->partnerMove) == AI_IS_SLOWER // Opponent mon 1 goes before partner + || AI_WhoStrikesFirst(battlerAtkPartner, BATTLE_PARTNER(FOE(battlerAtkPartner)), AI_DATA->partnerMove) == AI_IS_SLOWER) // Opponent mon 2 goes before partner { if (gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_COUNTER || gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_MIRROR_COAT) break; // These moves need to go last @@ -2913,7 +2936,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_MAGNITUDE: if (!IsBattlerGrounded(battlerAtkPartner) || (IsBattlerGrounded(battlerAtkPartner) - && AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner) == AI_IS_SLOWER + && AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner, move) == AI_IS_SLOWER && IsUngroundingEffect(gBattleMoves[AI_DATA->partnerMove].effect))) score += 2; else if (IS_BATTLER_OF_TYPE(battlerAtkPartner, TYPE_FIRE) @@ -2986,7 +3009,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // check already dead if (!IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]) && CanTargetFaintAi(battlerAtk, battlerDef) - && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Opponent should go first + && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) // Opponent should go first { if (atkPriority > 0) score++; @@ -3034,7 +3057,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case ABILITY_GRIM_NEIGH: case ABILITY_AS_ONE_ICE_RIDER: case ABILITY_AS_ONE_SHADOW_RIDER: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker should go first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker should go first { if (CanIndexMoveFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex, 0)) score += 8; // prioritize killing target for stat boost @@ -3481,7 +3504,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; break; case EFFECT_MIMIC: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) { if (gLastMoves[battlerDef] != MOVE_NONE && gLastMoves[battlerDef] != 0xFFFF) return AI_CheckViability(battlerAtk, battlerDef, gLastMoves[battlerDef], score); @@ -3540,7 +3563,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (gDisableStructs[battlerDef].disableTimer == 0 && (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB)) // mental herb { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // AI goes first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // AI goes first { if (gLastMoves[battlerDef] != MOVE_NONE && gLastMoves[battlerDef] != 0xFFFF) @@ -3594,7 +3617,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 3; break; case EFFECT_DESTINY_BOND: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER && CanTargetFaintAi(battlerDef, battlerAtk)) + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER && CanTargetFaintAi(battlerDef, battlerAtk)) score += 3; break; case EFFECT_SPITE: @@ -3703,7 +3726,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); } - else if (isDoubleBattle && AI_GetBattlerMoveTargetType(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) & MOVE_TARGET_FOES_AND_ALLY) + else if (isDoubleBattle && AI_GetBattlerMoveTargetType(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove) & MOVE_TARGET_FOES_AND_ALLY) { if (AI_DATA->abilities[battlerAtk] != ABILITY_TELEPATHY) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); @@ -3842,7 +3865,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) && AI_DATA->abilities[battlerAtk] != ABILITY_CONTRARY && CanIndexMoveFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex, 0)) { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker goes first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker goes first score += 9; else score += 3; @@ -3887,7 +3910,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; if (predictedMove != MOVE_NONE && !isDoubleBattle) { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker goes first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker goes first { if (gBattleMoves[predictedMove].effect == EFFECT_EXPLOSION || gBattleMoves[predictedMove].effect == EFFECT_PROTECT) @@ -3954,7 +3977,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_ATTRACT: if (!isDoubleBattle && BattlerWillFaintFromSecondaryDamage(battlerDef, AI_DATA->abilities[battlerDef]) - && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Target goes first + && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) // Target goes first break; // Don't use if the attract won't have a change to activate if (gBattleMons[battlerDef].status1 & STATUS1_ANY @@ -3999,7 +4022,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (isDoubleBattle) { if (IsHazardMoveEffect(gBattleMoves[AI_DATA->partnerMove].effect) // Partner is going to set up hazards - && AI_WhoStrikesFirst(battlerAtk, BATTLE_PARTNER(battlerAtk)) == AI_IS_SLOWER) // Partner going first + && AI_WhoStrikesFirst(battlerAtk, BATTLE_PARTNER(battlerAtk), move) == AI_IS_SLOWER) // Partner going first break; // Don't use Defog if partner is going to set up hazards } @@ -4488,13 +4511,13 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; break; case EFFECT_THROAT_CHOP: - if (predictedMove != MOVE_NONE && TestMoveFlags(predictedMove, FLAG_SOUND) && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) + if (predictedMove != MOVE_NONE && TestMoveFlags(predictedMove, FLAG_SOUND) && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) score += 3; // Ai goes first and predicts the target will use a sound move else if (TestMoveFlagsInMoveset(battlerDef, FLAG_SOUND)) score += 3; break; case EFFECT_HEAL_BLOCK: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER && predictedMove != MOVE_NONE && IsHealingMoveEffect(gBattleMoves[predictedMove].effect)) + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER && predictedMove != MOVE_NONE && IsHealingMoveEffect(gBattleMoves[predictedMove].effect)) score += 3; // Try to cancel healing move else if (HasHealingEffect(battlerDef) || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_LEFTOVERS || (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_BLACK_SLUDGE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON))) @@ -4530,7 +4553,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_QUASH: if (isDoubleBattle - && AI_WhoStrikesFirst(BATTLE_PARTNER(battlerAtk), battlerDef) == AI_IS_SLOWER) // Attacker partner wouldn't go before target + && AI_WhoStrikesFirst(BATTLE_PARTNER(battlerAtk), battlerDef, AI_DATA->partnerMove) == AI_IS_SLOWER) // Attacker partner wouldn't go before target score++; break; case EFFECT_TAILWIND: @@ -4552,7 +4575,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (IsBattlerGrounded(battlerAtk) && HasDamagingMoveOfType(battlerDef, TYPE_ELECTRIC) && !(AI_GetTypeEffectiveness(MOVE_EARTHQUAKE, battlerDef, battlerAtk) == AI_EFFECTIVENESS_x0)) // Doesn't resist ground move { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker goes first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker goes first { if (gBattleMoves[predictedMove].type == TYPE_GROUND) score += 3; // Cause the enemy's move to fail @@ -4567,7 +4590,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_CAMOUFLAGE: - if (predictedMove != MOVE_NONE && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER // Attacker goes first + if (predictedMove != MOVE_NONE && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER // Attacker goes first && !IS_MOVE_STATUS(move) && AI_GetTypeEffectiveness(predictedMove, battlerDef, battlerAtk) != AI_EFFECTIVENESS_x0) score++; break; @@ -4610,7 +4633,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_FLAIL: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Ai goes first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Ai goes first { if (AI_DATA->hpPercents[battlerAtk] < 20) score++; @@ -4652,7 +4675,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 2; break; case EFFECT_ENDEAVOR: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Opponent faster + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) // Opponent faster { if (AI_DATA->hpPercents[battlerAtk] < 40) score++; @@ -4683,7 +4706,7 @@ static s16 AI_SetupFirstTurn(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) return score; if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_SMART_SWITCHING - && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER + && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER && CanTargetFaintAi(battlerDef, battlerAtk) && GetMovePriority(battlerAtk, move) == 0) { diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 9136d667c..7963d8b86 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -18,6 +18,8 @@ static bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng); static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent); static bool8 ShouldUseItem(void); +static bool32 AI_ShouldHeal(u32 healAmount); +static bool32 AI_OpponentCanFaintAiWithMod(u32 healAmount); void GetAIPartyIndexes(u32 battlerId, s32 *firstId, s32 *lastId) { @@ -788,6 +790,25 @@ static u8 GetAI_ItemType(u16 itemId, const u8 *itemEffect) return AI_ITEM_NOT_RECOGNIZABLE; } +static bool32 AiExpectsToFaintPlayer(void) +{ + bool32 canFaintPlayer; + u32 i; + u8 target = gBattleStruct->aiChosenTarget[gActiveBattler]; + + if (gBattleStruct->aiMoveOrAction[gActiveBattler] > 3) + return FALSE; // AI not planning to use move + + if (GetBattlerSide(target) != GetBattlerSide(gActiveBattler) + && CanIndexMoveFaintTarget(gActiveBattler, target, gBattleStruct->aiMoveOrAction[gActiveBattler], 0) + && AI_WhoStrikesFirst(gActiveBattler, target, GetAIChosenMove(gActiveBattler)) == AI_IS_FASTER) { + // We expect to faint the target and move first -> dont use an item + return TRUE; + } + + return FALSE; +} + static bool8 ShouldUseItem(void) { struct Pokemon *party; @@ -802,6 +823,9 @@ static bool8 ShouldUseItem(void) if (gStatuses3[gActiveBattler] & STATUS3_EMBARGO) return FALSE; + + if (AiExpectsToFaintPlayer()) + return FALSE; if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) party = gPlayerParty; @@ -843,21 +867,10 @@ static bool8 ShouldUseItem(void) switch (*(gBattleStruct->AI_itemType + gActiveBattler / 2)) { case AI_ITEM_FULL_RESTORE: - if (gBattleMons[gActiveBattler].hp >= gBattleMons[gActiveBattler].maxHP / 4) - break; - if (gBattleMons[gActiveBattler].hp == 0) - break; - shouldUse = TRUE; + shouldUse = AI_ShouldHeal(0); break; case AI_ITEM_HEAL_HP: - paramOffset = GetItemEffectParamOffset(item, 4, 4); - if (paramOffset == 0) - break; - if (gBattleMons[gActiveBattler].hp == 0) - break; - if (gBattleMons[gActiveBattler].hp < gBattleMons[gActiveBattler].maxHP / 4 - || gBattleMons[gActiveBattler].maxHP - gBattleMons[gActiveBattler].hp > itemEffects[paramOffset]) - shouldUse = TRUE; + shouldUse = AI_ShouldHeal(itemEffects[GetItemEffectParamOffset(item, 4, 4)]); break; case AI_ITEM_CURE_CONDITION: *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) = 0; @@ -948,3 +961,32 @@ static bool8 ShouldUseItem(void) return FALSE; } + +static bool32 AI_ShouldHeal(u32 healAmount) +{ + bool32 shouldHeal = FALSE; + + if (gBattleMons[gActiveBattler].hp < gBattleMons[gActiveBattler].maxHP / 4 + || gBattleMons[gActiveBattler].hp == 0 + || (healAmount != 0 && gBattleMons[gActiveBattler].maxHP - gBattleMons[gActiveBattler].hp > healAmount)) { + // We have low enough HP to consider healing + shouldHeal = !AI_OpponentCanFaintAiWithMod(healAmount); // if target can kill us even after we heal, why bother + } + + return shouldHeal; +} + +static bool32 AI_OpponentCanFaintAiWithMod(u32 healAmount) +{ + u32 i; + // Check special cases to NOT heal + for (i = 0; i < gBattlersCount; i++) { + if (GetBattlerSide(i) == B_SIDE_PLAYER) { + if (CanTargetFaintAiWithMod(i, gActiveBattler, healAmount, 0)) { + // Target is expected to faint us + return TRUE; + } + } + } + return FALSE; +} diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 3a43fd702..a5cbc92b0 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -440,9 +440,14 @@ static const u16 sOtherMoveCallingMoves[] = }; // Functions +u16 GetAIChosenMove(u8 battlerId) +{ + return (gBattleMons[battlerId].moves[gBattleStruct->aiMoveOrAction[battlerId]]); +} + bool32 WillAIStrikeFirst(void) { - return (AI_WhoStrikesFirst(sBattler_AI, gBattlerTarget) == AI_IS_FASTER); + return (AI_WhoStrikesFirst(sBattler_AI, gBattlerTarget, AI_THINKING_STRUCT->moveConsidered) == AI_IS_FASTER); } bool32 AI_RandLessThan(u8 val) @@ -638,7 +643,7 @@ bool32 IsTruantMonVulnerable(u32 battlerAI, u32 opposingBattler) u32 move = gBattleResources->battleHistory->usedMoves[opposingBattler][i]; if (gBattleMoves[move].effect == EFFECT_PROTECT && move != MOVE_ENDURE) return TRUE; - if (gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE && AI_WhoStrikesFirst(battlerAI, opposingBattler) == AI_IS_SLOWER) + if (gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE && AI_WhoStrikesFirst(battlerAI, opposingBattler, GetAIChosenMove(battlerAI)) == AI_IS_SLOWER) return TRUE; } return FALSE; @@ -987,23 +992,25 @@ static u8 AI_GetEffectiveness(u16 multiplier) * AI_IS_FASTER: is user(ai) faster * AI_IS_SLOWER: is target faster */ -u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2) +u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2, u16 moveConsidered) { u32 fasterAI = 0, fasterPlayer = 0, i; s8 prioAI = 0; s8 prioPlayer = 0; + s8 prioBattler2 = 0; + u16 *battler2Moves = GetMovesArray(battler2); // Check move priorities first. - prioAI = GetMovePriority(battlerAI, AI_THINKING_STRUCT->moveConsidered); + prioAI = GetMovePriority(battlerAI, moveConsidered); for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMons[battler2].moves[i] == 0 || gBattleMons[battler2].moves[i] == 0xFFFF) + if (battler2Moves[i] == 0 || battler2Moves[i] == 0xFFFF) continue; - prioPlayer = GetMovePriority(battler2, gBattleMons[battler2].moves[i]); - if (prioAI > prioPlayer) + prioBattler2 = GetMovePriority(battler2, battler2Moves[i]); + if (prioAI > prioBattler2) fasterAI++; - else if (prioPlayer > prioAI) + else if (prioBattler2 > prioAI) fasterPlayer++; } @@ -1017,6 +1024,8 @@ u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2) } else { + if (prioAI > prioBattler2) + return AI_IS_FASTER; // if we didn't know any of battler 2's moves to compare priorities, assume they don't have a prio+ move // Priorities are the same(at least comparing to moves the AI is aware of), decide by speed. if (GetWhoStrikesFirst(battlerAI, battler2, TRUE) == 0) return AI_IS_FASTER; @@ -2422,7 +2431,7 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo /*if (IsPredictedToSwitch(battlerDef, battlerAtk) && !hasStatBoost) return PIVOT; // Try pivoting so you can switch to a better matchup to counter your new opponent*/ - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker goes first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker goes first { if (!CanAIFaintTarget(battlerAtk, battlerDef, 0)) // Can't KO foe otherwise { @@ -2782,7 +2791,7 @@ u32 ShouldTryToFlinch(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbili { if (defAbility == ABILITY_INNER_FOCUS || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) - || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Opponent goes first + || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) // Opponent goes first { return 0; // don't try to flinch } @@ -2906,7 +2915,7 @@ bool32 ShouldUseRecoilMove(u8 battlerAtk, u8 battlerDef, u32 recoilDmg, u8 moveI bool32 ShouldAbsorb(u8 battlerAtk, u8 battlerDef, u16 move, s32 damage) { - if (move == 0xFFFF || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) + if (move == 0xFFFF || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) { // using item or user goes first u8 healPercent = (gBattleMoves[move].argument == 0) ? 50 : gBattleMoves[move].argument; @@ -2933,7 +2942,7 @@ bool32 ShouldAbsorb(u8 battlerAtk, u8 battlerDef, u16 move, s32 damage) bool32 ShouldRecover(u8 battlerAtk, u8 battlerDef, u16 move, u8 healPercent) { - if (move == 0xFFFF || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) + if (move == 0xFFFF || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) { // using item or user going first s32 damage = AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index f3b8352bb..9c262405b 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1535,7 +1535,7 @@ static void OpponentHandlePrintSelectionString(void) static void OpponentHandleChooseAction(void) { - AI_TrySwitchOrUseItem(); // TODO consider move choice first + AI_TrySwitchOrUseItem(); OpponentBufferExecCompleted(); } @@ -1559,9 +1559,8 @@ static void OpponentHandleChooseMove(void) if (gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER) || IsWildMonSmart()) { - BattleAI_SetupAIData(0xF); - chosenMoveId = BattleAI_ChooseMoveOrAction(); - + chosenMoveId = gBattleStruct->aiMoveOrAction[gActiveBattler]; + gBattlerTarget = gBattleStruct->aiChosenTarget[gActiveBattler]; switch (chosenMoveId) { case AI_CHOICE_WATCH: diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 984a647f8..4e41651de 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1515,8 +1515,8 @@ static void PlayerPartnerHandleChooseMove(void) u8 chosenMoveId; struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]); - BattleAI_SetupAIData(0xF); - chosenMoveId = BattleAI_ChooseMoveOrAction(); + chosenMoveId = gBattleStruct->aiMoveOrAction[gActiveBattler]; + gBattlerTarget = gBattleStruct->aiChosenTarget[gActiveBattler]; if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED)) gBattlerTarget = gActiveBattler; diff --git a/src/battle_main.c b/src/battle_main.c index 5bf5043e1..cb38f3bdf 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3918,6 +3918,11 @@ static void HandleTurnActionSelectionState(void) case STATE_TURN_START_RECORD: // Recorded battle related action on start of every turn. RecordedBattle_CopyBattlerMoves(); gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN; + + // Do AI score computations here so we can use them in AI_TrySwitchOrUseItem + if ((gBattleTypeFlags & BATTLE_TYPE_HAS_AI || IsWildMonSmart()) && IsBattlerAIControlled(gActiveBattler)) { + gBattleStruct->aiMoveOrAction[gActiveBattler] = ComputeBattleAiScores(gActiveBattler); + } break; case STATE_BEFORE_ACTION_CHOSEN: // Choose an action. *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; From ceaff148f743ca8520e01554188c70b450c54f36 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 9 Jun 2022 10:52:19 -0400 Subject: [PATCH 146/208] Shift to multiply --- src/battle_anim_effects_1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index cd9cb8b30..c590572b9 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -5324,13 +5324,13 @@ static void AnimWavyMusicNotes_CalcVelocity(s16 x, s16 y, s16* velocX, s16* velo if (x < 0) xSpeedFactor = -xSpeedFactor; - x2 = x << 8; + x2 = x * 256; time = x2 / xSpeedFactor; if (time == 0) time = 1; *velocX = x2 / time; - *velocY = (y << 8) / time; + *velocY = (y * 256) / time; } static void AnimWavyMusicNotes_Step(struct Sprite* sprite) From 7143865f6f7dd8c17077111eac49a8972fb31399 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 6 Jun 2022 15:15:46 -0400 Subject: [PATCH 147/208] Add some battle frontier constant usage --- include/constants/battle_frontier.h | 10 +++ include/constants/battle_pike.h | 2 + include/constants/battle_pyramid.h | 7 ++ include/constants/battle_tent.h | 6 ++ include/constants/union_room.h | 2 + include/global.h | 2 +- src/battle_dome.c | 2 +- src/battle_factory.c | 44 ++++++----- src/battle_pike.c | 24 +++--- src/battle_pyramid.c | 78 +++++++++---------- src/battle_pyramid_bag.c | 6 +- src/battle_tent.c | 40 +++++----- src/battle_tower.c | 66 +++++++++------- .../battle_pyramid_open_level_wild_mons.h | 2 +- src/frontier_util.c | 17 ++-- src/map_name_popup.c | 5 +- src/mystery_gift_client.c | 2 +- src/party_menu.c | 6 +- src/pokemon.c | 2 +- src/start_menu.c | 7 +- src/union_room.c | 2 +- 21 files changed, 189 insertions(+), 143 deletions(-) diff --git a/include/constants/battle_frontier.h b/include/constants/battle_frontier.h index b6d15e6b2..6cfdc7931 100644 --- a/include/constants/battle_frontier.h +++ b/include/constants/battle_frontier.h @@ -1,6 +1,8 @@ #ifndef GUARD_CONSTANTS_BATTLE_FRONTIER_H #define GUARD_CONSTANTS_BATTLE_FRONTIER_H +#include "constants/pokemon.h" + #define FRONTIER_CHALLENGE(facility, mode) ((facility << 8) + mode) // Battle Frontier facility ids. @@ -46,6 +48,14 @@ #define MAX_BATTLE_FRONTIER_POINTS 9999 #define MAX_STREAK 9999 +#define FRONTIER_MAX_LEVEL_50 50 +#define FRONTIER_MIN_LEVEL_OPEN 60 +#define FRONTIER_MAX_LEVEL_OPEN MAX_LEVEL + +// This is the default number of battles (or floors, in Battle Pyramid) per challenge. +// There are 2 facilities that differ: Battle Dome (DOME_ROUNDS_COUNT) and Battle Pike (NUM_PIKE_ROOMS). +#define FRONTIER_STAGES_PER_CHALLENGE 7 + // These sets of facility ids would be redundant if the order was consistent // The order is important for this set so that all the non-link records can be continuous #define RANKING_HALL_TOWER_SINGLES 0 diff --git a/include/constants/battle_pike.h b/include/constants/battle_pike.h index 76309436e..eebfd741a 100644 --- a/include/constants/battle_pike.h +++ b/include/constants/battle_pike.h @@ -1,6 +1,8 @@ #ifndef GUARD_CONSTANTS_BATTLE_PIKE_H #define GUARD_CONSTANTS_BATTLE_PIKE_H +#define NUM_PIKE_ROOMS 14 + #define PIKE_ROOM_SINGLE_BATTLE 0 #define PIKE_ROOM_HEAL_FULL 1 #define PIKE_ROOM_NPC 2 diff --git a/include/constants/battle_pyramid.h b/include/constants/battle_pyramid.h index ebb753882..297f3b1ff 100644 --- a/include/constants/battle_pyramid.h +++ b/include/constants/battle_pyramid.h @@ -14,6 +14,13 @@ #define HINT_EXIT_FAR_REMAINING_TRAINERS 7 #define HINT_EXIT_FAR_REMAINING_ITEMS 8 +#define MAX_PYRAMID_TRAINERS 8 + +// Each floor of the Battle Pyramid is 32x32 metatiles, subdivided into a 4x4 grid of 8x8 metatile squares +#define PYRAMID_FLOOR_SQUARES_WIDE 4 +#define PYRAMID_FLOOR_SQUARES_HIGH 4 +#define NUM_PYRAMID_FLOOR_SQUARES (PYRAMID_FLOOR_SQUARES_WIDE * PYRAMID_FLOOR_SQUARES_HIGH) + #define OBJ_TRAINERS 0 #define OBJ_ITEMS 1 diff --git a/include/constants/battle_tent.h b/include/constants/battle_tent.h index 666ada6bd..6f9989b7a 100644 --- a/include/constants/battle_tent.h +++ b/include/constants/battle_tent.h @@ -1,6 +1,12 @@ #ifndef GUARD_CONSTANTS_BATTLE_TENT_H #define GUARD_CONSTANTS_BATTLE_TENT_H +#define TENT_MIN_LEVEL 30 + +// The number of battles in each Battle Tent challenge. +// Battle Tent equivalent of FRONTIER_STAGES_PER_CHALLENGE. +#define TENT_STAGES_PER_CHALLENGE 3 + #define VERDANTURF_TENT_FUNC_INIT 0 #define VERDANTURF_TENT_FUNC_GET_PRIZE 1 #define VERDANTURF_TENT_FUNC_SET_PRIZE 2 diff --git a/include/constants/union_room.h b/include/constants/union_room.h index 6e08c9ebb..f47a8723f 100644 --- a/include/constants/union_room.h +++ b/include/constants/union_room.h @@ -11,6 +11,8 @@ #define UNION_ROOM_SPAWN_IN 1 #define UNION_ROOM_SPAWN_OUT 2 +#define UNION_ROOM_MAX_LEVEL 30 + #define ACTIVITY_NONE 0 #define ACTIVITY_BATTLE_SINGLE 1 #define ACTIVITY_BATTLE_DOUBLE 2 diff --git a/include/global.h b/include/global.h index 60476b13f..64af518ce 100644 --- a/include/global.h +++ b/include/global.h @@ -409,7 +409,7 @@ struct BattleFrontier /*0xE1A*/ u16 pyramidWinStreaks[FRONTIER_LVL_MODE_COUNT]; /*0xE1E*/ u16 pyramidRecordStreaks[FRONTIER_LVL_MODE_COUNT]; /*0xE22*/ u16 pyramidRandoms[4]; - /*0xE2A*/ u8 pyramidTrainerFlags; + /*0xE2A*/ u8 pyramidTrainerFlags; // 1 bit for each trainer (MAX_PYRAMID_TRAINERS) /*0xE2C*/ struct PyramidBag pyramidBag; /*0xE68*/ u8 pyramidLightRadius; /*0xE6A*/ u16 verdanturfTentPrize; diff --git a/src/battle_dome.c b/src/battle_dome.c index aadd85afd..5c18cff42 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -5847,7 +5847,7 @@ static void InitRandomTourneyTreeResults(void) DOME_TRAINERS[i].forfeited = FALSE; } - monLevel = 50; + monLevel = FRONTIER_MAX_LEVEL_50; for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) { monTypesBits = 0; diff --git a/src/battle_factory.c b/src/battle_factory.c index d88ed37f9..a68ef8180 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -12,15 +12,15 @@ #include "constants/battle_factory.h" #include "constants/battle_frontier.h" #include "constants/battle_frontier_mons.h" +#include "constants/battle_tent.h" #include "constants/frontier_util.h" #include "constants/layouts.h" #include "constants/trainers.h" #include "constants/moves.h" +#include "constants/items.h" -// IWRAM bss static bool8 sPerformedRentalSwap; -// This file's functions. static void InitFactoryChallenge(void); static void GetBattleFactoryData(void); static void SetBattleFactoryData(void); @@ -212,7 +212,7 @@ static void InitFactoryChallenge(void) } sPerformedRentalSwap = FALSE; - for (i = 0; i < 6; i++) + for (i = 0; i < ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); i++) gSaveBlock2Ptr->frontier.rentalMons[i].monId = 0xFFFF; for (i = 0; i < FRONTIER_PARTY_SIZE; i++) gFrontierTempParty[i] = 0xFFFF; @@ -310,11 +310,12 @@ static void GenerateOpponentMons(void) u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); u32 winStreak = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode]; - u32 challengeNum = winStreak / 7; + u32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE; gFacilityTrainers = gBattleFrontierTrainers; do { + // Choose a random trainer, ensuring no repeats in this challenge trainerId = GetRandomScaledFrontierTrainerId(challengeNum, gSaveBlock2Ptr->frontier.curChallengeBattleNum); for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++) { @@ -324,27 +325,32 @@ static void GenerateOpponentMons(void) } while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum); gTrainerBattleOpponent_A = trainerId; - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 6) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < FRONTIER_STAGES_PER_CHALLENGE - 1) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = trainerId; i = 0; while (i != FRONTIER_PARTY_SIZE) { u16 monId = GetFactoryMonId(lvlMode, challengeNum, FALSE); + + // Unown (FRONTIER_MON_UNOWN) is forbidden on opponent Factory teams. if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN) continue; - for (j = 0; j < 6; j++) + // Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player + for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++) { if (gFacilityTrainerMons[monId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species) break; } - if (j != 6) + if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons)) continue; + // "High tier" pokemon are only allowed on open level mode if (lvlMode == FRONTIER_LVL_50 && monId > FRONTIER_MONS_HIGH_TIER) continue; + // Ensure this species hasn't already been chosen for the opponent for (k = firstMonId; k < firstMonId + i; k++) { if (species[k] == gFacilityTrainerMons[monId].species) @@ -353,14 +359,16 @@ static void GenerateOpponentMons(void) if (k != firstMonId + i) continue; + // Ensure held items don't repeat on the opponent's team for (k = firstMonId; k < firstMonId + i; k++) { - if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) + if (heldItems[k] != ITEM_NONE && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) break; } if (k != firstMonId + i) continue; + // Successful selection species[i] = gFacilityTrainerMons[monId].species; heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]; gFrontierTempParty[i] = monId; @@ -406,15 +414,15 @@ static void SetPlayerAndOpponentParties(void) if (gSaveBlock2Ptr->frontier.lvlMode == FRONTIER_LVL_TENT) { gFacilityTrainerMons = gSlateportBattleTentMons; - monLevel = 30; + monLevel = TENT_MIN_LEVEL; } else { gFacilityTrainerMons = gBattleFrontierMons; if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) - monLevel = 100; + monLevel = FRONTIER_MAX_LEVEL_OPEN; else - monLevel = 50; + monLevel = FRONTIER_MAX_LEVEL_50; } if (gSpecialVar_0x8005 < 2) @@ -618,9 +626,9 @@ static void GetOpponentMostCommonMonType(void) // Determine which are the two most-common types. // The second most-common type is only updated if // its count is equal to the most-common type. - mostCommonTypes[0] = TYPE_NORMAL; - mostCommonTypes[1] = TYPE_NORMAL; - for (i = TYPE_FIGHTING; i < NUMBER_OF_MON_TYPES; i++) + mostCommonTypes[0] = 0; + mostCommonTypes[1] = 0; + for (i = 1; i < NUMBER_OF_MON_TYPES; i++) { if (typeCounts[mostCommonTypes[0]] < typeCounts[i]) mostCommonTypes[0] = i; @@ -765,15 +773,15 @@ void FillFactoryBrainParty(void) if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN) continue; - if (monLevel == 50 && monId > FRONTIER_MONS_HIGH_TIER) + if (monLevel == FRONTIER_MAX_LEVEL_50 && monId > FRONTIER_MONS_HIGH_TIER) continue; - for (j = 0; j < 6; j++) + for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++) { if (monId == gSaveBlock2Ptr->frontier.rentalMons[j].monId) break; } - if (j != 6) + if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons)) continue; for (k = 0; k < i; k++) @@ -786,7 +794,7 @@ void FillFactoryBrainParty(void) for (k = 0; k < i; k++) { - if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) + if (heldItems[k] != ITEM_NONE && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) break; } if (k != i) diff --git a/src/battle_pike.c b/src/battle_pike.c index 2b0cf6420..6c97c99fc 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -684,7 +684,7 @@ static void SetBattlePikeData(void) static void IsNextRoomFinal(void) { - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum > 14) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum > NUM_PIKE_ROOMS) gSpecialVar_Result = TRUE; else gSpecialVar_Result = FALSE; @@ -1117,20 +1117,20 @@ bool32 TryGenerateBattlePikeWildMon(bool8 checkKeenEyeIntimidate) if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) { monLevel = GetHighestLevelInPlayerParty(); - if (monLevel < 60) + if (monLevel < FRONTIER_MIN_LEVEL_OPEN) { - monLevel = 60; + monLevel = FRONTIER_MIN_LEVEL_OPEN; } else { monLevel -= wildMons[headerId][pikeMonId].levelDelta; - if (monLevel < 60) - monLevel = 60; + if (monLevel < FRONTIER_MIN_LEVEL_OPEN) + monLevel = FRONTIER_MIN_LEVEL_OPEN; } } else { - monLevel = 50 - wildMons[headerId][pikeMonId].levelDelta; + monLevel = FRONTIER_MAX_LEVEL_50 - wildMons[headerId][pikeMonId].levelDelta; } if (checkKeenEyeIntimidate == TRUE && !CanEncounterWildMon(monLevel)) @@ -1395,7 +1395,7 @@ static void PrepareOneTrainer(bool8 difficult) battleNum = 6; lvlMode = gSaveBlock2Ptr->frontier.lvlMode; - challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / 14; + challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / NUM_PIKE_ROOMS; do { trainerId = GetRandomScaledFrontierTrainerId(challengeNum, battleNum); @@ -1409,7 +1409,7 @@ static void PrepareOneTrainer(bool8 difficult) gTrainerBattleOpponent_A = trainerId; gFacilityTrainers = gBattleFrontierTrainers; SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 14) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < NUM_PIKE_ROOMS) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1] = gTrainerBattleOpponent_A; } @@ -1418,7 +1418,7 @@ static void PrepareTwoTrainers(void) int i; u16 trainerId; u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; - u16 challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / 14; + u16 challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / NUM_PIKE_ROOMS; gFacilityTrainers = gBattleFrontierTrainers; do @@ -1433,7 +1433,7 @@ static void PrepareTwoTrainers(void) gTrainerBattleOpponent_A = trainerId; SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum <= 14) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum <= NUM_PIKE_ROOMS) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1] = gTrainerBattleOpponent_A; do @@ -1448,7 +1448,7 @@ static void PrepareTwoTrainers(void) gTrainerBattleOpponent_B = trainerId; SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_B, 1); - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 14) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < NUM_PIKE_ROOMS) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 2] = gTrainerBattleOpponent_B; } @@ -1456,7 +1456,7 @@ static void ClearPikeTrainerIds(void) { u8 i; - for (i = 0; i < 14; i++) + for (i = 0; i < NUM_PIKE_ROOMS; i++) gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF; } diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c index 9039f60f2..bbd4c84dc 100644 --- a/src/battle_pyramid.c +++ b/src/battle_pyramid.c @@ -279,9 +279,9 @@ static const u8 sPyramidFloorTemplateOptions[][2] = {100, 15} }; -static const u8 sFloorTemplateOffsets[] = +static const u8 sFloorTemplateOffsets[FRONTIER_STAGES_PER_CHALLENGE] = { - 0, 4, 9, 14, 19, 24, 29, 0 + 0, 4, 9, 14, 19, 24, 29 }; static const u16 sPickupItemsLvl50[TOTAL_ROUNDS][PICKUP_ITEMS_PER_ROUND] = @@ -406,7 +406,7 @@ static const u8 sPickupItemSlots[][2] = {100, 9}, }; -static const u8 sPickupItemOffsets[] = {0, 9, 18, 27, 36, 45, 54}; +static const u8 sPickupItemOffsets[FRONTIER_STAGES_PER_CHALLENGE] = {0, 9, 18, 27, 36, 45, 54}; static const struct PyramidTrainerEncounterMusic sTrainerClassEncounterMusic[54] = { @@ -963,7 +963,7 @@ static void SeedPyramidFloor(void) { int i; - for (i = 0; i < 4; i++) + for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.pyramidRandoms); i++) gSaveBlock2Ptr->frontier.pyramidRandoms[i] = Random(); gSaveBlock2Ptr->frontier.pyramidTrainerFlags = 0; @@ -977,7 +977,7 @@ static void SetPickupItem(void) u8 id; u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u32 floor = gSaveBlock2Ptr->frontier.curChallengeBattleNum; - u32 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / 7) % TOTAL_ROUNDS; + u32 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_ROUNDS; if (round >= TOTAL_ROUNDS) round = TOTAL_ROUNDS - 1; @@ -1016,8 +1016,8 @@ static void HidePyramidItem(void) { // Rather than using event flags to hide the item object event, // it moves them far off the map bounds. - events[i].x = 0x7FFF; - events[i].y = 0x7FFF; + events[i].x = SHRT_MAX; + events[i].y = SHRT_MAX; break; } i++; @@ -1063,7 +1063,7 @@ static void ShowPostBattleHintText(void) case HINT_REMAINING_ITEMS: for (i = 0; i < GetNumBattlePyramidObjectEvents(); i++) { - if (events[i].graphicsId == OBJ_EVENT_GFX_ITEM_BALL && events[i].x != 0x7FFF && events[i].y != 0x7FFF) + if (events[i].graphicsId == OBJ_EVENT_GFX_ITEM_BALL && events[i].x != SHRT_MAX && events[i].y != SHRT_MAX) textIndex++; } i = 1; @@ -1071,7 +1071,7 @@ static void ShowPostBattleHintText(void) case HINT_REMAINING_TRAINERS: id = GetPyramidFloorTemplateId(); textIndex = sPyramidFloorTemplates[id].numTrainers; - for (i = 0; i < 8; i++) + for (i = 0; i < MAX_PYRAMID_TRAINERS; i++) { if (gBitTable[i] & gSaveBlock2Ptr->frontier.pyramidTrainerFlags) textIndex--; @@ -1326,7 +1326,7 @@ static void MarkPyramidTrainerAsBattled(u16 trainerId) { int i; - for (i = 0; i < 8; i++) + for (i = 0; i < MAX_PYRAMID_TRAINERS; i++) { if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId) gSaveBlock2Ptr->frontier.pyramidTrainerFlags |= gBitTable[i]; @@ -1345,7 +1345,7 @@ void GenerateBattlePyramidWildMon(void) const struct PyramidWildMon *wildMons; u32 id; u32 lvl = gSaveBlock2Ptr->frontier.lvlMode; - u16 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] / 7) % TOTAL_ROUNDS; + u16 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_ROUNDS; if (round >= TOTAL_ROUNDS) round = TOTAL_ROUNDS - 1; @@ -1488,13 +1488,13 @@ static u16 GetUniqueTrainerId(u8 objectEventId) int i; u16 trainerId; u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; - u32 challengeNum = gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / 7; - u32 battleNum = gSaveBlock2Ptr->frontier.curChallengeBattleNum; - if (battleNum == 7) + u32 challengeNum = gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; + u32 floor = gSaveBlock2Ptr->frontier.curChallengeBattleNum; + if (floor == FRONTIER_STAGES_PER_CHALLENGE) { do { - trainerId = GetRandomScaledFrontierTrainerId(challengeNum + 1, battleNum); + trainerId = GetRandomScaledFrontierTrainerId(challengeNum + 1, floor); for (i = 0; i < objectEventId; i++) { if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId) @@ -1506,7 +1506,7 @@ static u16 GetUniqueTrainerId(u8 objectEventId) { do { - trainerId = GetRandomScaledFrontierTrainerId(challengeNum, battleNum); + trainerId = GetRandomScaledFrontierTrainerId(challengeNum, floor); for (i = 0; i < objectEventId; i++) { if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId) @@ -1523,11 +1523,11 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio int y, x; int i; u8 entranceSquareId, exitSquareId; - u8 *floorLayoutOffsets = AllocZeroed(16); + u8 *floorLayoutOffsets = AllocZeroed(NUM_PYRAMID_FLOOR_SQUARES); GetPyramidFloorLayoutOffsets(floorLayoutOffsets); GetPyramidEntranceAndExitSquareIds(&entranceSquareId, &exitSquareId); - for (i = 0; i < 16; i++) + for (i = 0; i < NUM_PYRAMID_FLOOR_SQUARES; i++) { u16 *map; int yOffset, xOffset; @@ -1535,11 +1535,11 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio const u16 *layoutMap = mapLayout->map; gBackupMapLayout.map = backupMapData; - gBackupMapLayout.width = mapLayout->width * 4 + MAP_OFFSET_W; - gBackupMapLayout.height = mapLayout->height * 4 + MAP_OFFSET_H; + gBackupMapLayout.width = mapLayout->width * PYRAMID_FLOOR_SQUARES_WIDE + MAP_OFFSET_W; + gBackupMapLayout.height = mapLayout->height * PYRAMID_FLOOR_SQUARES_HIGH + MAP_OFFSET_H; map = backupMapData; - yOffset = ((i / 4 * mapLayout->height) + MAP_OFFSET) * gBackupMapLayout.width; - xOffset = (i % 4 * mapLayout->width) + MAP_OFFSET; + yOffset = ((i / PYRAMID_FLOOR_SQUARES_WIDE * mapLayout->height) + MAP_OFFSET) * gBackupMapLayout.width; + xOffset = (i % PYRAMID_FLOOR_SQUARES_WIDE * mapLayout->width) + MAP_OFFSET; map += yOffset + xOffset; for (y = 0; y < mapLayout->height; y++) { @@ -1553,8 +1553,8 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio { if (i == entranceSquareId && setPlayerPosition == FALSE) { - gSaveBlock1Ptr->pos.x = (mapLayout->width * (i % 4)) + x; - gSaveBlock1Ptr->pos.y = (mapLayout->height * (i / 4)) + y; + gSaveBlock1Ptr->pos.x = (mapLayout->width * (i % PYRAMID_FLOOR_SQUARES_WIDE)) + x; + gSaveBlock1Ptr->pos.y = (mapLayout->height * (i / PYRAMID_FLOOR_SQUARES_WIDE)) + y; } map[x] = (layoutMap[x] & (MAPGRID_ELEVATION_MASK | MAPGRID_COLLISION_MASK)) | METATILE_BattlePyramid_Floor; } @@ -1563,7 +1563,7 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio map[x] = layoutMap[x]; } } - map += MAP_OFFSET_W + (mapLayout->width * 4); + map += MAP_OFFSET_W + (mapLayout->width * PYRAMID_FLOOR_SQUARES_WIDE); layoutMap += mapLayout->width; } } @@ -1577,7 +1577,7 @@ void LoadBattlePyramidObjectEventTemplates(void) u8 id; u8 entranceSquareId, exitSquareId; - for (i = 0; i < 8; i++) + for (i = 0; i < MAX_PYRAMID_TRAINERS; i++) gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF; id = GetPyramidFloorTemplateId(); @@ -1633,13 +1633,13 @@ void LoadBattlePyramidFloorObjectEventScripts(void) static void GetPyramidEntranceAndExitSquareIds(u8 *entranceSquareId, u8 *exitSquareId) { - *entranceSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[3] % 16; - *exitSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[0] % 16; + *entranceSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[3] % NUM_PYRAMID_FLOOR_SQUARES; + *exitSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[0] % NUM_PYRAMID_FLOOR_SQUARES; if (*entranceSquareId == *exitSquareId) { - *entranceSquareId = (gSaveBlock2Ptr->frontier.pyramidRandoms[3] + 1 ) % 16; - *exitSquareId = (gSaveBlock2Ptr->frontier.pyramidRandoms[0] + 15) % 16; + *entranceSquareId = (gSaveBlock2Ptr->frontier.pyramidRandoms[3] + 1 ) % NUM_PYRAMID_FLOOR_SQUARES; + *exitSquareId = (gSaveBlock2Ptr->frontier.pyramidRandoms[0] + NUM_PYRAMID_FLOOR_SQUARES - 1) % NUM_PYRAMID_FLOOR_SQUARES; } } @@ -1651,10 +1651,10 @@ static void SetPyramidObjectPositionsUniformly(u8 objType) int squareId; u32 bits = 0; u8 id = GetPyramidFloorTemplateId(); - u8 *floorLayoutOffsets = AllocZeroed(16); + u8 *floorLayoutOffsets = AllocZeroed(NUM_PYRAMID_FLOOR_SQUARES); GetPyramidFloorLayoutOffsets(floorLayoutOffsets); - squareId = gSaveBlock2Ptr->frontier.pyramidRandoms[2] % 16; + squareId = gSaveBlock2Ptr->frontier.pyramidRandoms[2] % NUM_PYRAMID_FLOOR_SQUARES; if (objType == OBJ_TRAINERS) { numObjects = sPyramidFloorTemplates[id].numTrainers; @@ -1682,10 +1682,10 @@ static void SetPyramidObjectPositionsUniformly(u8 objType) if (gBitTable[squareId] & gSaveBlock2Ptr->frontier.pyramidRandoms[3]) bits |= 2; } - if (++squareId >= 16) + if (++squareId >= NUM_PYRAMID_FLOOR_SQUARES) squareId = 0; - if (squareId == gSaveBlock2Ptr->frontier.pyramidRandoms[2] % 16) + if (squareId == gSaveBlock2Ptr->frontier.pyramidRandoms[2] % NUM_PYRAMID_FLOOR_SQUARES) { if (bits & 1) bits |= 6; @@ -1709,7 +1709,7 @@ static bool8 SetPyramidObjectPositionsInAndNearSquare(u8 objType, u8 squareId) int numPlacedObjects = 0; int numObjects; u8 id = GetPyramidFloorTemplateId(); - u8 *floorLayoutOffsets = AllocZeroed(16); + u8 *floorLayoutOffsets = AllocZeroed(NUM_PYRAMID_FLOOR_SQUARES); GetPyramidFloorLayoutOffsets(floorLayoutOffsets); if (objType == OBJ_TRAINERS) @@ -1775,7 +1775,7 @@ static bool8 SetPyramidObjectPositionsNearSquare(u8 objType, u8 squareId) int r8 = 0; int numObjects; u8 id = GetPyramidFloorTemplateId(); - u8 *floorLayoutOffsets = AllocZeroed(16); + u8 *floorLayoutOffsets = AllocZeroed(NUM_PYRAMID_FLOOR_SQUARES); GetPyramidFloorLayoutOffsets(floorLayoutOffsets); if (objType == OBJ_TRAINERS) @@ -1900,7 +1900,7 @@ static void GetPyramidFloorLayoutOffsets(u8 *layoutOffsets) int rand = (gSaveBlock2Ptr->frontier.pyramidRandoms[0]) | (gSaveBlock2Ptr->frontier.pyramidRandoms[1] << 16); u8 id = GetPyramidFloorTemplateId(); - for (i = 0; i < 16; i++) + for (i = 0; i < NUM_PYRAMID_FLOOR_SQUARES; i++) { layoutOffsets[i] = sPyramidFloorTemplates[id].layoutOffsets[rand & 0x7]; rand >>= 3; @@ -1931,7 +1931,7 @@ u8 GetNumBattlePyramidObjectEvents(void) u8 i; struct ObjectEventTemplate *events = gSaveBlock1Ptr->objectEventTemplates; - for (i = 0; i < 16; i++) + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) { if (events[i].localId == 0) break; @@ -1959,7 +1959,7 @@ u16 GetBattlePyramidPickupItemId(void) int rand; u32 i; u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; - int round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / 7); + int round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE); if (round >= TOTAL_ROUNDS) round = TOTAL_ROUNDS - 1; diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index d1b946146..66b4cd97d 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -1410,7 +1410,7 @@ void TryStoreHeldItemsInPyramidBag(void) memcpy(newItems, gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(u16)); memcpy(newQuantities, gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(u8)); - for (i = 0; i < 3; i++) + for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { heldItem = GetMonData(&party[i], MON_DATA_HELD_ITEM); if (heldItem != ITEM_NONE && !AddBagItem(heldItem, 1)) @@ -1426,10 +1426,8 @@ void TryStoreHeldItemsInPyramidBag(void) } heldItem = ITEM_NONE; - for (i = 0; i < 3; i++) - { + for (i = 0; i < FRONTIER_PARTY_SIZE; i++) SetMonData(&party[i], MON_DATA_HELD_ITEM, &heldItem); - } gSpecialVar_Result = 0; Free(newItems); Free(newQuantities); diff --git a/src/battle_tent.c b/src/battle_tent.c index 53c91c871..dba9e6e8a 100644 --- a/src/battle_tent.c +++ b/src/battle_tent.c @@ -56,10 +56,8 @@ static void GenerateInitialRentalMons(void); * */ -// IWRAM bss -static u16 sRandMonSetId; +static u16 sRandMonId; -// const rom data void static (*const sVerdanturfTentFuncs[])(void) = { [VERDANTURF_TENT_FUNC_INIT] = InitVerdanturfTentChallenge, @@ -357,7 +355,7 @@ static void GenerateOpponentMons(void) const u16 *monSet; u16 species[FRONTIER_PARTY_SIZE]; u16 heldItems[FRONTIER_PARTY_SIZE]; - s32 monId = 0; + s32 numMons = 0; gFacilityTrainers = gSlateportBattleTentTrainers; gFacilityTrainerMons = gSlateportBattleTentMons; @@ -366,6 +364,7 @@ static void GenerateOpponentMons(void) { do { + // Choose a random trainer, ensuring no repeats in this challenge trainerId = Random() % NUM_BATTLE_TENT_TRAINERS; for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++) { @@ -376,48 +375,53 @@ static void GenerateOpponentMons(void) gTrainerBattleOpponent_A = trainerId; monSet = gFacilityTrainers[gTrainerBattleOpponent_A].monSet; - while (monSet[monId] != 0xFFFF) - monId++; - if (monId > 8) + while (monSet[numMons] != 0xFFFF) + numMons++; + if (numMons > 8) break; - monId = 0; + numMons = 0; } - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 2) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < TENT_STAGES_PER_CHALLENGE - 1) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A; monSet = gFacilityTrainers[gTrainerBattleOpponent_A].monSet; i = 0; while (i != FRONTIER_PARTY_SIZE) { - sRandMonSetId = monSet[Random() % monId]; - for (j = 0; j < 6; j++) + sRandMonId = monSet[Random() % numMons]; + + // Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player + for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++) { - if (gFacilityTrainerMons[sRandMonSetId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species) + if (gFacilityTrainerMons[sRandMonId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species) break; } - if (j != 6) + if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons)) continue; + // Ensure this species hasn't already been chosen for the opponent for (k = 0; k < i; k++) { - if (species[k] == gFacilityTrainerMons[sRandMonSetId].species) + if (species[k] == gFacilityTrainerMons[sRandMonId].species) break; } if (k != i) continue; + // Ensure held items don't repeat on the opponent's team for (k = 0; k < i; k++) { - if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonSetId].itemTableId]) + if (heldItems[k] != ITEM_NONE && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonId].itemTableId]) break; } if (k != i) continue; - species[i] = gFacilityTrainerMons[sRandMonSetId].species; - heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonSetId].itemTableId]; - gFrontierTempParty[i] = sRandMonSetId; + // Successful selection + species[i] = gFacilityTrainerMons[sRandMonId].species; + heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonId].itemTableId]; + gFrontierTempParty[i] = sRandMonId; i++; } } diff --git a/src/battle_tower.c b/src/battle_tower.c index e652038ac..839b99b24 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -27,6 +27,7 @@ #include "constants/battle_dome.h" #include "constants/battle_frontier.h" #include "constants/battle_frontier_mons.h" +#include "constants/battle_tent.h" #include "constants/battle_tent_mons.h" #include "constants/battle_tent_trainers.h" #include "constants/battle_tower.h" @@ -1060,7 +1061,7 @@ static void SetNextFacilityOpponent(void) u16 id; u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); u16 winStreak = GetCurrentFacilityWinStreak(); - u32 challengeNum = winStreak / 7; + u32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE; SetFacilityPtrsGetLevel(); if (battleMode == FRONTIER_MODE_MULTIS || battleMode == FRONTIER_MODE_LINK_MULTIS) @@ -1095,7 +1096,7 @@ static void SetNextFacilityOpponent(void) gTrainerBattleOpponent_A = id; SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < 7) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < FRONTIER_STAGES_PER_CHALLENGE) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A; } } @@ -1107,7 +1108,7 @@ u16 GetRandomScaledFrontierTrainerId(u8 challengeNum, u8 battleNum) if (challengeNum <= 7) { - if (battleNum == 6) + if (battleNum == FRONTIER_STAGES_PER_CHALLENGE - 1) { // The last battle in each challenge has a jump in difficulty, pulls from a table with higher ranges trainerId = (sFrontierTrainerIdRangesHard[challengeNum][1] - sFrontierTrainerIdRangesHard[challengeNum][0]) + 1; @@ -1136,7 +1137,7 @@ static void GetRandomScaledFrontierTrainerIdRange(u8 challengeNum, u8 battleNum, if (challengeNum <= 7) { - if (battleNum == 6) + if (battleNum == FRONTIER_STAGES_PER_CHALLENGE - 1) { // The last battle in each challenge has a jump in difficulty, pulls from a table with higher ranges range = (sFrontierTrainerIdRangesHard[challengeNum][1] - sFrontierTrainerIdRangesHard[challengeNum][0]) + 1; @@ -1691,7 +1692,10 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount) while (i != monCount) { u16 monId = monSet[Random() % bfMonCount]; - if ((level == 50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER) + + // "High tier" pokemon are only allowed on open level mode + // 20 is not a possible value for level here + if ((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER) continue; // Ensure this pokemon species isn't a duplicate. @@ -1767,9 +1771,9 @@ static void Unused_CreateApprenticeMons(u16 trainerId, u8 firstMonId) fixedIV = 9; if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) - level = 100; + level = FRONTIER_MAX_LEVEL_OPEN; else - level = 50; + level = FRONTIER_MAX_LEVEL_50; for (i = 0; i != 3; i++) { @@ -1802,8 +1806,10 @@ u16 GetRandomFrontierMonFromSet(u16 trainerId) do { + // "High tier" pokemon are only allowed on open level mode + // 20 is not a possible value for level here monId = monSet[Random() % numMons]; - } while((level == 50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER); + } while((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER); return monId; } @@ -1831,11 +1837,11 @@ static void FillFactoryFrontierTrainerParty(u16 trainerId, u8 firstMonId) u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); // By mistake Battle Tower's Level 50 challenge number is used to determine the IVs for Battle Factory. #ifdef BUGFIX - u8 challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / 7; + u8 challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; #else - u8 challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][FRONTIER_LVL_50] / 7; + u8 challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][FRONTIER_LVL_50] / FRONTIER_STAGES_PER_CHALLENGE; #endif - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 6) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < FRONTIER_STAGES_PER_CHALLENGE - 1) fixedIV = GetFactoryMonFixedIV(challengeNum, FALSE); else fixedIV = GetFactoryMonFixedIV(challengeNum, TRUE); // Last trainer in challenge uses higher IVs @@ -1882,7 +1888,7 @@ static void FillFactoryTentTrainerParty(u16 trainerId, u8 firstMonId) { u8 i, j; u8 friendship; - u8 level = 30; + u8 level = TENT_MIN_LEVEL; u8 fixedIV = 0; u32 otID = T1_READ_32(gSaveBlock2Ptr->playerTrainerId); @@ -2043,7 +2049,7 @@ void DoSpecialTrainerBattle(void) break; case SPECIAL_BATTLE_EREADER: ZeroEnemyPartyMons(); - for (i = 0; i < 3; i++) + for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.ereaderTrainer.party); i++) CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i]); gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_EREADER_TRAINER; gTrainerBattleOpponent_A = 0; @@ -2189,7 +2195,7 @@ static void SaveTowerChallenge(void) { u16 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u16 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); - s32 challengeNum = (signed)(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7); + s32 challengeNum = (signed)(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE); if (gSpecialVar_0x8005 == 0 && (challengeNum > 1 || gSaveBlock2Ptr->frontier.curChallengeBattleNum != 0)) SaveBattleTowerRecord(); @@ -2279,7 +2285,7 @@ static void LoadMultiPartnerCandidatesData(void) objEventTemplates = gSaveBlock1Ptr->objectEventTemplates; lvlMode = gSaveBlock2Ptr->frontier.lvlMode; battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); - challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; species1 = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES, NULL); species2 = GetMonData(&gPlayerParty[1], MON_DATA_SPECIES, NULL); level = SetFacilityPtrsGetLevel(); @@ -2338,7 +2344,7 @@ static void LoadMultiPartnerCandidatesData(void) for (i = 0; i < APPRENTICE_COUNT; i++) { if (gSaveBlock2Ptr->apprentices[i].lvlMode != 0 - && sApprenticeChallengeThreshold[gSaveBlock2Ptr->apprentices[i].numQuestions] / 7 <= challengeNum + && sApprenticeChallengeThreshold[gSaveBlock2Ptr->apprentices[i].numQuestions] / FRONTIER_STAGES_PER_CHALLENGE <= challengeNum && gSaveBlock2Ptr->apprentices[i].lvlMode - 1 == lvlMode) { k = 0; @@ -2377,7 +2383,7 @@ static void LoadMultiPartnerCandidatesData(void) checksum += record[j]; } - if (gSaveBlock2Ptr->frontier.towerRecords[i].winStreak / 7 <= challengeNum + if (gSaveBlock2Ptr->frontier.towerRecords[i].winStreak / FRONTIER_STAGES_PER_CHALLENGE <= challengeNum && gSaveBlock2Ptr->frontier.towerRecords[i].lvlMode == lvlMode && recordHasData && gSaveBlock2Ptr->frontier.towerRecords[i].checksum == checksum) @@ -2458,7 +2464,7 @@ static void ShowPartnerCandidateMessage(void) s32 monId; s32 level = SetFacilityPtrsGetLevel(); u16 winStreak = GetCurrentFacilityWinStreak(); - s32 challengeNum = winStreak / 7; + s32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE; s32 k = gSpecialVar_LastTalked - 2; s32 trainerId = gSaveBlock2Ptr->frontier.trainerIds[k]; @@ -2517,7 +2523,7 @@ static void ShowPartnerCandidateMessage(void) gSaveBlock2Ptr->frontier.trainerIds[18] = gFrontierTempParty[0]; gSaveBlock2Ptr->frontier.trainerIds[19] = gFrontierTempParty[1]; } - for (k = 0; k < 14; k++) + for (k = 0; k < FRONTIER_STAGES_PER_CHALLENGE * 2; k++) { while (1) { @@ -2576,7 +2582,7 @@ static void LoadLinkMultiOpponentsData(void) case 0: if (battleMode == FRONTIER_MODE_LINK_MULTIS) { - challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; if (IsLinkTaskFinished()) { SendBlock(BitmaskAllOtherLinkPlayers(), &challengeNum, sizeof(challengeNum)); @@ -2596,7 +2602,7 @@ static void LoadLinkMultiOpponentsData(void) challengeNum = gBlockRecvBuffer[0][0]; else challengeNum = gBlockRecvBuffer[1][0]; - for (i = 0; i < 14; i++) + for (i = 0; i < FRONTIER_STAGES_PER_CHALLENGE * 2; i++) { do { @@ -2840,7 +2846,7 @@ static void FillEReaderTrainerWithPlayerData(void) ereaderTrainer->winStreak = 1; j = 7; - for (i = 0; i < 6; i++) + for (i = 0; i < EASY_CHAT_BATTLE_WORDS_COUNT; i++) { ereaderTrainer->greeting[i] = gSaveBlock1Ptr->easyChatBattleStart[i]; ereaderTrainer->farewellPlayerLost[i] = j; @@ -2848,7 +2854,7 @@ static void FillEReaderTrainerWithPlayerData(void) j++; } - for (i = 0; i < 3; i++) + for (i = 0; i < (int)ARRAY_COUNT(ereaderTrainer->party); i++) ConvertPokemonToBattleTowerPokemon(&gPlayerParty[i], &ereaderTrainer->party[i]); SetEReaderTrainerChecksum(ereaderTrainer); @@ -3246,12 +3252,12 @@ u8 GetFrontierEnemyMonLevel(u8 lvlMode) { default: case FRONTIER_LVL_50: - level = 50; + level = FRONTIER_MAX_LEVEL_50; break; case FRONTIER_LVL_OPEN: level = GetHighestLevelInPlayerParty(); - if (level < 60) - level = 60; + if (level < FRONTIER_MIN_LEVEL_OPEN) + level = FRONTIER_MIN_LEVEL_OPEN; break; } @@ -3321,7 +3327,7 @@ static u16 GetBattleTentTrainerId(void) static u8 SetTentPtrsGetLevel(void) { - u8 level = 30; + u8 level = TENT_MIN_LEVEL; u32 facility = VarGet(VAR_FRONTIER_FACILITY); if (facility == FRONTIER_FACILITY_FACTORY) @@ -3346,8 +3352,8 @@ static u8 SetTentPtrsGetLevel(void) } level = GetHighestLevelInPlayerParty(); - if (level < 30) - level = 30; + if (level < TENT_MIN_LEVEL) + level = TENT_MIN_LEVEL; return level; } @@ -3369,7 +3375,7 @@ static void SetNextBattleTentOpponent(void) gTrainerBattleOpponent_A = trainerId; SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < 3) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < TENT_STAGES_PER_CHALLENGE) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A; } diff --git a/src/data/battle_frontier/battle_pyramid_open_level_wild_mons.h b/src/data/battle_frontier/battle_pyramid_open_level_wild_mons.h index 8738b0de6..f09448b82 100644 --- a/src/data/battle_frontier/battle_pyramid_open_level_wild_mons.h +++ b/src/data/battle_frontier/battle_pyramid_open_level_wild_mons.h @@ -1038,7 +1038,7 @@ static const struct PyramidWildMon sOpenLevelWildMons_Round20[] = } }; -static const struct PyramidWildMon *const sOpenLevelWildMonPointers[] = +static const struct PyramidWildMon *const sOpenLevelWildMonPointers[TOTAL_ROUNDS] = { sOpenLevelWildMons_Round1, sOpenLevelWildMons_Round2, diff --git a/src/frontier_util.c b/src/frontier_util.c index 03d7b0cb5..a08ccad4f 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -29,6 +29,7 @@ #include "load_save.h" #include "battle_dome.h" #include "constants/battle_frontier.h" +#include "constants/battle_pike.h" #include "constants/frontier_util.h" #include "constants/trainers.h" #include "constants/game_stat.h" @@ -968,7 +969,7 @@ static void PrintHyphens(s32 y) s32 i; u8 text[37]; - for (i = 0; i < 36; i++) + for (i = 0; i < (int)ARRAY_COUNT(text) - 1; i++) text[i] = CHAR_HYPHEN; text[i] = EOS; @@ -1860,25 +1861,25 @@ static void GiveBattlePoints(void) switch (facility) { case FRONTIER_FACILITY_TOWER: - challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; break; case FRONTIER_FACILITY_DOME: challengeNum = gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode]; break; case FRONTIER_FACILITY_PALACE: - challengeNum = gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; break; case FRONTIER_FACILITY_ARENA: - challengeNum = gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; break; case FRONTIER_FACILITY_FACTORY: - challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; break; case FRONTIER_FACILITY_PIKE: - challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / 14; + challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / NUM_PIKE_ROOMS; break; case FRONTIER_FACILITY_PYRAMID: - challengeNum = gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; break; } @@ -1982,7 +1983,7 @@ static void AppendIfValid(u16 species, u16 heldItem, u16 hp, u8 lvlMode, u8 monL if (gFrontierBannedSpecies[i] != 0xFFFF) return; - if (lvlMode == FRONTIER_LVL_50 && monLevel > 50) + if (lvlMode == FRONTIER_LVL_50 && monLevel > FRONTIER_MAX_LEVEL_50) return; for (i = 0; i < *count && speciesArray[i] != species; i++) diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 363f2bc06..9eaa035ca 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -12,6 +12,7 @@ #include "string_util.h" #include "task.h" #include "text.h" +#include "constants/battle_frontier.h" #include "constants/layouts.h" #include "constants/region_map_sections.h" #include "constants/weather.h" @@ -185,7 +186,7 @@ static const u8 sText_PyramidFloor6[] = _("PYRAMID FLOOR 6"); static const u8 sText_PyramidFloor7[] = _("PYRAMID FLOOR 7"); static const u8 sText_Pyramid[] = _("PYRAMID"); -static const u8 * const sBattlePyramid_MapHeaderStrings[] = +static const u8 * const sBattlePyramid_MapHeaderStrings[FRONTIER_STAGES_PER_CHALLENGE + 1] = { sText_PyramidFloor1, sText_PyramidFloor2, @@ -309,7 +310,7 @@ static void ShowMapNamePopUpWindow(void) if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP) { withoutPrefixPtr = &(mapDisplayHeader[3]); - mapDisplayHeaderSource = sBattlePyramid_MapHeaderStrings[7]; + mapDisplayHeaderSource = sBattlePyramid_MapHeaderStrings[FRONTIER_STAGES_PER_CHALLENGE]; } else { diff --git a/src/mystery_gift_client.c b/src/mystery_gift_client.c index eeebec5d6..bd177e6f8 100644 --- a/src/mystery_gift_client.c +++ b/src/mystery_gift_client.c @@ -202,7 +202,7 @@ static u32 Client_Run(struct MysteryGiftClient * client) MysteryGiftLink_InitSend(&client->link, MG_LINKID_GAME_DATA, client->sendBuffer, sizeof(struct MysteryGiftLinkGameData)); break; case CLI_LOAD_TOSS_RESPONSE: - // param here is set by MG_STATE_LINK_ASK_TOSS or MG_STATE_LINK_ASK_TOSS_UNRECEIVED + // param here is set by MG_STATE_CLIENT_ASK_TOSS or MG_STATE_CLIENT_ASK_TOSS_UNRECEIVED MysteryGiftClient_InitSendWord(client, MG_LINKID_RESPONSE, client->param); break; case CLI_SAVE_CARD: diff --git a/src/party_menu.c b/src/party_menu.c index cbe127bb9..016c359cb 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5647,11 +5647,11 @@ static u8 GetBattleEntryLevelCap(void) case FACILITY_MULTI_OR_EREADER: return MAX_LEVEL; case FACILITY_UNION_ROOM: - return 30; + return UNION_ROOM_MAX_LEVEL; default: // Battle Frontier if (gSpecialVar_0x8004 == FRONTIER_LVL_50) - return 50; - return MAX_LEVEL; + return FRONTIER_MAX_LEVEL_50; + return FRONTIER_MAX_LEVEL_OPEN; } } diff --git a/src/pokemon.c b/src/pokemon.c index 7cdad72e9..b0bc41897 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2464,7 +2464,7 @@ void CreateBattleTowerMon_HandleLevel(struct Pokemon *mon, struct BattleTowerPok if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) level = GetFrontierEnemyMonLevel(gSaveBlock2Ptr->frontier.lvlMode); else if (lvl50) - level = 50; + level = FRONTIER_MAX_LEVEL_50; else level = src->level; diff --git a/src/start_menu.c b/src/start_menu.c index 90230c3dd..11189ee83 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -42,9 +42,10 @@ #include "text_window.h" #include "trainer_card.h" #include "window.h" -#include "constants/songs.h" #include "union_room.h" +#include "constants/battle_frontier.h" #include "constants/rgb.h" +#include "constants/songs.h" // Menu actions enum @@ -138,7 +139,7 @@ static bool8 FieldCB_ReturnToFieldStartMenu(void); static const struct WindowTemplate sSafariBallsWindowTemplate = {0, 1, 1, 9, 4, 0xF, 8}; -static const u8* const sPyramidFloorNames[] = +static const u8* const sPyramidFloorNames[FRONTIER_STAGES_PER_CHALLENGE + 1] = { gText_Floor1, gText_Floor2, @@ -392,7 +393,7 @@ static void ShowSafariBallsWindow(void) static void ShowPyramidFloorWindow(void) { - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum == 7) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum == FRONTIER_STAGES_PER_CHALLENGE) sBattlePyramidFloorWindowId = AddWindow(&sPyramidFloorWindowTemplate_1); else sBattlePyramidFloorWindowId = AddWindow(&sPyramidFloorWindowTemplate_2); diff --git a/src/union_room.c b/src/union_room.c index 9a743dbab..05b41a088 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -4318,7 +4318,7 @@ static bool32 HasAtLeastTwoMonsOfLevel30OrLower(void) for (i = 0; i < gPlayerPartyCount; i++) { - if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) <= 30 + if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) <= UNION_ROOM_MAX_LEVEL && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG) count++; } From 7470a56d44fa05749c4832e7c18570978afc5163 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Thu, 9 Jun 2022 14:59:21 -0300 Subject: [PATCH 148/208] Untangled CheckPartnersMonForRibbons --- src/trade.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/trade.c b/src/trade.c index df3cb4d33..25614c91a 100644 --- a/src/trade.c +++ b/src/trade.c @@ -4813,7 +4813,7 @@ static void CheckPartnersMonForRibbons(void) { u8 i; u8 numRibbons = 0; - for (i = 0; i < 12; i ++) + for (i = 0; i < (MON_DATA_UNUSED_RIBBONS - MON_DATA_CHAMPION_RIBBON); i ++) { numRibbons += GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_CHAMPION_RIBBON + i); } From 407047ace7bcfbf73119dd0b80cf890a23725604 Mon Sep 17 00:00:00 2001 From: sneed Date: Fri, 10 Jun 2022 22:31:53 +0300 Subject: [PATCH 149/208] ground x2 vs flying if inverse battle --- src/battle_util.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index ebd7917d4..e521ef00d 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7770,33 +7770,35 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) return FALSE; } - -bool32 IsBattlerGrounded(u8 battlerId) +// Only called directly when calculating damage type effectiveness +static bool32 IsBattlerGrounded2(u8 battlerId, bool32 considerInverse) { if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_IRON_BALL) return TRUE; - else if (gFieldStatuses & STATUS_FIELD_GRAVITY) + if (gFieldStatuses & STATUS_FIELD_GRAVITY) return TRUE; #if B_ROOTED_GROUNDING >= GEN_4 - else if (gStatuses3[battlerId] & STATUS3_ROOTED) + if (gStatuses3[battlerId] & STATUS3_ROOTED) return TRUE; #endif - else if (gStatuses3[battlerId] & STATUS3_SMACKED_DOWN) + if (gStatuses3[battlerId] & STATUS3_SMACKED_DOWN) return TRUE; + if (gStatuses3[battlerId] & STATUS3_TELEKINESIS) + return FALSE; + if (gStatuses3[battlerId] & STATUS3_MAGNET_RISE) + return FALSE; + if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_AIR_BALLOON) + return FALSE; + if (GetBattlerAbility(battlerId) == ABILITY_LEVITATE) + return FALSE; + if (IS_BATTLER_OF_TYPE(battlerId, TYPE_FLYING) && (!considerInverse || !FlagGet(B_FLAG_INVERSE_BATTLE))) + return FALSE; + return TRUE; +} - else if (gStatuses3[battlerId] & STATUS3_TELEKINESIS) - return FALSE; - else if (gStatuses3[battlerId] & STATUS3_MAGNET_RISE) - return FALSE; - else if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_AIR_BALLOON) - return FALSE; - else if (GetBattlerAbility(battlerId) == ABILITY_LEVITATE) - return FALSE; - else if (IS_BATTLER_OF_TYPE(battlerId, TYPE_FLYING)) - return FALSE; - - else - return TRUE; +bool32 IsBattlerGrounded(u8 battlerId) +{ + IsBattlerGrounded2(battlerId, FALSE); } bool32 IsBattlerAlive(u8 battlerId) @@ -9172,7 +9174,7 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat && gBattleMons[battlerDef].type3 != gBattleMons[battlerDef].type1) MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, gBattleMons[battlerDef].type3, battlerAtk, recordAbilities); - if (moveType == TYPE_GROUND && !IsBattlerGrounded(battlerDef) && !(gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)) + if (moveType == TYPE_GROUND && !IsBattlerGrounded2(battlerDef, TRUE) && !(gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)) { modifier = UQ_4_12(0.0); if (recordAbilities && defAbility == ABILITY_LEVITATE) From dec54e6e928217cdb6249fdad03d1b6492c7c7ff Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 9 Jun 2022 15:32:08 -0400 Subject: [PATCH 150/208] Additional constant usage --- data/maps/BattleFrontier_Lounge2/scripts.inc | 26 ++++++++-------- src/battle_pike.c | 8 ++--- src/battle_tower.c | 32 ++++++++++---------- src/frontier_util.c | 26 ++++++++-------- 4 files changed, 47 insertions(+), 45 deletions(-) diff --git a/data/maps/BattleFrontier_Lounge2/scripts.inc b/data/maps/BattleFrontier_Lounge2/scripts.inc index 8efc17293..12eda4a5e 100644 --- a/data/maps/BattleFrontier_Lounge2/scripts.inc +++ b/data/maps/BattleFrontier_Lounge2/scripts.inc @@ -22,18 +22,20 @@ BattleFrontier_Lounge2_EventScript_AlreadyMetManiac:: end BattleFrontier_Lounge2_EventScript_GiveAdvice:: - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 0, BattleFrontier_Lounge2_EventScript_BufferSingle - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 1, BattleFrontier_Lounge2_EventScript_BufferDouble - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 2, BattleFrontier_Lounge2_EventScript_BufferMulti - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 3, BattleFrontier_Lounge2_EventScript_BufferMultiLink - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 4, BattleFrontier_Lounge2_EventScript_BufferBattleDome - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 5, BattleFrontier_Lounge2_EventScript_BufferBattleFactory - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 6, BattleFrontier_Lounge2_EventScript_BufferBattlePalace - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 7, BattleFrontier_Lounge2_EventScript_BufferBattleArena - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 8, BattleFrontier_Lounge2_EventScript_BufferBattlePike - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 9, BattleFrontier_Lounge2_EventScript_BufferBattlePyramid - call_if_le VAR_FRONTIER_MANIAC_FACILITY, 3, BattleFrontier_Lounge2_EventScript_BattleTowerNews - call_if_ge VAR_FRONTIER_MANIAC_FACILITY, 4, BattleFrontier_Lounge2_EventScript_FacilityNews + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_SINGLES, BattleFrontier_Lounge2_EventScript_BufferSingle + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_DOUBLES, BattleFrontier_Lounge2_EventScript_BufferDouble + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_MULTIS, BattleFrontier_Lounge2_EventScript_BufferMulti + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_LINK, BattleFrontier_Lounge2_EventScript_BufferMultiLink + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_DOME, BattleFrontier_Lounge2_EventScript_BufferBattleDome + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_FACTORY, BattleFrontier_Lounge2_EventScript_BufferBattleFactory + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_PALACE, BattleFrontier_Lounge2_EventScript_BufferBattlePalace + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_ARENA, BattleFrontier_Lounge2_EventScript_BufferBattleArena + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_PIKE, BattleFrontier_Lounge2_EventScript_BufferBattlePike + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_PYRAMID, BattleFrontier_Lounge2_EventScript_BufferBattlePyramid +@ <= FRONTIER_MANIAC_TOWER_LINK is any Battle Tower mode + call_if_le VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_LINK, BattleFrontier_Lounge2_EventScript_BattleTowerNews +@ >= FRONTIER_MANIAC_DOME is any facility other than Battle Tower + call_if_ge VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_DOME, BattleFrontier_Lounge2_EventScript_FacilityNews special ShowFrontierManiacMessage waitmessage waitbuttonpress diff --git a/src/battle_pike.c b/src/battle_pike.c index 6c97c99fc..433dd0a08 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -1158,11 +1158,11 @@ u8 GetBattlePikeWildMonHeaderId(void) u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u16 winStreak = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode]; - if (winStreak <= 280) + if (winStreak <= 20 * NUM_PIKE_ROOMS) headerId = 0; - else if (winStreak <= 560) + else if (winStreak <= 40 * NUM_PIKE_ROOMS) headerId = 1; - else if (winStreak <= 840) + else if (winStreak <= 60 * NUM_PIKE_ROOMS) headerId = 2; else headerId = 3; @@ -1392,7 +1392,7 @@ static void PrepareOneTrainer(bool8 difficult) if (!difficult) battleNum = 1; else - battleNum = 6; + battleNum = FRONTIER_STAGES_PER_CHALLENGE - 1; lvlMode = gSaveBlock2Ptr->frontier.lvlMode; challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / NUM_PIKE_ROOMS; diff --git a/src/battle_tower.c b/src/battle_tower.c index 839b99b24..354a087c4 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -1327,19 +1327,19 @@ void PutNewBattleTowerRecord(struct EmeraldBattleTowerRecord *newRecordEm) if (gSaveBlock2Ptr->frontier.towerRecords[i].trainerId[j] != newRecord->trainerId[j]) break; } - if (j == 4) + if (j == TRAINER_ID_LENGTH) { for (k = 0; k < PLAYER_NAME_LENGTH; k++) { - #ifdef BUGFIX - if (gSaveBlock2Ptr->frontier.towerRecords[i].name[k] != newRecord->name[k]) + // Incorrect index being used + #ifdef BUGFIX + #define INDEX k + #else + #define INDEX j + #endif + if (gSaveBlock2Ptr->frontier.towerRecords[i].name[INDEX] != newRecord->name[INDEX]) break; - if (newRecord->name[k] == EOS) - #else - if (gSaveBlock2Ptr->frontier.towerRecords[i].name[j] != newRecord->name[j]) - break; - if (newRecord->name[j] == EOS) - #endif + if (newRecord->name[INDEX] == EOS) { k = PLAYER_NAME_LENGTH; break; @@ -1635,7 +1635,7 @@ static void FillTentTrainerParty(u8 monsCount) static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount) { s32 i, j; - u16 chosenMonIndices[4]; + u16 chosenMonIndices[MAX_FRONTIER_PARTY_SIZE]; u8 friendship = MAX_FRIENDSHIP; u8 level = SetFacilityPtrsGetLevel(); u8 fixedIV = 0; @@ -1651,7 +1651,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount) } else if (trainerId == TRAINER_EREADER) { - for (i = firstMonId; i < firstMonId + 3; i++) + for (i = firstMonId; i < firstMonId + FRONTIER_PARTY_SIZE; i++) CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i - firstMonId]); return; } @@ -1676,7 +1676,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount) else { // Apprentice. - for (i = firstMonId; i < firstMonId + 3; i++) + for (i = firstMonId; i < firstMonId + FRONTIER_PARTY_SIZE; i++) CreateApprenticeMon(&gEnemyParty[i], &gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE], i - firstMonId); return; } @@ -1775,7 +1775,7 @@ static void Unused_CreateApprenticeMons(u16 trainerId, u8 firstMonId) else level = FRONTIER_MAX_LEVEL_50; - for (i = 0; i != 3; i++) + for (i = 0; i != FRONTIER_PARTY_SIZE; i++) { CreateMonWithEVSpread(&gEnemyParty[firstMonId + i], apprentice->party[i].species, level, fixedIV, 8); friendship = MAX_FRIENDSHIP; @@ -1848,7 +1848,7 @@ static void FillFactoryFrontierTrainerParty(u16 trainerId, u8 firstMonId) } else if (trainerId == TRAINER_EREADER) { - for (i = firstMonId; i < firstMonId + 3; i++) + for (i = firstMonId; i < firstMonId + FRONTIER_PARTY_SIZE; i++) CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i - firstMonId]); return; } @@ -2743,8 +2743,8 @@ u16 GetCurrentBattleTowerWinStreak(u8 lvlMode, u8 battleMode) { u16 winStreak = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode]; - if (winStreak > 9999) - return 9999; + if (winStreak > MAX_STREAK) + return MAX_STREAK; else return winStreak; } diff --git a/src/frontier_util.c b/src/frontier_util.c index a08ccad4f..545f48ac0 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -595,13 +595,13 @@ static const u8 sBattlePointAwards[][NUM_FRONTIER_FACILITIES][FRONTIER_MODE_COUN // First bit is has battled them before and not won yet, second bit is has battled them and won (obtained a Symbol) static const u16 sBattledBrainBitFlags[NUM_FRONTIER_FACILITIES][2] = { - [FRONTIER_FACILITY_TOWER] = {0x0001, 0x0002}, - [FRONTIER_FACILITY_DOME] = {0x0004, 0x0008}, - [FRONTIER_FACILITY_PALACE] = {0x0010, 0x0020}, - [FRONTIER_FACILITY_ARENA] = {0x0040, 0x0080}, - [FRONTIER_FACILITY_FACTORY] = {0x0100, 0x0200}, - [FRONTIER_FACILITY_PIKE] = {0x0400, 0x0800}, - [FRONTIER_FACILITY_PYRAMID] = {0x1000, 0x2000}, + [FRONTIER_FACILITY_TOWER] = {1 << 0, 1 << 1}, + [FRONTIER_FACILITY_DOME] = {1 << 2, 1 << 3}, + [FRONTIER_FACILITY_PALACE] = {1 << 4, 1 << 5}, + [FRONTIER_FACILITY_ARENA] = {1 << 6, 1 << 7}, + [FRONTIER_FACILITY_FACTORY] = {1 << 8, 1 << 9}, + [FRONTIER_FACILITY_PIKE] = {1 << 10, 1 << 11}, + [FRONTIER_FACILITY_PYRAMID] = {1 << 12, 1 << 13}, }; static void (* const sFrontierUtilFuncs[])(void) = @@ -636,8 +636,8 @@ static const struct WindowTemplate sFrontierResultsWindowTemplate = .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, - .width = 0x1c, - .height = 0x12, + .width = 28, + .height = 18, .paletteNum = 15, .baseBlock = 1 }; @@ -647,7 +647,7 @@ static const struct WindowTemplate sLinkContestResultsWindowTemplate = .bg = 0, .tilemapLeft = 2, .tilemapTop = 2, - .width = 0x1a, + .width = 26, .height = 15, .paletteNum = 15, .baseBlock = 1 @@ -658,7 +658,7 @@ static const struct WindowTemplate sRankingHallRecordsWindowTemplate = .bg = 0, .tilemapLeft = 2, .tilemapTop = 1, - .width = 0x1a, + .width = 26, .height = 17, .paletteNum = 15, .baseBlock = 1 @@ -959,7 +959,7 @@ static bool8 IsWinStreakActive(u32 challenge) static void PrintAligned(const u8 *str, s32 y) { - s32 x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 224); + s32 x = GetStringCenterAlignXOffset(FONT_NORMAL, str, DISPLAY_WIDTH - 16); y = (y * 8) + 1; AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x, y, TEXT_SKIP_DRAW, NULL); } @@ -2345,7 +2345,7 @@ static void PrintHallRecords(s32 hallFacilityId, s32 lvlMode) StringCopy(gStringVar1, sRecordsWindowChallengeTexts[hallFacilityId][0]); StringExpandPlaceholders(gStringVar4, sRecordsWindowChallengeTexts[hallFacilityId][1]); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SKIP_DRAW, NULL); - x = GetStringRightAlignXOffset(FONT_NORMAL, sLevelModeText[lvlMode], 0xD0); + x = GetStringRightAlignXOffset(FONT_NORMAL, sLevelModeText[lvlMode], DISPLAY_WIDTH - 32); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, sLevelModeText[lvlMode], x, 1, TEXT_SKIP_DRAW, NULL); if (hallFacilityId == RANKING_HALL_TOWER_LINK) { From 95f075ec905da35ff1bc97f70a92c13a5a218c9a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 13 Jun 2022 15:01:04 -0400 Subject: [PATCH 151/208] Remove erroneous bugfix --- src/match_call.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/match_call.c b/src/match_call.c index de7f13416..8b25d5b44 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -33,6 +33,13 @@ #include "constants/songs.h" #include "constants/trainers.h" +// In this file only the values normally associated with Battle Pike and Factory are swapped. +// Note that this is *not* a bug, because they are properly swapped consistently in this file. +// There would only be an issue if anything in this file interacted with something expecting +// the usual value order, or vice versa. +#define MATCH_CALL_FACTORY FRONTIER_FACILITY_PIKE +#define MATCH_CALL_PIKE FRONTIER_FACILITY_FACTORY + // Each match call message has variables that can be populated randomly or // dependent on the trainer. The below are IDs for how to populate the vars // in a given message. @@ -1590,6 +1597,7 @@ static const struct MatchCallText *GetGeneralMatchCallText(int matchCallId, u8 * rand = Random(); if (!(rand & 1)) { + // Count the number of facilities with a win streak for (count = 0, i = 0; i < NUM_FRONTIER_FACILITIES; i++) { if (GetFrontierStreakInfo(i, &topic) > 1) @@ -1598,6 +1606,8 @@ static const struct MatchCallText *GetGeneralMatchCallText(int matchCallId, u8 * if (count) { + // At least one facility with a win streak + // Randomly choose one to have a call about count = Random() % count; for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) { @@ -1807,15 +1817,15 @@ static void PopulateSpeciesFromTrainerParty(int matchCallId, u8 *destStr) StringCopy(destStr, speciesName); } -static const u8 *const sBattleFrontierFacilityNames[] = +static const u8 *const sBattleFrontierFacilityNames[NUM_FRONTIER_FACILITIES] = { - gText_BattleTower2, - gText_BattleDome, - gText_BattlePalace, - gText_BattleArena, - gText_BattlePike, - gText_BattleFactory, - gText_BattlePyramid, + [FRONTIER_FACILITY_TOWER] = gText_BattleTower2, + [FRONTIER_FACILITY_DOME] = gText_BattleDome, + [FRONTIER_FACILITY_PALACE] = gText_BattlePalace, + [FRONTIER_FACILITY_ARENA] = gText_BattleArena, + [MATCH_CALL_PIKE] = gText_BattlePike, + [MATCH_CALL_FACTORY] = gText_BattleFactory, + [FRONTIER_FACILITY_PYRAMID] = gText_BattlePyramid, }; static void PopulateBattleFrontierFacilityName(int matchCallId, u8 *destStr) @@ -1899,7 +1909,7 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId) switch (facilityId) { case FRONTIER_FACILITY_DOME: - for (i = 0; i < 2; i++) + for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.domeRecordWinStreaks); i++) { for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++) { @@ -1909,11 +1919,7 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId) } *topicTextId = GEN_TOPIC_B_DOME - 1; break; - #ifdef BUGFIX - case FRONTIER_FACILITY_PIKE: - #else - case FRONTIER_FACILITY_FACTORY: - #endif + case MATCH_CALL_PIKE: for (i = 0; i < FRONTIER_LVL_MODE_COUNT; i++) { if (streak < gSaveBlock2Ptr->frontier.pikeRecordStreaks[i]) @@ -1922,7 +1928,7 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId) *topicTextId = GEN_TOPIC_B_PIKE - 1; break; case FRONTIER_FACILITY_TOWER: - for (i = 0; i < 4; i++) + for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.towerRecordWinStreaks); i++) { for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++) { @@ -1933,7 +1939,7 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId) *topicTextId = GEN_TOPIC_STREAK_RECORD - 1; break; case FRONTIER_FACILITY_PALACE: - for (i = 0; i < 2; i++) + for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.palaceRecordWinStreaks); i++) { for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++) { @@ -1943,12 +1949,8 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId) } *topicTextId = GEN_TOPIC_STREAK_RECORD - 1; break; - #ifdef BUGFIX - case FRONTIER_FACILITY_FACTORY: - #else - case FRONTIER_FACILITY_PIKE: - #endif - for (i = 0; i < 2; i++) + case MATCH_CALL_FACTORY: + for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.factoryRecordWinStreaks); i++) { for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++) { From 4660f8c88baeccf3ab0baba03e8f0b7430ed73df Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 14 Jun 2022 09:18:55 -0400 Subject: [PATCH 152/208] Document battle tower TV show --- data/text/tv.inc | 30 +++++------ include/constants/tv.h | 17 ++++++ include/event_scripts.h | 30 +++++------ src/easy_chat.c | 2 +- src/frontier_util.c | 60 +++++++++++----------- src/tv.c | 111 ++++++++++++++++++++-------------------- 6 files changed, 134 insertions(+), 116 deletions(-) diff --git a/data/text/tv.inc b/data/text/tv.inc index 68b842158..6cfc289d2 100644 --- a/data/text/tv.inc +++ b/data/text/tv.inc @@ -166,7 +166,7 @@ BattleFrontier_BattleTowerLobby_Text_LookingForwardToNextBattle:: .string "I'll be looking forward to your\n" .string "next battle!$" -gTVBravoTrainerBattleTowerText00:: +BravoTrainerBattleTower_Text_Intro:: .string "Yeah!\n" .string "It's BRAVO TRAINER time!\p" .string "Today, we're going to profile {STR_VAR_1},\n" @@ -174,12 +174,12 @@ gTVBravoTrainerBattleTowerText00:: .string "For the challenge, {STR_VAR_1} entered\n" .string "one wicked {STR_VAR_2}.$" -gTVBravoTrainerBattleTowerText01:: +BravoTrainerBattleTower_Text_NewRecord:: .string "The pair set a new record of {STR_VAR_2} wins\n" .string "in a row in {STR_VAR_1} competition!\l" .string "Bravo, TRAINER!$" -gTVBravoTrainerBattleTowerText02:: +BravoTrainerBattleTower_Text_Lost:: .string "The twosome finally succumbed to\n" .string "{STR_VAR_1} in match number {STR_VAR_2}.\l" .string "Nice try, TRAINER!\p" @@ -188,7 +188,7 @@ gTVBravoTrainerBattleTowerText02:: .string "We asked the TRAINER for impressions\n" .string "on the match with {STR_VAR_1}.$" -gTVBravoTrainerBattleTowerText03:: +BravoTrainerBattleTower_Text_Won:: .string "The twosome won it all by defeating\n" .string "{STR_VAR_1}'s {STR_VAR_2} thoroughly.\l" .string "Bravo, TRAINER!\p" @@ -197,7 +197,7 @@ gTVBravoTrainerBattleTowerText03:: .string "We asked the TRAINER for impressions\n" .string "on the moment of glory.$" -gTVBravoTrainerBattleTowerText04:: +BravoTrainerBattleTower_Text_LostFinal:: .string "After a string of wins, the pair finally\n" .string "succumbed to {STR_VAR_1}'s {STR_VAR_2},\l" .string "their final hurdle.\p" @@ -208,7 +208,7 @@ gTVBravoTrainerBattleTowerText04:: .string "We asked the TRAINER for impressions\n" .string "on battling the celebrity pair.$" -gTVBravoTrainerBattleTowerText05:: +BravoTrainerBattleTower_Text_Satisfied:: .string "This is what the TRAINER had to say:\n" .string "“I'm satisfied!”\p" .string "Now isn't that a refreshing reply?\n" @@ -218,7 +218,7 @@ gTVBravoTrainerBattleTowerText05:: .string "I found out exactly how satisfied\n" .string "when I heard the TRAINER say this:$" -gTVBravoTrainerBattleTowerText06:: +BravoTrainerBattleTower_Text_Unsatisfied:: .string "This is what the TRAINER had to say:\n" .string "“I'm not satisfied…”\p" .string "Our TRAINER was obviously a little down\n" @@ -228,22 +228,22 @@ gTVBravoTrainerBattleTowerText06:: .string "Anyway, I found out how dissatisfied\n" .string "our TRAINER was when I heard this:$" -gTVBravoTrainerBattleTowerText07:: +BravoTrainerBattleTower_Text_None1:: .string "None$" -gTVBravoTrainerBattleTowerText08:: +BravoTrainerBattleTower_Text_None2:: .string "None$" -gTVBravoTrainerBattleTowerText09:: +BravoTrainerBattleTower_Text_None3:: .string "None$" -gTVBravoTrainerBattleTowerText10:: +BravoTrainerBattleTower_Text_None4:: .string "None$" -gTVBravoTrainerBattleTowerText11:: +BravoTrainerBattleTower_Text_Response:: .string "“{STR_VAR_1}.”$" -gTVBravoTrainerBattleTowerText12:: +BravoTrainerBattleTower_Text_ResponseSatisfied:: .string "“{STR_VAR_1}.”\n" .string "Now isn't that great?\p" .string "It really expresses {STR_VAR_2}'s joy,\n" @@ -252,7 +252,7 @@ gTVBravoTrainerBattleTowerText12:: .string "end… It really was what you'd call\l" .string "“{STR_VAR_1}”!$" -gTVBravoTrainerBattleTowerText13:: +BravoTrainerBattleTower_Text_ResponseUnsatisfied:: .string "“{STR_VAR_1}.”\n" .string "Now isn't that fitting?\p" .string "That battle with {STR_VAR_3} at the\n" @@ -261,7 +261,7 @@ gTVBravoTrainerBattleTowerText13:: .string "{STR_VAR_2}'s disappointment comes across\n" .string "loud and clear, I'd say!$" -gTVBravoTrainerBattleTowerText14:: +BravoTrainerBattleTower_Text_Outro:: .string "Bravo, {STR_VAR_1}!\n" .string "Bravo, {STR_VAR_2}!\p" .string "I hope we can count on seeing\n" diff --git a/include/constants/tv.h b/include/constants/tv.h index 4c8dd4fa8..87748a31d 100644 --- a/include/constants/tv.h +++ b/include/constants/tv.h @@ -274,4 +274,21 @@ #define SMARTSHOPPER_NUM_ITEMS 3 +// TV Show states for Bravo Trainer's Battle Tower interview +#define BRAVOTOWER_STATE_INTRO 0 +#define BRAVOTOWER_STATE_NEW_RECORD 1 +#define BRAVOTOWER_STATE_LOST 2 +#define BRAVOTOWER_STATE_WON 3 +#define BRAVOTOWER_STATE_LOST_FINAL 4 +#define BRAVOTOWER_STATE_SATISFIED 5 +#define BRAVOTOWER_STATE_UNSATISFIED 6 +#define BRAVOTOWER_STATE_UNUSED_1 7 +#define BRAVOTOWER_STATE_UNUSED_2 8 +#define BRAVOTOWER_STATE_UNUSED_3 9 +#define BRAVOTOWER_STATE_UNUSED_4 10 +#define BRAVOTOWER_STATE_RESPONSE 11 +#define BRAVOTOWER_STATE_RESPONSE_SATISFIED 12 +#define BRAVOTOWER_STATE_RESPONSE_UNSATISFIED 13 +#define BRAVOTOWER_STATE_OUTRO 14 + #endif //GUARD_CONSTANTS_TV_H diff --git a/include/event_scripts.h b/include/event_scripts.h index a19d4553a..4e0a88f82 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -21,21 +21,21 @@ extern const u8 gTVBravoTrainerText05[]; extern const u8 gTVBravoTrainerText06[]; extern const u8 gTVBravoTrainerText07[]; extern const u8 gTVBravoTrainerText08[]; -extern const u8 gTVBravoTrainerBattleTowerText00[]; -extern const u8 gTVBravoTrainerBattleTowerText01[]; -extern const u8 gTVBravoTrainerBattleTowerText02[]; -extern const u8 gTVBravoTrainerBattleTowerText03[]; -extern const u8 gTVBravoTrainerBattleTowerText04[]; -extern const u8 gTVBravoTrainerBattleTowerText05[]; -extern const u8 gTVBravoTrainerBattleTowerText06[]; -extern const u8 gTVBravoTrainerBattleTowerText07[]; -extern const u8 gTVBravoTrainerBattleTowerText08[]; -extern const u8 gTVBravoTrainerBattleTowerText09[]; -extern const u8 gTVBravoTrainerBattleTowerText10[]; -extern const u8 gTVBravoTrainerBattleTowerText11[]; -extern const u8 gTVBravoTrainerBattleTowerText12[]; -extern const u8 gTVBravoTrainerBattleTowerText13[]; -extern const u8 gTVBravoTrainerBattleTowerText14[]; +extern const u8 BravoTrainerBattleTower_Text_Intro[]; +extern const u8 BravoTrainerBattleTower_Text_NewRecord[]; +extern const u8 BravoTrainerBattleTower_Text_Lost[]; +extern const u8 BravoTrainerBattleTower_Text_Won[]; +extern const u8 BravoTrainerBattleTower_Text_LostFinal[]; +extern const u8 BravoTrainerBattleTower_Text_Satisfied[]; +extern const u8 BravoTrainerBattleTower_Text_Unsatisfied[]; +extern const u8 BravoTrainerBattleTower_Text_None1[]; +extern const u8 BravoTrainerBattleTower_Text_None2[]; +extern const u8 BravoTrainerBattleTower_Text_None3[]; +extern const u8 BravoTrainerBattleTower_Text_None4[]; +extern const u8 BravoTrainerBattleTower_Text_Response[]; +extern const u8 BravoTrainerBattleTower_Text_ResponseSatisfied[]; +extern const u8 BravoTrainerBattleTower_Text_ResponseUnsatisfied[]; +extern const u8 BravoTrainerBattleTower_Text_Outro[]; extern const u8 gTVFanClubOpinionsText00[]; extern const u8 gTVFanClubOpinionsText01[]; extern const u8 gTVFanClubOpinionsText02[]; diff --git a/src/easy_chat.c b/src/easy_chat.c index 4d6006f1c..2bbd16cb2 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -1492,7 +1492,7 @@ void ShowEasyChatScreen(void) displayedPersonType = EASY_CHAT_PERSON_REPORTER_MALE; break; case EASY_CHAT_TYPE_BATTLE_TOWER_INTERVIEW: - words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].fanclubOpinions.words18; + words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].bravoTrainerTower.words; displayedPersonType = EASY_CHAT_PERSON_REPORTER_FEMALE; break; case EASY_CHAT_TYPE_GOOD_SAYING: diff --git a/src/frontier_util.c b/src/frontier_util.c index 545f48ac0..f5dde452f 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -500,94 +500,94 @@ static const struct FrontierBrainMon sFrontierBrainsMons[][2][FRONTIER_PARTY_SIZ static const u8 sBattlePointAwards[][NUM_FRONTIER_FACILITIES][FRONTIER_MODE_COUNT] = { { - {1, 2, 3, 3}, {1, 1, 0, 0}, {4, 5, 0, 0}, {1, 0, 0, 0}, {3, 4, 0, 0}, {1, 0, 0, 0}, {5, 0, 0, 0} + {1, 2, 3, 3}, {1, 1}, {4, 5}, {1}, {3, 4}, {1}, {5} }, { - {2, 3, 4, 4}, {1, 1, 0, 0}, {4, 5, 0, 0}, {1, 0, 0, 0}, {3, 4, 0, 0}, {1, 0, 0, 0}, {5, 0, 0, 0} + {2, 3, 4, 4}, {1, 1}, {4, 5}, {1}, {3, 4}, {1}, {5} }, { - {3, 4, 5, 5}, {2, 2, 0, 0}, {5, 6, 0, 0}, {1, 0, 0, 0}, {4, 5, 0, 0}, {2, 0, 0, 0}, {6, 0, 0, 0} + {3, 4, 5, 5}, {2, 2}, {5, 6}, {1}, {4, 5}, {2}, {6} }, { - {4, 5, 6, 6}, {2, 2, 0, 0}, {5, 6, 0, 0}, {2, 0, 0, 0}, {4, 5, 0, 0}, {2, 0, 0, 0}, {6, 0, 0, 0} + {4, 5, 6, 6}, {2, 2}, {5, 6}, {2}, {4, 5}, {2}, {6} }, { - {5, 6, 7, 7}, {3, 3, 0, 0}, {6, 7, 0, 0}, {2, 0, 0, 0}, {5, 6, 0, 0}, {2, 0, 0, 0}, {7, 0, 0, 0} + {5, 6, 7, 7}, {3, 3}, {6, 7}, {2}, {5, 6}, {2}, {7} }, { - {6, 7, 8, 8}, {3, 3, 0, 0}, {6, 7, 0, 0}, {2, 0, 0, 0}, {5, 6, 0, 0}, {4, 0, 0, 0}, {7, 0, 0, 0} + {6, 7, 8, 8}, {3, 3}, {6, 7}, {2}, {5, 6}, {4}, {7} }, { - {7, 8, 9, 9}, {4, 4, 0, 0}, {7, 8, 0, 0}, {3, 0, 0, 0}, {6, 7, 0, 0}, {4, 0, 0, 0}, {8, 0, 0, 0} + {7, 8, 9, 9}, {4, 4}, {7, 8}, {3}, {6, 7}, {4}, {8} }, { - {8, 9, 10, 10}, {4, 4, 0, 0}, {7, 8, 0, 0}, {3, 0, 0, 0},{6, 7, 0, 0}, {4, 0, 0, 0}, {8, 0, 0, 0} + {8, 9, 10, 10}, {4, 4}, {7, 8}, {3},{6, 7}, {4}, {8} }, { - {9, 10, 11, 11}, {5, 5, 0, 0}, {8, 9, 0, 0}, {4, 0, 0, 0}, {7, 8, 0, 0}, {8, 0, 0, 0}, {9, 0, 0, 0} + {9, 10, 11, 11}, {5, 5}, {8, 9}, {4}, {7, 8}, {8}, {9} }, { - {10, 11, 12, 12}, {5, 5, 0, 0}, {8, 9, 0, 0}, {4, 0, 0, 0}, {7, 8, 0, 0}, {8, 0, 0, 0}, {9, 0, 0, 0} + {10, 11, 12, 12}, {5, 5}, {8, 9}, {4}, {7, 8}, {8}, {9} }, { - {11, 12, 13, 13}, {6, 6, 0, 0}, {9, 10, 0, 0}, {5, 0, 0,0}, {8, 9, 0, 0}, {8, 0, 0, 0}, {10, 0, 0, 0} + {11, 12, 13, 13}, {6, 6}, {9, 10}, {5,0}, {8, 9}, {8}, {10} }, { - {12, 13, 14, 14}, {6, 6, 0, 0}, {9, 10, 0, 0}, {6, 0, 0,0}, {8, 9, 0, 0}, {8, 0, 0, 0}, {10, 0, 0, 0} + {12, 13, 14, 14}, {6, 6}, {9, 10}, {6,0}, {8, 9}, {8}, {10} }, { - {13, 14, 15, 15}, {7, 7, 0, 0}, {10, 11, 0, 0}, {7, 0, 0, 0}, {9, 10, 0, 0}, {10, 0, 0, 0}, {11, 0, 0, 0} + {13, 14, 15, 15}, {7, 7}, {10, 11}, {7}, {9, 10}, {10}, {11} }, { - {14, 15, 15, 15}, {7, 7, 0, 0}, {10, 11, 0, 0}, {8, 0, 0, 0}, {9, 10, 0, 0}, {10, 0, 0, 0}, {11, 0, 0, 0} + {14, 15, 15, 15}, {7, 7}, {10, 11}, {8}, {9, 10}, {10}, {11} }, { - {15, 15, 15, 15}, {8, 8, 0, 0}, {11, 12, 0, 0}, {9, 0, 0, 0}, {10, 11, 0, 0}, {10, 0, 0, 0}, {12, 0, 0, 0} + {15, 15, 15, 15}, {8, 8}, {11, 12}, {9}, {10, 11}, {10}, {12} }, { - {15, 15, 15, 15}, {8, 8, 0, 0}, {11, 12, 0, 0}, {10, 0, 0, 0}, {10, 11, 0, 0}, {10, 0, 0, 0}, {12, 0, 0, 0} + {15, 15, 15, 15}, {8, 8}, {11, 12}, {10}, {10, 11}, {10}, {12} }, { - {15, 15, 15, 15}, {9, 9, 0, 0}, {12, 13, 0, 0}, {11, 0, 0, 0}, {11, 12, 0, 0}, {12, 0, 0, 0}, {13, 0, 0, 0} + {15, 15, 15, 15}, {9, 9}, {12, 13}, {11}, {11, 12}, {12}, {13} }, { - {15, 15, 15, 15}, {9, 9, 0, 0}, {12, 13, 0, 0}, {12, 0, 0, 0}, {11, 12, 0, 0}, {12, 0, 0, 0}, {13, 0, 0, 0} + {15, 15, 15, 15}, {9, 9}, {12, 13}, {12}, {11, 12}, {12}, {13} }, { - {15, 15, 15, 15}, {10, 10, 0, 0}, {13, 14, 0, 0}, {13, 0, 0, 0}, {12, 13, 0, 0}, {12, 0, 0, 0}, {14, 0, 0, 0} + {15, 15, 15, 15}, {10, 10}, {13, 14}, {13}, {12, 13}, {12}, {14} }, { - {15, 15, 15, 15}, {10, 10, 0, 0}, {13, 14, 0, 0}, {14, 0, 0, 0}, {12, 13, 0, 0}, {12, 0, 0, 0}, {14, 0, 0, 0} + {15, 15, 15, 15}, {10, 10}, {13, 14}, {14}, {12, 13}, {12}, {14} }, { - {15, 15, 15, 15}, {11, 11, 0, 0}, {14, 15, 0, 0}, {15, 0, 0, 0}, {13, 14, 0, 0}, {12, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {11, 11}, {14, 15}, {15}, {13, 14}, {12}, {15} }, { - {15, 15, 15, 15}, {11, 11, 0, 0}, {14, 15, 0, 0}, {15, 0, 0, 0}, {13, 14, 0, 0}, {14, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {11, 11}, {14, 15}, {15}, {13, 14}, {14}, {15} }, { - {15, 15, 15, 15}, {12, 12, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {14, 15, 0, 0}, {14, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {12, 12}, {15, 15}, {15}, {14, 15}, {14}, {15} }, { - {15, 15, 15, 15}, {12, 12, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {14, 15, 0, 0}, {14, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {12, 12}, {15, 15}, {15}, {14, 15}, {14}, {15} }, { - {15, 15, 15, 15}, {13, 13, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 15, 0, 0}, {14, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {13, 13}, {15, 15}, {15}, {15, 15}, {14}, {15} }, { - {15, 15, 15, 15}, {13, 13, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {13, 13}, {15, 15}, {15}, {15, 15}, {15}, {15} }, { - {15, 15, 15, 15}, {14, 14, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {14, 14}, {15, 15}, {15}, {15, 15}, {15}, {15} }, { - {15, 15, 15, 15}, {14, 14, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {14, 14}, {15, 15}, {15}, {15, 15}, {15}, {15} }, { - {15, 15, 15, 15}, {15, 15, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {15, 15}, {15, 15}, {15}, {15, 15}, {15}, {15} }, { - {15, 15, 15, 15}, {15, 15, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {15, 15}, {15, 15}, {15}, {15, 15}, {15}, {15} }, }; diff --git a/src/tv.c b/src/tv.c index 5cca91ff7..ec36a3ff0 100644 --- a/src/tv.c +++ b/src/tv.c @@ -373,21 +373,21 @@ static const u8 *const sTV3CheersForPokeblocksTextGroup[] = { }; static const u8 *const sTVBravoTrainerBattleTowerTextGroup[] = { - gTVBravoTrainerBattleTowerText00, - gTVBravoTrainerBattleTowerText01, - gTVBravoTrainerBattleTowerText02, - gTVBravoTrainerBattleTowerText03, - gTVBravoTrainerBattleTowerText04, - gTVBravoTrainerBattleTowerText05, - gTVBravoTrainerBattleTowerText06, - gTVBravoTrainerBattleTowerText07, - gTVBravoTrainerBattleTowerText08, - gTVBravoTrainerBattleTowerText09, - gTVBravoTrainerBattleTowerText10, - gTVBravoTrainerBattleTowerText11, - gTVBravoTrainerBattleTowerText12, - gTVBravoTrainerBattleTowerText13, - gTVBravoTrainerBattleTowerText14 + [BRAVOTOWER_STATE_INTRO] = BravoTrainerBattleTower_Text_Intro, + [BRAVOTOWER_STATE_NEW_RECORD] = BravoTrainerBattleTower_Text_NewRecord, + [BRAVOTOWER_STATE_LOST] = BravoTrainerBattleTower_Text_Lost, + [BRAVOTOWER_STATE_WON] = BravoTrainerBattleTower_Text_Won, + [BRAVOTOWER_STATE_LOST_FINAL] = BravoTrainerBattleTower_Text_LostFinal, + [BRAVOTOWER_STATE_SATISFIED] = BravoTrainerBattleTower_Text_Satisfied, + [BRAVOTOWER_STATE_UNSATISFIED] = BravoTrainerBattleTower_Text_Unsatisfied, + [BRAVOTOWER_STATE_UNUSED_1] = BravoTrainerBattleTower_Text_None1, + [BRAVOTOWER_STATE_UNUSED_2] = BravoTrainerBattleTower_Text_None2, + [BRAVOTOWER_STATE_UNUSED_3] = BravoTrainerBattleTower_Text_None3, + [BRAVOTOWER_STATE_UNUSED_4] = BravoTrainerBattleTower_Text_None4, + [BRAVOTOWER_STATE_RESPONSE] = BravoTrainerBattleTower_Text_Response, + [BRAVOTOWER_STATE_RESPONSE_SATISFIED] = BravoTrainerBattleTower_Text_ResponseSatisfied, + [BRAVOTOWER_STATE_RESPONSE_UNSATISFIED] = BravoTrainerBattleTower_Text_ResponseUnsatisfied, + [BRAVOTOWER_STATE_OUTRO] = BravoTrainerBattleTower_Text_Outro }; static const u8 *const sTVContestLiveUpdatesTextGroup[] = { @@ -1490,9 +1490,9 @@ static void InterviewAfter_BravoTrainerBattleTowerProfile(void) show->bravoTrainerTower.numFights = GetCurrentBattleTowerWinStreak(gSaveBlock2Ptr->frontier.towerLvlMode, 0); show->bravoTrainerTower.wonTheChallenge = gSaveBlock2Ptr->frontier.towerBattleOutcome; if (gSaveBlock2Ptr->frontier.towerLvlMode == FRONTIER_LVL_50) - show->bravoTrainerTower.btLevel = 50; + show->bravoTrainerTower.btLevel = FRONTIER_MAX_LEVEL_50; else - show->bravoTrainerTower.btLevel = 100; + show->bravoTrainerTower.btLevel = FRONTIER_MAX_LEVEL_OPEN; show->bravoTrainerTower.interviewResponse = gSpecialVar_0x8004; StorePlayerIdInNormalShow(show); show->bravoTrainerTower.language = gGameLanguage; @@ -4371,6 +4371,9 @@ static void DoTVShowBravoTrainerPokemonProfile(void) ShowFieldMessage(sTVBravoTrainerTextGroup[state]); } +// This is the TV show triggered by accepting the reporter's interview in the lobby of Battle Tower. +// The reporter had asked the player if they were satisfied or not with the challenge, and then asked +// for a one word Easy Chat description of their feelings about the challenge. static void DoTVShowBravoTrainerBattleTower(void) { TVShow *show; @@ -4381,85 +4384,83 @@ static void DoTVShowBravoTrainerBattleTower(void) state = sTVShowState; switch(state) { - case 0: + case BRAVOTOWER_STATE_INTRO: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.species]); - if (show->bravoTrainerTower.numFights >= 7) - sTVShowState = 1; + if (show->bravoTrainerTower.numFights >= FRONTIER_STAGES_PER_CHALLENGE) + sTVShowState = BRAVOTOWER_STATE_NEW_RECORD; else - sTVShowState = 2; + sTVShowState = BRAVOTOWER_STATE_LOST; break; - case 1: - if (show->bravoTrainerTower.btLevel == 50) - { + case BRAVOTOWER_STATE_NEW_RECORD: + // The TV show states a "new record" was achieved as long as all the battles in the challenge were attempted, + // regardless of any previous records or whether the final battle was won or lost. + if (show->bravoTrainerTower.btLevel == FRONTIER_MAX_LEVEL_50) StringCopy(gStringVar1, gText_Lv50); - } else - { StringCopy(gStringVar1, gText_OpenLevel); - } ConvertIntToDecimalString(1, show->bravoTrainerTower.numFights); if (show->bravoTrainerTower.wonTheChallenge == TRUE) - sTVShowState = 3; + sTVShowState = BRAVOTOWER_STATE_WON; else - sTVShowState = 4; + sTVShowState = BRAVOTOWER_STATE_LOST_FINAL; break; - case 2: + case BRAVOTOWER_STATE_LOST: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); ConvertIntToDecimalString(1, show->bravoTrainerTower.numFights + 1); if (show->bravoTrainerTower.interviewResponse == 0) - sTVShowState = 5; + sTVShowState = BRAVOTOWER_STATE_SATISFIED; else - sTVShowState = 6; + sTVShowState = BRAVOTOWER_STATE_UNSATISFIED; break; - case 3: + case BRAVOTOWER_STATE_WON: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.defeatedSpecies]); if (show->bravoTrainerTower.interviewResponse == 0) - sTVShowState = 5; + sTVShowState = BRAVOTOWER_STATE_SATISFIED; else - sTVShowState = 6; + sTVShowState = BRAVOTOWER_STATE_UNSATISFIED; break; - case 4: + case BRAVOTOWER_STATE_LOST_FINAL: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.defeatedSpecies]); if (show->bravoTrainerTower.interviewResponse == 0) - sTVShowState = 5; + sTVShowState = BRAVOTOWER_STATE_SATISFIED; else - sTVShowState = 6; + sTVShowState = BRAVOTOWER_STATE_UNSATISFIED; break; - case 5: + case BRAVOTOWER_STATE_SATISFIED: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); - sTVShowState = 11; + sTVShowState = BRAVOTOWER_STATE_RESPONSE; break; - case 6: + case BRAVOTOWER_STATE_UNSATISFIED: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); - sTVShowState = 11; + sTVShowState = BRAVOTOWER_STATE_RESPONSE; break; - case 7: - sTVShowState = 11; + case BRAVOTOWER_STATE_UNUSED_1: + sTVShowState = BRAVOTOWER_STATE_RESPONSE; break; - case 8: - case 9: - case 10: + case BRAVOTOWER_STATE_UNUSED_2: + case BRAVOTOWER_STATE_UNUSED_3: + case BRAVOTOWER_STATE_UNUSED_4: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); - sTVShowState = 11; + sTVShowState = BRAVOTOWER_STATE_RESPONSE; break; - case 11: + case BRAVOTOWER_STATE_RESPONSE: CopyEasyChatWord(gStringVar1, show->bravoTrainerTower.words[0]); if (show->bravoTrainerTower.interviewResponse == 0) - sTVShowState = 12; + sTVShowState = BRAVOTOWER_STATE_RESPONSE_SATISFIED; else - sTVShowState = 13; + sTVShowState = BRAVOTOWER_STATE_RESPONSE_UNSATISFIED; break; - case 12: - case 13: + case BRAVOTOWER_STATE_RESPONSE_SATISFIED: + case BRAVOTOWER_STATE_RESPONSE_UNSATISFIED: CopyEasyChatWord(gStringVar1, show->bravoTrainerTower.words[0]); TVShowConvertInternationalString(gStringVar2, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); TVShowConvertInternationalString(gStringVar3, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); - sTVShowState = 14; + sTVShowState = BRAVOTOWER_STATE_OUTRO; break; - case 14: + case BRAVOTOWER_STATE_OUTRO: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.species]); TVShowDone(); From e48341f7fcd7dba2aaf352ece4e7e24c16eef043 Mon Sep 17 00:00:00 2001 From: Simply BLG <61010688+SimplyBLGDev@users.noreply.github.com> Date: Fri, 17 Jun 2022 11:52:54 -0300 Subject: [PATCH 153/208] Format newlines in contest_string.inc Some of the strings declared in contest_string.inc were poorly formatted, containing newline characters in the middle of the string, opposing the format used by every string in data/text, I just updated them to match the format, making it more readable. --- data/text/contest_strings.inc | 135 ++++++++++++++++++++++------------ 1 file changed, 90 insertions(+), 45 deletions(-) diff --git a/data/text/contest_strings.inc b/data/text/contest_strings.inc index e57e76a52..23de25af6 100644 --- a/data/text/contest_strings.inc +++ b/data/text/contest_strings.inc @@ -4,145 +4,190 @@ gText_HighlyAppealingMove:: .string "A highly appealing move.$" gText_UserMoreEasilyStartled:: - .string "After this move, the user is\nmore easily startled.$" + .string "After this move, the user is\n" + .string "more easily startled.$" gText_GreatAppealButNoMoreToEnd:: - .string "Makes a great appeal, but\nallows no more to the end.$" + .string "Makes a great appeal, but\n" + .string "allows no more to the end.$" gText_UsedRepeatedlyWithoutBoringJudge:: .string "Can be repeatedly used\nwithout boring the JUDGE.$" gText_AvoidStartledByOthersOnce:: - .string "Can avoid being startled\nby others once.$" + .string "Can avoid being startled\n" + .string "by others once.$" gText_AvoidStartledByOthers:: - .string "Can avoid being startled\nby others.$" + .string "Can avoid being startled\n" + .string "by others.$" gText_AvoidStartledByOthersLittle:: - .string "Can avoid being startled\nby others a little.$" + .string "Can avoid being startled\n" + .string "by others a little.$" gText_UserLessLikelyStartled:: - .string "After this move, the user is\nless likely to be startled.$" + .string "After this move, the user is\n" + .string "less likely to be startled.$" gText_SlightlyStartleFrontMon:: - .string "Slightly startles the\nPOKéMON in front.$" + .string "Slightly startles the\n" + .string "POKéMON in front.$" gText_SlightlyStartleAppealed:: - .string "Slightly startles those\nthat have made appeals.$" + .string "Slightly startles those\n" + .string "that have made appeals.$" gText_StartleAppealedBeforeUser:: - .string "Startles the POKéMON that\nappealed before the user.$" + .string "Startles the POKéMON that\n" + .string "appealed before the user.$" gText_StartleAllAppealed:: - .string "Startles all POKéMON that\nhave done their appeals.$" + .string "Startles all POKéMON that\n" + .string "have done their appeals.$" gText_BadlyStartleFrontMon:: - .string "Badly startles the\nPOKéMON in front.$" + .string "Badly startles the\n" + .string "POKéMON in front.$" gText_BadlyStartleAppealed:: - .string "Badly startles those that\nhave made appeals.$" + .string "Badly startles those that\n" + .string "have made appeals.$" gText_StartleAppealedBeforeUser2:: - .string "Startles the POKéMON that\nappealed before the user.$" + .string "Startles the POKéMON that\n" + .string "appealed before the user.$" gText_StartleAllAppealed2:: - .string "Startles all POKéMON that\nhave done their appeals.$" + .string "Startles all POKéMON that\n" + .string "have done their appeals.$" gText_ShiftJudgesAttentionFromOthers:: - .string "Shifts the JUDGE's\nattention from others.$" + .string "Shifts the JUDGE's\n" + .string "attention from others.$" gText_StartleMonHasJudgesAttention:: - .string "Startles the POKéMON that\nhas the JUDGE's attention.$" + .string "Startles the POKéMON that\n" + .string "has the JUDGE's attention.$" gText_JamOthersMissesTurn:: - .string "Jams the others, and misses\none turn of appeals.$" + .string "Jams the others, and misses\n" + .string "one turn of appeals.$" gText_StartleMonsMadeSameTypeAppeal:: - .string "Startles POKéMON that\nmade a same-type appeal.$" + .string "Startles POKéMON that\n" + .string "made a same-type appeal.$" gText_BadlyStartleCoolAppeals:: - .string "Badly startles POKéMON\nthat made COOL appeals.$" + .string "Badly startles POKéMON\n" + .string "that made COOL appeals.$" gText_BadlyStartleBeautyAppeals:: - .string "Badly startles POKéMON\nthat made BEAUTY appeals.$" + .string "Badly startles POKéMON\n" + .string "that made BEAUTY appeals.$" gText_BadlyStartleCuteAppeals:: - .string "Badly startles POKéMON\nthat made CUTE appeals.$" + .string "Badly startles POKéMON\n" + .string "that made CUTE appeals.$" gText_BadlyStartleSmartAppeals:: - .string "Badly startles POKéMON\nthat made SMART appeals.$" + .string "Badly startles POKéMON\n" + .string "that made SMART appeals.$" gText_BadlyStartleToughAppeals:: - .string "Badly startles POKéMON\nthat made TOUGH appeals.$" + .string "Badly startles POKéMON\n" + .string "that made TOUGH appeals.$" gText_MakeMonAfterUserNervous:: - .string "Makes one POKéMON after\nthe user nervous.$" + .string "Makes one POKéMON after\n" + .string "the user nervous.$" gText_MakeAllMonsAfterUserNervous:: - .string "Makes all POKéMON after\nthe user nervous.$" + .string "Makes all POKéMON after\n" + .string "the user nervous.$" gText_WorsenConditionOfThoseMadeAppeals:: - .string "Worsens the condition of\nthose that made appeals.$" + .string "Worsens the condition of\n" + .string "those that made appeals.$" gText_BadlyStartleMonsGoodCondition:: - .string "Badly startles POKéMON in\ngood condition.$" + .string "Badly startles POKéMON in\n" + .string "good condition.$" gText_AppealGreatIfPerformedFirst:: - .string "The appeal works great if\nperformed first.$" + .string "The appeal works great if\n" + .string "performed first.$" gText_AppealGreatIfPerformedLast:: - .string "The appeal works great if\nperformed last.$" + .string "The appeal works great if\n" + .string "performed last.$" gText_AppealAsGoodAsThoseBeforeIt:: - .string "Makes the appeal as good\nas those before it.$" + .string "Makes the appeal as good\n" + .string "as those before it.$" gText_AppealAsGoodAsOneBeforeIt:: - .string "Makes the appeal as good\nas the one before it.$" + .string "Makes the appeal as good\n" + .string "as the one before it.$" gText_AppealBetterLaterItsPerformed:: - .string "The appeal works better\nthe later it is performed.$" + .string "The appeal works better\n" + .string "the later it is performed.$" gText_AppealVariesDependingOnTiming:: .string "The appeal's quality varies\ndepending on its timing.$" gText_WorksWellIfSameTypeAsBefore:: - .string "Works well if it's the same\ntype as the one before.$" + .string "Works well if it's the same\n" + .string "type as the one before.$" gText_WorksWellIfDifferentTypeAsBefore:: - .string "Works well if different in\ntype than the one before.$" + .string "Works well if different in\n" + .string "type than the one before.$" gText_AffectedByAppealInFront:: - .string "Affected by how well the\nappeal in front goes.$" + .string "Affected by how well the\n" + .string "appeal in front goes.$" gText_UpsConditionHelpsPreventNervousness:: - .string "Ups the user's condition.\nHelps prevent nervousness.$" + .string "Ups the user's condition.\n" + .string "Helps prevent nervousness.$" gText_AppealWorksWellIfConditionGood:: - .string "The appeal works well if the\nuser's condition is good.$" + .string "The appeal works well if the\n" + .string "user's condition is good.$" gText_NextAppealMadeEarlier:: - .string "The next appeal can be\nmade earlier next turn.$" + .string "The next appeal can be\n" + .string "made earlier next turn.$" gText_NextAppealMadeLater:: - .string "The next appeal can be\nmade later next turn.$" + .string "The next appeal can be\n" + .string "made later next turn.$" gText_TurnOrderMoreEasilyScrambled:: - .string "Makes the next turn's order\nmore easily scrambled.$" + .string "Makes the next turn's order\n" + .string "more easily scrambled.$" gText_ScrambleOrderOfNextAppeals:: - .string "Scrambles the order of\nappeals on the next turn.$" + .string "Scrambles the order of\n" + .string "appeals on the next turn.$" gText_AppealExcitesAudienceInAnyContest:: - .string "An appeal that excites the\naudience in any CONTEST.$" + .string "An appeal that excites the\n" + .string "audience in any CONTEST.$" gText_BadlyStartlesMonsGoodAppeals:: - .string "Badly startles all POKéMON\nthat made good appeals.$" + .string "Badly startles all POKéMON\n" + .string "that made good appeals.$" gText_AppealBestMoreCrowdExcited:: - .string "The appeal works best the\nmore the crowd is excited.$" + .string "The appeal works best the\n" + .string "more the crowd is excited.$" gText_TemporarilyStopCrowdExcited:: - .string "Temporarily stops the\ncrowd from growing excited.$" + .string "Temporarily stops the\n" + .string "crowd from growing excited.$" @ Unused move names From 1860b61fe35941d7c8a15266e6e4a2689eb1ed62 Mon Sep 17 00:00:00 2001 From: Simply BLG <61010688+SimplyBLGDev@users.noreply.github.com> Date: Fri, 17 Jun 2022 12:05:32 -0300 Subject: [PATCH 154/208] Corrected two missing newlines --- data/text/contest_strings.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/text/contest_strings.inc b/data/text/contest_strings.inc index 23de25af6..948c19922 100644 --- a/data/text/contest_strings.inc +++ b/data/text/contest_strings.inc @@ -12,7 +12,8 @@ gText_GreatAppealButNoMoreToEnd:: .string "allows no more to the end.$" gText_UsedRepeatedlyWithoutBoringJudge:: - .string "Can be repeatedly used\nwithout boring the JUDGE.$" + .string "Can be repeatedly used\n" + .string "without boring the JUDGE.$" gText_AvoidStartledByOthersOnce:: .string "Can avoid being startled\n" @@ -135,7 +136,8 @@ gText_AppealBetterLaterItsPerformed:: .string "the later it is performed.$" gText_AppealVariesDependingOnTiming:: - .string "The appeal's quality varies\ndepending on its timing.$" + .string "The appeal's quality varies\n" + .string "depending on its timing.$" gText_WorksWellIfSameTypeAsBefore:: .string "Works well if it's the same\n" From 380cc8615b3c33191e4aa6de059bcbb76220fc1f Mon Sep 17 00:00:00 2001 From: Simply BLG <61010688+SimplyBLGDev@users.noreply.github.com> Date: Fri, 17 Jun 2022 14:22:31 -0300 Subject: [PATCH 155/208] Format newlines in pc_transfer.inc --- data/text/pc_transfer.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/text/pc_transfer.inc b/data/text/pc_transfer.inc index 53a82c8f1..3fa255340 100644 --- a/data/text/pc_transfer.inc +++ b/data/text/pc_transfer.inc @@ -5,7 +5,8 @@ gText_PkmnTransferredSomeonesPC:: .string "BOX “{STR_VAR_1}.”$" gText_PkmnTransferredLanettesPC:: - .string "{STR_VAR_2} was transferred to\nLANETTE'S PC.\p" + .string "{STR_VAR_2} was transferred to\n" + .string "LANETTE'S PC.\p" .string "It was placed in \n" .string "BOX “{STR_VAR_1}.”$" From 324a157b3497405dc41c5988fa04ccdf70da95b7 Mon Sep 17 00:00:00 2001 From: Simply BLG <61010688+SimplyBLGDev@users.noreply.github.com> Date: Fri, 17 Jun 2022 15:21:12 -0300 Subject: [PATCH 156/208] Format newlines in surf.inc One of the strings declared in surf.inc was poorly formatted. ## Description Some of the strings declared in surf.inc contained newline characters in the middle of the .string line, opposing the format used by every string in the `data/text` directory, I just updated them to match the format, making it more readable. --- data/text/surf.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/text/surf.inc b/data/text/surf.inc index 453a3d5b1..13854f7aa 100644 --- a/data/text/surf.inc +++ b/data/text/surf.inc @@ -1,5 +1,6 @@ gText_WantToUseSurf:: - .string "The water is dyed a deep blue…\nWould you like to SURF?$" + .string "The water is dyed a deep blue…\n" + .string "Would you like to SURF?$" gText_PlayerUsedSurf:: .string "{STR_VAR_1} used SURF!$" From e42498ab40f72a136a20c277442a209d00701934 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Fri, 17 Jun 2022 18:06:37 -0300 Subject: [PATCH 157/208] Add bugfix from bugs_and_glitches.md to BUGFIX Item flicker fix now in `BUGFIX` Supersedes and resolves #1680 Fixes #1215 Fixes #1514 --- src/item_menu_icons.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/item_menu_icons.c b/src/item_menu_icons.c index b1e163499..c436f0feb 100644 --- a/src/item_menu_icons.c +++ b/src/item_menu_icons.c @@ -544,7 +544,20 @@ void AddBagItemIconSprite(u16 itemId, u8 id) void RemoveBagItemIconSprite(u8 id) { - RemoveBagSprite(id + ITEMMENUSPRITE_ITEM); + #ifdef BUGFIX + u8 *spriteId = &gBagMenu->spriteIds[ITEMMENUSPRITE_ITEM]; + + if (spriteId[id ^ 1] != SPRITE_NONE) + gSprites[spriteId[id ^ 1]].invisible = TRUE; + + if (spriteId[id] != SPRITE_NONE) + { + DestroySpriteAndFreeResources(&gSprites[spriteId[id]]); + spriteId[id] = SPRITE_NONE; + } + #else + RemoveBagSprite(id + ITEMMENUSPRITE_ITEM); + #endif } void CreateItemMenuSwapLine(void) From b17fb2ff569ef27070c4fa9dbd67532cd640a260 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Fri, 17 Jun 2022 18:07:46 -0300 Subject: [PATCH 158/208] Delete bugs_and_glitches.md --- docs/bugs_and_glitches.md | 51 --------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 docs/bugs_and_glitches.md diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md deleted file mode 100644 index ce06c1489..000000000 --- a/docs/bugs_and_glitches.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Bugs and Glitches - -These are known bugs and glitches in the original Pokémon Emerald game: code that clearly does not work as intended, or that only works in limited circumstances but has the possibility to fail or crash. Defining the `BUGFIX` and `UBFIX` preprocessor variables will fix some of these automatically. `UBFIX` will already be defined for MODERN builds. - -Fixes are written in the `diff` format. If you've used Git before, this should look familiar: - -```diff - this is some code --delete red - lines -+add green + lines -``` - -## Contents - -- [Scrolling through items in the bag causes the image to flicker](#scrolling-through-items-in-the-bag-causes-the-image-to-flicker) - - -## Scrolling through items in the bag causes the image to flicker - -**Fix:** Add the following function to [src/item_menu_icons.c](https://github.com/pret/pokeemerald/blob/master/src/item_menu_icons.c): -```diff -+void HideBagItemIconSprite(u8 id) -+{ -+ u8 *spriteId = &gBagMenu->spriteId[10]; -+ if (spriteId[id] != 0xFF) -+ { -+ gSprites[spriteId[id]].invisible = TRUE; -+ } -+} - -``` - -and its corresponding declaration in [include/item_menu_icons.h](https://github.com/pret/pokeemerald/blob/master/include/item_menu_icons.h): - -```diff -+void HideBagItemIconSprite(u8 id); - -``` - -Then edit `BagMenu_MoveCursorCallback` in [src/item_menu.c](https://github.com/pret/pokeemerald/blob/master/src/item_menu.c): - -```diff - ... -{ -- RemoveBagItemIconSprite(1 ^ gBagMenu->itemIconSlot); -+ HideBagItemIconSprite(gBagMenu->itemIconSlot ^ 1); -+ RemoveBagItemIconSprite(gBagMenu->itemIconSlot); - if (itemIndex != LIST_CANCEL) - ... -``` From b885e01b39b0e17acd1b23305143f8218c9ecd47 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Fri, 17 Jun 2022 18:16:14 -0300 Subject: [PATCH 159/208] Update src/item_menu_icons.c Co-authored-by: sneed <56992013+Sneed69@users.noreply.github.com> --- src/item_menu_icons.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/item_menu_icons.c b/src/item_menu_icons.c index c436f0feb..d06f90809 100644 --- a/src/item_menu_icons.c +++ b/src/item_menu_icons.c @@ -544,20 +544,20 @@ void AddBagItemIconSprite(u16 itemId, u8 id) void RemoveBagItemIconSprite(u8 id) { - #ifdef BUGFIX - u8 *spriteId = &gBagMenu->spriteIds[ITEMMENUSPRITE_ITEM]; +#ifdef BUGFIX + u8 *spriteId = &gBagMenu->spriteIds[ITEMMENUSPRITE_ITEM]; - if (spriteId[id ^ 1] != SPRITE_NONE) - gSprites[spriteId[id ^ 1]].invisible = TRUE; +if (spriteId[id ^ 1] != SPRITE_NONE) + gSprites[spriteId[id ^ 1]].invisible = TRUE; - if (spriteId[id] != SPRITE_NONE) - { - DestroySpriteAndFreeResources(&gSprites[spriteId[id]]); - spriteId[id] = SPRITE_NONE; - } - #else - RemoveBagSprite(id + ITEMMENUSPRITE_ITEM); - #endif +if (spriteId[id] != SPRITE_NONE) +{ + DestroySpriteAndFreeResources(&gSprites[spriteId[id]]); + spriteId[id] = SPRITE_NONE; +} +#else + RemoveBagSprite(id + ITEMMENUSPRITE_ITEM); +#endif } void CreateItemMenuSwapLine(void) From d7ab1ba58896287ca83509d94b7b51c26b49b880 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Fri, 17 Jun 2022 18:22:47 -0300 Subject: [PATCH 160/208] Fix formatting --- src/item_menu_icons.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/item_menu_icons.c b/src/item_menu_icons.c index d06f90809..24f0db242 100644 --- a/src/item_menu_icons.c +++ b/src/item_menu_icons.c @@ -547,14 +547,14 @@ void RemoveBagItemIconSprite(u8 id) #ifdef BUGFIX u8 *spriteId = &gBagMenu->spriteIds[ITEMMENUSPRITE_ITEM]; -if (spriteId[id ^ 1] != SPRITE_NONE) - gSprites[spriteId[id ^ 1]].invisible = TRUE; + if (spriteId[id ^ 1] != SPRITE_NONE) + gSprites[spriteId[id ^ 1]].invisible = TRUE; -if (spriteId[id] != SPRITE_NONE) -{ - DestroySpriteAndFreeResources(&gSprites[spriteId[id]]); - spriteId[id] = SPRITE_NONE; -} + if (spriteId[id] != SPRITE_NONE) + { + DestroySpriteAndFreeResources(&gSprites[spriteId[id]]); + spriteId[id] = SPRITE_NONE; + } #else RemoveBagSprite(id + ITEMMENUSPRITE_ITEM); #endif From f02ea58a683b3617f306f5529ec269ee3c9ec6b9 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Fri, 17 Jun 2022 18:32:46 -0300 Subject: [PATCH 161/208] Add comment description of this bugfix --- src/item_menu_icons.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/item_menu_icons.c b/src/item_menu_icons.c index 24f0db242..5ac44f5ad 100644 --- a/src/item_menu_icons.c +++ b/src/item_menu_icons.c @@ -544,6 +544,8 @@ void AddBagItemIconSprite(u16 itemId, u8 id) void RemoveBagItemIconSprite(u8 id) { +// BUG: For one frame, the item you scroll to in the Bag menu +// will have an incorrect palette and may be seen as a flicker. #ifdef BUGFIX u8 *spriteId = &gBagMenu->spriteIds[ITEMMENUSPRITE_ITEM]; From 7a6b417b8e2b34a5ea4081ad3ccd0860810ebe6e Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 17 Jun 2022 15:47:56 -0400 Subject: [PATCH 162/208] Remove UBFIX related to task destruction --- src/battle_anim_sound_tasks.c | 16 ++++++++++------ src/battle_factory_screen.c | 7 +------ src/battle_transition.c | 4 +--- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/battle_anim_sound_tasks.c b/src/battle_anim_sound_tasks.c index 6b14d3863..f329ea210 100644 --- a/src/battle_anim_sound_tasks.c +++ b/src/battle_anim_sound_tasks.c @@ -135,10 +135,12 @@ void SoundTask_PlayCryHighPitch(u8 taskId) { if (gBattleAnimArgs[0] == ANIM_ATTACKER) species = gContestResources->moveAnim->species; - #ifndef UBFIX + // Destroying the task twice (here and at end of function) + // results in an incorrect value for gAnimVisualTaskCount + #ifndef BUGFIX else - DestroyAnimVisualTask(taskId); // UB: task gets destroyed twice. - #endif + DestroyAnimVisualTask(taskId); + #endif } else { @@ -181,10 +183,12 @@ void SoundTask_PlayDoubleCry(u8 taskId) { if (gBattleAnimArgs[0] == ANIM_ATTACKER) species = gContestResources->moveAnim->species; - #ifndef UBFIX + // Destroying the task twice (here and at end of function) + // results in an incorrect value for gAnimVisualTaskCount + #ifndef BUGFIX else - DestroyAnimVisualTask(taskId); // UB: task gets destroyed twice. - #endif + DestroyAnimVisualTask(taskId); + #endif } else { diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 88e934759..14c63b7b8 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -4220,17 +4220,12 @@ static void Task_OpenMonPic(u8 taskId) return; break; default: - #ifndef UBFIX DestroyTask(taskId); - #endif - // UB: Should not use the task after it has been deleted. + // Accessing data of destroyed task. Task data isn't reset until a new task needs that task id. if (gTasks[taskId].tIsSwapScreen == TRUE) Swap_CreateMonSprite(); else Select_CreateMonSprite(); - #ifdef UBFIX - DestroyTask(taskId); - #endif return; } task->tState++; diff --git a/src/battle_transition.c b/src/battle_transition.c index 1e421b5e4..c523cbe7b 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -4762,10 +4762,8 @@ static bool8 FrontierSquaresScroll_End(struct Task *task) BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); DestroyTask(FindTaskIdByFunc(task->func)); + task->tState++; // Changing value of a destroyed task -#ifndef UBFIX - task->tState++; // UB: changing value of a destroyed task -#endif return FALSE; } From 23e9455e0a6c1ed9f115149f5a3fe78cf0a4e2ba Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 17 Jun 2022 21:52:58 -0400 Subject: [PATCH 163/208] document design oddity, use constants, correct comment --- src/battle_ai_switch_items.c | 51 ++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 6ded48467..9c9bc4eef 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -2,6 +2,7 @@ #include "battle.h" #include "battle_anim.h" #include "battle_controllers.h" +#include "battle_main.h" #include "data.h" #include "pokemon.h" #include "random.h" @@ -66,13 +67,13 @@ static bool8 ShouldSwitchIfWonderGuard(void) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI)) { if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT) - firstId = 0, lastId = 3; + firstId = 0, lastId = PARTY_SIZE / 2; else - firstId = 3, lastId = 6; + firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE; } else { - firstId = 0, lastId = 6; + firstId = 0, lastId = PARTY_SIZE; } if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) @@ -162,13 +163,13 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI)) { if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT) - firstId = 0, lastId = 3; + firstId = 0, lastId = PARTY_SIZE / 2; else - firstId = 3, lastId = 6; + firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE; } else { - firstId = 0, lastId = 6; + firstId = 0, lastId = PARTY_SIZE; } if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) @@ -357,13 +358,13 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI)) { if ((gActiveBattler & BIT_FLANK) == 0) - firstId = 0, lastId = 3; + firstId = 0, lastId = PARTY_SIZE / 2; else - firstId = 3, lastId = 6; + firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE; } else { - firstId = 0, lastId = 6; + firstId = 0, lastId = PARTY_SIZE; } if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) @@ -468,13 +469,13 @@ static bool8 ShouldSwitch(void) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI)) { if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT) - firstId = 0, lastId = 3; + firstId = 0, lastId = PARTY_SIZE / 2; else - firstId = 3, lastId = 6; + firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE; } else { - firstId = 0, lastId = 6; + firstId = 0, lastId = PARTY_SIZE; } if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) @@ -559,13 +560,13 @@ void AI_TrySwitchOrUseItem(void) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI)) { if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT) - firstId = 0, lastId = 3; + firstId = 0, lastId = PARTY_SIZE / 2; else - firstId = 3, lastId = 6; + firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE; } else { - firstId = 0, lastId = 6; + firstId = 0, lastId = PARTY_SIZE; } for (monToSwitchId = firstId; monToSwitchId < lastId; monToSwitchId++) @@ -615,10 +616,10 @@ static void ModulateByTypeEffectiveness(u8 atkType, u8 defType1, u8 defType2, u8 { // Check type1. if (TYPE_EFFECT_DEF_TYPE(i) == defType1) - *var = (*var * TYPE_EFFECT_MULTIPLIER(i)) / 10; + *var = (*var * TYPE_EFFECT_MULTIPLIER(i)) / TYPE_MUL_NORMAL; // Check type2. if (TYPE_EFFECT_DEF_TYPE(i) == defType2 && defType1 != defType2) - *var = (*var * TYPE_EFFECT_MULTIPLIER(i)) / 10; + *var = (*var * TYPE_EFFECT_MULTIPLIER(i)) / TYPE_MUL_NORMAL; } i += 3; } @@ -627,7 +628,7 @@ static void ModulateByTypeEffectiveness(u8 atkType, u8 defType1, u8 defType2, u8 u8 GetMostSuitableMonToSwitchInto(void) { u8 opposingBattler; - u8 bestDmg; // Note : should be changed to u32 for obvious reasons. + u8 bestDmg; // Note: should be changed to s32 since it is also used for the actual damage done later u8 bestMonId; u8 battlerIn1, battlerIn2; s32 firstId; @@ -665,13 +666,13 @@ u8 GetMostSuitableMonToSwitchInto(void) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI)) { if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT) - firstId = 0, lastId = 3; + firstId = 0, lastId = PARTY_SIZE / 2; else - firstId = 3, lastId = 6; + firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE; } else { - firstId = 0, lastId = 6; + firstId = 0, lastId = PARTY_SIZE; } if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) @@ -683,7 +684,7 @@ u8 GetMostSuitableMonToSwitchInto(void) while (invalidMons != 0x3F) // All mons are invalid. { - bestDmg = 0; + bestDmg = ; bestMonId = 6; // Find the mon whose type is the most suitable offensively. for (i = firstId; i < lastId; i++) @@ -699,9 +700,13 @@ u8 GetMostSuitableMonToSwitchInto(void) { u8 type1 = gBaseStats[species].type1; u8 type2 = gBaseStats[species].type2; - u8 typeDmg = 10; + u8 typeDmg = TYPE_MUL_NORMAL; ModulateByTypeEffectiveness(gBattleMons[opposingBattler].type1, type1, type2, &typeDmg); ModulateByTypeEffectiveness(gBattleMons[opposingBattler].type2, type1, type2, &typeDmg); + + /* Possible bug: this comparison gives the type that takes the most damage, when + a "good" AI would want to select the type that takes the least damage. Unknown if this + is a legitimate mistake or if it's an intentional, if weird, design choice*/ if (bestDmg < typeDmg) { bestDmg = typeDmg; From d3c8346a676cec0a0e18f0acb4a9b4c8b418dde6 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 17 Jun 2022 21:58:56 -0400 Subject: [PATCH 164/208] fix type, add bugfix --- src/battle_ai_switch_items.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 9c9bc4eef..c87271722 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -628,7 +628,11 @@ static void ModulateByTypeEffectiveness(u8 atkType, u8 defType1, u8 defType2, u8 u8 GetMostSuitableMonToSwitchInto(void) { u8 opposingBattler; +#ifdef BUGFIX + s32 bestDmg; +#else u8 bestDmg; // Note: should be changed to s32 since it is also used for the actual damage done later +#endif u8 bestMonId; u8 battlerIn1, battlerIn2; s32 firstId; @@ -684,8 +688,8 @@ u8 GetMostSuitableMonToSwitchInto(void) while (invalidMons != 0x3F) // All mons are invalid. { - bestDmg = ; - bestMonId = 6; + bestDmg = TYPE_MUL_NO_EFFECT; + bestMonId = PARTY_SIZE; // Find the mon whose type is the most suitable offensively. for (i = firstId; i < lastId; i++) { @@ -706,7 +710,7 @@ u8 GetMostSuitableMonToSwitchInto(void) /* Possible bug: this comparison gives the type that takes the most damage, when a "good" AI would want to select the type that takes the least damage. Unknown if this - is a legitimate mistake or if it's an intentional, if weird, design choice*/ + is a legitimate mistake or if it's an intentional, if weird, design choice */ if (bestDmg < typeDmg) { bestDmg = typeDmg; From c8e6d69fdcacab404ae69cbefe7c318e7c363c54 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Sat, 18 Jun 2022 11:49:13 -0300 Subject: [PATCH 165/208] Format newline in BattleBattleFrontier_BattlePikeLobby/scripts.inc One of the strings declared in BattleFrontier_BattlePikeLobby/scripts.inc was poorly formatted. --- data/maps/BattleFrontier_BattlePikeLobby/scripts.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc b/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc index 320e12d99..3e729e212 100644 --- a/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc @@ -364,7 +364,8 @@ BattleFrontier_BattlePikeLobby_Text_AwardYouTheseBattlePoints2: @ Unused BattleFrontier_BattlePikeLobby_Text_ReachedBattlePointLimit: .string "You appear to have reached the limit\n" - .string "for Battle Points…\pPlease exchange some Battle Points\n" + .string "for Battle Points…\p" + .string "Please exchange some Battle Points\n" .string "for prizes, then return…$" BattleFrontier_BattlePikeLobby_Text_FailedToSaveBeforeQuitting: From f43d54af8935fddc511d90aac46eecc1f2ec3abe Mon Sep 17 00:00:00 2001 From: sneed Date: Sat, 18 Jun 2022 19:00:33 +0300 Subject: [PATCH 166/208] AI chooses most resistant mon --- src/battle_ai_switch_items.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 9136d667c..0d394c3b8 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -602,39 +602,39 @@ static u32 GetBestMonBatonPass(struct Pokemon *party, int firstId, int lastId, u return PARTY_SIZE; } -static u32 GestBestMonOffensive(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 opposingBattler) +static u32 GestBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 opposingBattler) { int i, bits = 0; while (bits != 0x3F) // All mons were checked. { - int bestDmg = 0; + u32 bestResist = UQ_4_12(1.0); int bestMonId = PARTY_SIZE; - // Find the mon whose type is the most suitable offensively. + // Find the mon whose type is the most suitable defensively. for (i = firstId; i < lastId; i++) { if (!(gBitTable[i] & invalidMons) && !(gBitTable[i] & bits)) { u16 species = GetMonData(&party[i], MON_DATA_SPECIES); - u32 typeDmg = UQ_4_12(1.0); + u32 typeEffectiveness = UQ_4_12(1.0); - u8 atkType1 = gBaseStats[species].type1; - u8 atkType2 = gBaseStats[species].type2; - u8 defType1 = gBattleMons[opposingBattler].type1; - u8 defType2 = gBattleMons[opposingBattler].type2; + u8 atkType1 = gBattleMons[opposingBattler].type1; + u8 atkType2 = gBattleMons[opposingBattler].type2; + u8 defType1 = gBaseStats[species].type1; + u8 defType2 = gBaseStats[species].type2; - typeDmg *= GetTypeModifier(atkType1, defType1); + typeEffectiveness *= GetTypeModifier(atkType1, defType1); if (atkType2 != atkType1) - typeDmg *= GetTypeModifier(atkType2, defType1); + typeEffectiveness *= GetTypeModifier(atkType2, defType1); if (defType2 != defType1) { - typeDmg *= GetTypeModifier(atkType1, defType2); + typeEffectiveness *= GetTypeModifier(atkType1, defType2); if (atkType2 != atkType1) - typeDmg *= GetTypeModifier(atkType2, defType2); + typeEffectiveness *= GetTypeModifier(atkType2, defType2); } - if (bestDmg < typeDmg) + if (typeEffectiveness < bestResist) { - bestDmg = typeDmg; + bestResist = typeEffectiveness; bestMonId = i; } } @@ -698,7 +698,6 @@ static u32 GetBestMonDmg(struct Pokemon *party, int firstId, int lastId, u8 inva u8 GetMostSuitableMonToSwitchInto(void) { u32 opposingBattler = 0; - u32 bestDmg = 0; u32 bestMonId = 0; u8 battlerIn1 = 0, battlerIn2 = 0; s32 firstId = 0; @@ -757,7 +756,7 @@ u8 GetMostSuitableMonToSwitchInto(void) if (bestMonId != PARTY_SIZE) return bestMonId; - bestMonId = GestBestMonOffensive(party, firstId, lastId, invalidMons, opposingBattler); + bestMonId = GestBestMonTypeMatchup(party, firstId, lastId, invalidMons, opposingBattler); if (bestMonId != PARTY_SIZE) return bestMonId; From 5e7df653bd2658d6b55c28d00f180eea744caa2d Mon Sep 17 00:00:00 2001 From: sneed Date: Sat, 18 Jun 2022 19:18:01 +0300 Subject: [PATCH 167/208] no gest --- src/battle_ai_switch_items.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 0d394c3b8..42f6c7fc9 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -602,7 +602,7 @@ static u32 GetBestMonBatonPass(struct Pokemon *party, int firstId, int lastId, u return PARTY_SIZE; } -static u32 GestBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 opposingBattler) +static u32 GetBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 opposingBattler) { int i, bits = 0; @@ -756,7 +756,7 @@ u8 GetMostSuitableMonToSwitchInto(void) if (bestMonId != PARTY_SIZE) return bestMonId; - bestMonId = GestBestMonTypeMatchup(party, firstId, lastId, invalidMons, opposingBattler); + bestMonId = GetBestMonTypeMatchup(party, firstId, lastId, invalidMons, opposingBattler); if (bestMonId != PARTY_SIZE) return bestMonId; From 3de23b332a7e67e0748bdb469b059f718fb8c029 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Sat, 18 Jun 2022 21:51:05 -0300 Subject: [PATCH 168/208] Supplant https://github.com/pret/pokeemerald/pull/1579 --- data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc index 406ab46ae..def903b1d 100644 --- a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc @@ -5,6 +5,10 @@ .set LOCALID_PLAYER, 13 .set LOCALID_OPPONENT, 15 +.set NO_DRAW, 0 +.set DRAW_TRAINER, 1 +.set DRAW_TUCKER, 2 + BattleFrontier_BattleDomeBattleRoom_MapScripts:: map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattleDomeBattleRoom_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleDomeBattleRoom_OnFrame @@ -12,10 +16,6 @@ BattleFrontier_BattleDomeBattleRoom_MapScripts:: map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_BattleDomeBattleRoom_OnResume .byte 0 - .set NO_DRAW, 0 - .set DRAW_TRAINER, 1 - .set DRAW_TUCKER, 2 - BattleFrontier_BattleDomeBattleRoom_OnTransition: dome_setopponentgfx frontier_get FRONTIER_DATA_BATTLE_NUM From 5d7140fa83ab5745ce0f56841c66805fab59f149 Mon Sep 17 00:00:00 2001 From: sphericalice Date: Sun, 19 Jun 2022 13:33:47 +0100 Subject: [PATCH 169/208] Fix missing COPYWIN_FULL constant use --- src/main_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main_menu.c b/src/main_menu.c index a69f73d17..d11784133 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -2270,7 +2270,7 @@ static void NewGameBirchSpeech_ShowDialogueWindow(u8 windowId, u8 copyToVram) FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } static void NewGameBirchSpeech_CreateDialogueWindowBorder(u8 bg, u8 x, u8 y, u8 width, u8 height, u8 palNum) From 8950a41bfd1488c06aca80d38a6b1e56f135c704 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 21 Jun 2022 18:31:09 -0400 Subject: [PATCH 170/208] Update some GF rom header names --- src/rom_header_gf.c | 49 +++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/rom_header_gf.c b/src/rom_header_gf.c index 782a05c75..b854c899e 100644 --- a/src/rom_header_gf.c +++ b/src/rom_header_gf.c @@ -30,10 +30,10 @@ struct GFRomHeader u32 pokedexFlag; u32 mysteryEventFlag; u32 pokedexCount; - u8 unk1; + u8 playerNameLength; u8 unk2; - u8 unk3; - u8 unk4; + u8 pokemonNameLength1; + u8 pokemonNameLength2; u8 unk5; u8 unk6; u8 unk7; @@ -79,8 +79,8 @@ struct GFRomHeader u32 pcItemsOffset; u32 giftRibbonsOffset; u32 enigmaBerryOffset; - u32 mapViewOffset; - u32 unk19; + u32 enigmaBerrySize; + const u8 * moveDescriptions; u32 unk20; }; @@ -110,23 +110,24 @@ static const struct GFRomHeader sGFRomHeader = { .pokedexFlag = FLAG_RECEIVED_POKEDEX_FROM_BIRCH, .mysteryEventFlag = FLAG_SYS_MYSTERY_EVENT_ENABLE, .pokedexCount = NATIONAL_DEX_COUNT, - .unk1 = 0x07, - .unk2 = 0x0a, - .unk3 = 0x0a, - .unk4 = 0x0a, - .unk5 = 0x0c, - .unk6 = 0x0c, - .unk7 = 0x06, - .unk8 = 0x0c, - .unk9 = 0x06, - .unk10 = 0x10, - .unk11 = 0x12, - .unk12 = 0x0c, - .unk13 = 0x0f, - .unk14 = 0x0b, - .unk15 = 0x01, - .unk16 = 0x08, - .unk17 = 0x0c, + .playerNameLength = PLAYER_NAME_LENGTH, + .unk2 = 10, + .pokemonNameLength1 = POKEMON_NAME_LENGTH, + .pokemonNameLength2 = POKEMON_NAME_LENGTH, + // Two of the below 12s are likely move/ability name length, given their presence in this header + .unk5 = 12, + .unk6 = 12, + .unk7 = 6, + .unk8 = 12, + .unk9 = 6, + .unk10 = 16, + .unk11 = 18, + .unk12 = 12, + .unk13 = 15, + .unk14 = 11, + .unk15 = 1, + .unk16 = 8, + .unk17 = 12, .saveBlock2Size = sizeof(struct SaveBlock2), .saveBlock1Size = sizeof(struct SaveBlock1), .partyCountOffset = offsetof(struct SaveBlock1, playerPartyCount), @@ -159,7 +160,7 @@ static const struct GFRomHeader sGFRomHeader = { .pcItemsOffset = offsetof(struct SaveBlock1, pcItems), .giftRibbonsOffset = offsetof(struct SaveBlock1, giftRibbons), .enigmaBerryOffset = offsetof(struct SaveBlock1, enigmaBerry), - .mapViewOffset = offsetof(struct SaveBlock1, mapView), - .unk19 = 0x00000000, + .enigmaBerrySize = sizeof(struct EnigmaBerry), + .moveDescriptions = NULL, .unk20 = 0x00000000, // 0xFFFFFFFF in FRLG }; From 2e7f50064c71cdd261af196b39aa877653852b81 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Tue, 28 Jun 2022 00:11:59 -0400 Subject: [PATCH 171/208] use floats for tempo calculation --- tools/mid2agb/agb.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/mid2agb/agb.cpp b/tools/mid2agb/agb.cpp index d4d79f133..caa6f0ecd 100644 --- a/tools/mid2agb/agb.cpp +++ b/tools/mid2agb/agb.cpp @@ -18,6 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +#include #include #include #include @@ -503,7 +504,7 @@ void PrintAgbTrack(std::vector& events) ResetTrackVars(); break; case EventType::Tempo: - PrintByte("TEMPO , %u*%s_tbs/2", 60000000 / event.param2, g_asmLabel.c_str()); + PrintByte("TEMPO , %u*%s_tbs/2", static_cast(round(60000000.0f / static_cast(event.param2))), g_asmLabel.c_str()); PrintWait(event.time); break; case EventType::InstrumentChange: From c1af41834041817e78eea735d17e09fdcd1246e5 Mon Sep 17 00:00:00 2001 From: sneed Date: Fri, 1 Jul 2022 17:52:46 +0300 Subject: [PATCH 172/208] define B_MSG_WRAPPED_ constants --- include/constants/battle.h | 3 --- include/constants/battle_string_ids.h | 12 ++++++++++++ src/battle_message.c | 18 +++++++++--------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/include/constants/battle.h b/include/constants/battle.h index bcfb34c45..d651dab18 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -475,7 +475,4 @@ // For the second argument of GetMoveTarget, when no target override is needed #define NO_TARGET_OVERRIDE 0 -// Makes sure gWrappedStringIds and sTrappingMoves have the same size -#define TRAPPING_MOVES_COUNT 9 - #endif // GUARD_CONSTANTS_BATTLE_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 4eff91c85..2017d7085 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -872,4 +872,16 @@ #define B_MSG_TERRAINPREVENTS_ELECTRIC 1 #define B_MSG_TERRAINPREVENTS_PSYCHIC 2 +// gWrappedStringIds +#define B_MSG_WRAPPED_BIND 0 +#define B_MSG_WRAPPED_WRAP 1 +#define B_MSG_WRAPPED_FIRE_SPIN 2 +#define B_MSG_WRAPPED_CLAMP 3 +#define B_MSG_WRAPPED_WHIRLPOOL 4 +#define B_MSG_WRAPPED_SAND_TOMB 5 +#define B_MSG_WRAPPED_MAGMA_STORM 6 +#define B_MSG_WRAPPED_INFESTATION 7 +#define B_MSG_WRAPPED_SNAP_TRAP 8 +#define TRAPPING_MOVES_COUNT 9 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H diff --git a/src/battle_message.c b/src/battle_message.c index 34d020188..f9e625224 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1564,15 +1564,15 @@ const u16 gFirstTurnOfTwoStringIds[] = // Index copied from move's index in sTrappingMoves const u16 gWrappedStringIds[TRAPPING_MOVES_COUNT] = { - STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND - STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP - STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN - STRINGID_PKMNCLAMPED, // MOVE_CLAMP - STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL - STRINGID_PKMNTRAPPEDBYSANDTOMB, // MOVE_SAND_TOMB - STRINGID_TRAPPEDBYSWIRLINGMAGMA, // MOVE_MAGMA_STORM - STRINGID_INFESTATION, // MOVE_INFESTATION - STRINGID_PKMNINSNAPTRAP, // MOVE_SNAPTRAP + [B_MSG_WRAPPED_BIND] = STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND + [B_MSG_WRAPPED_WRAP] = STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP + [B_MSG_WRAPPED_FIRE_SPIN] = STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN + [B_MSG_WRAPPED_CLAMP] = STRINGID_PKMNCLAMPED, // MOVE_CLAMP + [B_MSG_WRAPPED_WHIRLPOOL] = STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL + [B_MSG_WRAPPED_SAND_TOMB] = STRINGID_PKMNTRAPPEDBYSANDTOMB, // MOVE_SAND_TOMB + [B_MSG_WRAPPED_MAGMA_STORM] = STRINGID_TRAPPEDBYSWIRLINGMAGMA, // MOVE_MAGMA_STORM + [B_MSG_WRAPPED_INFESTATION] = STRINGID_INFESTATION, // MOVE_INFESTATION + [B_MSG_WRAPPED_SNAP_TRAP] = STRINGID_PKMNINSNAPTRAP, // MOVE_SNAP_TRAP }; const u16 gMistUsedStringIds[] = From fac6f21ed007c09dc09f2174874e690651a09c7d Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 3 Jul 2022 16:28:34 -0400 Subject: [PATCH 173/208] AI_EFFECTIVENESS_xY are enums --- include/constants/battle_ai.h | 14 +++++++------- src/battle_ai_main.c | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index 67f5c11b8..d48827683 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -15,13 +15,13 @@ #define AI_TYPE_MOVE 4 // type effectiveness -#define AI_EFFECTIVENESS_x8 320 -#define AI_EFFECTIVENESS_x4 160 -#define AI_EFFECTIVENESS_x2 80 -#define AI_EFFECTIVENESS_x1 40 -#define AI_EFFECTIVENESS_x0_5 20 -#define AI_EFFECTIVENESS_x0_25 10 -#define AI_EFFECTIVENESS_x0_125 5 +#define AI_EFFECTIVENESS_x8 7 +#define AI_EFFECTIVENESS_x4 6 +#define AI_EFFECTIVENESS_x2 5 +#define AI_EFFECTIVENESS_x1 4 +#define AI_EFFECTIVENESS_x0_5 3 +#define AI_EFFECTIVENESS_x0_25 2 +#define AI_EFFECTIVENESS_x0_125 1 #define AI_EFFECTIVENESS_x0 0 // ai weather diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 9840c4827..7350c9b03 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -274,6 +274,7 @@ void GetAiLogicData(void) || !IsBattlerAIControlled(battlerAtk)) { continue; } + for (battlerDef = 0; battlerDef < gBattlersCount; battlerDef++) { if (battlerAtk == battlerDef) From f0edbeb0b037c7493e827a7061cdffa42397c5dd Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 3 Jul 2022 16:31:00 -0400 Subject: [PATCH 174/208] minor format fix --- src/battle_ai_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 7350c9b03..11b672bca 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -179,7 +179,7 @@ void BattleAI_SetupAIData(u8 defaultScoreMoves) { s32 i, move, dmg; u8 moveLimitations; - + // Clear AI data but preserve the flags. u32 flags = AI_THINKING_STRUCT->aiFlags; memset(AI_THINKING_STRUCT, 0, sizeof(struct AI_ThinkingStruct)); From 57e110aa6a2c2a2702f149c1fb307e598b5fb8cc Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 3 Jul 2022 17:20:39 -0400 Subject: [PATCH 175/208] fix AI_GetEffectiveness declaration --- src/battle_ai_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index a00b53de3..9b7c4bdbb 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -20,7 +20,7 @@ #include "constants/moves.h" #include "constants/items.h" -static u8 AI_GetEffectiveness(u16 multiplier); +static u32 AI_GetEffectiveness(u16 multiplier); // Const Data static const s8 sAiAbilityRatings[ABILITIES_COUNT] = From 3f739a8f3b0390ad0a11f67451925b9e15663a4e Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 3 Jul 2022 17:23:59 -0400 Subject: [PATCH 176/208] AI_CalcDamage returns 0 for status moves --- src/battle_ai_util.c | 100 ++++++++++++++++++++++++------------------- 1 file changed, 55 insertions(+), 45 deletions(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 9b7c4bdbb..d04f9d7ee 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -736,53 +736,63 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness) SetTypeBeforeUsingMove(move, battlerAtk); GET_MOVE_TYPE(move, moveType); - critChance = GetInverseCritChance(battlerAtk, battlerDef, move); - normalDmg = CalculateMoveDamageAndEffectiveness(move, battlerAtk, battlerDef, moveType, &effectivenessMultiplier); - critDmg = CalculateMoveDamage(move, battlerAtk, battlerDef, moveType, 0, TRUE, FALSE, FALSE); - - if(critChance == -1) - dmg = normalDmg; - else - dmg = (critDmg + normalDmg * (critChance - 1)) / critChance; - - // Handle dynamic move damage - switch (gBattleMoves[move].effect) + if (gBattleMoves[move].power) { - case EFFECT_LEVEL_DAMAGE: - case EFFECT_PSYWAVE: - dmg = gBattleMons[battlerAtk].level * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); - break; - case EFFECT_DRAGON_RAGE: - dmg = 40 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); - break; - case EFFECT_SONICBOOM: - dmg = 20 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); - break; - case EFFECT_MULTI_HIT: - dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 5 : 3); - break; - case EFFECT_TRIPLE_KICK: - dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 6 : 5); - break; - case EFFECT_ENDEAVOR: - // If target has less HP than user, Endeavor does no damage - dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp); - break; - case EFFECT_SUPER_FANG: - dmg = (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND - ? max(2, gBattleMons[battlerDef].hp * 3 / 4) - : max(1, gBattleMons[battlerDef].hp / 2)); - break; - case EFFECT_FINAL_GAMBIT: - dmg = gBattleMons[battlerAtk].hp; - break; - } + critChance = GetInverseCritChance(battlerAtk, battlerDef, move); + normalDmg = CalculateMoveDamageAndEffectiveness(move, battlerAtk, battlerDef, moveType, &effectivenessMultiplier); + critDmg = CalculateMoveDamage(move, battlerAtk, battlerDef, moveType, 0, TRUE, FALSE, FALSE); - // Handle other multi-strike moves - if (gBattleMoves[move].flags & FLAG_TWO_STRIKES) - dmg *= 2; - else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) - dmg *= 3; + if (critChance == -1) + dmg = normalDmg; + else + dmg = (critDmg + normalDmg * (critChance - 1)) / critChance; + + // Handle dynamic move damage + switch (gBattleMoves[move].effect) + { + case EFFECT_LEVEL_DAMAGE: + case EFFECT_PSYWAVE: + dmg = gBattleMons[battlerAtk].level * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); + break; + case EFFECT_DRAGON_RAGE: + dmg = 40 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); + break; + case EFFECT_SONICBOOM: + dmg = 20 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); + break; + case EFFECT_MULTI_HIT: + dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 5 : 3); + break; + case EFFECT_TRIPLE_KICK: + dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 6 : 5); + break; + case EFFECT_ENDEAVOR: + // If target has less HP than user, Endeavor does no damage + dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp); + break; + case EFFECT_SUPER_FANG: + dmg = (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND + ? max(2, gBattleMons[battlerDef].hp * 3 / 4) + : max(1, gBattleMons[battlerDef].hp / 2)); + break; + case EFFECT_FINAL_GAMBIT: + dmg = gBattleMons[battlerAtk].hp; + break; + } + + // Handle other multi-strike moves + if (gBattleMoves[move].flags & FLAG_TWO_STRIKES) + dmg *= 2; + else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) + dmg *= 3; + + if (dmg == 0) + dmg = 1; + } + else + { + dmg = 0; + } RestoreBattlerData(battlerAtk); RestoreBattlerData(battlerDef); From 4e76ffb4cac99a9df34eb1dd04f6e67a93ad81a0 Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Mon, 4 Jul 2022 21:25:19 +0100 Subject: [PATCH 177/208] Identify a % 16 --- src/field_camera.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/field_camera.c b/src/field_camera.c index 95c7ed952..9b129e6b2 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -404,9 +404,9 @@ void CameraUpdate(void) } gFieldCamera.x += movementSpeedX; - gFieldCamera.x = gFieldCamera.x - 16 * (gFieldCamera.x / 16); + gFieldCamera.x %= 16; gFieldCamera.y += movementSpeedY; - gFieldCamera.y = gFieldCamera.y - 16 * (gFieldCamera.y / 16); + gFieldCamera.y %= 16; if (deltaX != 0 || deltaY != 0) { From c9958e3087eac6e4bc9c5bbe06022690cbe06d75 Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Tue, 5 Jul 2022 14:17:46 +0100 Subject: [PATCH 178/208] Simplify GetBattleTransitionTypeByMap --- src/battle_setup.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/battle_setup.c b/src/battle_setup.c index f928cf3f9..be2f7e859 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -699,21 +699,22 @@ static u8 GetBattleTransitionTypeByMap(void) PlayerGetDestCoords(&x, &y); tileBehavior = MapGridGetMetatileBehaviorAt(x, y); + if (GetFlashLevel()) return TRANSITION_TYPE_FLASH; - if (!MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior)) + + if (MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior)) + return TRANSITION_TYPE_WATER; + + switch (gMapHeader.mapType) { - switch (gMapHeader.mapType) - { - case MAP_TYPE_UNDERGROUND: - return TRANSITION_TYPE_CAVE; - case MAP_TYPE_UNDERWATER: - return TRANSITION_TYPE_WATER; - default: - return TRANSITION_TYPE_NORMAL; - } + case MAP_TYPE_UNDERGROUND: + return TRANSITION_TYPE_CAVE; + case MAP_TYPE_UNDERWATER: + return TRANSITION_TYPE_WATER; + default: + return TRANSITION_TYPE_NORMAL; } - return TRANSITION_TYPE_WATER; } static u16 GetSumOfPlayerPartyLevel(u8 numMons) From fc81b4cac6454cb77f6b3398fd00c918dc8ad435 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Tue, 5 Jul 2022 13:19:03 -0400 Subject: [PATCH 179/208] fix GetAiLogicData logic --- src/battle_ai_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 11b672bca..47a074025 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -255,8 +255,8 @@ void GetAiLogicData(void) memset(AI_DATA, 0, sizeof(struct AiLogicData)); - if (!(gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER) - && !IsWildMonSmart())) + if (!(gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER)) + && !IsWildMonSmart()) return; // get/assume all battler data From ce5aba16f6df121b9933c7a5b23e4e9848d5f71c Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Tue, 5 Jul 2022 18:24:50 -0300 Subject: [PATCH 180/208] Removed global and unused IsPinchBerryItemEffect --- src/item.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/item.c b/src/item.c index 02ecefdc2..5a07e7b35 100644 --- a/src/item.c +++ b/src/item.c @@ -948,25 +948,6 @@ u8 ItemId_GetSecondaryId(u16 itemId) return gItems[SanitizeItemId(itemId)].secondaryId; } -bool32 IsPinchBerryItemEffect(u16 holdEffect) -{ - switch (holdEffect) - { - case HOLD_EFFECT_ATTACK_UP: - case HOLD_EFFECT_DEFENSE_UP: - case HOLD_EFFECT_SPEED_UP: - case HOLD_EFFECT_SP_ATTACK_UP: - case HOLD_EFFECT_SP_DEFENSE_UP: - case HOLD_EFFECT_CRITICAL_UP: - case HOLD_EFFECT_RANDOM_STAT_UP: - case HOLD_EFFECT_CUSTAP_BERRY: - case HOLD_EFFECT_MICLE_BERRY: - return TRUE; - } - - return FALSE; -} - u8 ItemId_GetFlingPower(u16 itemId) { return gItems[SanitizeItemId(itemId)].flingPower; From 15f386ede6c604511559224c485fbd0604a761ab Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 8 Jul 2022 01:34:38 -0400 Subject: [PATCH 181/208] Move make compare to its own build section --- INSTALL.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 7f1d47879..02851644a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -418,21 +418,16 @@ If you aren't in the pokeemerald directory already, then **change directory** to ```bash cd pokeemerald ``` -To build **pokeemerald.gba** for the first time and confirm it matches the official ROM image (Note: to speed up builds, see [Parallel builds](#parallel-builds)): +To build **pokeemerald.gba** (Note: to speed up builds, see [Parallel builds](#parallel-builds)): ```bash -make compare +make ``` -If an OK is returned, then the installation went smoothly. +If it has built successfully you will have the output file **pokeemerald.gba** in your project folder.
Note for Windows... > If you switched terminals since the last build (e.g. from msys2 to WSL1), you must run `make clean-tools` once before any subsequent `make` commands.
-To build **pokeemerald.gba** with your changes: -```bash -make -``` - # Building guidance ## Parallel builds @@ -451,6 +446,22 @@ Replace `` with the number that the `nproc` command returned. `nproc` is not available on macOS. The alternative is `sysctl -n hw.ncpu` ([relevant Stack Overflow thread](https://stackoverflow.com/questions/1715580)). +## Compare ROM to the original + +For contributing, or if you'd simply like to verify that your ROM is identical to the original game, run: +```bash +make compare +``` +If it matches, you will see the following at the end of the output: +```bash +pokeemerald.gba: OK +``` +If there are any changes from the original game, you will instead see: +```bash +pokeemerald.gba: FAILED +shasum: WARNING: 1 computed checksum did NOT match +``` + ## devkitARM's C compiler This project supports the `arm-none-eabi-gcc` compiler included with devkitARM. If devkitARM (a.k.a. gba-dev) has already been installed as part of the platform-specific instructions, simply run: From a1004485c558538e1401c5bffbb0e517f54d8431 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 10 Jul 2022 20:08:28 -0300 Subject: [PATCH 182/208] Relocated TYPE_NAME_LENGTH and ABILITY_NAME_LENGTH --- include/battle_main.h | 3 --- include/constants/global.h | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/battle_main.h b/include/battle_main.h index b7691b4fd..449131e53 100644 --- a/include/battle_main.h +++ b/include/battle_main.h @@ -22,9 +22,6 @@ struct MultiPartnerMenuPokemon /*0x1D*/ u8 language; }; -#define TYPE_NAME_LENGTH 6 -#define ABILITY_NAME_LENGTH 12 - // defines for the u8 array gTypeEffectiveness #define TYPE_EFFECT_ATK_TYPE(i)((gTypeEffectiveness[i + 0])) #define TYPE_EFFECT_DEF_TYPE(i)((gTypeEffectiveness[i + 1])) diff --git a/include/constants/global.h b/include/constants/global.h index 096094220..f4b503c32 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -101,6 +101,8 @@ #define WONDER_NEWS_TEXT_LENGTH 40 #define WONDER_CARD_BODY_TEXT_LINES 4 #define WONDER_NEWS_BODY_TEXT_LINES 10 +#define TYPE_NAME_LENGTH 6 +#define ABILITY_NAME_LENGTH 12 #define MAX_STAMP_CARD_STAMPS 7 From 186f2c0232238653a1aa9eda718cc993996e7443 Mon Sep 17 00:00:00 2001 From: sphericalice Date: Mon, 11 Jul 2022 15:18:13 +0100 Subject: [PATCH 183/208] Introduce a MOVE_UNAVAILABLE constant --- include/constants/moves.h | 3 + src/battle_ai_switch_items.c | 15 ++-- src/battle_dome.c | 2 +- src/battle_script_commands.c | 149 +++++++++++++++++++---------------- src/battle_util.c | 20 ++--- src/contest.c | 6 +- src/pokemon.c | 6 +- 7 files changed, 112 insertions(+), 89 deletions(-) diff --git a/include/constants/moves.h b/include/constants/moves.h index 85c02e3da..324bfb899 100644 --- a/include/constants/moves.h +++ b/include/constants/moves.h @@ -359,4 +359,7 @@ #define MOVES_COUNT 355 +// Used for checks for moves affected by Disable, Mimic, etc. +#define MOVE_UNAVAILABLE 0xFFFF + #endif // GUARD_CONSTANTS_MOVES_H diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index c87271722..169fa5f4f 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -127,9 +127,9 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) if (HasSuperEffectiveMoveAgainstOpponents(TRUE) && Random() % 3 != 0) return FALSE; - if (gLastLandedMoves[gActiveBattler] == 0) + if (gLastLandedMoves[gActiveBattler] == MOVE_NONE) return FALSE; - if (gLastLandedMoves[gActiveBattler] == 0xFFFF) + if (gLastLandedMoves[gActiveBattler] == MOVE_UNAVAILABLE) return FALSE; if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0) return FALSE; @@ -224,13 +224,16 @@ static bool8 ShouldSwitchIfNaturalCure(void) if (gBattleMons[gActiveBattler].hp < gBattleMons[gActiveBattler].maxHP / 2) return FALSE; - if ((gLastLandedMoves[gActiveBattler] == 0 || gLastLandedMoves[gActiveBattler] == 0xFFFF) && Random() & 1) + if ((gLastLandedMoves[gActiveBattler] == MOVE_NONE + || gLastLandedMoves[gActiveBattler] == MOVE_UNAVAILABLE) + && Random() & 1) { *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); return TRUE; } - else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0 && Random() & 1) + else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0 + && Random() & 1) { *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); @@ -332,9 +335,9 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent) u16 move; u8 moveFlags; - if (gLastLandedMoves[gActiveBattler] == 0) + if (gLastLandedMoves[gActiveBattler] == MOVE_NONE) return FALSE; - if (gLastLandedMoves[gActiveBattler] == 0xFFFF) + if (gLastLandedMoves[gActiveBattler] == MOVE_UNAVAILABLE) return FALSE; if (gLastHitBy[gActiveBattler] == 0xFF) return FALSE; diff --git a/src/battle_dome.c b/src/battle_dome.c index cbd9d0b6b..8385e831b 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -2747,7 +2747,7 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int mode) int i = 0; int typePower = TYPE_x1; - if (move == MOVE_NONE || move == 0xFFFF || gBattleMoves[move].power == 0) + if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || gBattleMoves[move].power == 0) return 0; defType1 = gBaseStats[targetSpecies].type1; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 4f31f0f01..4689e4fb0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2355,7 +2355,7 @@ void SetMoveEffect(bool8 primary, u8 certain) break; if (gBattleMons[gEffectBattler].status1) break; - if (noSunCanFreeze == 0) + if (noSunCanFreeze == FALSE) break; if (gBattleMons[gEffectBattler].ability == ABILITY_MAGMA_ARMOR) break; @@ -2553,9 +2553,9 @@ void SetMoveEffect(bool8 primary, u8 certain) case MOVE_EFFECT_PAYDAY: if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER) { - u16 PayDay = gPaydayMoney; + u16 payDay = gPaydayMoney; gPaydayMoney += (gBattleMons[gBattlerAttacker].level * 5); - if (PayDay > gPaydayMoney) + if (payDay > gPaydayMoney) gPaydayMoney = 0xFFFF; } BattleScriptPush(gBattlescriptCurrInstr + 1); @@ -2743,10 +2743,10 @@ void SetMoveEffect(bool8 primary, u8 certain) gLastUsedAbility = gBattleMons[gBattlerTarget].ability; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } - else if (gBattleMons[gBattlerAttacker].item != 0 + else if (gBattleMons[gBattlerAttacker].item != ITEM_NONE || gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY || IS_ITEM_MAIL(gBattleMons[gBattlerTarget].item) - || gBattleMons[gBattlerTarget].item == 0) + || gBattleMons[gBattlerTarget].item == ITEM_NONE) { gBattlescriptCurrInstr++; } @@ -4184,8 +4184,8 @@ static void Cmd_moveend(void) u8 endMode, endState; u16 originallyUsedMove; - if (gChosenMove == 0xFFFF) - originallyUsedMove = 0; + if (gChosenMove == MOVE_UNAVAILABLE) + originallyUsedMove = MOVE_NONE; else originallyUsedMove = gChosenMove; @@ -4206,10 +4206,13 @@ static void Cmd_moveend(void) { case MOVEEND_RAGE: // rage check if (gBattleMons[gBattlerTarget].status2 & STATUS2_RAGE - && gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget + && gBattleMons[gBattlerTarget].hp != 0 + && gBattlerAttacker != gBattlerTarget && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget) - && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && TARGET_TURN_DAMAGED - && gBattleMoves[gCurrentMove].power && gBattleMons[gBattlerTarget].statStages[STAT_ATK] < MAX_STAT_STAGE) + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED + && gBattleMoves[gCurrentMove].power != 0 + && gBattleMons[gBattlerTarget].statStages[STAT_ATK] < MAX_STAT_STAGE) { gBattleMons[gBattlerTarget].statStages[STAT_ATK]++; BattleScriptPushCursor(); @@ -4220,9 +4223,11 @@ static void Cmd_moveend(void) break; case MOVEEND_DEFROST: // defrosting check if (gBattleMons[gBattlerTarget].status1 & STATUS1_FREEZE - && gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget + && gBattleMons[gBattlerTarget].hp != 0 + && gBattlerAttacker != gBattlerTarget && gSpecialStatuses[gBattlerTarget].specialDmg - && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && moveType == TYPE_FIRE) + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && moveType == TYPE_FIRE) { gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FREEZE; gActiveBattler = gBattlerTarget; @@ -4259,7 +4264,7 @@ static void Cmd_moveend(void) if (gHitMarker & HITMARKER_OBEYS && holdEffectAtk == HOLD_EFFECT_CHOICE_BAND && gChosenMove != MOVE_STRUGGLE - && (*choicedMoveAtk == 0 || *choicedMoveAtk == 0xFFFF)) + && (*choicedMoveAtk == MOVE_NONE || *choicedMoveAtk == MOVE_UNAVAILABLE)) { if (gChosenMove == MOVE_BATON_PASS && !(gMoveResultFlags & MOVE_RESULT_FAILED)) { @@ -4274,17 +4279,17 @@ static void Cmd_moveend(void) break; } if (i == MAX_MON_MOVES) - *choicedMoveAtk = 0; + *choicedMoveAtk = MOVE_NONE; ++gBattleScripting.moveendState; break; case MOVEEND_CHANGED_ITEMS: // changed held items for (i = 0; i < gBattlersCount; i++) { u16* changedItem = &gBattleStruct->changedItems[i]; - if (*changedItem != 0) + if (*changedItem != ITEM_NONE) { gBattleMons[i].item = *changedItem; - *changedItem = 0; + *changedItem = ITEM_NONE; } } gBattleScripting.moveendState++; @@ -4371,8 +4376,8 @@ static void Cmd_moveend(void) } else { - gLastMoves[gBattlerAttacker] = 0xFFFF; - gLastResultingMoves[gBattlerAttacker] = 0xFFFF; + gLastMoves[gBattlerAttacker] = MOVE_UNAVAILABLE; + gLastResultingMoves[gBattlerAttacker] = MOVE_UNAVAILABLE; } if (!(gHitMarker & HITMARKER_FAINTED(gBattlerTarget))) @@ -4380,7 +4385,7 @@ static void Cmd_moveend(void) if (gHitMarker & HITMARKER_OBEYS && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { - if (gChosenMove == 0xFFFF) + if (gChosenMove == MOVE_UNAVAILABLE) { gLastLandedMoves[gBattlerTarget] = gChosenMove; } @@ -4392,15 +4397,18 @@ static void Cmd_moveend(void) } else { - gLastLandedMoves[gBattlerTarget] = 0xFFFF; + gLastLandedMoves[gBattlerTarget] = MOVE_UNAVAILABLE; } } gBattleScripting.moveendState++; break; case MOVEEND_MIRROR_MOVE: // mirror move - if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker]) && !(gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker]) - && gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED && gHitMarker & HITMARKER_OBEYS - && gBattlerAttacker != gBattlerTarget && !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget)) + if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker]) + && !(gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker]) + && gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED + && gHitMarker & HITMARKER_OBEYS + && gBattlerAttacker != gBattlerTarget + && !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget)) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { u8 target, attacker; @@ -6585,10 +6593,10 @@ static void Cmd_trymirrormove(void) s32 validMovesCount; s32 i; u16 move; - u16 movesArray[4]; + u16 validMoves[MAX_BATTLERS_COUNT]; - for (i = 0; i < 3; i++) - movesArray[i] = 0; + for (i = 0; i < (MAX_BATTLERS_COUNT - 1); i++) // -1 to exclude the user + validMoves[i] = MOVE_NONE; for (validMovesCount = 0, i = 0; i < gBattlersCount; i++) { @@ -6597,9 +6605,9 @@ static void Cmd_trymirrormove(void) move = *(i * 2 + gBattlerAttacker * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) | (*(i * 2 + gBattlerAttacker * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) << 8); - if (move != 0 && move != 0xFFFF) + if (move != MOVE_NONE && move != MOVE_UNAVAILABLE) { - movesArray[validMovesCount] = move; + validMoves[validMovesCount] = move; validMovesCount++; } } @@ -6608,24 +6616,24 @@ static void Cmd_trymirrormove(void) move = *(gBattleStruct->lastTakenMove + gBattlerAttacker * 2 + 0) | (*(gBattleStruct->lastTakenMove + gBattlerAttacker * 2 + 1) << 8); - if (move != 0 && move != 0xFFFF) + if (move != MOVE_NONE && move != MOVE_UNAVAILABLE) { gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; gCurrentMove = move; gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; } - else if (validMovesCount) + else if (validMovesCount != 0) { gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; i = Random() % validMovesCount; - gCurrentMove = movesArray[i]; + gCurrentMove = validMoves[i]; gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; } - else + else // no valid moves found { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; gBattlescriptCurrInstr++; } } @@ -7164,7 +7172,7 @@ static void Cmd_forcerandomswitch(void) || (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER && gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK) || (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)) { - if ((gBattlerTarget & BIT_FLANK) != 0) + if ((gBattlerTarget & BIT_FLANK) != B_FLANK_LEFT) { firstMonId = 3; lastMonId = 6; @@ -7182,7 +7190,7 @@ static void Cmd_forcerandomswitch(void) else if ((gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) || (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)) { - if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gBattlerTarget)) == 1) + if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gBattlerTarget)) == B_FLANK_RIGHT) { firstMonId = 3; lastMonId = 6; @@ -7208,7 +7216,7 @@ static void Cmd_forcerandomswitch(void) } else { - if ((gBattlerTarget & BIT_FLANK) != 0) + if ((gBattlerTarget & BIT_FLANK) != B_FLANK_LEFT) { firstMonId = 3; lastMonId = 6; @@ -7305,7 +7313,7 @@ static void Cmd_tryconversiontypechange(void) // randomly changes user's type to while (validMoves < MAX_MON_MOVES) { - if (gBattleMons[gBattlerAttacker].moves[validMoves] == 0) + if (gBattleMons[gBattlerAttacker].moves[validMoves] == MOVE_NONE) break; validMoves++; @@ -7674,7 +7682,7 @@ static void Cmd_setfocusenergy(void) static void Cmd_transformdataexecution(void) { - gChosenMove = 0xFFFF; + gChosenMove = MOVE_UNAVAILABLE; gBattlescriptCurrInstr++; if (gBattleMons[gBattlerTarget].status2 & STATUS2_TRANSFORMED || gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE) @@ -7688,7 +7696,7 @@ static void Cmd_transformdataexecution(void) u8 *battleMonAttacker, *battleMonTarget; gBattleMons[gBattlerAttacker].status2 |= STATUS2_TRANSFORMED; - gDisableStructs[gBattlerAttacker].disabledMove = 0; + gDisableStructs[gBattlerAttacker].disabledMove = MOVE_NONE; gDisableStructs[gBattlerAttacker].disableTimer = 0; gDisableStructs[gBattlerAttacker].transformedMonPersonality = gBattleMons[gBattlerTarget].personality; gDisableStructs[gBattlerAttacker].mimickedMoves = 0; @@ -7754,12 +7762,12 @@ static bool8 IsMoveUncopyableByMimic(u16 move) static void Cmd_mimicattackcopy(void) { - gChosenMove = 0xFFFF; + gChosenMove = MOVE_UNAVAILABLE; if (IsMoveUncopyableByMimic(gLastMoves[gBattlerTarget]) || gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED - || gLastMoves[gBattlerTarget] == 0 - || gLastMoves[gBattlerTarget] == 0xFFFF) + || gLastMoves[gBattlerTarget] == MOVE_NONE + || gLastMoves[gBattlerTarget] == MOVE_UNAVAILABLE) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } @@ -7900,7 +7908,7 @@ static void Cmd_disablelastusedattack(void) if (gBattleMons[gBattlerTarget].moves[i] == gLastMoves[gBattlerTarget]) break; } - if (gDisableStructs[gBattlerTarget].disabledMove == 0 + if (gDisableStructs[gBattlerTarget].disabledMove == MOVE_NONE && i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] != 0) { PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerTarget].moves[i]) @@ -7933,7 +7941,7 @@ static void Cmd_trysetencore(void) i = 4; } - if (gDisableStructs[gBattlerTarget].encoredMove == 0 + if (gDisableStructs[gBattlerTarget].encoredMove == MOVE_NONE && i != 4 && gBattleMons[gBattlerTarget].pp[i] != 0) { gDisableStructs[gBattlerTarget].encoredMove = gBattleMons[gBattlerTarget].moves[i]; @@ -7975,7 +7983,7 @@ static void Cmd_painsplitdmgcalc(void) static void Cmd_settypetorandomresistance(void) // conversion 2 { if (gLastLandedMoves[gBattlerAttacker] == MOVE_NONE - || gLastLandedMoves[gBattlerAttacker] == 0xFFFF) + || gLastLandedMoves[gBattlerAttacker] == MOVE_UNAVAILABLE) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } @@ -8042,12 +8050,12 @@ static void Cmd_setalwayshitflag(void) static void Cmd_copymovepermanently(void) // sketch { - gChosenMove = 0xFFFF; + gChosenMove = MOVE_UNAVAILABLE; if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED) && gLastPrintedMoves[gBattlerTarget] != MOVE_STRUGGLE - && gLastPrintedMoves[gBattlerTarget] != 0 - && gLastPrintedMoves[gBattlerTarget] != 0xFFFF + && gLastPrintedMoves[gBattlerTarget] != MOVE_NONE + && gLastPrintedMoves[gBattlerTarget] != MOVE_UNAVAILABLE && gLastPrintedMoves[gBattlerTarget] != MOVE_SKETCH) { s32 i; @@ -8096,11 +8104,11 @@ static void Cmd_copymovepermanently(void) // sketch static bool8 IsTwoTurnsMove(u16 move) { if (gBattleMoves[move].effect == EFFECT_SKULL_BASH - || gBattleMoves[move].effect == EFFECT_RAZOR_WIND - || gBattleMoves[move].effect == EFFECT_SKY_ATTACK - || gBattleMoves[move].effect == EFFECT_SOLAR_BEAM - || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE - || gBattleMoves[move].effect == EFFECT_BIDE) + || gBattleMoves[move].effect == EFFECT_RAZOR_WIND + || gBattleMoves[move].effect == EFFECT_SKY_ATTACK + || gBattleMoves[move].effect == EFFECT_SOLAR_BEAM + || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE + || gBattleMoves[move].effect == EFFECT_BIDE) return TRUE; else return FALSE; @@ -8108,8 +8116,11 @@ static bool8 IsTwoTurnsMove(u16 move) static bool8 IsInvalidForSleepTalkOrAssist(u16 move) { - if (move == 0 || move == MOVE_SLEEP_TALK || move == MOVE_ASSIST - || move == MOVE_MIRROR_MOVE || move == MOVE_METRONOME) + if (move == MOVE_NONE + || move == MOVE_SLEEP_TALK + || move == MOVE_ASSIST + || move == MOVE_MIRROR_MOVE + || move == MOVE_METRONOME) return TRUE; else return FALSE; @@ -8123,11 +8134,11 @@ static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a c return 2; if (gBattleMoves[move].effect == EFFECT_SKULL_BASH - || gBattleMoves[move].effect == EFFECT_RAZOR_WIND - || gBattleMoves[move].effect == EFFECT_SKY_ATTACK - || gBattleMoves[move].effect == EFFECT_SOLAR_BEAM - || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE - || gBattleMoves[move].effect == EFFECT_BIDE) + || gBattleMoves[move].effect == EFFECT_RAZOR_WIND + || gBattleMoves[move].effect == EFFECT_SKY_ATTACK + || gBattleMoves[move].effect == EFFECT_SOLAR_BEAM + || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE + || gBattleMoves[move].effect == EFFECT_BIDE) { if ((gHitMarker & HITMARKER_CHARGING)) return 1; @@ -8215,8 +8226,8 @@ static void Cmd_remaininghptopower(void) static void Cmd_tryspiteppreduce(void) { - if (gLastMoves[gBattlerTarget] != 0 - && gLastMoves[gBattlerTarget] != 0xFFFF) + if (gLastMoves[gBattlerTarget] != MOVE_NONE + && gLastMoves[gBattlerTarget] != MOVE_UNAVAILABLE) { s32 i; @@ -9092,7 +9103,7 @@ static void Cmd_tryswapitems(void) // trick } // can't swap if two pokemon don't have an item // or if either of them is an enigma berry or a mail - else if ((gBattleMons[gBattlerAttacker].item == 0 && gBattleMons[gBattlerTarget].item == 0) + else if ((gBattleMons[gBattlerAttacker].item == ITEM_NONE && gBattleMons[gBattlerTarget].item == ITEM_NONE) || gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY || gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY || IS_ITEM_MAIL(gBattleMons[gBattlerAttacker].item) @@ -9150,7 +9161,7 @@ static void Cmd_tryswapitems(void) // trick static void Cmd_trycopyability(void) // role play { - if (gBattleMons[gBattlerTarget].ability != 0 + if (gBattleMons[gBattlerTarget].ability != ABILITY_NONE && gBattleMons[gBattlerTarget].ability != ABILITY_WONDER_GUARD) { gBattleMons[gBattlerAttacker].ability = gBattleMons[gBattlerTarget].ability; @@ -9263,8 +9274,8 @@ static void Cmd_scaledamagebyhealthratio(void) static void Cmd_tryswapabilities(void) // skill swap { - if ((gBattleMons[gBattlerAttacker].ability == 0 - && gBattleMons[gBattlerTarget].ability == 0) + if ((gBattleMons[gBattlerAttacker].ability == ABILITY_NONE + && gBattleMons[gBattlerTarget].ability == ABILITY_NONE) || gBattleMons[gBattlerAttacker].ability == ABILITY_WONDER_GUARD || gBattleMons[gBattlerTarget].ability == ABILITY_WONDER_GUARD || gMoveResultFlags & MOVE_RESULT_NO_EFFECT) @@ -9358,7 +9369,7 @@ static void Cmd_assistattackselect(void) s32 chooseableMovesNo = 0; struct Pokemon* party; s32 monId, moveId; - u16* movesArray = gBattleStruct->assistPossibleMoves; + u16* validMoves = gBattleStruct->assistPossibleMoves; if (GET_BATTLER_SIDE(gBattlerAttacker) != B_SIDE_PLAYER) party = gEnemyParty; @@ -9389,14 +9400,14 @@ static void Cmd_assistattackselect(void) if (move == MOVE_NONE) continue; - movesArray[chooseableMovesNo] = move; + validMoves[chooseableMovesNo] = move; chooseableMovesNo++; } } if (chooseableMovesNo) { gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - gCalledMove = movesArray[((Random() & 0xFF) * chooseableMovesNo) >> 8]; + gCalledMove = validMoves[((Random() & 0xFF) * chooseableMovesNo) >> 8]; gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); gBattlescriptCurrInstr += 5; } diff --git a/src/battle_util.c b/src/battle_util.c index f34c39eb0..865b0112c 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -679,10 +679,12 @@ void HandleAction_ActionFinished(void) gBattleResources->battleScriptsStack->size = 0; } +#define SOUND_MOVES_END 0xFFFF + static const u16 sSoundMovesTable[] = { MOVE_GROWL, MOVE_ROAR, MOVE_SING, MOVE_SUPERSONIC, MOVE_SCREECH, MOVE_SNORE, - MOVE_UPROAR, MOVE_METAL_SOUND, MOVE_GRASS_WHISTLE, MOVE_HYPER_VOICE, 0xFFFF + MOVE_UPROAR, MOVE_METAL_SOUND, MOVE_GRASS_WHISTLE, MOVE_HYPER_VOICE, SOUND_MOVES_END }; u8 GetBattlerForBattleScript(u8 caseId) @@ -1029,7 +1031,7 @@ u8 TrySetCantSelectMoveBattleScript(void) gPotentialItemEffectBattler = gActiveBattler; - if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != 0xFFFF && *choicedMove != move) + if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move) { gCurrentMove = *choicedMove; gLastUsedItem = gBattleMons[gActiveBattler].item; @@ -1097,7 +1099,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check) if (gDisableStructs[battlerId].encoreTimer && gDisableStructs[battlerId].encoredMove != gBattleMons[battlerId].moves[i]) unusableMoves |= gBitTable[i]; // Choice Band - if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != 0xFFFF && *choicedMove != gBattleMons[battlerId].moves[i]) + if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i]) unusableMoves |= gBitTable[i]; } return unusableMoves; @@ -2640,12 +2642,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA case ABILITYEFFECT_MOVES_BLOCK: // 2 if (gLastUsedAbility == ABILITY_SOUNDPROOF) { - for (i = 0; sSoundMovesTable[i] != 0xFFFF; i++) + for (i = 0; sSoundMovesTable[i] != SOUND_MOVES_END; i++) { if (sSoundMovesTable[i] == move) break; } - if (sSoundMovesTable[i] != 0xFFFF) + if (sSoundMovesTable[i] != SOUND_MOVES_END) { if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS) gHitMarker |= HITMARKER_NO_PPDEDUCT; @@ -3005,22 +3007,22 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA target2 = GetBattlerAtPosition(side + BIT_FLANK); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { - if (gBattleMons[target1].ability != 0 && gBattleMons[target1].hp != 0 - && gBattleMons[target2].ability != 0 && gBattleMons[target2].hp != 0) + if (gBattleMons[target1].ability != ABILITY_NONE && gBattleMons[target1].hp != 0 + && gBattleMons[target2].ability != ABILITY_NONE && gBattleMons[target2].hp != 0) { gActiveBattler = GetBattlerAtPosition(((Random() & 1) * 2) | side); gBattleMons[i].ability = gBattleMons[gActiveBattler].ability; gLastUsedAbility = gBattleMons[gActiveBattler].ability; effect++; } - else if (gBattleMons[target1].ability != 0 && gBattleMons[target1].hp != 0) + else if (gBattleMons[target1].ability != ABILITY_NONE && gBattleMons[target1].hp != 0) { gActiveBattler = target1; gBattleMons[i].ability = gBattleMons[gActiveBattler].ability; gLastUsedAbility = gBattleMons[gActiveBattler].ability; effect++; } - else if (gBattleMons[target2].ability != 0 && gBattleMons[target2].hp != 0) + else if (gBattleMons[target2].ability != ABILITY_NONE && gBattleMons[target2].hp != 0) { gActiveBattler = target2; gBattleMons[i].ability = gBattleMons[gActiveBattler].ability; diff --git a/src/contest.c b/src/contest.c index da57d9e28..a520588a0 100644 --- a/src/contest.c +++ b/src/contest.c @@ -5694,6 +5694,8 @@ static void SetContestLiveUpdateFlags(u8 contestant) } } +#define APPEAL_MOVES_END 0xFFFF + static void CalculateContestLiveUpdateData(void) { u8 loser; @@ -5758,7 +5760,7 @@ static void CalculateContestLiveUpdateData(void) appealMoves[i] = MOVE_NONE; numMoveUses[i] = 0; } - appealMoves[CONTEST_NUM_APPEALS] = 0xFFFF; + appealMoves[CONTEST_NUM_APPEALS] = APPEAL_MOVES_END; numMoveUses[CONTEST_NUM_APPEALS] = 0; for (i = 0; i < CONTEST_NUM_APPEALS; i++) @@ -5787,7 +5789,7 @@ static void CalculateContestLiveUpdateData(void) moveCandidates[0] = appealMoves[0]; mostUses = numMoveUses[0]; numMoveCandidates = 0; - for (i = 1; appealMoves[i] != 0xFFFF; i++) + for (i = 1; appealMoves[i] != APPEAL_MOVES_END; i++) { if (mostUses < numMoveUses[i]) { diff --git a/src/pokemon.c b/src/pokemon.c index 170425391..60722fe02 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2093,10 +2093,12 @@ static const s8 sFriendshipEventModifiers[][3] = [FRIENDSHIP_EVENT_FAINT_LARGE] = {-5, -5, -10}, }; +#define HM_MOVES_END 0xFFFF + static const u16 sHMMoves[] = { MOVE_CUT, MOVE_FLY, MOVE_SURF, MOVE_STRENGTH, MOVE_FLASH, - MOVE_ROCK_SMASH, MOVE_WATERFALL, MOVE_DIVE, 0xFFFF + MOVE_ROCK_SMASH, MOVE_WATERFALL, MOVE_DIVE, HM_MOVES_END }; static const struct SpeciesItem sAlteringCaveWildMonHeldItems[] = @@ -6479,7 +6481,7 @@ const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u bool32 IsHMMove2(u16 move) { int i = 0; - while (sHMMoves[i] != 0xFFFF) + while (sHMMoves[i] != HM_MOVES_END) { if (sHMMoves[i++] == move) return TRUE; From 167353223cafd8ec3ef52d33edcb051443209b78 Mon Sep 17 00:00:00 2001 From: sphericalice Date: Mon, 11 Jul 2022 15:23:23 +0100 Subject: [PATCH 184/208] Use MAX_MON_MOVES in Cmd_trysetencore --- src/battle_script_commands.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 4689e4fb0..fa27d8aa8 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2553,9 +2553,9 @@ void SetMoveEffect(bool8 primary, u8 certain) case MOVE_EFFECT_PAYDAY: if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER) { - u16 payDay = gPaydayMoney; + u16 payday = gPaydayMoney; gPaydayMoney += (gBattleMons[gBattlerAttacker].level * 5); - if (payDay > gPaydayMoney) + if (payday > gPaydayMoney) gPaydayMoney = 0xFFFF; } BattleScriptPush(gBattlescriptCurrInstr + 1); @@ -7938,11 +7938,11 @@ static void Cmd_trysetencore(void) || gLastMoves[gBattlerTarget] == MOVE_ENCORE || gLastMoves[gBattlerTarget] == MOVE_MIRROR_MOVE) { - i = 4; + i = MAX_MON_MOVES; } if (gDisableStructs[gBattlerTarget].encoredMove == MOVE_NONE - && i != 4 && gBattleMons[gBattlerTarget].pp[i] != 0) + && i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] != 0) { gDisableStructs[gBattlerTarget].encoredMove = gBattleMons[gBattlerTarget].moves[i]; gDisableStructs[gBattlerTarget].encoredMovePos = i; From cec7e30ef10d7ba24c34f5c0969363fee2420d00 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 15 Jul 2022 01:51:36 -0300 Subject: [PATCH 185/208] Update battle_moves.h --- src/data/battle_moves.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 2035acff7..2027d797c 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -7850,7 +7850,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, }, From 0651cc9fe46c474e5f65fd88ccc9e9c6e2626672 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 16 Jul 2022 05:09:32 -0300 Subject: [PATCH 186/208] Updated Cmd_handleballthrow --- src/battle_script_commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 309c6f36b..07e6b8735 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -13586,7 +13586,7 @@ static void Cmd_handleballthrow(void) else catchRate = gBaseStats[gBattleMons[gBattlerTarget].species].catchRate; - #ifdef POKEMON_EXPANSION + #if defined POKEMON_EXPANSION && defined ITEM_EXPANSION if (gBaseStats[gBattleMons[gBattlerTarget].species].flags & FLAG_ULTRA_BEAST) { if (gLastUsedItem == ITEM_BEAST_BALL) @@ -13764,7 +13764,7 @@ static void Cmd_handleballthrow(void) #endif } - #ifdef POKEMON_EXPANSION + #if defined POKEMON_EXPANSION && defined ITEM_EXPANSION } #endif From 9b5aee3b93ac17e3e07c3cb924fb92650d181de4 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 17 Jul 2022 12:17:54 -0400 Subject: [PATCH 187/208] fix z stat-boosts --- data/battle_scripts_1.s | 10 +++++++--- src/battle_z_move.c | 36 +++++++----------------------------- 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index bac1b83e7..a74d71246 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -9214,9 +9214,12 @@ BattleScript_ZMoveActivateDamaging:: return BattleScript_ZMoveActivateStatus:: + savetarget printstring STRINGID_ZPOWERSURROUNDS playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL setzeffect + restoretarget + copybyte sSTATCHANGER, sSAVED_STAT_CHANGER return BattleScript_ZEffectPrintString:: @@ -9232,9 +9235,10 @@ BattleScript_RecoverHPZMove:: return BattleScript_StatUpZMove:: - statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StatUpZMoveEnd - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatUpZMoveEnd - playanimation BS_SCRIPTING, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_StatUpZMoveEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_StatUpZMoveEnd + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printstring STRINGID_ZMOVESTATUP waitmessage 0x40 printfromtable gStatUpStringIds diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 674082698..285a354e4 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -581,8 +581,10 @@ void SetZEffect(void) else gBattleStruct->zmove.effect = Z_EFFECT_ATK_UP_1; } - + + gBattleScripting.savedStatChanger = gBattleScripting.statChanger; // save used move's stat changer (e.g. for Z-Growl) gBattleScripting.battler = gBattlerAttacker; + switch (gBattleStruct->zmove.effect) { case Z_EFFECT_RESET_STATS: @@ -639,42 +641,18 @@ void SetZEffect(void) gBattleCommunication[MULTISTRING_CHOOSER] = MULTISTRING_Z_HP_TRAP; gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; break; - case Z_EFFECT_ATK_UP_1: - case Z_EFFECT_DEF_UP_1: - case Z_EFFECT_SPD_UP_1: - case Z_EFFECT_SPATK_UP_1: - case Z_EFFECT_SPDEF_UP_1: - case Z_EFFECT_ACC_UP_1: - case Z_EFFECT_EVSN_UP_1: - SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_1 + 1, 1, FALSE); - gBattleScripting.animArg1 = 0xE + (gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_1 + 1); - gBattleScripting.animArg2 = 0; + case Z_EFFECT_ATK_UP_1 ... Z_EFFECT_EVSN_UP_1: + SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_1 + 1, 1, FALSE); BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); gBattlescriptCurrInstr = BattleScript_StatUpZMove; break; - case Z_EFFECT_ATK_UP_2: - case Z_EFFECT_DEF_UP_2: - case Z_EFFECT_SPD_UP_2: - case Z_EFFECT_SPATK_UP_2: - case Z_EFFECT_SPDEF_UP_2: - case Z_EFFECT_ACC_UP_2: - case Z_EFFECT_EVSN_UP_2: + case Z_EFFECT_ATK_UP_2 ... Z_EFFECT_EVSN_UP_2: SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_2 + 1, 2, FALSE); - gBattleScripting.animArg1 = 0xE + (gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_2 + 1); - gBattleScripting.animArg2 = 0; BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); gBattlescriptCurrInstr = BattleScript_StatUpZMove; break; - case Z_EFFECT_ATK_UP_3: - case Z_EFFECT_DEF_UP_3: - case Z_EFFECT_SPD_UP_3: - case Z_EFFECT_SPATK_UP_3: - case Z_EFFECT_SPDEF_UP_3: - case Z_EFFECT_ACC_UP_3: - case Z_EFFECT_EVSN_UP_3: + case Z_EFFECT_ATK_UP_3 ... Z_EFFECT_EVSN_UP_3: SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_3 + 1, 3, FALSE); - gBattleScripting.animArg1 = 0xE + (gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_3 + 1); - gBattleScripting.animArg2 = 0; BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); gBattlescriptCurrInstr = BattleScript_StatUpZMove; break; From 5d91bdeafcf2fdae8c0ceee12c6ca3888946d156 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 17 Jul 2022 19:13:45 -0400 Subject: [PATCH 188/208] add B_ANIM_RESTORE_BG to BattleScript_EffectTerrainHit --- data/battle_scripts_1.s | 1 + 1 file changed, 1 insertion(+) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 4178b41ab..03ab6802c 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -9628,6 +9628,7 @@ BattleScript_EffectTerrainHit: resultmessage waitmessage 0x40 setterrain BattleScript_TryFaint + playanimation BS_ATTACKER, B_ANIM_RESTORE_BG printfromtable gTerrainStringIds BattleScript_TryFaint: tryfaintmon BS_TARGET From f6b6ab56be081d75f74e4eab71194afcf9e15e45 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 17 Jul 2022 19:16:13 -0400 Subject: [PATCH 189/208] some style fixes --- src/battle_util.c | 6 +++--- src/battle_z_move.c | 38 +++++++++++++++++++------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index e1ce94f5f..044e36adb 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -9733,7 +9733,7 @@ static bool32 IsUnnerveAbilityOnOpposingSide(u8 battlerId) return FALSE; } -// photon geyser & light that burns the sky +// Photon geyser & light that burns the sky u8 GetSplitBasedOnStats(u8 battlerId) { u32 attack = gBattleMons[battlerId].attack; @@ -9769,7 +9769,7 @@ struct Pokemon *GetBattlerPartyData(u8 battlerId) return mon; } -//Make sure the input bank is any bank on the specific mon's side +// Make sure the input bank is any bank on the specific mon's side bool32 CanFling(u8 battlerId) { u16 item = gBattleMons[battlerId].item; @@ -9788,7 +9788,7 @@ bool32 CanFling(u8 battlerId) return TRUE; } -// ability checks +// Ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability) { u32 i; diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 747281a8e..939418434 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -181,18 +181,18 @@ bool32 IsViableZMove(u8 battlerId, u16 move) #endif if (mega->alreadyEvolved[battlerPosition]) - return FALSE; // trainer has mega evolved + return FALSE; // Trainer has mega evolved if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { if (IsPartnerMonFromSameTrainer(battlerId) && (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)]))) - return FALSE; //partner has mega evolved or is about to mega evolve + return FALSE; // Partner has mega evolved or is about to mega evolve } if (B_ENABLE_DEBUG && gBattleStruct->debugHoldEffects[battlerId]) holdEffect = gBattleStruct->debugHoldEffects[battlerId]; else if (item == ITEM_ENIGMA_BERRY) - return FALSE; //holdEffect = gEnigmaBerries[battlerId].holdEffect; + return FALSE; // HoldEffect = gEnigmaBerries[battlerId].holdEffect; else holdEffect = ItemId_GetHoldEffect(item); @@ -205,7 +205,7 @@ bool32 IsViableZMove(u8 battlerId, u16 move) u16 zMove = GetSignatureZMove(move, gBattleMons[battlerId].species, item); if (zMove != MOVE_NONE) { - gBattleStruct->zmove.chosenZMove = zMove; //signature z move exists + gBattleStruct->zmove.chosenZMove = zMove; // Signature z move exists return TRUE; } @@ -237,7 +237,7 @@ void GetUsableZMoves(u8 battlerId, u16 *moves) bool32 IsZMoveUsable(u8 battlerId, u16 moveIndex) { if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsPartnerMonFromSameTrainer(battlerId) && gBattleStruct->zmove.toBeUsed[BATTLE_PARTNER(battlerId)] != MOVE_NONE) - return FALSE; //player's other mon has a z move queued up already + return FALSE; // Player's other mon has a z move queued up already if (gBattleStruct->zmove.possibleZMoves[battlerId] & (1 << moveIndex)) return TRUE; return FALSE; @@ -248,9 +248,9 @@ bool32 TryChangeZIndicator(u8 battlerId, u8 moveIndex) bool32 viableZMove = IsZMoveUsable(battlerId, moveIndex); if (gBattleStruct->zmove.viable && !viableZMove) - HideZMoveTriggerSprite(); //was a viable z move, now is not -> slide out + HideZMoveTriggerSprite(); // Was a viable z move, now is not -> slide out else if (!gBattleStruct->zmove.viable && viableZMove) - ShowZMoveTriggerSprite(); //was not a viable z move, now is -> slide back in + ShowZMoveTriggerSprite(); // Was not a viable z move, now is -> slide back in } #define SINGLES_Z_TRIGGER_POS_X_OPTIMAL (30) @@ -380,7 +380,7 @@ static u16 GetSignatureZMove(u16 move, u16 species, u16 item) { u32 i; - // check signature z move + // Check signature z move for (i = 0; i < ARRAY_COUNT(sSignatureZMoves); ++i) { if (sSignatureZMoves[i].item == item && sSignatureZMoves[i].species == species && sSignatureZMoves[i].move == move) @@ -394,7 +394,7 @@ static u16 GetTypeBasedZMove(u16 move, u8 battler) { u8 moveType = gBattleMoves[move].type; - // get z move from type + // Get z move from type if (moveType < TYPE_FIRE) return MOVE_BREAKNECK_BLITZ + moveType; else if (moveType >= TYPE_FAIRY) @@ -413,7 +413,7 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) gBattleStruct->zmove.viewing = TRUE; if (zmove != MOVE_NONE) { - // clear move slots + // Clear move slots for (i = 0; i < MAX_MON_MOVES; ++i) { MoveSelectionDestroyCursorAt(i); @@ -499,16 +499,16 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) break; } - BattlePutTextOnWindow(gDisplayedStringBattle, 5); //Slot of Move 3 + BattlePutTextOnWindow(gDisplayedStringBattle, 5); // Slot of Move 3 gDisplayedStringBattle[0] = CHAR_Z; gDisplayedStringBattle[1] = CHAR_HYPHEN; StringCopy(gDisplayedStringBattle + 2, gMoveNames[move]); } else if (zmove == MOVE_EXTREME_EVOBOOST) { - //damaging move -> status z move + // Damaging move -> status z move StringCopy(gDisplayedStringBattle, sText_StatsPlus2); - BattlePutTextOnWindow(gDisplayedStringBattle, 5); //Slot of Move 3 + BattlePutTextOnWindow(gDisplayedStringBattle, 5); // Slot of Move 3 StringCopy(gDisplayedStringBattle, GetZMoveName(zmove)); } else @@ -516,7 +516,7 @@ bool32 MoveSelectionDisplayZMove(u16 zmove) ZMoveSelectionDisplayPower(move, zmove); StringCopy(gDisplayedStringBattle, GetZMoveName(zmove)); } - BattlePutTextOnWindow(gDisplayedStringBattle, 3); //first move slot + BattlePutTextOnWindow(gDisplayedStringBattle, 3); // First move slot ZMoveSelectionDisplayPpNumber(); MoveSelectionCreateCursorAt(0, 0); @@ -538,7 +538,7 @@ static void ZMoveSelectionDisplayPower(u16 move, u16 zMove) { txtPtr = StringCopy(gDisplayedStringBattle, sText_PowerColon); ConvertIntToDecimalStringN(txtPtr, power, STR_CONV_MODE_LEFT_ALIGN, 3); - BattlePutTextOnWindow(gDisplayedStringBattle, 5); //bottom left + BattlePutTextOnWindow(gDisplayedStringBattle, 5); // Bottom left } } @@ -547,7 +547,7 @@ static void ZMoveSelectionDisplayPpNumber(void) u8 *txtPtr; struct ChooseMoveStruct *moveInfo; - if (gBattleResources->bufferA[gActiveBattler][2] == TRUE) // check if we didn't want to display pp number + if (gBattleResources->bufferA[gActiveBattler][2] == TRUE) // Check if we didn't want to display pp number return; SetPpNumbersPaletteInMoveSelection(); @@ -563,7 +563,7 @@ const u8* GetZMoveName(u16 move) if (IsZMove(move)) return gZMoveNames[move - MOVE_BREAKNECK_BLITZ]; else - return gZMoveNames[0]; //failsafe + return gZMoveNames[0]; // Failsafe } #define Z_EFFECT_BS_LENGTH 3 @@ -582,7 +582,7 @@ void SetZEffect(void) gBattleStruct->zmove.effect = Z_EFFECT_ATK_UP_1; } - gBattleScripting.savedStatChanger = gBattleScripting.statChanger; // save used move's stat changer (e.g. for Z-Growl) + gBattleScripting.savedStatChanger = gBattleScripting.statChanger; // Save used move's stat changer (e.g. for Z-Growl) gBattleScripting.battler = gBattlerAttacker; switch (gBattleStruct->zmove.effect) @@ -600,7 +600,7 @@ void SetZEffect(void) case Z_EFFECT_ALL_STATS_UP_1: if (!AreStatsMaxed(gBattlerAttacker, STAT_SPDEF)) { - for (i = 0; i < STAT_ACC - 1; i++) //Doesn't increase Acc or Evsn + for (i = 0; i < STAT_ACC - 1; i++) // Doesn't increase Acc or Evsn { if (gBattleMons[gBattlerAttacker].statStages[i] < 12) ++gBattleMons[gBattlerAttacker].statStages[i]; From 1dcbf5968695900526369fe7ca3ef2a6dfe3e3ad Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 18 Jul 2022 08:11:02 -0400 Subject: [PATCH 190/208] Config for Plus and Minus interaction --- include/constants/battle_config.h | 1 + src/battle_util.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index a6f24a0c6..27e3b6f53 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -191,6 +191,7 @@ #define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned. #define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. It also activates Rattled. #define B_OBLIVIOUS_TAUNT GEN_7 // In Gen6+, Pokémon with Oblivious can't be taunted. +#define B_PLUS_MINUS_INTERACTION GEN_7 // In Gen5+, Plus and Minus can be activated with themselves and the opposite ability. Before, only the opposing ability could activate it. // Item settings #define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. diff --git a/src/battle_util.c b/src/battle_util.c index 0440cfba0..57486558a 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8657,6 +8657,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b if (moveType == TYPE_GRASS && gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 3)) MulModifier(&modifier, UQ_4_12(1.5)); break; + #if B_PLUS_MINUS_INTERACTION >= GEN_5 case ABILITY_PLUS: case ABILITY_MINUS: if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) @@ -8666,6 +8667,24 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b MulModifier(&modifier, UQ_4_12(1.5)); } break; + #else + case ABILITY_PLUS: + if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) + { + u32 partnerAbility = GetBattlerAbility(BATTLE_PARTNER(battlerAtk)); + if (partnerAbility == ABILITY_MINUS) + MulModifier(&modifier, UQ_4_12(1.5)); + } + break; + case ABILITY_MINUS: + if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) + { + u32 partnerAbility = GetBattlerAbility(BATTLE_PARTNER(battlerAtk)); + if (partnerAbility == ABILITY_PLUS) + MulModifier(&modifier, UQ_4_12(1.5)); + } + break; + #endif case ABILITY_FLOWER_GIFT: if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move)) MulModifier(&modifier, UQ_4_12(1.5)); From 18affe8c1ab1bff1e678f8e2351ec59b04f3b5e0 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Mon, 18 Jul 2022 09:21:59 -0400 Subject: [PATCH 191/208] new z move indicator, credits to blackforest --- graphics/battle_interface/z_move_trigger.pal | 19 --------------- graphics/battle_interface/z_move_trigger.png | Bin 272 -> 255 bytes src/battle_z_move.c | 23 ++++++++++--------- 3 files changed, 12 insertions(+), 30 deletions(-) delete mode 100644 graphics/battle_interface/z_move_trigger.pal diff --git a/graphics/battle_interface/z_move_trigger.pal b/graphics/battle_interface/z_move_trigger.pal deleted file mode 100644 index 2672d1f10..000000000 --- a/graphics/battle_interface/z_move_trigger.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -185 207 163 -77 105 97 -199 159 199 -221 177 207 -57 151 117 -139 221 253 -247 161 133 -255 255 255 -153 87 67 -233 233 125 -129 255 223 -149 147 247 -195 207 201 -123 151 135 -0 0 0 -0 0 0 diff --git a/graphics/battle_interface/z_move_trigger.png b/graphics/battle_interface/z_move_trigger.png index 9a9c5d937abc948679d39a39bf302822a9f1ff45..1b2b30a1279c0b4b81ffcf52ed18bb219d608b3c 100644 GIT binary patch delta 216 zcmbQh^q+Bpe*KFV0Y83ZRAeM{RAf|7Z$EH=;m403A3h{7V1QY|^^1UlU7jwEAsQ2( zPT0-MWGLVwYxyn4#m1faS{K`evW9I8;SXiB79_tBu6Uc>IQ{L5w?BjrIXZF~fBbaH zJ7C_O%Ssc@tY&x@cbSFZ%t_XgJ*t6DR{867CukX!GN_qW2PAwGkao=3eDbUguj5z0 zP~XLjr&hnpU%Dk>bx2LKUc;IrC8v(@{n>c@tbhC$`5J}_Es2In8{UL~-0JD-=d#Wz Gp$P!A8(RGU delta 233 zcmey*IDu(`e*N+J$M0@DZ#liR`|jWG3tRvH|35R_`Q^*n#{c)HPX2!Q{K@L+?F?X0 zmSWWcWN;REL>4nJh^c}wqi2xH2cTe^r;B5V#>C`=28K9CHjx9`D>{zt&*@Mq2)rQ{ z+PYxlf`_}?nK)#N-ZwCKHoTXebzpb7KWih0VnI@1h}pZjISMfi;Q?k(?q2TRSkTzr z)b##dXT@5f25o^U)!VZ=?^rXYuqr4tEMZ_t*cQ{mVUyj$#UR?y5V1~Sl68ZF(+8%k eh6SJ9IT#q^j+o_pOfTIGa slide back in } -#define SINGLES_Z_TRIGGER_POS_X_OPTIMAL (30) -#define SINGLES_Z_TRIGGER_POS_X_PRIORITY (31) -#define SINGLES_Z_TRIGGER_POS_X_SLIDE (15) -#define SINGLES_Z_TRIGGER_POS_Y_DIFF (-11) +#define SINGLES_Z_TRIGGER_POS_X_OPTIMAL (29) +#define SINGLES_Z_TRIGGER_POS_X_PRIORITY (29) +#define SINGLES_Z_TRIGGER_POS_X_SLIDE (15) +#define SINGLES_Z_TRIGGER_POS_Y_DIFF (-11) -#define DOUBLES_Z_TRIGGER_POS_X_OPTIMAL (30) -#define DOUBLES_Z_TRIGGER_POS_X_PRIORITY (31) -#define DOUBLES_Z_TRIGGER_POS_X_SLIDE (15) -#define DOUBLES_Z_TRIGGER_POS_Y_DIFF (-4) +#define DOUBLES_Z_TRIGGER_POS_X_OPTIMAL SINGLES_Z_TRIGGER_POS_X_OPTIMAL +#define DOUBLES_Z_TRIGGER_POS_X_PRIORITY SINGLES_Z_TRIGGER_POS_X_PRIORITY +#define DOUBLES_Z_TRIGGER_POS_X_SLIDE SINGLES_Z_TRIGGER_POS_X_SLIDE +#define DOUBLES_Z_TRIGGER_POS_Y_DIFF (-4) #define tBattler data[0] #define tHide data[1] @@ -330,13 +330,14 @@ static void SpriteCB_ZMoveTrigger(struct Sprite *sprite) else { if (sprite->x != gSprites[gHealthboxSpriteIds[sprite->tBattler]].x - xOptimal) + { sprite->x--; - - if (sprite->x >= gSprites[gHealthboxSpriteIds[sprite->tBattler]].x - xPriority) sprite->oam.priority = 2; + } else + { sprite->oam.priority = 1; - + } sprite->y = gSprites[gHealthboxSpriteIds[sprite->tBattler]].y - yDiff; sprite->y2 = gSprites[gHealthboxSpriteIds[sprite->tBattler]].y2 - yDiff; } From e55fea47f3448149347148b7280b78301bac99cb Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 18 Jul 2022 09:24:08 -0400 Subject: [PATCH 192/208] Added missing MOVE_UNAVAILABLE to Gorilla Tactics check --- src/battle_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 8de0bd5a2..d01b55e2b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1893,7 +1893,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } if ((GetBattlerAbility(gActiveBattler) == ABILITY_GORILLA_TACTICS) && *choicedMove != MOVE_NONE - && *choicedMove != 0xFFFF && *choicedMove != move) + && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move) { gCurrentMove = *choicedMove; gLastUsedItem = gBattleMons[gActiveBattler].item; @@ -1977,7 +1977,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check) else if (gBattleMons[battlerId].moves[i] == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES) unusableMoves |= gBitTable[i]; // Gorilla Tactics - else if (GetBattlerAbility(battlerId) == ABILITY_GORILLA_TACTICS && *choicedMove != MOVE_NONE && *choicedMove != 0xFFFF && *choicedMove != gBattleMons[battlerId].moves[i]) + else if (GetBattlerAbility(battlerId) == ABILITY_GORILLA_TACTICS && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i]) unusableMoves |= gBitTable[i]; } return unusableMoves; From f2ee9f3ba039f10f81abda5208c6849d99a99988 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Mon, 18 Jul 2022 09:44:04 -0400 Subject: [PATCH 193/208] tweak z indicator position relative to healthbox --- graphics/battle_interface/z_move_trigger.png | Bin 255 -> 351 bytes src/battle_z_move.c | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/battle_interface/z_move_trigger.png b/graphics/battle_interface/z_move_trigger.png index 1b2b30a1279c0b4b81ffcf52ed18bb219d608b3c..5e27dbabbe83560938b5871700ea63f0a8158dd5 100644 GIT binary patch delta 264 zcmey*c%Ny4N;rFor>`sfGj<_fWsX0=wbl#_4B{oO5hcO-X(i=}MX3z#J}v=%?h0k8 zMGD4xCWWm_9s-qcloa^617(bXYzD6eO?e>2lJ4m1$iT3%pZiZD>qJHSdd4JgcbET5 z**_fx$~JqtIEGZrdD^#8kjapTMb`40py2(>4erj&Jyr=J4XX>zg@2H3me}w{s_yXI z%X5Q%T?)A5v+rH0;M=2Xbr>g=@-{?YsbOM>@Md}7;@xK9e#Oi~d}iE9gO{a3XWwX= zt(`IR&e^ Date: Mon, 18 Jul 2022 13:10:27 -0400 Subject: [PATCH 194/208] Config for Explosion halving defense --- include/constants/battle_config.h | 1 + src/battle_util.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index a6f24a0c6..237b95da2 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -125,6 +125,7 @@ #define B_ROUGH_SKIN_DMG GEN_7 // In Gen4+, Rough Skin contact damage is 1/8th of max HP instead of 1/16th. This will also affect Iron Barbs. #define B_KNOCK_OFF_DMG GEN_8 // In Gen6+, Knock Off deals 50% more damage when knocking off an item. #define B_SPORT_DMG_REDUCTION GEN_7 // In Gen5+, Water/Mud Sport reduce Fire/Electric Damage by 67% instead of 50%. +#define B_EXPLOSION_DEFENSE GEN_7 // In Gen5+, Self-Destruct and Explosion don't halve the targets' defense. // Type settings #define B_GHOSTS_ESCAPE GEN_7 // In Gen6+, abilities like Shadow Tag or moves like Mean Look fail on Ghost-type Pokémon. They can also escape any Wild Battle. diff --git a/src/battle_util.c b/src/battle_util.c index 0440cfba0..55485e568 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8794,6 +8794,12 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, usesDefStat = FALSE; } + #if B_EXPLOSION_DEFENSE <= GEN_4 + // Self-destruct / Explosion cut defense in half + if (gBattleMoves[gCurrentMove].effect == EFFECT_EXPLOSION) + defStat /= 2; + #endif + // critical hits ignore positive stat changes if (isCrit && defStage > DEFAULT_STAT_STAGE) defStage = DEFAULT_STAT_STAGE; From 2b5bb9f6e405da2c4af2f2d64c68d95864e4da37 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Tue, 19 Jul 2022 18:24:53 -0400 Subject: [PATCH 195/208] move gSwapDamagecategory to battle struct, use GetSplitBasedOnStats for photon geyser check --- asm/macros/battle_script.inc | 4 ++-- data/battle_scripts_1.s | 2 +- include/battle.h | 2 +- include/constants/z_move_effects.h | 2 +- src/battle_anim_new.c | 2 +- src/battle_main.c | 3 +-- src/battle_script_commands.c | 22 +++------------------- src/battle_util.c | 6 +++--- 8 files changed, 13 insertions(+), 30 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 7875364f1..ff246955a 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1928,8 +1928,8 @@ .4byte \ptr .endm - .macro photongeysercheck - various BS_ATTACKER, VARIOUS_PHOTON_GEYSER_CHECK + .macro photongeysercheck battler:req + various \battler, VARIOUS_PHOTON_GEYSER_CHECK .endm .macro shellsidearmcheck diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 03ab6802c..4afb9c87e 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -722,7 +722,7 @@ BattleScript_EffectPhotonGeyser: critcalc damagecalc adjustdamage - photongeysercheck + photongeysercheck BS_ATTACKER attackanimation waitanimation effectivenesssound diff --git a/include/battle.h b/include/battle.h index 185c509df..38e14b734 100644 --- a/include/battle.h +++ b/include/battle.h @@ -615,6 +615,7 @@ struct BattleStruct u8 quickClawBattlerId; struct StolenItem itemStolen[PARTY_SIZE]; // Player's team that had items stolen (two bytes per party member) u8 blunderPolicy:1; // should blunder policy activate + u8 swapDamageCategory:1; u8 ballSpriteIds[2]; // item gfx, window gfx u8 stickyWebUser; u8 appearedInBattle; // Bitfield to track which Pokemon appeared in battle. Used for Burmy's form change @@ -938,7 +939,6 @@ extern u8 gBattleControllerData[MAX_BATTLERS_COUNT]; extern bool8 gHasFetchedBall; extern u8 gLastUsedBall; extern u16 gLastThrownBall; -extern bool8 gSwapDamageCategory; // Photon Geyser, Shell Side Arm, Light That Burns the Sky extern u8 gPartyCriticalHits[PARTY_SIZE]; #endif // GUARD_BATTLE_H diff --git a/include/constants/z_move_effects.h b/include/constants/z_move_effects.h index 8b77596ef..ce4d5c4ad 100644 --- a/include/constants/z_move_effects.h +++ b/include/constants/z_move_effects.h @@ -35,4 +35,4 @@ #define Z_EFFECT_EVSN_UP_3 28 -#endif // GUARD_Z_MOVE_EFFECTS_H \ No newline at end of file +#endif // GUARD_Z_MOVE_EFFECTS_H diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index f737aee80..96faf23dd 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -7867,7 +7867,7 @@ void AnimTask_PrimalReversion(u8 taskId) void AnimTask_ShellSideArm(u8 taskId) { - if (gSwapDamageCategory) + if (gBattleStruct->swapDamageCategory) gBattleAnimArgs[0] = TRUE; else gBattleAnimArgs[0] = FALSE; diff --git a/src/battle_main.c b/src/battle_main.c index 0d001d6f6..ff8b6a58d 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -239,7 +239,6 @@ EWRAM_DATA struct TotemBoost gTotemBoosts[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA bool8 gHasFetchedBall = FALSE; EWRAM_DATA u8 gLastUsedBall = 0; EWRAM_DATA u16 gLastThrownBall = 0; -EWRAM_DATA bool8 gSwapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky EWRAM_DATA u8 gPartyCriticalHits[PARTY_SIZE] = {0}; EWRAM_DATA static u8 sTriedEvolving = 0; @@ -3007,7 +3006,7 @@ static void BattleStartClearSetData(void) gPartyCriticalHits[i] = 0; } - gSwapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky + gBattleStruct->swapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky } void SwitchInClearSetData(void) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 0de1725e8..eb3f32269 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9404,24 +9404,8 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 9; return; case VARIOUS_PHOTON_GEYSER_CHECK: - { - u32 attackerAtkStat = gBattleMons[gBattlerAttacker].attack; - u8 attackerAtkStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; - u32 attackerSpAtkStat = gBattleMons[gBattlerAttacker].spAttack; - - gSwapDamageCategory = FALSE; - - attackerAtkStat *= gStatStageRatios[attackerAtkStage][0]; - attackerAtkStat /= gStatStageRatios[attackerAtkStage][1]; - - attackerAtkStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK]; - attackerSpAtkStat *= gStatStageRatios[attackerAtkStage][0]; - attackerSpAtkStat /= gStatStageRatios[attackerAtkStage][1]; - - if (attackerAtkStat > attackerSpAtkStat) - gSwapDamageCategory = TRUE; + gBattleStruct->swapDamageCategory = (GetSplitBasedOnStats(gActiveBattler) == SPLIT_SPECIAL); break; - } case VARIOUS_SHELL_SIDE_ARM_CHECK: // 0% chance GameFreak actually checks this way according to DaWobblefet, but this is the only functional explanation at the moment { u32 attackerAtkStat = gBattleMons[gBattlerAttacker].attack; @@ -9432,7 +9416,7 @@ static void Cmd_various(void) u32 physical; u32 special; - gSwapDamageCategory = FALSE; + gBattleStruct->swapDamageCategory = FALSE; statStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; attackerAtkStat *= gStatStageRatios[statStage][0]; @@ -9455,7 +9439,7 @@ static void Cmd_various(void) special = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gBattleMoves[gCurrentMove].power * attackerSpAtkStat) / targetSpDefStat) / 50); if (((physical > special) || (physical == special && (Random() % 2) == 0))) - gSwapDamageCategory = TRUE; + gBattleStruct->swapDamageCategory = TRUE; break; } case VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED: diff --git a/src/battle_util.c b/src/battle_util.c index 044e36adb..bfbfb8993 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7740,7 +7740,7 @@ bool32 IsMoveMakingContact(u16 move, u8 battlerAtk) { if (!(gBattleMoves[move].flags & FLAG_MAKES_CONTACT)) { - if (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gSwapDamageCategory) + if (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gBattleStruct->swapDamageCategory) return TRUE; else return FALSE; @@ -7773,7 +7773,7 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) // Protective Pads doesn't stop Unseen Fist from bypassing Protect effects, so IsMoveMakingContact() isn't used here. // This means extra logic is needed to handle Shell Side Arm. if (GetBattlerAbility(gBattlerAttacker) == ABILITY_UNSEEN_FIST - && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT || (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gSwapDamageCategory))) + && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT || (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gBattleStruct->swapDamageCategory))) return FALSE; else if (!(gBattleMoves[move].flags & FLAG_PROTECT_AFFECTED)) return FALSE; @@ -9685,7 +9685,7 @@ u8 GetBattleMoveSplit(u32 moveId) { if (gBattleStruct != NULL && gBattleStruct->zmove.active && !IS_MOVE_STATUS(moveId)) return gBattleStruct->zmove.activeSplit; - if (gSwapDamageCategory) // Photon Geyser, Shell Side Arm, Light That Burns the Sky + if (gBattleStruct != NULL && gBattleStruct->swapDamageCategory) // Photon Geyser, Shell Side Arm, Light That Burns the Sky return SPLIT_PHYSICAL; else if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) return gBattleMoves[moveId].split; From 99424e1aafe2239116ad91443124c81d5c08fb85 Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Tue, 19 Jul 2022 19:03:05 -0400 Subject: [PATCH 196/208] Update include/battle.h Co-authored-by: Eduardo Quezada D'Ottone --- include/battle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/battle.h b/include/battle.h index 38e14b734..b56b381e7 100644 --- a/include/battle.h +++ b/include/battle.h @@ -615,7 +615,7 @@ struct BattleStruct u8 quickClawBattlerId; struct StolenItem itemStolen[PARTY_SIZE]; // Player's team that had items stolen (two bytes per party member) u8 blunderPolicy:1; // should blunder policy activate - u8 swapDamageCategory:1; + u8 swapDamageCategory:1; // Photon Geyser, Shell Side Arm, Light That Burns the Sky u8 ballSpriteIds[2]; // item gfx, window gfx u8 stickyWebUser; u8 appearedInBattle; // Bitfield to track which Pokemon appeared in battle. Used for Burmy's form change From cb3411971109a7d2d86748ed96b770a0ec615f56 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 20 Jul 2022 10:13:18 -0400 Subject: [PATCH 197/208] Config for Charge raising Sp. Def. --- data/battle_scripts_1.s | 2 ++ include/constants/battle_config.h | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 4afb9c87e..1635f7ba8 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -5544,6 +5544,7 @@ BattleScript_EffectCharge:: setcharge attackanimation waitanimation +.if B_CHARGE_SPDEF_RAISE >= GEN_5 setstatchanger STAT_SPDEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_EffectChargeString jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_EffectChargeString @@ -5552,6 +5553,7 @@ BattleScript_EffectCharge:: printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_EffectChargeString: +.endif printstring STRINGID_PKMNCHARGINGPOWER waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index c9b64d1a5..91f5634a5 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -183,14 +183,10 @@ // Move data settings #define B_UPDATED_MOVE_DATA GEN_8 // Updates move data in gBattleMoves, including Power, Accuracy, PP, stat changes, targets, chances of secondary effects, etc. #define B_PHYSICAL_SPECIAL_SPLIT GEN_7 // In Gen3, the move's type determines if it will do physical or special damage. The split icon in the summary will reflect this. -#define B_FELL_STINGER_STAT_RAISE GEN_7 // In Gen7+, it raises Atk by 3 stages instead of 2 if it causes the target to faint. -#define B_KINGS_SHIELD_LOWER_ATK GEN_7 // In Gen7+, it lowers Atk by 1 stage instead of 2 of oponents that hit it. -#define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage. #define B_RECOIL_IF_MISS_DMG GEN_7 // In Gen5+, Jump Kick and High Jump Kick will always do half of the user's max HP when missing. #define B_KLUTZ_FLING_INTERACTION GEN_7 // In Gen5+, Pokémon with the Klutz ability can't use Fling. #define B_UPDATED_CONVERSION GEN_7 // In Gen6+, Conversion changes the user's type to match their first move's. Before, it would choose a move at random. #define B_PP_REDUCED_BY_SPITE GEN_7 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5. -#define B_MINIMIZE_EVASION GEN_7 // In Gen5+, Minimize raises evasion by 2 stages instead of 1. // Move accuracy settings #define B_TOXIC_NEVER_MISS GEN_7 // In Gen6+, if Toxic is used by a Poison-type Pokémon, it will never miss. @@ -198,6 +194,14 @@ #define B_BLIZZARD_HAIL GEN_7 // In Gen4+, Blizzard bypasses accuracy checks if it's hailing. #define B_SHEER_COLD_ACC GEN_7 // In Gen7+, Sheer Cold's base chance of hitting is reduced to 20% if the user isn't Ice-typed. +// Move stat change settings +#define B_FELL_STINGER_STAT_RAISE GEN_7 // In Gen7+, it raises Atk by 3 stages instead of 2 if it causes the target to faint. +#define B_KINGS_SHIELD_LOWER_ATK GEN_7 // In Gen7+, it lowers Atk by 1 stage instead of 2 of oponents that hit it. +#define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage. +#define B_CHARGE_SPDEF_RAISE GEN_7 // In Gen5+, Charge raises the user's Special Defense by 1 stage. +#define B_MINIMIZE_EVASION GEN_7 // In Gen5+, Minimize raises evasion by 2 stages instead of 1. +#define B_GROWTH_UNDER_SUN GEN_7 // In Gen5+, Growth's effects are doubled when under the effects of the sun. + // Other move settings #define B_SOUND_SUBSTITUTE GEN_7 // In Gen6+, sound moves bypass Substitute. #define B_INCINERATE_GEMS GEN_7 // In Gen6+, Incinerate can destroy Gems. @@ -212,7 +216,6 @@ #define B_HEAL_BLOCKING GEN_7 // In Gen5+, Heal Block prevents healing by Black Sludge, Leftovers, Shell Bell. Affected Pokémon will not consume held HP-restoring Berries or Berry Juice. // Draining abilities will not heal but will prevent damage. In Gen6+, Heal Block prevents the use of most HP-draining moves. #define B_ROOTED_GROUNDING GEN_7 // In Gen4+, Ingrain causes the affected Pokémon to become grounded. -#define B_GROWTH_UNDER_SUN GEN_7 // In Gen5+, Growth's effects are doubled when under the effects of the sun. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. From e14afd8957937921c9fba9721f2e4b767ee24269 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 20 Jul 2022 10:33:18 -0400 Subject: [PATCH 198/208] Added Growth's Atk. raise to the its configuration, as that was also introduced in Gen 5. --- data/battle_scripts_1.s | 4 ---- include/constants/battle_config.h | 2 +- src/data/battle_moves.h | 6 +++++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 1635f7ba8..145ea7004 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2154,9 +2154,7 @@ BattleScript_GrowthDoMoveAnim:: waitanimation setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPATK, 0 -.if B_GROWTH_UNDER_SUN >= GEN_5 jumpifweatheraffected BS_ATTACKER, B_WEATHER_SUN, BattleScript_GrowthAtk2 -.endif setstatchanger STAT_ATK, 1, FALSE goto BattleScript_GrowthAtk BattleScript_GrowthAtk2: @@ -2167,9 +2165,7 @@ BattleScript_GrowthAtk: printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_GrowthTrySpAtk:: -.if B_GROWTH_UNDER_SUN >= GEN_5 jumpifweatheraffected BS_ATTACKER, B_WEATHER_SUN, BattleScript_GrowthSpAtk2 -.endif setstatchanger STAT_SPATK, 1, FALSE goto BattleScript_GrowthSpAtk BattleScript_GrowthSpAtk2: diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 91f5634a5..1d1782def 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -200,7 +200,7 @@ #define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage. #define B_CHARGE_SPDEF_RAISE GEN_7 // In Gen5+, Charge raises the user's Special Defense by 1 stage. #define B_MINIMIZE_EVASION GEN_7 // In Gen5+, Minimize raises evasion by 2 stages instead of 1. -#define B_GROWTH_UNDER_SUN GEN_7 // In Gen5+, Growth's effects are doubled when under the effects of the sun. +#define B_GROWTH_STAT_RAISE GEN_7 // In Gen5+, Growth raises Attack in addition to Special Attack by 1 stage each. Under the effects of the sun, it raises them by 2 stages each instead. // Other move settings #define B_SOUND_SUBSTITUTE GEN_7 // In Gen6+, sound moves bypass Substitute. diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 6d7ec5dfc..b1178a584 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -1321,7 +1321,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #else .pp = 40, #endif - .effect = EFFECT_GROWTH, + #if B_GROWTH_STAT_RAISE >= GEN_5 + .effect = EFFECT_GROWTH, + #else + .effect = EFFECT_SPECIAL_ATTACK_UP, + #endif .power = 0, .type = TYPE_NORMAL, .accuracy = 0, From f00beac3f92beab7c84671f0b10f357f6875a899 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 20 Jul 2022 11:32:16 -0400 Subject: [PATCH 199/208] Updated Z-Move power for Gen 8 moves and moves with power varying by Gen --- src/data/battle_moves.h | 338 +++++++++++++++++++++++++++++++++------- 1 file changed, 284 insertions(+), 54 deletions(-) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 6d7ec5dfc..7700c1fdc 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -322,8 +322,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_4 .power = 90, + .zMovePower = 175, #else .power = 70, + .zMovePower = 140, #endif .effect = EFFECT_SEMI_INVULNERABLE, .type = TYPE_FLYING, @@ -334,7 +336,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 175, .zMoveEffect = Z_EFFECT_NONE, }, @@ -451,12 +452,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 100, .pp = 10, + .zMovePower = 180, #elif B_UPDATED_MOVE_DATA == GEN_4 .power = 85, .pp = 25, + .zMovePower = 160, #else .power = 70, .pp = 25, + .zMovePower = 140, #endif .effect = EFFECT_RECOIL_IF_MISS, .type = TYPE_FIGHTING, @@ -466,7 +470,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, - .zMovePower = 180, .zMoveEffect = Z_EFFECT_NONE, }, @@ -655,9 +658,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 120, .pp = 10, + .zMovePower = 190, #else .power = 90, .pp = 20, + .zMovePower = 175, #endif .effect = EFFECT_RAMPAGE, .type = TYPE_NORMAL, @@ -667,7 +672,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 190, .zMoveEffect = Z_EFFECT_NONE, }, @@ -992,8 +996,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 110, + .zMovePower = 185, #else .power = 120, + .zMovePower = 190, #endif .effect = EFFECT_HIT, .type = TYPE_WATER, @@ -1004,7 +1010,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 185, .zMoveEffect = Z_EFFECT_NONE, }, @@ -1056,8 +1061,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 110, + .zMovePower = 185, #else .power = 120, + .zMovePower = 190, #endif .effect = EFFECT_FREEZE_HIT, .type = TYPE_ICE, @@ -1068,7 +1075,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, - .zMovePower = 185, .zMoveEffect = Z_EFFECT_NONE, }, @@ -1419,12 +1425,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 120, .pp = 10, + .zMovePower = 190, #elif B_UPDATED_MOVE_DATA == GEN_4 .power = 90, .pp = 20, + .zMovePower = 175, #else .power = 70, .pp = 20, + .zMovePower = 140, #endif .effect = EFFECT_RAMPAGE, .type = TYPE_GRASS, @@ -1434,7 +1443,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DANCE, .split = SPLIT_SPECIAL, - .zMovePower = 190, .zMoveEffect = Z_EFFECT_NONE, }, @@ -1556,8 +1564,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 110, + .zMovePower = 185, #else .power = 120, + .zMovePower = 190, #endif .effect = EFFECT_THUNDER, .type = TYPE_ELECTRIC, @@ -1568,7 +1578,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_IN_AIR, .split = SPLIT_SPECIAL, - .zMovePower = 185, .zMoveEffect = Z_EFFECT_NONE, }, @@ -1624,8 +1633,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_4 .power = 80, + .zMovePower = 160, #else .power = 60, + .zMovePower = 120, #endif .effect = EFFECT_SEMI_INVULNERABLE, .type = TYPE_GROUND, @@ -1636,7 +1647,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 160, .zMoveEffect = Z_EFFECT_NONE, }, @@ -2217,8 +2227,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 110, + .zMovePower = 185, #else .power = 120, + .zMovePower = 190, #endif .effect = EFFECT_BURN_HIT, .type = TYPE_FIRE, @@ -2229,7 +2241,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, - .zMovePower = 185, .zMoveEffect = Z_EFFECT_NONE, }, @@ -2299,9 +2310,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 130, .pp = 10, + .zMovePower = 195, #else .power = 100, .pp = 15, + .zMovePower = 180, #endif .effect = EFFECT_SKULL_BASH, .type = TYPE_NORMAL, @@ -2311,7 +2324,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 195, .zMoveEffect = Z_EFFECT_NONE, }, @@ -2404,12 +2416,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 130, .pp = 10, + .zMovePower = 195, #elif B_UPDATED_MOVE_DATA == GEN_4 .power = 100, .pp = 20, + .zMovePower = 180, #else .power = 85, .pp = 20, + .zMovePower = 60, #endif .effect = EFFECT_RECOIL_IF_MISS, .type = TYPE_FIGHTING, @@ -2419,7 +2434,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, - .zMovePower = 195, .zMoveEffect = Z_EFFECT_NONE, }, @@ -2506,9 +2520,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_7 .power = 80, .pp = 10, + .zMovePower = 160, #else .power = 20, .pp = 15, + .zMovePower = 100, #endif .effect = EFFECT_ABSORB, .type = TYPE_BUG, @@ -2518,7 +2534,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 160, .zMoveEffect = Z_EFFECT_NONE, }, @@ -2708,12 +2723,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 100, .accuracy = 90, + .zMovePower = 180, #elif B_UPDATED_MOVE_DATA == GEN_5 .power = 90, .accuracy = 90, + .zMovePower = 175, #else .power = 90, .accuracy = 85, + .zMovePower = 175, #endif .effect = EFFECT_HIT, .type = TYPE_WATER, @@ -2723,7 +2741,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, - .zMovePower = 180, .zMoveEffect = Z_EFFECT_NONE, }, @@ -2982,9 +2999,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 60, .pp = 25, + .zMovePower = 120, #else .power = 40, .pp = 10, + .zMovePower = 100, #endif .effect = EFFECT_THIEF, .type = TYPE_DARK, @@ -2994,7 +3013,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, }, @@ -3426,8 +3444,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_4 .power = 120, + .zMovePower = 190, #else .power = 100, + .zMovePower = 180, #endif .effect = EFFECT_PARALYZE_HIT, .type = TYPE_ELECTRIC, @@ -3438,7 +3458,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, - .zMovePower = 190, .zMoveEffect = Z_EFFECT_NONE, }, @@ -3579,12 +3598,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 120, .pp = 10, + .zMovePower = 190, #elif B_UPDATED_MOVE_DATA == GEN_4 .power = 120, .pp = 15, + .zMovePower = 190, #else .power = 90, .pp = 15, + .zMovePower = 175, #endif .effect = EFFECT_RAMPAGE, .type = TYPE_DRAGON, @@ -3594,7 +3616,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 190, .zMoveEffect = Z_EFFECT_NONE, }, @@ -3619,12 +3640,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 75, .pp = 10, + .zMovePower = 140, #elif B_UPDATED_MOVE_DATA == GEN_4 .power = 60, .pp = 10, + .zMovePower = 120, #else .power = 60, .pp = 5, + .zMovePower = 120, #endif .effect = EFFECT_ABSORB, .type = TYPE_GRASS, @@ -3634,7 +3658,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 140, .zMoveEffect = Z_EFFECT_NONE, }, @@ -4436,14 +4459,17 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .power = 120, .accuracy = 100, .pp = 10, + .zMovePower = 190, #elif B_UPDATED_MOVE_DATA == GEN_5 .power = 100, .accuracy = 100, .pp = 10, + .zMovePower = 180, #else .power = 80, .accuracy = 90, .pp = 15, + .zMovePower = 160, #endif .effect = EFFECT_FUTURE_SIGHT, .type = TYPE_PSYCHIC, @@ -4452,7 +4478,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = 0, .split = SPLIT_SPECIAL, - .zMovePower = 190, .zMoveEffect = Z_EFFECT_NONE, }, @@ -4545,8 +4570,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 90, + .zMovePower = 175, #else .power = 50, + .zMovePower = 100, #endif .effect = EFFECT_UPROAR, .type = TYPE_NORMAL, @@ -4557,7 +4584,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, - .zMovePower = 175, .zMoveEffect = Z_EFFECT_NONE, }, @@ -4621,8 +4647,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 95, + .zMovePower = 175, #else .power = 100, + .zMovePower = 180, #endif .effect = EFFECT_BURN_HIT, .type = TYPE_FIRE, @@ -4633,7 +4661,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, - .zMovePower = 175, .zMoveEffect = Z_EFFECT_NONE, }, @@ -4761,8 +4788,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 70, + .zMovePower = 140, #else .power = 60, + .zMovePower = 120, #endif .effect = EFFECT_SMELLINGSALT, .type = TYPE_NORMAL, @@ -4774,7 +4803,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, .argument = STATUS1_PARALYSIS, - .zMovePower = 140, .zMoveEffect = Z_EFFECT_NONE, }, @@ -5060,8 +5088,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 65, + .zMovePower = 120, #else .power = 20, + .zMovePower = 100, #endif .effect = EFFECT_KNOCK_OFF, .type = TYPE_DARK, @@ -5072,7 +5102,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, }, @@ -5212,8 +5241,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_4 .power = 80, + .zMovePower = 160, #else .power = 60, + .zMovePower = 120, #endif .effect = EFFECT_SEMI_INVULNERABLE, .type = TYPE_WATER, @@ -5224,7 +5255,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 160, .zMoveEffect = Z_EFFECT_NONE, }, @@ -5521,9 +5551,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 90, .accuracy = 90, + .zMovePower = 175, #else .power = 100, .accuracy = 85, + .zMovePower = 180, #endif .effect = EFFECT_ATTACK_UP_HIT, .type = TYPE_STEEL, @@ -5533,7 +5565,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, - .zMovePower = 175, .zMoveEffect = Z_EFFECT_NONE, }, @@ -5609,8 +5640,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 60, + .zMovePower = 120, #else .power = 55, + .zMovePower = 100, #endif .effect = EFFECT_HIT, .type = TYPE_FLYING, @@ -5621,7 +5654,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_SPECIAL, - .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, }, @@ -5630,12 +5662,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 130, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 195, #elif B_UPDATED_MOVE_DATA == GEN_4 || B_UPDATED_MOVE_DATA == GEN_5 .power = 140, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 200, #else .power = 140, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 200, #endif .effect = EFFECT_OVERHEAT, .type = TYPE_FIRE, @@ -5645,7 +5680,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, - .zMovePower = 195, .zMoveEffect = Z_EFFECT_NONE, }, @@ -5679,10 +5713,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .power = 60, .accuracy = 95, .pp = 15, + .zMovePower = 120, #else .power = 50, .accuracy = 80, .pp = 10, + .zMovePower = 100, #endif .effect = EFFECT_SPEED_DOWN_HIT, .type = TYPE_ROCK, @@ -5691,7 +5727,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, - .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, }, @@ -6135,18 +6170,22 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .power = 60, .pp = 25, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + .zMovePower = 120, #elif B_UPDATED_MOVE_DATA == GEN_5 .power = 60, .pp = 40, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + .zMovePower = 120, #elif B_UPDATED_MOVE_DATA == GEN_4 .power = 40, .pp = 40, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + .zMovePower = 100, #else .power = 40, .pp = 40, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + .zMovePower = 100, #endif .effect = EFFECT_THIEF, .type = TYPE_NORMAL, @@ -6155,7 +6194,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, - .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, }, @@ -6232,8 +6270,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_4 .power = 90, + .zMovePower = 175, #else .power = 70, + .zMovePower = 140, #endif .effect = EFFECT_HIT, .type = TYPE_GRASS, @@ -6244,7 +6284,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, - .zMovePower = 175, .zMoveEffect = Z_EFFECT_NONE, }, @@ -6325,9 +6364,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 140, .accuracy = 100, + .zMovePower = 200, #else .power = 120, .accuracy = 85, + .zMovePower = 190, #endif .effect = EFFECT_FUTURE_SIGHT, .type = TYPE_STEEL, @@ -6337,7 +6378,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = 0, .split = SPLIT_SPECIAL, - .zMovePower = 200, .zMoveEffect = Z_EFFECT_NONE, }, @@ -6413,8 +6453,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 70, + .zMovePower = 140, #else .power = 60, + .zMovePower = 120, #endif .effect = EFFECT_WAKE_UP_SLAP, .type = TYPE_FIGHTING, @@ -6426,7 +6468,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, .argument = STATUS1_SLEEP, - .zMovePower = 140, .zMoveEffect = Z_EFFECT_NONE, }, @@ -6665,8 +6706,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 60, + .zMovePower = 120, #else .power = 50, + .zMovePower = 100, #endif .effect = EFFECT_ASSURANCE, .type = TYPE_DARK, @@ -6677,7 +6720,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, }, @@ -6925,8 +6967,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 140, + .zMovePower = 200, #else .power = 130, + .zMovePower = 195, #endif .effect = EFFECT_LAST_RESORT, .type = TYPE_NORMAL, @@ -6937,7 +6981,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 200, .zMoveEffect = Z_EFFECT_NONE, }, @@ -6961,8 +7004,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_7 .power = 70, + .zMovePower = 140, #else .power = 80, + .zMovePower = 160, #endif .effect = EFFECT_SUCKER_PUNCH, .type = TYPE_DARK, @@ -6973,7 +7018,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 140, .zMoveEffect = Z_EFFECT_NONE, }, @@ -7090,8 +7134,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 80, + .zMovePower = 160, #else .power = 90, + .zMovePower = 175, #endif .effect = EFFECT_HIT, .type = TYPE_FIGHTING, @@ -7102,7 +7148,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, - .zMovePower = 160, .zMoveEffect = Z_EFFECT_NONE, }, @@ -7266,8 +7311,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 85, + .zMovePower = 160, #else .power = 90, + .zMovePower = 175, #endif .effect = EFFECT_HIT, .type = TYPE_DRAGON, @@ -7278,7 +7325,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST, .split = SPLIT_SPECIAL, - .zMovePower = 160, .zMoveEffect = Z_EFFECT_NONE, }, @@ -7308,8 +7354,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 80, + .zMovePower = 160, #else .power = 70, + .zMovePower = 140, #endif .effect = EFFECT_HIT, .type = TYPE_ROCK, @@ -7320,7 +7368,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 160, .zMoveEffect = Z_EFFECT_NONE, }, @@ -7329,9 +7376,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 75, .pp = 10, + .zMovePower = 140, #else .power = 60, .pp = 5, + .zMovePower = 120, #endif .effect = EFFECT_ABSORB, .type = TYPE_FIGHTING, @@ -7341,7 +7390,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, - .zMovePower = 140, .zMoveEffect = Z_EFFECT_NONE, }, @@ -7381,8 +7429,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 90, + .zMovePower = 175, #else .power = 80, + .zMovePower = 160, #endif .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, .type = TYPE_GRASS, @@ -7393,7 +7443,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, - .zMovePower = 175, .zMoveEffect = Z_EFFECT_NONE, }, @@ -7756,8 +7805,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 130, + .zMovePower = 195, #else .power = 140, + .zMovePower = 200, #endif .effect = EFFECT_OVERHEAT, .type = TYPE_DRAGON, @@ -7768,7 +7819,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 195, .zMoveEffect = Z_EFFECT_NONE, }, @@ -7808,8 +7858,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 130, + .zMovePower = 195, #else .power = 140, + .zMovePower = 200, #endif .effect = EFFECT_OVERHEAT, .type = TYPE_GRASS, @@ -7820,7 +7872,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 195, .zMoveEffect = Z_EFFECT_NONE, }, @@ -8256,12 +8307,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 100, .accuracy = 75, + .zMovePower = 180, #elif B_UPDATED_MOVE_DATA == GEN_5 .power = 120, .accuracy = 75, + .zMovePower = 190, #else .power = 120, .accuracy = 70, + .zMovePower = 190, #endif .effect = EFFECT_TRAP, .type = TYPE_FIRE, @@ -8271,7 +8325,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 180, .zMoveEffect = Z_EFFECT_NONE, }, @@ -8557,8 +8610,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 60, + .zMovePower = 120, #else .power = 40, + .zMovePower = 100, #endif .effect = EFFECT_ALWAYS_CRIT, .type = TYPE_FIGHTING, @@ -8569,7 +8624,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, - .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, }, @@ -8646,9 +8700,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 120, .pp = 10, + .zMovePower = 190, #else .power = 70, .pp = 15, + .zMovePower = 140, #endif .effect = EFFECT_SYNCHRONOISE, .type = TYPE_PSYCHIC, @@ -8658,7 +8714,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 190, .zMoveEffect = Z_EFFECT_NONE, }, @@ -9067,8 +9122,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 60, + .zMovePower = 120, #else .power = 30, + .zMovePower = 100, #endif .effect = EFFECT_INCINERATE, .type = TYPE_FIRE, @@ -9079,7 +9136,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, }, @@ -9203,8 +9259,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 80, + .zMovePower = 160, #else .power = 50, + .zMovePower = 100, #endif .effect = EFFECT_PLEDGE, .type = TYPE_WATER, @@ -9215,7 +9273,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 160, .zMoveEffect = Z_EFFECT_NONE, }, @@ -9223,8 +9280,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 80, + .zMovePower = 160, #else .power = 50, + .zMovePower = 100, #endif .effect = EFFECT_PLEDGE, .type = TYPE_FIRE, @@ -9235,7 +9294,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 160, .zMoveEffect = Z_EFFECT_NONE, }, @@ -9243,8 +9301,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 80, + .zMovePower = 160, #else .power = 50, + .zMovePower = 100, #endif .effect = EFFECT_PLEDGE, .type = TYPE_GRASS, @@ -9255,7 +9315,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 160, .zMoveEffect = Z_EFFECT_NONE, }, @@ -9315,8 +9374,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 60, + .zMovePower = 120, #else .power = 40, + .zMovePower = 100, #endif .effect = EFFECT_ALWAYS_CRIT, .type = TYPE_ICE, @@ -9327,7 +9388,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, }, @@ -9615,8 +9675,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 110, + .zMovePower = 185, #else .power = 120, + .zMovePower = 190, #endif .effect = EFFECT_HURRICANE, .type = TYPE_FLYING, @@ -9627,7 +9689,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_IN_AIR, .split = SPLIT_SPECIAL, - .zMovePower = 185, .zMoveEffect = Z_EFFECT_NONE, }, @@ -9683,8 +9744,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 120, + .zMovePower = 190, #else .power = 85, + .zMovePower = 160, #endif .effect = EFFECT_CHANGE_TYPE_ON_ITEM, .type = TYPE_NORMAL, @@ -9696,7 +9759,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, .argument = HOLD_EFFECT_DRIVE, - .zMovePower = 190, .zMoveEffect = Z_EFFECT_NONE, }, @@ -10091,8 +10153,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_7 .power = 65, + .zMovePower = 120, #else .power = 50, + .zMovePower = 100, #endif .effect = EFFECT_ABSORB, .type = TYPE_ELECTRIC, @@ -10103,7 +10167,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .zMovePower = 120, .zMoveEffect = Z_EFFECT_NONE, }, @@ -10512,8 +10575,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_7 .power = 75, + .zMovePower = 140, #else .power = 65, + .zMovePower = 120, #endif .effect = EFFECT_SPECIAL_ATTACK_DOWN_HIT, .type = TYPE_FIRE, @@ -10524,7 +10589,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, - .zMovePower = 140, .zMoveEffect = Z_EFFECT_NONE, }, @@ -11748,8 +11812,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { #if B_UPDATED_MOVE_DATA >= GEN_8 .power = 120, + .zMovePower = 190, #else .power = 90, + .zMovePower = 175, #endif .effect = EFFECT_CHANGE_TYPE_ON_ITEM, .type = TYPE_NORMAL, @@ -11761,7 +11827,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, .argument = HOLD_EFFECT_MEMORY, - .zMovePower = 175, .zMoveEffect = Z_EFFECT_NONE, }, @@ -11820,11 +11885,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .effect = EFFECT_EVASION_UP_HIT, .pp = 10, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, + .zMovePower = 160, #else .effect = EFFECT_ALWAYS_CRIT, .power = 50, .pp = 15, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 100, #endif .type = TYPE_ELECTRIC, .accuracy = 100, @@ -11832,6 +11899,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 2, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPLISHY_SPLASH] = @@ -11850,6 +11918,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_BOTH, .priority = 0, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLOATY_FALL] = @@ -11868,6 +11938,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PIKA_PAPOW] = @@ -11886,6 +11958,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BOUNCY_BUBBLE] = @@ -11895,10 +11969,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .pp = 20, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .argument = 100, // restores 100% HP instead of 50% HP + .zMovePower = 120, #else .power = 90, .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_ABSORB, .type = TYPE_WATER, @@ -11907,6 +11983,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BUZZY_BUZZ] = @@ -11915,10 +11992,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .power = 60, .pp = 20, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 120, #else .power = 90, .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_PARALYZE_HIT, .type = TYPE_ELECTRIC, @@ -11927,6 +12006,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SIZZLY_SLIDE] = @@ -11935,10 +12015,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .power = 60, .pp = 20, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_THAW_USER, + .zMovePower = 120, #else .power = 90, .pp = 15, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_THAW_USER, + .zMovePower = 175, #endif .effect = EFFECT_BURN_HIT, .type = TYPE_FIRE, @@ -11947,6 +12029,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GLITZY_GLOW] = @@ -11955,10 +12038,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .power = 80, .accuracy = 95, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 160, #else .power = 90, .accuracy = 100, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_GLITZY_GLOW, .type = TYPE_PSYCHIC, @@ -11967,6 +12052,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BADDY_BAD] = @@ -11975,10 +12061,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .power = 80, .accuracy = 95, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 160, #else .power = 90, .accuracy = 100, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_BADDY_BAD, .type = TYPE_DARK, @@ -11987,6 +12075,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SAPPY_SEED] = @@ -11996,11 +12085,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .accuracy = 90, .pp = 10, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 180, #else .power = 90, .accuracy = 100, .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_SAPPY_SEED, .type = TYPE_GRASS, @@ -12008,6 +12099,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FREEZY_FROST] = @@ -12017,11 +12109,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .accuracy = 90, .pp = 10, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 180, #else .power = 90, .accuracy = 100, .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_FREEZY_FROST, .type = TYPE_ICE, @@ -12029,6 +12123,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPARKLY_SWIRL] = @@ -12038,11 +12133,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .accuracy = 85, .pp = 5, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 190, #else .power = 90, .accuracy = 100, .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_SPARKLY_SWIRL, .type = TYPE_FAIRY, @@ -12050,6 +12147,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VEEVEE_VOLLEY] = @@ -12068,6 +12166,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOUBLE_IRON_BASH] = @@ -12102,6 +12202,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SNIPE_SHOT] = @@ -12116,6 +12218,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_JAW_LOCK] = @@ -12130,6 +12234,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STUFF_CHEEKS] = @@ -12144,6 +12250,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_NO_RETREAT] = @@ -12158,6 +12266,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TAR_SHOT] = @@ -12172,6 +12282,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAGIC_POWDER] = @@ -12187,6 +12299,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, .argument = TYPE_PSYCHIC, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_DARTS] = @@ -12201,6 +12315,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TEATIME] = @@ -12215,6 +12331,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OCTOLOCK] = @@ -12229,6 +12347,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BOLT_BEAK] = @@ -12243,6 +12363,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FISHIOUS_REND] = @@ -12257,6 +12379,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COURT_CHANGE] = @@ -12271,6 +12395,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CLANGOROUS_SOUL] = @@ -12285,6 +12411,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BODY_PRESS] = @@ -12299,6 +12427,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DECORATE] = @@ -12313,6 +12443,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRUM_BEATING] = @@ -12327,6 +12459,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SNAP_TRAP] = @@ -12341,6 +12475,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PYRO_BALL] = @@ -12355,6 +12491,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST | FLAG_THAW_USER, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BEHEMOTH_BLADE] = @@ -12369,6 +12507,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BEHEMOTH_BASH] = @@ -12383,6 +12523,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AURA_WHEEL] = @@ -12397,6 +12539,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BREAKING_SWIPE] = @@ -12411,6 +12555,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BRANCH_POKE] = @@ -12425,6 +12571,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OVERDRIVE] = @@ -12439,6 +12587,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_APPLE_ACID] = @@ -12453,6 +12603,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GRAV_APPLE] = @@ -12467,6 +12619,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPIRIT_BREAK] = @@ -12481,6 +12635,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STRANGE_STEAM] = @@ -12495,6 +12651,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LIFE_DEW] = @@ -12509,6 +12667,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OBSTRUCT] = @@ -12523,6 +12683,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 4, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FALSE_SURRENDER] = @@ -12537,6 +12699,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_METEOR_ASSAULT] = @@ -12551,6 +12715,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ETERNABEAM] = @@ -12565,6 +12731,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STEEL_BEAM] = @@ -12579,6 +12747,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EXPANDING_FORCE] = @@ -12593,6 +12763,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STEEL_ROLLER] = @@ -12607,6 +12779,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SCALE_SHOT] = @@ -12621,6 +12795,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_METEOR_BEAM] = @@ -12635,6 +12811,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHELL_SIDE_ARM] = @@ -12649,6 +12827,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MISTY_EXPLOSION] = @@ -12663,6 +12843,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GRASSY_GLIDE] = @@ -12677,6 +12859,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RISING_VOLTAGE] = @@ -12691,6 +12875,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TERRAIN_PULSE] = @@ -12705,6 +12891,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SKITTER_SMACK] = @@ -12719,6 +12907,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BURNING_JEALOUSY] = @@ -12733,6 +12923,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LASH_OUT] = @@ -12747,6 +12939,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POLTERGEIST] = @@ -12761,6 +12955,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CORROSIVE_GAS] = @@ -12775,6 +12971,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COACHING] = @@ -12789,6 +12987,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLIP_TURN] = @@ -12803,6 +13003,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TRIPLE_AXEL] = @@ -12817,6 +13019,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DUAL_WINGBEAT] = @@ -12831,6 +13035,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SCORCHING_SANDS] = @@ -12845,6 +13051,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_THAW_USER, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_JUNGLE_HEALING] = @@ -12858,6 +13066,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WICKED_BLOW] = @@ -12872,6 +13082,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SURGING_STRIKES] = @@ -12886,6 +13098,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THUNDER_CAGE] = @@ -12900,6 +13114,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_ENERGY] = @@ -12914,6 +13130,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FREEZING_GLARE] = @@ -12928,6 +13146,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIERY_WRATH] = @@ -12942,6 +13162,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THUNDEROUS_KICK] = @@ -12956,6 +13178,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GLACIAL_LANCE] = @@ -12970,6 +13194,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ASTRAL_BARRAGE] = @@ -12984,6 +13210,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EERIE_SPELL] = @@ -12998,6 +13226,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, // Z MOVES From 0f3fdd410af38066439a774cfe76135c62747d25 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 20 Jul 2022 13:06:41 -0400 Subject: [PATCH 200/208] Config for Sturdy's Gen5+ effect. --- include/constants/battle_config.h | 1 + src/battle_script_commands.c | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index c9b64d1a5..198267179 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -226,6 +226,7 @@ #define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned. #define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. It also activates Rattled. #define B_OBLIVIOUS_TAUNT GEN_7 // In Gen6+, Pokémon with Oblivious can't be taunted. +#define B_STURDY GEN_7 // In Gen5+, Sturdy causes the Pokémon to have 1 HP remaining if another Pokémon's attack or confusion damage would have brought it from full health to 0 HP. // Item settings #define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index eb3f32269..f72986edc 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1984,16 +1984,18 @@ static void Cmd_adjustdamage(void) RecordItemEffectBattle(gBattlerTarget, holdEffect); gSpecialStatuses[gBattlerTarget].focusBanded = TRUE; } - else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget)) - { - RecordItemEffectBattle(gBattlerTarget, holdEffect); - gSpecialStatuses[gBattlerTarget].focusSashed = TRUE; - } + #if B_STURDY >= GEN_5 else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STURDY && BATTLER_MAX_HP(gBattlerTarget)) { RecordAbilityBattle(gBattlerTarget, ABILITY_STURDY); gSpecialStatuses[gBattlerTarget].sturdied = TRUE; } + #endif + else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget)) + { + RecordItemEffectBattle(gBattlerTarget, holdEffect); + gSpecialStatuses[gBattlerTarget].focusSashed = TRUE; + } if (gBattleMoves[gCurrentMove].effect != EFFECT_FALSE_SWIPE && !gProtectStructs[gBattlerTarget].endured From 212ecb98ce13a61987316637d3abf281bf5c8c53 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 20 Jul 2022 14:28:49 -0400 Subject: [PATCH 201/208] Added AI checks. --- src/battle_ai_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index b8c42ed0c..57adf719e 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2467,13 +2467,13 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo if (!IS_MOVE_STATUS(move) && (shouldSwitch || (AtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH - || defAbility == ABILITY_STURDY || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD)))) + || (defAbility == ABILITY_STURDY && B_STURDY >= GEN_5) || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD)))) return PIVOT; // pivot to break sash/sturdy/multiscale } else if (!hasStatBoost) { if (!IS_MOVE_STATUS(move) && (AtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH - || defAbility == ABILITY_STURDY || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD))) + || (defAbility == ABILITY_STURDY && B_STURDY >= GEN_5) || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD))) return PIVOT; // pivot to break sash/sturdy/multiscale if (shouldSwitch) From b8ea412e61e23e67aeeda206e0e6509f4748ad0d Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 20 Jul 2022 14:44:57 -0400 Subject: [PATCH 202/208] AI logic for Charge --- src/battle_ai_main.c | 5 ++++- src/battle_ai_util.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index f924728d2..794065bec 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -985,8 +985,10 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 20; else if (!HasMoveWithType(battlerAtk, TYPE_ELECTRIC)) score -= 10; + #if B_CHARGE_SPDEF_RAISE >= GEN_5 else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 5; + #endif break; case EFFECT_QUIVER_DANCE: case EFFECT_GEOMANCY: @@ -4051,8 +4053,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_CHARGE: if (HasDamagingMoveOfType(battlerAtk, TYPE_ELECTRIC)) score += 2; - + #if B_CHARGE_SPDEF_RAISE >= GEN_5 IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPDEF, &score); + #endif break; case EFFECT_TAUNT: if (IS_MOVE_STATUS(predictedMove)) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index b8c42ed0c..de22866ad 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2063,7 +2063,9 @@ bool32 IsStatRaisingEffect(u16 effect) case EFFECT_EVASION_UP_2: case EFFECT_MINIMIZE: case EFFECT_DEFENSE_CURL: + #if B_CHARGE_SPDEF_RAISE >= GEN_5 case EFFECT_CHARGE: + #endif case EFFECT_CALM_MIND: case EFFECT_COSMIC_POWER: case EFFECT_DRAGON_DANCE: From 343e685537ce297b17757ba9b32187e743048331 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 20 Jul 2022 15:13:53 -0400 Subject: [PATCH 203/208] Sky Drop fixes - Sky Drop was using lbs in the formula instead of hectograms. This has been fixed. - Sky Drop is now affected by weight modifiers like Float Stone. - Enabled AI_CheckBadMove for Sky Drop. --- src/battle_ai_main.c | 9 ++++----- src/battle_script_commands.c | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index f924728d2..dfb7ab867 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -2491,15 +2491,14 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) //break; //case EFFECT_BEAK_BLAST: //break; - /*case EFFECT_SKY_DROP: + case EFFECT_SKY_DROP: if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) score -= 10; - if (WillFaintFromWeather(battlerAtk) - || MoveBlockedBySubstitute(move, battlerAtk, battlerDef) - || GetSpeciesWeight(gBattleMons[battlerDef].species, AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerDef], battlerDef, TRUE) >= 2000) //200.0 kg + if (BattlerWillFaintFromWeather(battlerAtk, AI_DATA->abilities[battlerAtk]) + || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) + || GetBattlerWeight(battlerDef) >= 2000) //200.0 kg score -= 10; break; - */ /*case EFFECT_NO_RETREAT: if (TrappedByNoRetreat(battlerAtk)) score -= 10; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index eb3f32269..52c838501 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9192,7 +9192,7 @@ static void Cmd_various(void) break; case VARIOUS_JUMP_IF_UNDER_200: // If the Pokemon is less than 200 kg, or weighing less than 441 lbs, then Sky Drop will work. Otherwise, it will fail. - if (GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), 1) < 441) + if (GetBattlerWeight(gBattlerTarget) < 2000) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); else gBattlescriptCurrInstr += 7; From 76f5926743f601e2d0f574292311890b2cfc1650 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 20 Jul 2022 15:29:40 -0400 Subject: [PATCH 204/208] Sky Drop check in IsBattlerTrapped --- src/battle_ai_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index b8c42ed0c..afd53e162 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -617,7 +617,7 @@ bool32 IsBattlerTrapped(u8 battler, bool8 checkSwitch) { if (gBattleMons[battler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED) || IsAbilityPreventingEscape(battler) - || gStatuses3[battler] & (STATUS3_ROOTED) // TODO: sky drop target in air + || gStatuses3[battler] & (STATUS3_ROOTED | STATUS3_SKY_DROPPED) || (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK)) return TRUE; } From d87610a1e0a6831812b90e24109430921b6dc728 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 20 Jul 2022 15:31:08 -0400 Subject: [PATCH 205/208] Ghost Escape config AI fix --- src/battle_ai_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index b8c42ed0c..02f2e8228 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -606,7 +606,7 @@ bool32 AtMaxHp(u8 battlerId) bool32 IsBattlerTrapped(u8 battler, bool8 checkSwitch) { u8 holdEffect = AI_DATA->holdEffects[battler]; - if (IS_BATTLER_OF_TYPE(battler, TYPE_GHOST) + if ((B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GHOST)) || (checkSwitch && holdEffect == HOLD_EFFECT_SHED_SHELL) || (!checkSwitch && GetBattlerAbility(battler) == ABILITY_RUN_AWAY) || (!checkSwitch && holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)) From 25397e57944c9f17f83c11e3e20798ec2a2c6d6a Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Thu, 21 Jul 2022 15:13:00 -0400 Subject: [PATCH 206/208] Fixed Light That Burns The Sky not using the calculated damage category Also: - Modified move defines to ease with future move expansion. - Enabled Instruct's check for Z Moves in AI_CheckBadMove. --- include/constants/moves.h | 77 +++++++++++++++++++------------------- src/battle_ai_main.c | 4 +- src/battle_ai_util.c | 6 --- src/battle_z_move.c | 5 ++- src/data/text/move_names.h | 70 +++++++++++++++++----------------- 5 files changed, 78 insertions(+), 84 deletions(-) diff --git a/include/constants/moves.h b/include/constants/moves.h index 392c8a30d..746076cb3 100644 --- a/include/constants/moves.h +++ b/include/constants/moves.h @@ -784,48 +784,49 @@ #define MOVES_COUNT_GEN8 755 +#define MOVES_COUNT MOVES_COUNT_GEN8 + // Z Moves -#define MOVE_BREAKNECK_BLITZ (MOVES_COUNT_GEN8 + 0) -#define MOVE_ALL_OUT_PUMMELING (MOVES_COUNT_GEN8 + 1) -#define MOVE_SUPERSONIC_SKYSTRIKE (MOVES_COUNT_GEN8 + 2) -#define MOVE_ACID_DOWNPOUR (MOVES_COUNT_GEN8 + 3) -#define MOVE_TECTONIC_RAGE (MOVES_COUNT_GEN8 + 4) -#define MOVE_CONTINENTAL_CRUSH (MOVES_COUNT_GEN8 + 5) -#define MOVE_SAVAGE_SPIN_OUT (MOVES_COUNT_GEN8 + 6) -#define MOVE_NEVER_ENDING_NIGHTMARE (MOVES_COUNT_GEN8 + 7) -#define MOVE_CORKSCREW_CRASH (MOVES_COUNT_GEN8 + 8) -#define MOVE_INFERNO_OVERDRIVE (MOVES_COUNT_GEN8 + 9) -#define MOVE_HYDRO_VORTEX (MOVES_COUNT_GEN8 + 10) -#define MOVE_BLOOM_DOOM (MOVES_COUNT_GEN8 + 11) -#define MOVE_GIGAVOLT_HAVOC (MOVES_COUNT_GEN8 + 12) -#define MOVE_SHATTERED_PSYCHE (MOVES_COUNT_GEN8 + 13) -#define MOVE_SUBZERO_SLAMMER (MOVES_COUNT_GEN8 + 14) -#define MOVE_DEVASTATING_DRAKE (MOVES_COUNT_GEN8 + 15) -#define MOVE_BLACK_HOLE_ECLIPSE (MOVES_COUNT_GEN8 + 16) -#define MOVE_TWINKLE_TACKLE (MOVES_COUNT_GEN8 + 17) -//signature z moves -#define MOVE_CATASTROPIKA (MOVES_COUNT_GEN8 + 18) -#define MOVE_10000000_VOLT_THUNDERBOLT (MOVES_COUNT_GEN8 + 19) -#define MOVE_STOKED_SPARKSURFER (MOVES_COUNT_GEN8 + 20) -#define MOVE_EXTREME_EVOBOOST (MOVES_COUNT_GEN8 + 21) -#define MOVE_PULVERIZING_PANCAKE (MOVES_COUNT_GEN8 + 22) -#define MOVE_GENESIS_SUPERNOVA (MOVES_COUNT_GEN8 + 23) -#define MOVE_SINISTER_ARROW_RAID (MOVES_COUNT_GEN8 + 24) -#define MOVE_MALICIOUS_MOONSAULT (MOVES_COUNT_GEN8 + 25) -#define MOVE_OCEANIC_OPERETTA (MOVES_COUNT_GEN8 + 26) -#define MOVE_SPLINTERED_STORMSHARDS (MOVES_COUNT_GEN8 + 27) -#define MOVE_LETS_SNUGGLE_FOREVER (MOVES_COUNT_GEN8 + 28) -#define MOVE_CLANGOROUS_SOULBLAZE (MOVES_COUNT_GEN8 + 29) -#define MOVE_GUARDIAN_OF_ALOLA (MOVES_COUNT_GEN8 + 30) -#define MOVE_SEARING_SUNRAZE_SMASH (MOVES_COUNT_GEN8 + 31) -#define MOVE_MENACING_MOONRAZE_MAELSTROM (MOVES_COUNT_GEN8 + 32) -#define MOVE_LIGHT_THAT_BURNS_THE_SKY (MOVES_COUNT_GEN8 + 33) -#define MOVE_SOUL_STEALING_7_STAR_STRIKE (MOVES_COUNT_GEN8 + 34) +#define MOVE_BREAKNECK_BLITZ (MOVES_COUNT + 0) +#define MOVE_ALL_OUT_PUMMELING (MOVES_COUNT + 1) +#define MOVE_SUPERSONIC_SKYSTRIKE (MOVES_COUNT + 2) +#define MOVE_ACID_DOWNPOUR (MOVES_COUNT + 3) +#define MOVE_TECTONIC_RAGE (MOVES_COUNT + 4) +#define MOVE_CONTINENTAL_CRUSH (MOVES_COUNT + 5) +#define MOVE_SAVAGE_SPIN_OUT (MOVES_COUNT + 6) +#define MOVE_NEVER_ENDING_NIGHTMARE (MOVES_COUNT + 7) +#define MOVE_CORKSCREW_CRASH (MOVES_COUNT + 8) +#define MOVE_INFERNO_OVERDRIVE (MOVES_COUNT + 9) +#define MOVE_HYDRO_VORTEX (MOVES_COUNT + 10) +#define MOVE_BLOOM_DOOM (MOVES_COUNT + 11) +#define MOVE_GIGAVOLT_HAVOC (MOVES_COUNT + 12) +#define MOVE_SHATTERED_PSYCHE (MOVES_COUNT + 13) +#define MOVE_SUBZERO_SLAMMER (MOVES_COUNT + 14) +#define MOVE_DEVASTATING_DRAKE (MOVES_COUNT + 15) +#define MOVE_BLACK_HOLE_ECLIPSE (MOVES_COUNT + 16) +#define MOVE_TWINKLE_TACKLE (MOVES_COUNT + 17) +// Signature Z Moves +#define MOVE_CATASTROPIKA (MOVES_COUNT + 18) +#define MOVE_10000000_VOLT_THUNDERBOLT (MOVES_COUNT + 19) +#define MOVE_STOKED_SPARKSURFER (MOVES_COUNT + 20) +#define MOVE_EXTREME_EVOBOOST (MOVES_COUNT + 21) +#define MOVE_PULVERIZING_PANCAKE (MOVES_COUNT + 22) +#define MOVE_GENESIS_SUPERNOVA (MOVES_COUNT + 23) +#define MOVE_SINISTER_ARROW_RAID (MOVES_COUNT + 24) +#define MOVE_MALICIOUS_MOONSAULT (MOVES_COUNT + 25) +#define MOVE_OCEANIC_OPERETTA (MOVES_COUNT + 26) +#define MOVE_SPLINTERED_STORMSHARDS (MOVES_COUNT + 27) +#define MOVE_LETS_SNUGGLE_FOREVER (MOVES_COUNT + 28) +#define MOVE_CLANGOROUS_SOULBLAZE (MOVES_COUNT + 29) +#define MOVE_GUARDIAN_OF_ALOLA (MOVES_COUNT + 30) +#define MOVE_SEARING_SUNRAZE_SMASH (MOVES_COUNT + 31) +#define MOVE_MENACING_MOONRAZE_MAELSTROM (MOVES_COUNT + 32) +#define MOVE_LIGHT_THAT_BURNS_THE_SKY (MOVES_COUNT + 33) +#define MOVE_SOUL_STEALING_7_STAR_STRIKE (MOVES_COUNT + 34) #define FIRST_Z_MOVE MOVE_BREAKNECK_BLITZ #define LAST_Z_MOVE MOVE_SOUL_STEALING_7_STAR_STRIKE -#define MOVES_COUNT MOVES_COUNT_GEN8 -#define MOVES_COUNT_Z (MOVE_SOUL_STEALING_7_STAR_STRIKE + 1) +#define MOVES_COUNT_Z (LAST_Z_MOVE + 1) #endif // GUARD_CONSTANTS_MOVES_H diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 794065bec..f2b48af61 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -2385,9 +2385,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || IsInstructBannedMove(instructedMove) || MoveRequiresRecharging(instructedMove) || MoveCallsOtherMove(instructedMove) - #ifdef ITEM_Z_POWER_RING - //|| (IsZMove(instructedMove)) - #endif + || IsZMove(instructedMove) || (gLockedMoves[battlerDef] != 0 && gLockedMoves[battlerDef] != 0xFFFF) || gBattleMons[battlerDef].status2 & STATUS2_MULTIPLETURNS || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index de22866ad..7896a9b12 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -375,15 +375,9 @@ static const u16 sIgnoreMoldBreakerMoves[] = MOVE_MOONGEIST_BEAM, MOVE_SUNSTEEL_STRIKE, MOVE_PHOTON_GEYSER, - #ifdef MOVE_LIGHT_THAT_BURNS_THE_SKY MOVE_LIGHT_THAT_BURNS_THE_SKY, - #endif - #ifdef MOVE_MENACING_MOONRAZE_MAELSTROM MOVE_MENACING_MOONRAZE_MAELSTROM, - #endif - #ifdef MOVE_SEARING_SUNRAZE_SMASH MOVE_SEARING_SUNRAZE_SMASH, - #endif }; static const u16 sInstructBannedMoves[] = diff --git a/src/battle_z_move.c b/src/battle_z_move.c index a91c9ec5f..db00d8d7c 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -154,7 +154,8 @@ void QueueZMove(u8 battlerId, u16 baseMove) gBattleStruct->zmove.baseMoves[battlerId] = baseMove; if (gBattleStruct->zmove.chosenZMove == MOVE_LIGHT_THAT_BURNS_THE_SKY) gBattleStruct->zmove.splits[battlerId] = GetSplitBasedOnStats(battlerId); - gBattleStruct->zmove.splits[battlerId] = gBattleMoves[baseMove].split; + else + gBattleStruct->zmove.splits[battlerId] = gBattleMoves[baseMove].split; } bool32 IsViableZMove(u8 battlerId, u16 move) @@ -562,7 +563,7 @@ static void ZMoveSelectionDisplayPpNumber(void) const u8* GetZMoveName(u16 move) { if (IsZMove(move)) - return gZMoveNames[move - MOVE_BREAKNECK_BLITZ]; + return gZMoveNames[move - FIRST_Z_MOVE]; else return gZMoveNames[0]; // Failsafe } diff --git a/src/data/text/move_names.h b/src/data/text/move_names.h index 6299244bb..08703b201 100644 --- a/src/data/text/move_names.h +++ b/src/data/text/move_names.h @@ -796,39 +796,39 @@ static const u8 sText_Soul_Stealing_7_Star_Strike[] = _("Soul Stealing 7 Star St const u8 *const gZMoveNames[] = { - [MOVE_BREAKNECK_BLITZ - MOVE_BREAKNECK_BLITZ] = sText_Breakneck_Blitz, - [MOVE_ALL_OUT_PUMMELING - MOVE_BREAKNECK_BLITZ] = sText_All_Out_Pummeling, - [MOVE_SUPERSONIC_SKYSTRIKE - MOVE_BREAKNECK_BLITZ] = sText_Supersonic_Skystrike, - [MOVE_ACID_DOWNPOUR - MOVE_BREAKNECK_BLITZ] = sText_Acid_Downpour, - [MOVE_TECTONIC_RAGE - MOVE_BREAKNECK_BLITZ] = sText_Tectonic_Rage, - [MOVE_CONTINENTAL_CRUSH - MOVE_BREAKNECK_BLITZ] = sText_Continental_Crush, - [MOVE_SAVAGE_SPIN_OUT - MOVE_BREAKNECK_BLITZ] = sText_Savage_Spin_Out, - [MOVE_NEVER_ENDING_NIGHTMARE - MOVE_BREAKNECK_BLITZ] = sText_Never_Ending_Nightmare, - [MOVE_CORKSCREW_CRASH - MOVE_BREAKNECK_BLITZ] = sText_Corkscrew_Crash, - [MOVE_INFERNO_OVERDRIVE - MOVE_BREAKNECK_BLITZ] = sText_Inferno_Overdrive, - [MOVE_HYDRO_VORTEX - MOVE_BREAKNECK_BLITZ] = sText_Hydro_Vortex, - [MOVE_BLOOM_DOOM - MOVE_BREAKNECK_BLITZ] = sText_Bloom_Doom, - [MOVE_GIGAVOLT_HAVOC - MOVE_BREAKNECK_BLITZ] = sText_Gigavolt_Havoc, - [MOVE_SHATTERED_PSYCHE - MOVE_BREAKNECK_BLITZ] = sText_Shattered_Psyche, - [MOVE_SUBZERO_SLAMMER - MOVE_BREAKNECK_BLITZ] = sText_Subzero_Slammer, - [MOVE_DEVASTATING_DRAKE - MOVE_BREAKNECK_BLITZ] = sText_Devastating_Drake, - [MOVE_BLACK_HOLE_ECLIPSE - MOVE_BREAKNECK_BLITZ] = sText_Black_Hole_Eclipse, - [MOVE_TWINKLE_TACKLE - MOVE_BREAKNECK_BLITZ] = sText_Twinkle_Tackle, - [MOVE_CATASTROPIKA - MOVE_BREAKNECK_BLITZ] = sText_Catastropika, - [MOVE_10000000_VOLT_THUNDERBOLT - MOVE_BREAKNECK_BLITZ] = sText_10000000_Volt_Thunderbolt, - [MOVE_STOKED_SPARKSURFER - MOVE_BREAKNECK_BLITZ] = sText_Stoked_Sparksurfer, - [MOVE_EXTREME_EVOBOOST - MOVE_BREAKNECK_BLITZ] = sText_Extreme_Evoboost, - [MOVE_PULVERIZING_PANCAKE - MOVE_BREAKNECK_BLITZ] = sText_Pulverizing_Pancake, - [MOVE_GENESIS_SUPERNOVA - MOVE_BREAKNECK_BLITZ] = sText_Genesis_Supernova, - [MOVE_SINISTER_ARROW_RAID - MOVE_BREAKNECK_BLITZ] = sText_Sinister_Arrow_Raid, - [MOVE_MALICIOUS_MOONSAULT - MOVE_BREAKNECK_BLITZ] = sText_Malicious_Moonsault, - [MOVE_OCEANIC_OPERETTA - MOVE_BREAKNECK_BLITZ] = sText_Oceanic_Operetta, - [MOVE_SPLINTERED_STORMSHARDS - MOVE_BREAKNECK_BLITZ] = sText_Splintered_Stormshards, - [MOVE_LETS_SNUGGLE_FOREVER - MOVE_BREAKNECK_BLITZ] = sText_Lets_Snuggle_Forever, - [MOVE_CLANGOROUS_SOULBLAZE - MOVE_BREAKNECK_BLITZ] = sText_Clangorous_Soulblaze, - [MOVE_GUARDIAN_OF_ALOLA - MOVE_BREAKNECK_BLITZ] = sText_Guardian_Of_Alola, - [MOVE_SEARING_SUNRAZE_SMASH - MOVE_BREAKNECK_BLITZ] = sText_Searing_Sunraze_Smash, - [MOVE_MENACING_MOONRAZE_MAELSTROM - MOVE_BREAKNECK_BLITZ] = sText_Menacing_Moonraze_Maelstrom, - [MOVE_LIGHT_THAT_BURNS_THE_SKY - MOVE_BREAKNECK_BLITZ] = sText_Light_That_Burns_The_Sky, - [MOVE_SOUL_STEALING_7_STAR_STRIKE - MOVE_BREAKNECK_BLITZ] = sText_Soul_Stealing_7_Star_Strike, + [MOVE_BREAKNECK_BLITZ - FIRST_Z_MOVE] = sText_Breakneck_Blitz, + [MOVE_ALL_OUT_PUMMELING - FIRST_Z_MOVE] = sText_All_Out_Pummeling, + [MOVE_SUPERSONIC_SKYSTRIKE - FIRST_Z_MOVE] = sText_Supersonic_Skystrike, + [MOVE_ACID_DOWNPOUR - FIRST_Z_MOVE] = sText_Acid_Downpour, + [MOVE_TECTONIC_RAGE - FIRST_Z_MOVE] = sText_Tectonic_Rage, + [MOVE_CONTINENTAL_CRUSH - FIRST_Z_MOVE] = sText_Continental_Crush, + [MOVE_SAVAGE_SPIN_OUT - FIRST_Z_MOVE] = sText_Savage_Spin_Out, + [MOVE_NEVER_ENDING_NIGHTMARE - FIRST_Z_MOVE] = sText_Never_Ending_Nightmare, + [MOVE_CORKSCREW_CRASH - FIRST_Z_MOVE] = sText_Corkscrew_Crash, + [MOVE_INFERNO_OVERDRIVE - FIRST_Z_MOVE] = sText_Inferno_Overdrive, + [MOVE_HYDRO_VORTEX - FIRST_Z_MOVE] = sText_Hydro_Vortex, + [MOVE_BLOOM_DOOM - FIRST_Z_MOVE] = sText_Bloom_Doom, + [MOVE_GIGAVOLT_HAVOC - FIRST_Z_MOVE] = sText_Gigavolt_Havoc, + [MOVE_SHATTERED_PSYCHE - FIRST_Z_MOVE] = sText_Shattered_Psyche, + [MOVE_SUBZERO_SLAMMER - FIRST_Z_MOVE] = sText_Subzero_Slammer, + [MOVE_DEVASTATING_DRAKE - FIRST_Z_MOVE] = sText_Devastating_Drake, + [MOVE_BLACK_HOLE_ECLIPSE - FIRST_Z_MOVE] = sText_Black_Hole_Eclipse, + [MOVE_TWINKLE_TACKLE - FIRST_Z_MOVE] = sText_Twinkle_Tackle, + [MOVE_CATASTROPIKA - FIRST_Z_MOVE] = sText_Catastropika, + [MOVE_10000000_VOLT_THUNDERBOLT - FIRST_Z_MOVE] = sText_10000000_Volt_Thunderbolt, + [MOVE_STOKED_SPARKSURFER - FIRST_Z_MOVE] = sText_Stoked_Sparksurfer, + [MOVE_EXTREME_EVOBOOST - FIRST_Z_MOVE] = sText_Extreme_Evoboost, + [MOVE_PULVERIZING_PANCAKE - FIRST_Z_MOVE] = sText_Pulverizing_Pancake, + [MOVE_GENESIS_SUPERNOVA - FIRST_Z_MOVE] = sText_Genesis_Supernova, + [MOVE_SINISTER_ARROW_RAID - FIRST_Z_MOVE] = sText_Sinister_Arrow_Raid, + [MOVE_MALICIOUS_MOONSAULT - FIRST_Z_MOVE] = sText_Malicious_Moonsault, + [MOVE_OCEANIC_OPERETTA - FIRST_Z_MOVE] = sText_Oceanic_Operetta, + [MOVE_SPLINTERED_STORMSHARDS - FIRST_Z_MOVE] = sText_Splintered_Stormshards, + [MOVE_LETS_SNUGGLE_FOREVER - FIRST_Z_MOVE] = sText_Lets_Snuggle_Forever, + [MOVE_CLANGOROUS_SOULBLAZE - FIRST_Z_MOVE] = sText_Clangorous_Soulblaze, + [MOVE_GUARDIAN_OF_ALOLA - FIRST_Z_MOVE] = sText_Guardian_Of_Alola, + [MOVE_SEARING_SUNRAZE_SMASH - FIRST_Z_MOVE] = sText_Searing_Sunraze_Smash, + [MOVE_MENACING_MOONRAZE_MAELSTROM - FIRST_Z_MOVE] = sText_Menacing_Moonraze_Maelstrom, + [MOVE_LIGHT_THAT_BURNS_THE_SKY - FIRST_Z_MOVE] = sText_Light_That_Burns_The_Sky, + [MOVE_SOUL_STEALING_7_STAR_STRIKE - FIRST_Z_MOVE] = sText_Soul_Stealing_7_Star_Strike, }; From e4ae280ca6c1d6033edf145586951b9ace7b88f6 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Thu, 21 Jul 2022 15:32:14 -0400 Subject: [PATCH 207/208] Fixed calls to IsZMove --- include/battle_z_move.h | 1 + src/battle_ai_main.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/battle_z_move.h b/include/battle_z_move.h index 5d34e25a9..2d1ff1a00 100644 --- a/include/battle_z_move.h +++ b/include/battle_z_move.h @@ -13,6 +13,7 @@ struct SignatureZMove u16 zmove; }; +bool8 IsZMove(u16 move); void QueueZMove(u8 battlerId, u16 baseMove); bool32 IsViableZMove(u8 battlerId, u16 move); bool32 TryChangeZIndicator(u8 battlerId, u8 moveIndex); diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index f2b48af61..d3d158c76 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -6,6 +6,7 @@ #include "battle_ai_main.h" #include "battle_factory.h" #include "battle_setup.h" +#include "battle_z_move.h" #include "data.h" #include "event_data.h" #include "item.h" From af72fb0d32f5fa663263de20e2321f9c51c4ab7d Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Thu, 21 Jul 2022 16:36:07 -0400 Subject: [PATCH 208/208] Simplified pre-gen5 checks --- src/battle_util.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index c30d3f68e..e13b5b378 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8706,20 +8706,12 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b break; #else case ABILITY_PLUS: - if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) - { - u32 partnerAbility = GetBattlerAbility(BATTLE_PARTNER(battlerAtk)); - if (partnerAbility == ABILITY_MINUS) - MulModifier(&modifier, UQ_4_12(1.5)); - } + if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) && GetBattlerAbility(BATTLE_PARTNER(battlerAtk)) == ABILITY_MINUS) + MulModifier(&modifier, UQ_4_12(1.5)); break; case ABILITY_MINUS: - if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) - { - u32 partnerAbility = GetBattlerAbility(BATTLE_PARTNER(battlerAtk)); - if (partnerAbility == ABILITY_PLUS) - MulModifier(&modifier, UQ_4_12(1.5)); - } + if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) && GetBattlerAbility(BATTLE_PARTNER(battlerAtk)) == ABILITY_PLUS) + MulModifier(&modifier, UQ_4_12(1.5)); break; #endif case ABILITY_FLOWER_GIFT: