mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-06 07:27:47 +01:00
z move unleash anim, fix active/used flags
This commit is contained in:
parent
4060b09bd6
commit
2b1dfe73cf
@ -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
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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]];
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user