Attackstring hitmarker clean up (#8136)
This commit is contained in:
parent
80b5d81a9a
commit
41aba41838
@ -3013,7 +3013,6 @@ BattleScript_PowerHerbActivation:
|
||||
BattleScript_EffectTwoTurnsAttack::
|
||||
jumpifvolatile BS_ATTACKER, VOLATILE_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn
|
||||
tryfiretwoturnmovewithoutcharging BS_ATTACKER, BattleScript_EffectHit @ e.g. Solar Beam
|
||||
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_ATTACKSTRING_PRINTED, BattleScript_EffectHit @ if it's not the first hit
|
||||
call BattleScript_FirstChargingTurn
|
||||
tryfiretwoturnmoveaftercharging BS_ATTACKER, BattleScript_TwoTurnMovesSecondTurn @ e.g. Electro Shot
|
||||
jumpifholdeffect BS_ATTACKER, HOLD_EFFECT_POWER_HERB, BattleScript_TwoTurnMovesSecondPowerHerbActivates, TRUE
|
||||
|
||||
@ -246,10 +246,9 @@ enum SemiInvulnerableExclusion
|
||||
EXCLUDE_COMMANDER,
|
||||
};
|
||||
|
||||
#define HITMARKER_DESTINYBOND (1 << 6)
|
||||
#define HITMARKER_NO_ANIMATIONS (1 << 7) // set from battleSceneOff. Never changed during battle
|
||||
#define HITMARKER_UNUSED_8 (1 << 8)
|
||||
#define HITMARKER_ATTACKSTRING_PRINTED (1 << 9)
|
||||
#define HITMARKER_UNUSED_9 (1 << 9)
|
||||
#define HITMARKER_UNUSED_10 (1 << 10)
|
||||
#define HITMARKER_UNUSED_11 (1 << 11)
|
||||
#define HITMARKER_UNUSED_12 (1 << 12)
|
||||
|
||||
@ -4006,7 +4006,6 @@ void BattleTurnPassed(void)
|
||||
|
||||
TurnValuesCleanUp(FALSE);
|
||||
gHitMarker &= ~HITMARKER_UNABLE_TO_USE_MOVE;
|
||||
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||
gHitMarker &= ~HITMARKER_PLAYER_FAINTED;
|
||||
gBattleScripting.animTurn = 0;
|
||||
gBattleScripting.animTargetsHit = 0;
|
||||
@ -5408,10 +5407,7 @@ static void RunTurnActionsFunctions(void)
|
||||
else
|
||||
{
|
||||
if (gBattleStruct->savedTurnActionNumber != gCurrentTurnActionNumber) // action turn has been done, clear hitmarker bits for another battler
|
||||
{
|
||||
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||
gHitMarker &= ~HITMARKER_UNABLE_TO_USE_MOVE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6314,13 +6314,6 @@ static void Cmd_moveend(void)
|
||||
{
|
||||
gDisableStructs[gBattlerAttacker].usedMoves |= 1u << gCurrMovePos;
|
||||
gBattleStruct->lastMoveTarget[gBattlerAttacker] = gBattlerTarget;
|
||||
if (gHitMarker & HITMARKER_ATTACKSTRING_PRINTED)
|
||||
{
|
||||
gLastPrintedMoves[gBattlerAttacker] = gChosenMove;
|
||||
gLastUsedMove = gCurrentMove;
|
||||
if (IsMaxMove(gCurrentMove))
|
||||
gBattleStruct->dynamax.lastUsedBaseMove = gBattleStruct->dynamax.baseMoves[gBattlerAttacker];
|
||||
}
|
||||
}
|
||||
enum BattleMoveEffects originalEffect = GetMoveEffect(originallyUsedMove);
|
||||
if (!(gAbsentBattlerFlags & (1u << gBattlerAttacker))
|
||||
@ -6356,6 +6349,12 @@ static void Cmd_moveend(void)
|
||||
{
|
||||
gLastLandedMoves[gBattlerTarget] = gCurrentMove;
|
||||
gLastHitByType[gBattlerTarget] = GetBattleMoveType(gCurrentMove);
|
||||
if (!gSpecialStatuses[gBattlerAttacker].dancerUsedMove)
|
||||
{
|
||||
gLastUsedMove = gCurrentMove;
|
||||
if (IsMaxMove(gCurrentMove))
|
||||
gBattleStruct->dynamax.lastUsedBaseMove = gBattleStruct->dynamax.baseMoves[gBattlerAttacker];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -6431,7 +6430,8 @@ static void Cmd_moveend(void)
|
||||
if (moveEffect == EFFECT_EXPLOSION
|
||||
|| moveEffect == EFFECT_MISTY_EXPLOSION
|
||||
|| moveEffect == EFFECT_MAGNITUDE
|
||||
|| moveEffect == EFFECT_SYNCHRONOISE)
|
||||
|| moveEffect == EFFECT_SYNCHRONOISE
|
||||
|| gBattleMoveEffects[moveEffect].battleScript == BattleScript_EffectTwoTurnsAttack)
|
||||
BattleScriptPush(gBattleMoveEffects[EFFECT_HIT].battleScript);
|
||||
else
|
||||
BattleScriptPush(GetMoveBattleScript(gCurrentMove));
|
||||
|
||||
@ -914,9 +914,7 @@ void HandleAction_NothingIsFainted(void)
|
||||
gCurrentTurnActionNumber++;
|
||||
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_NONE;
|
||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED
|
||||
| HITMARKER_STATUS_ABILITY_EFFECT
|
||||
| HITMARKER_OBEYS);
|
||||
gHitMarker &= ~(HITMARKER_STATUS_ABILITY_EFFECT | HITMARKER_OBEYS);
|
||||
}
|
||||
|
||||
void HandleAction_ActionFinished(void)
|
||||
@ -927,9 +925,7 @@ void HandleAction_ActionFinished(void)
|
||||
gCurrentTurnActionNumber++;
|
||||
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
||||
memset(&gSpecialStatuses, 0, sizeof(gSpecialStatuses));
|
||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED
|
||||
| HITMARKER_STATUS_ABILITY_EFFECT
|
||||
| HITMARKER_OBEYS);
|
||||
gHitMarker &= ~(HITMARKER_STATUS_ABILITY_EFFECT | HITMARKER_OBEYS);
|
||||
|
||||
ClearDamageCalcResults();
|
||||
gCurrentMove = 0;
|
||||
@ -2475,8 +2471,9 @@ static enum MoveCanceller CancellerStanceChangeTwo(struct BattleContext *ctx)
|
||||
|
||||
static enum MoveCanceller CancellerAttackstring(struct BattleContext *ctx)
|
||||
{
|
||||
gHitMarker |= HITMARKER_ATTACKSTRING_PRINTED;
|
||||
BattleScriptCall(BattleScript_Attackstring);
|
||||
if (!gSpecialStatuses[gBattlerAttacker].dancerUsedMove)
|
||||
gLastPrintedMoves[gBattlerAttacker] = gChosenMove;
|
||||
return MOVE_STEP_BREAK;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user