z move indicator and some data

This commit is contained in:
Evan 2020-11-26 15:56:18 -05:00
parent 47fe30f0a1
commit 348d70b309
27 changed files with 2597 additions and 2168 deletions

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

View File

@ -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;

View File

@ -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);

View File

@ -41,6 +41,7 @@ enum
#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
@ -49,6 +50,7 @@ enum
#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

View File

@ -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;

View File

@ -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

22
include/battle_z_move.h Normal file
View File

@ -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

View File

@ -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

View File

@ -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))

View File

@ -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

View File

@ -775,6 +775,50 @@
#define MOVES_COUNT_GEN8 747
// 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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)

View File

@ -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,11 +630,19 @@ static void HandleInputChooseMove(void)
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
{
PlaySE(SE_SELECT);
if (gBattleStruct->zmove.viewingZMove)
{
ReloadMoveNames();
}
else
{
gBattleStruct->mega.playerSelect = FALSE;
gBattleStruct->zmove.viable = FALSE;
BtlController_EmitTwoReturnValues(1, 10, 0xFFFF);
HideMegaTriggerSprite();
HideTriggerSprites();
PlayerBufferExecCompleted();
}
}
else if (JOY_NEW(DPAD_LEFT))
{
if (gMoveSelectionCursor[gActiveBattler] & 1)
@ -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,7 +721,30 @@ 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
@ -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;
}
}

View File

@ -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);

View File

@ -5049,3 +5049,4 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk)
gSpecialStatuses[battlerAtk].gemBoost = 1;
}
}

View File

@ -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;

View File

@ -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;

525
src/battle_z_move.c Normal file
View File

@ -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
}

File diff suppressed because it is too large Load Diff

View File

@ -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,
};

View File

@ -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

View File

@ -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"