mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 23:23:43 +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 */
|
/* Given */
|
||||||
|
|
||||||
#define MOVE_ARGS(...) {__VA_ARGS__}
|
struct moveWithPP {
|
||||||
#define PP_ARGS(...) {__VA_ARGS__}
|
u16 moveId;
|
||||||
|
u8 pp;
|
||||||
|
};
|
||||||
|
|
||||||
#define GIVEN for (; gBattleTestRunnerState->runGiven; gBattleTestRunnerState->runGiven = FALSE)
|
#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 Speed(speed) Speed_(__LINE__, speed)
|
||||||
#define Item(item) Item_(__LINE__, item)
|
#define Item(item) Item_(__LINE__, item)
|
||||||
#define Moves(move1, ...) Moves_(__LINE__, (const u16 [MAX_MON_MOVES]) { move1, __VA_ARGS__ })
|
#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 Friendship(friendship) Friendship_(__LINE__, friendship)
|
||||||
#define Status1(status1) Status1_(__LINE__, status1)
|
#define Status1(status1) Status1_(__LINE__, status1)
|
||||||
|
|
||||||
@ -757,7 +759,7 @@ void SpDefense_(u32 sourceLine, u32 spDefense);
|
|||||||
void Speed_(u32 sourceLine, u32 speed);
|
void Speed_(u32 sourceLine, u32 speed);
|
||||||
void Item_(u32 sourceLine, u32 item);
|
void Item_(u32 sourceLine, u32 item);
|
||||||
void Moves_(u32 sourceLine, const u16 moves[MAX_MON_MOVES]);
|
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 Friendship_(u32 sourceLine, u32 friendship);
|
||||||
void Status1_(u32 sourceLine, u32 status1);
|
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;
|
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;
|
s32 i;
|
||||||
INVALID_IF(!DATA.currentMon, "Moves outside of PLAYER/OPPONENT");
|
INVALID_IF(!DATA.currentMon, "Moves outside of PLAYER/OPPONENT");
|
||||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||||
{
|
{
|
||||||
if (moves[i] == MOVE_NONE)
|
if (moveWithPP[i].moveId == MOVE_NONE)
|
||||||
break;
|
break;
|
||||||
INVALID_IF(moves[i] >= MOVES_COUNT, "Illegal move: %d", moves[i]);
|
INVALID_IF(moveWithPP[i].moveId >= MOVES_COUNT, "Illegal move: %d", &moveWithPP[i].moveId);
|
||||||
SetMonData(DATA.currentMon, MON_DATA_MOVE1 + i, &moves[i]);
|
SetMonData(DATA.currentMon, MON_DATA_MOVE1 + i, &moveWithPP[i].moveId);
|
||||||
SetMonData(DATA.currentMon, MON_DATA_PP1 + i, &pp[i]);
|
SetMonData(DATA.currentMon, MON_DATA_PP1 + i, &moveWithPP[i].pp);
|
||||||
}
|
}
|
||||||
DATA.explicitMoves[DATA.currentSide] |= 1 << DATA.currentPartyIndex;
|
DATA.explicitMoves[DATA.currentSide] |= 1 << DATA.currentPartyIndex;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user