mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
update MoveWithPP macro to use struct
This commit is contained in:
parent
7fad0a2dbc
commit
08ec873ef2
@ -713,8 +713,10 @@ void Randomly(u32 sourceLine, u32 passes, u32 trials, struct RandomlyContext);
|
||||
|
||||
/* Given */
|
||||
|
||||
#define MOVE_ARGS(...) {__VA_ARGS__}
|
||||
#define PP_ARGS(...) {__VA_ARGS__}
|
||||
struct moveWithPP {
|
||||
u16 moveId;
|
||||
u8 pp;
|
||||
};
|
||||
|
||||
#define GIVEN for (; gBattleTestRunnerState->runGiven; gBattleTestRunnerState->runGiven = FALSE)
|
||||
|
||||
@ -736,7 +738,7 @@ void Randomly(u32 sourceLine, u32 passes, u32 trials, struct RandomlyContext);
|
||||
#define Speed(speed) Speed_(__LINE__, speed)
|
||||
#define Item(item) Item_(__LINE__, item)
|
||||
#define Moves(move1, ...) Moves_(__LINE__, (const u16 [MAX_MON_MOVES]) { move1, __VA_ARGS__ })
|
||||
#define MovesWithPP(moves, pp) MovesWithPP_(__LINE__, (const u16 [MAX_MON_MOVES]) MOVE_ARGS moves, (const u8 [MAX_MON_MOVES]) PP_ARGS pp)
|
||||
#define MovesWithPP(movewithpp1, ...) MovesWithPP_(__LINE__, (struct moveWithPP[MAX_MON_MOVES]) {movewithpp1, __VA_ARGS__})
|
||||
#define Friendship(friendship) Friendship_(__LINE__, friendship)
|
||||
#define Status1(status1) Status1_(__LINE__, status1)
|
||||
|
||||
@ -757,7 +759,7 @@ void SpDefense_(u32 sourceLine, u32 spDefense);
|
||||
void Speed_(u32 sourceLine, u32 speed);
|
||||
void Item_(u32 sourceLine, u32 item);
|
||||
void Moves_(u32 sourceLine, const u16 moves[MAX_MON_MOVES]);
|
||||
void MovesWithPP_(u32 sourceLine, const u16 moves[MAX_MON_MOVES], const u8 pp[MAX_MON_MOVES]);
|
||||
void MovesWithPP_(u32 sourceLine, struct moveWithPP moveWithPP[MAX_MON_MOVES]);
|
||||
void Friendship_(u32 sourceLine, u32 friendship);
|
||||
void Status1_(u32 sourceLine, u32 status1);
|
||||
|
||||
|
@ -1161,17 +1161,17 @@ void Moves_(u32 sourceLine, const u16 moves[MAX_MON_MOVES])
|
||||
DATA.explicitMoves[DATA.currentSide] |= 1 << DATA.currentPartyIndex;
|
||||
}
|
||||
|
||||
void MovesWithPP_(u32 sourceLine, const u16 moves[MAX_MON_MOVES], const u8 pp[MAX_MON_MOVES])
|
||||
void MovesWithPP_(u32 sourceLine, struct moveWithPP moveWithPP[MAX_MON_MOVES])
|
||||
{
|
||||
s32 i;
|
||||
INVALID_IF(!DATA.currentMon, "Moves outside of PLAYER/OPPONENT");
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
if (moves[i] == MOVE_NONE)
|
||||
if (moveWithPP[i].moveId == MOVE_NONE)
|
||||
break;
|
||||
INVALID_IF(moves[i] >= MOVES_COUNT, "Illegal move: %d", moves[i]);
|
||||
SetMonData(DATA.currentMon, MON_DATA_MOVE1 + i, &moves[i]);
|
||||
SetMonData(DATA.currentMon, MON_DATA_PP1 + i, &pp[i]);
|
||||
INVALID_IF(moveWithPP[i].moveId >= MOVES_COUNT, "Illegal move: %d", &moveWithPP[i].moveId);
|
||||
SetMonData(DATA.currentMon, MON_DATA_MOVE1 + i, &moveWithPP[i].moveId);
|
||||
SetMonData(DATA.currentMon, MON_DATA_PP1 + i, &moveWithPP[i].pp);
|
||||
}
|
||||
DATA.explicitMoves[DATA.currentSide] |= 1 << DATA.currentPartyIndex;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user