mirror of
https://github.com/pret/pokeemerald.git
synced 2026-04-25 15:57:29 -05:00
Fix Wall Werrors on modern (#3412)
* Fix Wall Werror errors * fix hgss pokedex modern errors * tests build on modern * learnset change * Update src/battle_ai_util.c Co-authored-by: Philipp AUER <SBird1337@users.noreply.github.com> * Update src/battle_anim_new.c Co-authored-by: Philipp AUER <SBird1337@users.noreply.github.com> * Update src/debug.c Co-authored-by: Philipp AUER <SBird1337@users.noreply.github.com> * Update src/debug.c Co-authored-by: Philipp AUER <SBird1337@users.noreply.github.com> * Update src/pokedex_plus_hgss.c Co-authored-by: Philipp AUER <SBird1337@users.noreply.github.com> * review changes * unused cmd args * various args back --------- Co-authored-by: Philipp AUER <SBird1337@users.noreply.github.com>
This commit is contained in:
parent
311224d32f
commit
a7b9d139da
2
Makefile
2
Makefile
|
|
@ -119,7 +119,7 @@ LIBPATH := -L ../../tools/agbcc/lib
|
|||
LIB := $(LIBPATH) -lgcc -lc -L../../libagbsyscall -lagbsyscall
|
||||
else
|
||||
CC1 = $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet
|
||||
override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17
|
||||
override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias
|
||||
ifeq ($(ANALYZE),1)
|
||||
override CFLAGS += -fanalyzer
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -19426,8 +19426,8 @@ Move_MILK_DRINK:
|
|||
Move_MAGNITUDE:
|
||||
createvisualtask AnimTask_IsPowerOver99, 2
|
||||
waitforvisualfinish
|
||||
jumpargeq 15, FALSE, MagnitudeRegular
|
||||
jumpargeq 15, TRUE, MagnitudeIntense
|
||||
jumpreteq FALSE, MagnitudeRegular
|
||||
jumpreteq TRUE, MagnitudeIntense
|
||||
MagnitudeEnd:
|
||||
end
|
||||
MagnitudeRegular:
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ void AnimateSprites(void)
|
|||
void BuildOamBuffer(void)
|
||||
{
|
||||
bool32 oamLoadDisabled;
|
||||
u32 i, stride;
|
||||
u32 i;
|
||||
u8 oamIndex;
|
||||
|
||||
// All attributes which affect sorting packed into a single u32:
|
||||
|
|
|
|||
|
|
@ -922,7 +922,7 @@ extern u16 gBattle_WIN0H;
|
|||
extern u16 gBattle_WIN0V;
|
||||
extern u16 gBattle_WIN1H;
|
||||
extern u16 gBattle_WIN1V;
|
||||
extern u8 gDisplayedStringBattle[400];
|
||||
extern u8 gDisplayedStringBattle[425];
|
||||
extern u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT];
|
||||
extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT];
|
||||
extern u8 gBattleTextBuff3[30]; //to handle stupidly large z move names
|
||||
|
|
|
|||
|
|
@ -24,6 +24,13 @@
|
|||
score += val; \
|
||||
} while (0) \
|
||||
|
||||
#define ADJUST_SCORE_PTR(val) \
|
||||
do \
|
||||
{ \
|
||||
TestRunner_Battle_AIAdjustScore(__FILE__, __LINE__, sBattler_AI, AI_THINKING_STRUCT->movesetIndex, val); \
|
||||
(*score) += val; \
|
||||
} while (0) \
|
||||
|
||||
#define RETURN_SCORE_PLUS(val) \
|
||||
{ \
|
||||
ADJUST_SCORE(val); \
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@
|
|||
|
||||
#define LEVEL_UP_MOVE_ID 0x01FF
|
||||
#define LEVEL_UP_MOVE_LV 0xFE00
|
||||
#define LEVEL_UP_END 0xFFFF
|
||||
#define LEVEL_UP_MOVE_END 0xFFFF
|
||||
|
||||
#define MAX_LEVEL_UP_MOVES 20
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ struct Weather
|
|||
s16 droughtTimer;
|
||||
s16 droughtState;
|
||||
u8 droughtUnused[9];
|
||||
s8 loadDroughtPalsIndex;
|
||||
u8 loadDroughtPalsIndex;
|
||||
u8 loadDroughtPalsOffset;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -893,8 +893,8 @@ enum { TURN_CLOSED, TURN_OPEN, TURN_CLOSING };
|
|||
|
||||
#define EXPECT_MOVE(battler, ...) ExpectMove(__LINE__, battler, (struct MoveContext) { APPEND_TRUE(__VA_ARGS__) })
|
||||
#define NOT_EXPECT_MOVE(battler, _move) ExpectMove(__LINE__, battler, (struct MoveContext) { .move = _move, .explicitMove = TRUE, .notExpected = TRUE, .explicitNotExpected = TRUE, })
|
||||
#define EXPECT_MOVES(battler, ...) ExpectMoves(__LINE__, battler, FALSE, (struct FourMoves) { __VA_ARGS__ })
|
||||
#define NOT_EXPECT_MOVES(battler, ...) ExpectMoves(__LINE__, battler, TRUE, (struct FourMoves) { __VA_ARGS__ })
|
||||
#define EXPECT_MOVES(battler, ...) ExpectMoves(__LINE__, battler, FALSE, (struct FourMoves) {{ __VA_ARGS__ }})
|
||||
#define NOT_EXPECT_MOVES(battler, ...) ExpectMoves(__LINE__, battler, TRUE, (struct FourMoves) {{ __VA_ARGS__ }})
|
||||
#define EXPECT_SEND_OUT(battler, partyIndex) ExpectSendOut(__LINE__, battler, partyIndex)
|
||||
#define EXPECT_SWITCH(battler, partyIndex) ExpectSwitch(__LINE__, battler, partyIndex)
|
||||
#define SCORE_EQ(battler, ...) Score(__LINE__, battler, CMP_EQUAL, FALSE, (struct TestAIScoreStruct) { APPEND_TRUE(__VA_ARGS__) } )
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ static u16 GetRandomAlternateMove(u8 monId)
|
|||
else // == APPRENTICE_LVL_MODE_OPEN
|
||||
level = 60; // Despite being open level, level up moves are only read up to level 60
|
||||
|
||||
for (j = 0; learnset[j].move != LEVEL_UP_END; j++)
|
||||
for (j = 0; learnset[j].move != LEVEL_UP_MOVE_END; j++)
|
||||
{
|
||||
if (learnset[j].level > level)
|
||||
break;
|
||||
|
|
@ -468,7 +468,7 @@ static void GetLatestLearnedMoves(u16 species, u16 *moves)
|
|||
level = 60;
|
||||
|
||||
learnset = gLevelUpLearnsets[species];
|
||||
for (i = 0; learnset[i].move != LEVEL_UP_END; i++)
|
||||
for (i = 0; learnset[i].move != LEVEL_UP_MOVE_END; i++)
|
||||
{
|
||||
if (learnset[i].level > level)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ void BattleAI_SetupItems(void)
|
|||
static u32 GetWildAiFlags(void)
|
||||
{
|
||||
u32 avgLevel = GetMonData(&gEnemyParty[0], MON_DATA_LEVEL);
|
||||
u32 flags;
|
||||
u32 flags = 0;
|
||||
|
||||
if (IsDoubleBattle())
|
||||
avgLevel = (GetMonData(&gEnemyParty[0], MON_DATA_LEVEL) + GetMonData(&gEnemyParty[1], MON_DATA_LEVEL)) / 2;
|
||||
|
|
@ -174,7 +174,7 @@ void BattleAI_SetupFlags(void)
|
|||
// sBattler_AI set in ComputeBattleAiScores
|
||||
void BattleAI_SetupAIData(u8 defaultScoreMoves, u32 battler)
|
||||
{
|
||||
s32 i, move, dmg;
|
||||
s32 i;
|
||||
u8 moveLimitations;
|
||||
|
||||
// Clear AI data but preserve the flags.
|
||||
|
|
@ -492,7 +492,7 @@ static u32 ChooseMoveOrAction_Singles(u32 battlerAi)
|
|||
u8 currentMoveArray[MAX_MON_MOVES];
|
||||
u8 consideredMoveArray[MAX_MON_MOVES];
|
||||
u32 numOfBestMoves;
|
||||
s32 i, id;
|
||||
s32 i;
|
||||
u32 flags = AI_THINKING_STRUCT->aiFlags;
|
||||
|
||||
AI_DATA->partnerMove = 0; // no ally
|
||||
|
|
@ -721,7 +721,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
|||
u32 moveEffect = gBattleMoves[move].effect;
|
||||
s32 moveType;
|
||||
u32 moveTarget = AI_GetBattlerMoveTargetType(battlerAtk, move);
|
||||
u32 accuracy = AI_DATA->moveAccuracy[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex];
|
||||
struct AiLogicData *aiData = AI_DATA;
|
||||
u32 effectiveness = aiData->effectiveness[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex];
|
||||
bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk);
|
||||
|
|
@ -3141,26 +3140,13 @@ static u32 CompareMoveAccuracies(u32 battlerAtk, u32 battlerDef, u32 moveSlot1,
|
|||
return 2;
|
||||
}
|
||||
|
||||
static u32 GetAIMostDamagingMoveId(u32 battlerAtk, u32 battlerDef)
|
||||
{
|
||||
u32 i, id = 0;
|
||||
u32 mostDmg = 0;
|
||||
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
if (AI_DATA->simulatedDmg[battlerAtk][battlerDef][i] > mostDmg)
|
||||
id = i, mostDmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][i];
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
static s32 AI_CompareDamagingMoves(u32 battlerAtk, u32 battlerDef, u32 currId)
|
||||
{
|
||||
u32 i;
|
||||
bool32 multipleBestMoves = FALSE;
|
||||
s32 noOfHits[MAX_MON_MOVES];
|
||||
s32 score = 0;
|
||||
s32 leastHits = 1000, leastHitsId = 0;
|
||||
s32 leastHits = 1000;
|
||||
u16 *moves = GetMovesArray(battlerAtk);
|
||||
bool8 isPowerfulIgnoredEffect[MAX_MON_MOVES];
|
||||
|
||||
|
|
@ -3172,7 +3158,6 @@ static s32 AI_CompareDamagingMoves(u32 battlerAtk, u32 battlerDef, u32 currId)
|
|||
if (noOfHits[i] < leastHits)
|
||||
{
|
||||
leastHits = noOfHits[i];
|
||||
leastHitsId = i;
|
||||
}
|
||||
isPowerfulIgnoredEffect[i] = IsInIgnoredPowerfulMoveEffects(gBattleMoves[moves[i]].effect);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -420,7 +420,6 @@ static bool8 ShouldSwitchIfGameStatePrompt(u32 battler)
|
|||
|
||||
static bool8 ShouldSwitchIfAbilityBenefit(u32 battler)
|
||||
{
|
||||
s32 monToSwitchId;
|
||||
s32 moduloChance = 4; //25% Chance Default
|
||||
s32 chanceReducer = 1; //No Reduce default. Increase to reduce
|
||||
|
||||
|
|
@ -894,7 +893,7 @@ static u32 GetBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId,
|
|||
|
||||
static u32 GetBestMonDmg(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 battler, u32 opposingBattler)
|
||||
{
|
||||
int i, j;
|
||||
int i;
|
||||
int dmg, bestDmg = 0;
|
||||
int bestMonId = PARTY_SIZE;
|
||||
|
||||
|
|
@ -926,7 +925,7 @@ u8 GetMostSuitableMonToSwitchInto(u32 battler)
|
|||
s32 firstId = 0;
|
||||
s32 lastId = 0; // + 1
|
||||
struct Pokemon *party;
|
||||
s32 i, j, aliveCount = 0;
|
||||
s32 i, aliveCount = 0;
|
||||
u32 invalidMons = 0, aceMonId = PARTY_SIZE;
|
||||
|
||||
if (*(gBattleStruct->monToSwitchIntoId + battler) != PARTY_SIZE)
|
||||
|
|
@ -1004,8 +1003,6 @@ u8 GetMostSuitableMonToSwitchInto(u32 battler)
|
|||
|
||||
static bool32 AiExpectsToFaintPlayer(u32 battler)
|
||||
{
|
||||
bool32 canFaintPlayer;
|
||||
u32 i;
|
||||
u8 target = gBattleStruct->aiChosenTarget[battler];
|
||||
|
||||
if (gBattleStruct->aiMoveOrAction[battler] > 3)
|
||||
|
|
@ -1059,7 +1056,6 @@ static bool8 ShouldUseItem(u32 battler)
|
|||
{
|
||||
u16 item;
|
||||
const u8 *itemEffects;
|
||||
u8 paramOffset;
|
||||
u8 battlerSide;
|
||||
|
||||
item = gBattleResources->battleHistory->trainerItems[i];
|
||||
|
|
|
|||
|
|
@ -702,7 +702,7 @@ s32 AI_CalcDamageSaveBattlers(u32 move, u32 battlerAtk, u32 battlerDef, u8 *type
|
|||
{
|
||||
SaveBattlerData(battlerAtk);
|
||||
SaveBattlerData(battlerDef);
|
||||
AI_CalcDamage(move, battlerAtk, battlerDef, typeEffectiveness, considerZPower, AI_GetWeather(AI_DATA));
|
||||
return AI_CalcDamage(move, battlerAtk, battlerDef, typeEffectiveness, considerZPower, AI_GetWeather(AI_DATA));
|
||||
}
|
||||
|
||||
static inline s32 LowestRollDmg(s32 dmg)
|
||||
|
|
@ -1225,7 +1225,6 @@ u32 AI_WhoStrikesFirst(u32 battlerAI, u32 battler2, u32 moveConsidered)
|
|||
{
|
||||
u32 fasterAI = 0, fasterPlayer = 0, i;
|
||||
s8 prioAI = 0;
|
||||
s8 prioPlayer = 0;
|
||||
s8 prioBattler2 = 0;
|
||||
u16 *battler2Moves = GetMovesArray(battler2);
|
||||
|
||||
|
|
@ -1271,7 +1270,7 @@ u32 AI_WhoStrikesFirst(u32 battlerAI, u32 battler2, u32 moveConsidered)
|
|||
// Check if target has means to faint ai mon.
|
||||
bool32 CanTargetFaintAi(u32 battlerDef, u32 battlerAtk)
|
||||
{
|
||||
s32 i, dmg;
|
||||
s32 i;
|
||||
u32 unusable = AI_DATA->moveLimitations[battlerDef];
|
||||
u16 *moves = GetMovesArray(battlerDef);
|
||||
|
||||
|
|
@ -1460,8 +1459,6 @@ bool32 AI_IsBattlerGrounded(u32 battlerId)
|
|||
|
||||
bool32 DoesBattlerIgnoreAbilityChecks(u32 atkAbility, u32 move)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_UNAWARE)
|
||||
return FALSE; // AI handicap flag: doesn't understand ability suppression concept
|
||||
|
||||
|
|
@ -1490,8 +1487,6 @@ u32 AI_GetWeather(struct AiLogicData *aiData)
|
|||
|
||||
u32 AI_GetBattlerMoveTargetType(u32 battlerId, u32 move)
|
||||
{
|
||||
u32 target;
|
||||
|
||||
if (gBattleMoves[move].effect == EFFECT_EXPANDING_FORCE && AI_IsTerrainAffected(battlerId, STATUS_FIELD_PSYCHIC_TERRAIN))
|
||||
return MOVE_TARGET_BOTH;
|
||||
else
|
||||
|
|
@ -1500,8 +1495,6 @@ u32 AI_GetBattlerMoveTargetType(u32 battlerId, u32 move)
|
|||
|
||||
bool32 IsAromaVeilProtectedMove(u32 move)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
switch (move)
|
||||
{
|
||||
case MOVE_DISABLE:
|
||||
|
|
@ -1797,42 +1790,40 @@ bool32 ShouldSetSnow(u32 battler, u32 ability, u32 holdEffect)
|
|||
void ProtectChecks(u32 battlerAtk, u32 battlerDef, u32 move, u32 predictedMove, s32 *score)
|
||||
{
|
||||
// TODO more sophisticated logic
|
||||
u32 predictedEffect = gBattleMoves[predictedMove].effect;
|
||||
u32 defAbility = AI_DATA->abilities[battlerDef];
|
||||
u32 uses = gDisableStructs[battlerAtk].protectUses;
|
||||
|
||||
/*if (GetMoveResultFlags(predictedMove) & (MOVE_RESULT_NO_EFFECT | MOVE_RESULT_MISSED))
|
||||
{
|
||||
(*score) -= 5;
|
||||
ADJUST_SCORE_PTR(-5);
|
||||
return;
|
||||
}*/
|
||||
|
||||
if (uses == 0)
|
||||
{
|
||||
if (predictedMove != MOVE_NONE && predictedMove != 0xFFFF && !IS_MOVE_STATUS(predictedMove))
|
||||
(*score) += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else if (Random() % 256 < 100)
|
||||
(*score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsDoubleBattle())
|
||||
(*score) -= 2 * min(uses, 3);
|
||||
ADJUST_SCORE_PTR(-(2 * min(uses, 3)));
|
||||
else
|
||||
(*score) -= min(uses, 3);
|
||||
ADJUST_SCORE_PTR(-(min(uses, 3)));
|
||||
}
|
||||
|
||||
if (gBattleMons[battlerAtk].status1 & (STATUS1_PSN_ANY | STATUS1_BURN | STATUS1_FROSTBITE)
|
||||
|| gBattleMons[battlerAtk].status2 & (STATUS2_CURSED | STATUS2_INFATUATION)
|
||||
|| gStatuses3[battlerAtk] & (STATUS3_PERISH_SONG | STATUS3_LEECHSEED | STATUS3_YAWN))
|
||||
{
|
||||
(*score)--;
|
||||
ADJUST_SCORE_PTR(-1);
|
||||
}
|
||||
|
||||
if (gBattleMons[battlerDef].status1 & STATUS1_TOXIC_POISON
|
||||
|| gBattleMons[battlerDef].status2 & (STATUS2_CURSED | STATUS2_INFATUATION)
|
||||
|| gStatuses3[battlerDef] & (STATUS3_PERISH_SONG | STATUS3_LEECHSEED | STATUS3_YAWN))
|
||||
(*score) += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
}
|
||||
|
||||
// stat stages
|
||||
|
|
@ -3388,7 +3379,7 @@ bool32 PartnerMoveIsSameNoTarget(u32 battlerAtkPartner, u32 move, u32 partnerMov
|
|||
bool32 ShouldUseWishAromatherapy(u32 battlerAtk, u32 battlerDef, u32 move)
|
||||
{
|
||||
u32 i;
|
||||
u32 firstId, lastId;
|
||||
s32 firstId, lastId;
|
||||
struct Pokemon* party;
|
||||
bool32 hasStatus = FALSE;
|
||||
bool32 needHealing = FALSE;
|
||||
|
|
@ -3471,7 +3462,7 @@ void FreeRestoreBattleMons(struct BattlePokemon *savedBattleMons)
|
|||
// party logic
|
||||
s32 AI_CalcPartyMonBestMoveDamage(u32 battlerAtk, u32 battlerDef, struct Pokemon *attackerMon, struct Pokemon *targetMon)
|
||||
{
|
||||
s32 i, move, bestDmg, dmg;
|
||||
s32 i, move, bestDmg, dmg = 0;
|
||||
u8 effectiveness;
|
||||
struct BattlePokemon *savedBattleMons = AllocSaveBattleMons();
|
||||
|
||||
|
|
@ -3559,7 +3550,6 @@ bool32 IsPartyFullyHealedExceptBattler(u32 battlerId)
|
|||
|
||||
bool32 PartyHasMoveSplit(u32 battlerId, u32 split)
|
||||
{
|
||||
u32 firstId, lastId;
|
||||
struct Pokemon *party = GetBattlerParty(battlerId);
|
||||
u32 i, j;
|
||||
|
||||
|
|
@ -3695,39 +3685,39 @@ void IncreaseStatUpScore(u32 battlerAtk, u32 battlerDef, u32 statId, s32 *score)
|
|||
if (HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL) && AI_DATA->hpPercents[battlerAtk] > 40)
|
||||
{
|
||||
if (gBattleMons[battlerAtk].statStages[STAT_ATK] < STAT_UP_2_STAGE)
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else if (gBattleMons[battlerAtk].statStages[STAT_ATK] < STAT_UP_STAGE)
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
if (HasMoveEffect(battlerAtk, EFFECT_FOUL_PLAY))
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
break;
|
||||
case STAT_DEF:
|
||||
if ((HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)|| IS_MOVE_PHYSICAL(gLastMoves[battlerDef]))
|
||||
&& AI_DATA->hpPercents[battlerAtk] > 70)
|
||||
{
|
||||
if (gBattleMons[battlerAtk].statStages[STAT_DEF] < STAT_UP_2_STAGE)
|
||||
*score += 2; // seems better to raise def at higher HP
|
||||
ADJUST_SCORE_PTR(2); // seems better to raise def at higher HP
|
||||
else if (gBattleMons[battlerAtk].statStages[STAT_DEF] < STAT_UP_STAGE)
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
break;
|
||||
case STAT_SPEED:
|
||||
if (!AI_STRIKES_FIRST(battlerAtk, battlerDef, AI_THINKING_STRUCT->moveConsidered))
|
||||
{
|
||||
if (gBattleMons[battlerAtk].statStages[STAT_SPEED] < STAT_UP_2_STAGE)
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else if (gBattleMons[battlerAtk].statStages[STAT_SPEED] < STAT_UP_STAGE)
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
break;
|
||||
case STAT_SPATK:
|
||||
if (HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL) && AI_DATA->hpPercents[battlerAtk] > 40)
|
||||
{
|
||||
if (gBattleMons[battlerAtk].statStages[STAT_SPATK] < STAT_UP_2_STAGE)
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else if (gBattleMons[battlerAtk].statStages[STAT_SPATK] < STAT_UP_STAGE)
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
break;
|
||||
case STAT_SPDEF:
|
||||
|
|
@ -3735,24 +3725,24 @@ void IncreaseStatUpScore(u32 battlerAtk, u32 battlerDef, u32 statId, s32 *score)
|
|||
&& AI_DATA->hpPercents[battlerAtk] > 70)
|
||||
{
|
||||
if (gBattleMons[battlerAtk].statStages[STAT_SPDEF] < STAT_UP_2_STAGE)
|
||||
*score += 2; // seems better to raise spdef at higher HP
|
||||
ADJUST_SCORE_PTR(2); // seems better to raise spdef at higher HP
|
||||
else if (gBattleMons[battlerAtk].statStages[STAT_SPDEF] < STAT_UP_STAGE)
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
break;
|
||||
case STAT_ACC:
|
||||
if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 80, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef]))
|
||||
*score += 2; // has moves with less than 80% accuracy
|
||||
ADJUST_SCORE_PTR(2); // has moves with less than 80% accuracy
|
||||
else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef]))
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
break;
|
||||
case STAT_EVASION:
|
||||
if (!BattlerWillFaintFromWeather(battlerAtk, AI_DATA->abilities[battlerAtk]))
|
||||
{
|
||||
if (!GetBattlerSecondaryDamage(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_ROOTED))
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -3767,18 +3757,18 @@ void IncreasePoisonScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score)
|
|||
if (AI_CanPoison(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove) && AI_DATA->hpPercents[battlerDef] > 20)
|
||||
{
|
||||
if (!HasDamagingMove(battlerDef))
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
|
||||
if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_STALL && HasMoveEffect(battlerAtk, EFFECT_PROTECT))
|
||||
(*score)++; // stall tactic
|
||||
ADJUST_SCORE_PTR(1); // stall tactic
|
||||
|
||||
if (HasMoveEffect(battlerAtk, EFFECT_VENOSHOCK)
|
||||
|| HasMoveEffect(battlerAtk, EFFECT_HEX)
|
||||
|| HasMoveEffect(battlerAtk, EFFECT_VENOM_DRENCH)
|
||||
|| AI_DATA->abilities[battlerAtk] == ABILITY_MERCILESS)
|
||||
*(score) += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3790,15 +3780,15 @@ void IncreaseBurnScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score)
|
|||
|
||||
if (AI_CanBurn(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove))
|
||||
{
|
||||
(*score)++; // burning is good
|
||||
ADJUST_SCORE_PTR(1); // burning is good
|
||||
if (HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL))
|
||||
{
|
||||
if (CanTargetFaintAi(battlerDef, battlerAtk))
|
||||
*score += 2; // burning the target to stay alive is cool
|
||||
ADJUST_SCORE_PTR(2); // burning the target to stay alive is cool
|
||||
}
|
||||
|
||||
if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_HEX))
|
||||
(*score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3818,9 +3808,9 @@ void IncreaseParalyzeScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score)
|
|||
|| HasMoveEffect(battlerAtk, EFFECT_FLINCH_HIT)
|
||||
|| gBattleMons[battlerDef].status2 & STATUS2_INFATUATION
|
||||
|| gBattleMons[battlerDef].status2 & STATUS2_CONFUSION)
|
||||
*score += 4;
|
||||
ADJUST_SCORE_PTR(4);
|
||||
else
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3831,16 +3821,16 @@ void IncreaseSleepScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score)
|
|||
return;
|
||||
|
||||
if (AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove))
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else
|
||||
return;
|
||||
|
||||
if ((HasMoveEffect(battlerAtk, EFFECT_DREAM_EATER) || HasMoveEffect(battlerAtk, EFFECT_NIGHTMARE))
|
||||
&& !(HasMoveEffect(battlerDef, EFFECT_SNORE) || HasMoveEffect(battlerDef, EFFECT_SLEEP_TALK)))
|
||||
(*score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
|
||||
if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_HEX))
|
||||
(*score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
|
||||
void IncreaseConfusionScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score)
|
||||
|
|
@ -3856,9 +3846,9 @@ void IncreaseConfusionScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score
|
|||
if (gBattleMons[battlerDef].status1 & STATUS1_PARALYSIS
|
||||
|| gBattleMons[battlerDef].status2 & STATUS2_INFATUATION
|
||||
|| (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && HasMoveEffect(battlerAtk, EFFECT_FLINCH_HIT)))
|
||||
*score += 3;
|
||||
ADJUST_SCORE_PTR(3);
|
||||
else
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3869,15 +3859,15 @@ void IncreaseFrostbiteScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score
|
|||
|
||||
if (AI_CanGiveFrostbite(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove))
|
||||
{
|
||||
(*score)++; // frostbite is good
|
||||
ADJUST_SCORE_PTR(1); // frostbite is good
|
||||
if (HasMoveWithSplit(battlerDef, SPLIT_SPECIAL))
|
||||
{
|
||||
if (CanTargetFaintAi(battlerDef, battlerAtk))
|
||||
*score += 2; // frostbiting the target to stay alive is cool
|
||||
ADJUST_SCORE_PTR(2); // frostbiting the target to stay alive is cool
|
||||
}
|
||||
|
||||
if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_HEX))
|
||||
(*score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -248,6 +248,7 @@ void LaunchBattleAnimation(u32 animType, u32 animId)
|
|||
switch (animType)
|
||||
{
|
||||
case ANIM_TYPE_GENERAL:
|
||||
default:
|
||||
animsTable = gBattleAnims_General;
|
||||
break;
|
||||
case ANIM_TYPE_MOVE:
|
||||
|
|
|
|||
2
src/battle_anim_effects_3.c
Executable file → Normal file
2
src/battle_anim_effects_3.c
Executable file → Normal file
|
|
@ -721,8 +721,6 @@ const struct SpriteTemplate gSweetScentPetalSpriteTemplate =
|
|||
.callback = AnimSweetScentPetal,
|
||||
};
|
||||
|
||||
static const u16 sUnusedPalette[] = INCBIN_U16("graphics/battle_anims/unused/unknown.gbapal");
|
||||
|
||||
const union AnimCmd gPainSplitAnimCmds[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 5),
|
||||
|
|
|
|||
|
|
@ -1447,7 +1447,6 @@ static void AnimPoltergeistItem(struct Sprite *sprite)
|
|||
void AnimTask_PulverizingPancakeWhiteShadow(u8 taskId)
|
||||
{
|
||||
struct Task *task;
|
||||
s16 battler;
|
||||
u8 spriteId;
|
||||
s16 baseX, baseY;
|
||||
s16 x, y;
|
||||
|
|
|
|||
|
|
@ -750,7 +750,7 @@ static void SetBattlersXOffsetForShake(struct Task *task)
|
|||
|
||||
void AnimTask_IsPowerOver99(u8 taskId)
|
||||
{
|
||||
gBattleAnimArgs[15] = gAnimMovePower > 99;
|
||||
gBattleAnimArgs[ARG_RET_ID] = gAnimMovePower > 99;
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,8 +81,6 @@ static void SpriteCB_HorizontalSliceStep(struct Sprite *sprite);
|
|||
static void SpriteCB_HorizontalSlice(struct Sprite *sprite);
|
||||
static void SpriteCB_LashOutStrike(struct Sprite* sprite);
|
||||
static void AnimTask_TwinkleTackleLaunchStep(u8 taskId);
|
||||
static void SpriteCB_ShellSmashShell(struct Sprite* sprite);
|
||||
static void SpriteCB_ShellSmashShell_DestroyDuringFadeOut(struct Sprite* sprite);
|
||||
static void SpriteCB_AnimSpriteOnTargetSideCentre(struct Sprite *sprite);
|
||||
static void SpriteCB_SpriteOnMonUntilAffineAnimEnds(struct Sprite* sprite);
|
||||
static void SpriteCB_MoveSpriteUpwardsForDurationStep(struct Sprite* sprite);
|
||||
|
|
@ -8727,6 +8725,7 @@ static void SpriteCB_LashOutStrike(struct Sprite* sprite)
|
|||
sprite->callback = AnimKnockOffStrike_Step;
|
||||
}
|
||||
|
||||
/* TODO - Use the ShellSmash Anim
|
||||
//Moves the shells towards the attacker and leaves them there until they fade out
|
||||
//arg 0: Initial x-pos
|
||||
//arg 1: Final x-pos
|
||||
|
|
@ -8754,6 +8753,7 @@ static void SpriteCB_ShellSmashShell_DestroyDuringFadeOut(struct Sprite* sprite)
|
|||
if (GetGpuReg(REG_OFFSET_BLDALPHA) >= BLDALPHA_BLEND(0, 8)) //Fade out 1/2 done
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
*/
|
||||
|
||||
static void SpriteCB_AnimSpriteOnTargetSideCentre(struct Sprite *sprite)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -351,8 +351,7 @@ const struct SpriteTemplate gSeedFlareGreenWavesTemplate =
|
|||
|
||||
static void AnimStealthRock(struct Sprite *sprite)
|
||||
{
|
||||
u16 x;
|
||||
u16 y;
|
||||
s16 x, y;
|
||||
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &x, &y);
|
||||
|
|
|
|||
|
|
@ -57,9 +57,6 @@ static void AnimAquaTail(struct Sprite *sprite);
|
|||
static void AnimKnockOffAquaTail(struct Sprite *sprite);
|
||||
static void AnimKnockOffAquaTailStep(struct Sprite *sprite);
|
||||
|
||||
static const u8 sUnusedWater_Gfx[] = INCBIN_U8("graphics/battle_anims/unused/water_gfx.4bpp");
|
||||
static const u8 sUnusedWater[] = INCBIN_U8("graphics/battle_anims/unused/water.bin");
|
||||
|
||||
static const union AnimCmd sAnim_RainDrop[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 2),
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ static void CompleteOnBattlerSpritePosX_0(u32 battler)
|
|||
static u16 GetPrevBall(u16 ballId)
|
||||
{
|
||||
u16 ballPrev;
|
||||
u32 i, j;
|
||||
s32 i, j;
|
||||
CompactItemsInBagPocket(&gBagPockets[BALLS_POCKET]);
|
||||
for (i = 0; i < gBagPockets[BALLS_POCKET].capacity; i++)
|
||||
{
|
||||
|
|
@ -218,28 +218,29 @@ static u16 GetPrevBall(u16 ballId)
|
|||
}
|
||||
}
|
||||
i--;
|
||||
return gBagPockets[BALLS_POCKET].itemSlots[i].itemId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return gBagPockets[BALLS_POCKET].itemSlots[i].itemId;
|
||||
}
|
||||
|
||||
static u16 GetNextBall(u16 ballId)
|
||||
{
|
||||
u16 ballNext;
|
||||
u32 i;
|
||||
u16 ballNext = 0;
|
||||
s32 i;
|
||||
CompactItemsInBagPocket(&gBagPockets[BALLS_POCKET]);
|
||||
for (i = 0; i < gBagPockets[BALLS_POCKET].capacity; i++)
|
||||
{
|
||||
if (ballId == gBagPockets[BALLS_POCKET].itemSlots[i].itemId)
|
||||
{
|
||||
i++;
|
||||
ballNext = gBagPockets[BALLS_POCKET].itemSlots[i].itemId;
|
||||
if (ballNext == ITEM_NONE)
|
||||
return gBagPockets[BALLS_POCKET].itemSlots[0].itemId; // Zeroth slot
|
||||
else
|
||||
return ballNext;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ballNext == ITEM_NONE)
|
||||
return gBagPockets[BALLS_POCKET].itemSlots[0].itemId; // Zeroth slot
|
||||
else
|
||||
return ballNext;
|
||||
}
|
||||
|
||||
static void HandleInputChooseAction(u32 battler)
|
||||
|
|
@ -1789,7 +1790,7 @@ static void PlayerHandleDrawTrainerPic(u32 battler)
|
|||
{
|
||||
bool32 isFrontPic;
|
||||
s16 xPos, yPos;
|
||||
u32 trainerPicId, gender;
|
||||
u32 trainerPicId;
|
||||
|
||||
trainerPicId = PlayerGetTrainerBackPicId();
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
|
|
|
|||
|
|
@ -841,7 +841,7 @@ static const u8 *const sAiInfoItemNames[] =
|
|||
|
||||
static void PutAiInfoText(struct BattleDebugMenu *data)
|
||||
{
|
||||
u32 i, j, count;
|
||||
u32 i;
|
||||
u8 *text = Alloc(0x50);
|
||||
|
||||
FillWindowPixelBuffer(data->aiMovesWindowId, 0x11);
|
||||
|
|
|
|||
|
|
@ -2796,7 +2796,6 @@ static int SelectOpponentMonsFromParty(int *partyMovePoints, bool8 allowRandom)
|
|||
static int GetTypeEffectivenessPoints(int move, int targetSpecies, int mode)
|
||||
{
|
||||
int defType1, defType2, defAbility, moveType;
|
||||
int i = 0;
|
||||
int typePower = TYPE_x1;
|
||||
|
||||
if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || IS_MOVE_STATUS(move))
|
||||
|
|
|
|||
|
|
@ -754,12 +754,6 @@ static const struct SpriteTemplate sSpriteTemplate_BurstTrigger =
|
|||
#define hBar_HealthBoxSpriteId data[5]
|
||||
#define hBar_Data6 data[6]
|
||||
|
||||
static void InitLastUsedBallAssets(void)
|
||||
{
|
||||
gBattleStruct->ballSpriteIds[0] = MAX_SPRITES;
|
||||
gBattleStruct->ballSpriteIds[1] = MAX_SPRITES;
|
||||
}
|
||||
|
||||
// This function is here to cover a specific case - one player's mon in a 2 vs 1 double battle. In this scenario - display singles layout.
|
||||
// The same goes for a 2 vs 1 where opponent has only one pokemon.
|
||||
u32 WhichBattleCoords(u32 battlerId) // 0 - singles, 1 - doubles
|
||||
|
|
@ -780,7 +774,7 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId)
|
|||
{
|
||||
s16 data6 = 0;
|
||||
u8 healthboxLeftSpriteId, healthboxRightSpriteId;
|
||||
u8 healthbarSpriteId, megaIndicatorSpriteId;
|
||||
u8 healthbarSpriteId;
|
||||
struct Sprite *healthBarSpritePtr;
|
||||
|
||||
if (WhichBattleCoords(battlerId) == 0) // Singles
|
||||
|
|
@ -1088,7 +1082,7 @@ static void UpdateLvlInHealthbox(u8 healthboxSpriteId, u8 lvl)
|
|||
static void PrintHpOnHealthbox(u32 spriteId, s16 currHp, s16 maxHp, u32 bgColor, u32 rightTile, u32 leftTile)
|
||||
{
|
||||
u8 *windowTileData;
|
||||
u32 windowId, tilesCount, x, healthboxTileNum;
|
||||
u32 windowId, tilesCount, x;
|
||||
u8 text[28], *txtPtr;
|
||||
void *objVram = (void *)(OBJ_VRAM0) + gSprites[spriteId].oam.tileNum * TILE_SIZE_4BPP;
|
||||
|
||||
|
|
@ -1690,7 +1684,6 @@ void MegaIndicator_LoadSpritesGfx(void)
|
|||
|
||||
static bool32 MegaIndicator_ShouldBeInvisible(u32 battlerId, struct Sprite *sprite)
|
||||
{
|
||||
u32 side = GetBattlerSide(battlerId);
|
||||
bool32 megaEvolved = IsBattlerMegaEvolved(battlerId);
|
||||
bool32 primalReverted = IsBattlerPrimalReverted(battlerId);
|
||||
|
||||
|
|
@ -1737,7 +1730,6 @@ static void MegaIndicator_UpdateOamPriority(u32 healthboxId, u32 oamPriority)
|
|||
|
||||
static void MegaIndicator_UpdateLevel(u32 healthboxId, u32 level)
|
||||
{
|
||||
u32 i;
|
||||
s16 xDelta = 0;
|
||||
u8 *spriteId = MegaIndicator_GetSpriteId(healthboxId);
|
||||
|
||||
|
|
@ -1752,7 +1744,7 @@ static void MegaIndicator_UpdateLevel(u32 healthboxId, u32 level)
|
|||
static void MegaIndicator_CreateSprite(u32 battlerId, u32 healthboxSpriteId)
|
||||
{
|
||||
struct SpriteTemplate sprTemplate;
|
||||
u32 position, level;
|
||||
u32 position;
|
||||
u8 *spriteId;
|
||||
s16 xHealthbox = 0, y = 0;
|
||||
s32 x = 0;
|
||||
|
|
@ -3656,13 +3648,13 @@ static void Task_BounceBall(u8 taskId)
|
|||
sprite->callback = SpriteCB_LastUsedBallBounce; //Show and bounce down
|
||||
task->sState++;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 4: // Destroy Task
|
||||
if(!sprite->sMoving)
|
||||
{
|
||||
sprite->callback = SpriteCB_LastUsedBall;
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!gLastUsedBallMenuPresent)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -587,7 +587,6 @@ static void BattleIntroSlidePartner(u8 taskId)
|
|||
void DrawBattlerOnBg(int bgId, u8 x, u8 y, u8 battlerPosition, u8 paletteId, u8 *tiles, u16 *tilemap, u16 tilesOffset)
|
||||
{
|
||||
int i, j;
|
||||
u8 battler = GetBattlerAtPosition(battlerPosition);
|
||||
int offset = tilesOffset;
|
||||
CpuCopy16(gMonSpritesGfxPtr->sprites.ptr[battlerPosition], tiles, BG_SCREEN_SIZE);
|
||||
LoadBgTiles(bgId, tiles, 0x1000, tilesOffset);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ static void AskRecordBattle(void);
|
|||
static void SpriteCB_MoveWildMonToRight(struct Sprite *sprite);
|
||||
static void SpriteCB_WildMonShowHealthbox(struct Sprite *sprite);
|
||||
static void SpriteCB_WildMonAnimate(struct Sprite *sprite);
|
||||
static void SpriteCB_Flicker(struct Sprite *sprite);
|
||||
static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite);
|
||||
static void SpriteCB_BlinkVisible(struct Sprite *sprite);
|
||||
static void SpriteCB_Idle(struct Sprite *sprite);
|
||||
|
|
@ -103,8 +102,6 @@ static void SetActionsAndBattlersTurnOrder(void);
|
|||
static void UpdateBattlerPartyOrdersOnSwitch(u32 battler);
|
||||
static bool8 AllAtActionConfirmed(void);
|
||||
static void TryChangeTurnOrder(void);
|
||||
static void CheckChosenMoveForEffectsBeforeTurnStarts(void);
|
||||
static void CheckMegaEvolutionBeforeTurn(void);
|
||||
static void CheckQuickClaw_CustapBerryActivation(void);
|
||||
static void FreeResetData_ReturnToOvOrDoEvolutions(void);
|
||||
static void ReturnFromBattleToOverworld(void);
|
||||
|
|
@ -134,16 +131,10 @@ EWRAM_DATA u16 gBattle_WIN0H = 0;
|
|||
EWRAM_DATA u16 gBattle_WIN0V = 0;
|
||||
EWRAM_DATA u16 gBattle_WIN1H = 0;
|
||||
EWRAM_DATA u16 gBattle_WIN1V = 0;
|
||||
EWRAM_DATA u8 gDisplayedStringBattle[400] = {0};
|
||||
EWRAM_DATA u8 gDisplayedStringBattle[425] = {0}; // Increased in size to fit Juan's defeat text (SootopolisCity_Gym_1F_Text_JuanDefeat)
|
||||
EWRAM_DATA u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT] = {0};
|
||||
EWRAM_DATA u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT] = {0};
|
||||
EWRAM_DATA u8 gBattleTextBuff3[30] = {0}; //expanded for stupidly long z move names
|
||||
// The below array is never intentionally used. However, Juan's
|
||||
// defeat text (SootopolisCity_Gym_1F_Text_JuanDefeat) is too long
|
||||
// for gDisplayedStringBattle and overflows into this array. If it
|
||||
// is removed (and none of the buffers above are increased in size)
|
||||
// it will instead overflow into useful data.
|
||||
EWRAM_DATA static u32 sFlickerArray[25] = {0};
|
||||
EWRAM_DATA u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT + 13] = {0}; // expanded for stupidly long z move names
|
||||
EWRAM_DATA u32 gBattleTypeFlags = 0;
|
||||
EWRAM_DATA u8 gBattleTerrain = 0;
|
||||
EWRAM_DATA u32 gUnusedFirstBattleVar1 = 0; // Never read
|
||||
|
|
@ -509,7 +500,6 @@ void CB2_InitBattle(void)
|
|||
static void CB2_InitBattleInternal(void)
|
||||
{
|
||||
s32 i;
|
||||
u16 targetSpecies;
|
||||
|
||||
SetHBlankCallback(NULL);
|
||||
SetVBlankCallback(NULL);
|
||||
|
|
@ -1941,7 +1931,6 @@ void CustomTrainerPartyAssignMoves(struct Pokemon *mon, const struct TrainerMon
|
|||
u8 CreateNPCTrainerPartyFromTrainer(struct Pokemon *party, const struct Trainer *trainer, bool32 firstTrainer, u32 battleTypeFlags)
|
||||
{
|
||||
u32 personalityValue;
|
||||
u8 fixedIV;
|
||||
s32 i, j;
|
||||
u8 monsCount;
|
||||
if (battleTypeFlags & BATTLE_TYPE_TRAINER && !(battleTypeFlags & (BATTLE_TYPE_FRONTIER
|
||||
|
|
@ -2697,29 +2686,6 @@ void SpriteCallbackDummy_2(struct Sprite *sprite)
|
|||
|
||||
}
|
||||
|
||||
#define sNumFlickers data[3]
|
||||
#define sDelay data[4]
|
||||
|
||||
static void SpriteCB_Flicker(struct Sprite *sprite)
|
||||
{
|
||||
sprite->sDelay--;
|
||||
if (sprite->sDelay == 0)
|
||||
{
|
||||
sprite->sDelay = 8;
|
||||
sprite->invisible ^= 1;
|
||||
sprite->sNumFlickers--;
|
||||
if (sprite->sNumFlickers == 0)
|
||||
{
|
||||
sprite->invisible = FALSE;
|
||||
sprite->callback = SpriteCallbackDummy_2;
|
||||
// sFlickerArray[0] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#undef sNumFlickers
|
||||
#undef sDelay
|
||||
|
||||
extern const struct MonCoords gMonFrontPicCoords[];
|
||||
|
||||
void SpriteCB_FaintOpponentMon(struct Sprite *sprite)
|
||||
|
|
@ -3244,6 +3210,7 @@ void SwitchInClearSetData(u32 battler)
|
|||
gSelectedMonPartyId = PARTY_SIZE;
|
||||
|
||||
// Allow for illegal abilities within tests.
|
||||
#if TESTING
|
||||
if (gTestRunnerEnabled)
|
||||
{
|
||||
u32 side = GetBattlerSide(battler);
|
||||
|
|
@ -3251,6 +3218,7 @@ void SwitchInClearSetData(u32 battler)
|
|||
if (TestRunner_Battle_GetForcedAbility(side, partyIndex))
|
||||
gBattleMons[i].ability = gBattleStruct->overwrittenAbilities[i] = TestRunner_Battle_GetForcedAbility(side, partyIndex);
|
||||
}
|
||||
#endif // TESTING
|
||||
|
||||
Ai_UpdateSwitchInData(battler);
|
||||
}
|
||||
|
|
@ -3746,6 +3714,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
|||
}
|
||||
|
||||
// Allow for illegal abilities within tests.
|
||||
#if TESTING
|
||||
if (gTestRunnerEnabled && gBattleStruct->switchInAbilitiesCounter == 0)
|
||||
{
|
||||
for (i = 0; i < gBattlersCount; ++i)
|
||||
|
|
@ -3756,6 +3725,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
|||
gBattleMons[i].ability = gBattleStruct->overwrittenAbilities[i] = TestRunner_Battle_GetForcedAbility(side, partyIndex);
|
||||
}
|
||||
}
|
||||
#endif // TESTING
|
||||
|
||||
if (gBattleStruct->switchInAbilitiesCounter == 0)
|
||||
{
|
||||
|
|
@ -3816,7 +3786,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
|||
if (ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gBattlerByTurnOrder[gBattleStruct->switchInItemsCounter++], FALSE))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_OPPORTUNIST, 0, 0, 0, 0))
|
||||
return;
|
||||
|
||||
|
|
@ -3852,7 +3822,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
|||
gMoveResultFlags = 0;
|
||||
|
||||
gRandomTurnNumber = Random();
|
||||
|
||||
|
||||
memset(gQueuedStatBoosts, 0, sizeof(gQueuedStatBoosts)); // erase all totem boosts just to be safe
|
||||
|
||||
SetAiLogicDataForTurn(AI_DATA); // get assumed abilities, hold effects, etc of all battlers
|
||||
|
|
@ -5005,8 +4975,6 @@ static bool32 TryDoMegaEvosBeforeMoves(void)
|
|||
if (!(gHitMarker & HITMARKER_RUN) && (gBattleStruct->mega.toEvolve || gBattleStruct->burst.toBurst))
|
||||
{
|
||||
u32 i, battler;
|
||||
struct Pokemon *party;
|
||||
struct Pokemon *mon;
|
||||
u8 megaOrder[MAX_BATTLERS_COUNT];
|
||||
|
||||
PopulateArrayWithBattlers(megaOrder);
|
||||
|
|
@ -5019,8 +4987,6 @@ static bool32 TryDoMegaEvosBeforeMoves(void)
|
|||
gBattlerAttacker = megaOrder[i];
|
||||
gBattleStruct->mega.toEvolve &= ~(gBitTable[gBattlerAttacker]);
|
||||
gLastUsedItem = gBattleMons[gBattlerAttacker].item;
|
||||
party = GetBattlerParty(gBattlerAttacker);
|
||||
mon = &party[gBattlerPartyIndexes[gBattlerAttacker]];
|
||||
if (GetBattleFormChangeTargetSpecies(gBattlerAttacker, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE) != SPECIES_NONE)
|
||||
BattleScriptExecute(BattleScript_WishMegaEvolution);
|
||||
else
|
||||
|
|
@ -5034,8 +5000,6 @@ static bool32 TryDoMegaEvosBeforeMoves(void)
|
|||
battler = gBattlerAttacker = megaOrder[i];
|
||||
gBattleStruct->burst.toBurst &= ~(gBitTable[battler]);
|
||||
gLastUsedItem = gBattleMons[battler].item;
|
||||
party = GetBattlerParty(battler);
|
||||
mon = &party[gBattlerPartyIndexes[battler]];
|
||||
BattleScriptExecute(BattleScript_UltraBurst);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -5052,7 +5016,6 @@ static bool32 TryDoMoveEffectsBeforeMoves(void)
|
|||
if (!(gHitMarker & HITMARKER_RUN))
|
||||
{
|
||||
u32 i;
|
||||
struct Pokemon *mon;
|
||||
u8 battlers[MAX_BATTLERS_COUNT];
|
||||
|
||||
PopulateArrayWithBattlers(battlers);
|
||||
|
|
|
|||
|
|
@ -532,12 +532,12 @@ static const u8 sText_TwoInGameTrainersDefeated[];
|
|||
static const u8 sText_Trainer2LoseText[];
|
||||
|
||||
// New battle strings.
|
||||
static const s8 sText_EnduredViaSturdy[] = _("{B_DEF_NAME_WITH_PREFIX} endured\nthe hit using {B_DEF_ABILITY}!");
|
||||
static const s8 sText_PowerHerbActivation[] = _("{B_ATK_NAME_WITH_PREFIX} became fully charged\ndue to its {B_LAST_ITEM}!");
|
||||
static const s8 sText_HurtByItem[] = _("{B_ATK_NAME_WITH_PREFIX} was hurt\nby its {B_LAST_ITEM}!");
|
||||
static const s8 sText_BadlyPoisonedByItem[] = _("{B_EFF_NAME_WITH_PREFIX} was badly\npoisoned by the {B_LAST_ITEM}!");
|
||||
static const s8 sText_BurnedByItem[] = _("{B_EFF_NAME_WITH_PREFIX} was burned\nby the {B_LAST_ITEM}!");
|
||||
static const s8 sText_TargetAbilityActivates[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY} activates!");
|
||||
static const u8 sText_EnduredViaSturdy[] = _("{B_DEF_NAME_WITH_PREFIX} endured\nthe hit using {B_DEF_ABILITY}!");
|
||||
static const u8 sText_PowerHerbActivation[] = _("{B_ATK_NAME_WITH_PREFIX} became fully charged\ndue to its {B_LAST_ITEM}!");
|
||||
static const u8 sText_HurtByItem[] = _("{B_ATK_NAME_WITH_PREFIX} was hurt\nby its {B_LAST_ITEM}!");
|
||||
static const u8 sText_BadlyPoisonedByItem[] = _("{B_EFF_NAME_WITH_PREFIX} was badly\npoisoned by the {B_LAST_ITEM}!");
|
||||
static const u8 sText_BurnedByItem[] = _("{B_EFF_NAME_WITH_PREFIX} was burned\nby the {B_LAST_ITEM}!");
|
||||
static const u8 sText_TargetAbilityActivates[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY} activates!");
|
||||
static const u8 sText_GravityIntensified[] = _("Gravity intensified!");
|
||||
static const u8 sText_TargetIdentified[] = _("{B_DEF_NAME_WITH_PREFIX} was\nidentified!");
|
||||
static const u8 sText_TargetWokeUp[] = _("{B_DEF_NAME_WITH_PREFIX} woke up!");
|
||||
|
|
@ -2948,7 +2948,7 @@ void BufferStringBattle(u16 stringID, u32 battler)
|
|||
|
||||
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8 *src)
|
||||
{
|
||||
BattleStringExpandPlaceholders(src, gDisplayedStringBattle);
|
||||
return BattleStringExpandPlaceholders(src, gDisplayedStringBattle);
|
||||
}
|
||||
|
||||
static const u8 *TryGetStatusString(u8 *src)
|
||||
|
|
@ -3016,7 +3016,7 @@ static void GetBattlerNick(u32 battler, u8 *dst)
|
|||
|
||||
static const u8 *BattleStringGetOpponentNameByTrainerId(u16 trainerId, u8 *text, u8 multiplayerId, u8 battler)
|
||||
{
|
||||
const u8 *toCpy;
|
||||
const u8 *toCpy = NULL;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_SECRET_BASE)
|
||||
{
|
||||
|
|
@ -3068,7 +3068,7 @@ static const u8 *BattleStringGetOpponentNameByTrainerId(u16 trainerId, u8 *text,
|
|||
|
||||
static const u8 *BattleStringGetOpponentName(u8 *text, u8 multiplayerId, u8 battler)
|
||||
{
|
||||
const u8 *toCpy;
|
||||
const u8 *toCpy = NULL;
|
||||
|
||||
switch (GetBattlerPosition(battler))
|
||||
{
|
||||
|
|
@ -3088,7 +3088,7 @@ static const u8 *BattleStringGetOpponentName(u8 *text, u8 multiplayerId, u8 batt
|
|||
|
||||
static const u8 *BattleStringGetPlayerName(u8 *text, u8 battler)
|
||||
{
|
||||
const u8 *toCpy;
|
||||
const u8 *toCpy = NULL;
|
||||
|
||||
switch (GetBattlerPosition(battler))
|
||||
{
|
||||
|
|
@ -3164,7 +3164,6 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
|||
// This buffer may hold either the name of a trainer, pokemon, or item.
|
||||
u8 text[max(max(max(32, TRAINER_NAME_LENGTH + 1), POKEMON_NAME_LENGTH + 1), ITEM_NAME_LENGTH)];
|
||||
u8 multiplayerId;
|
||||
s32 i;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
|
||||
multiplayerId = gRecordedBattleMultiplayerId;
|
||||
|
|
@ -3745,7 +3744,7 @@ void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
|
|||
// unused, since the value loaded into the buffer is not read; it loaded one of
|
||||
// two particles (either "?" or "?") which works in tandem with ChooseTypeOfMoveUsedString
|
||||
// below to effect changes in the meaning of the line.
|
||||
static void ChooseMoveUsedParticle(u8 *textBuff)
|
||||
static void UNUSED ChooseMoveUsedParticle(u8 *textBuff)
|
||||
{
|
||||
s32 counter = 0;
|
||||
u32 i = 0;
|
||||
|
|
@ -3785,7 +3784,7 @@ static void ChooseMoveUsedParticle(u8 *textBuff)
|
|||
//
|
||||
// sText_ExclamationMark5 was " ????!" This resulted in a translation of
|
||||
// "<NAME>'s <ATTACK> attack!".
|
||||
static void ChooseTypeOfMoveUsedString(u8 *dst)
|
||||
static void UNUSED ChooseTypeOfMoveUsedString(u8 *dst)
|
||||
{
|
||||
s32 counter = 0;
|
||||
s32 i = 0;
|
||||
|
|
@ -4028,9 +4027,8 @@ u32 BattlerHPPercentage(u32 battler, u32 operation, u32 threshold)
|
|||
case GREATER_THAN_OR_EQUAL:
|
||||
return gBattleMons[battler].hp >= (gBattleMons[battler].maxHP / threshold);
|
||||
case NOT_EQUAL:
|
||||
return gBattleMons[battler].hp != (gBattleMons[battler].maxHP / threshold);
|
||||
default:
|
||||
break;
|
||||
return gBattleMons[battler].hp != (gBattleMons[battler].maxHP / threshold);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
//
|
||||
// The arguments can be accessed as cmd->failInstr and cmd->move.
|
||||
// gBattlescriptCurrInstr = cmd->nextInstr; advances to the next instruction.
|
||||
#define CMD_ARGS(...) const struct __attribute__((packed)) { u8 opcode; MEMBERS(__VA_ARGS__) const u8 nextInstr[0]; } *const cmd = (const void *)gBattlescriptCurrInstr
|
||||
#define CMD_ARGS(...) const struct __attribute__((packed)) { u8 opcode; MEMBERS(__VA_ARGS__) const u8 nextInstr[0]; } *const cmd UNUSED = (const void *)gBattlescriptCurrInstr
|
||||
#define VARIOUS_ARGS(...) CMD_ARGS(u8 battler, u8 id, ##__VA_ARGS__)
|
||||
#define NATIVE_ARGS(...) CMD_ARGS(void (*func)(void), ##__VA_ARGS__)
|
||||
|
||||
|
|
@ -338,7 +338,6 @@ static const u16 sWhiteOutBadgeMoney[9] = { 8, 16, 24, 36, 48, 64, 80, 100, 120
|
|||
|
||||
static bool8 IsTwoTurnsMove(u16 move);
|
||||
static void TrySetDestinyBondToHappen(void);
|
||||
static u8 AttacksThisTurn(u8 battler, u16 move); // Note: returns 1 if it's a charging turn, otherwise 2.
|
||||
static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr);
|
||||
static bool32 IsMonGettingExpSentOut(void);
|
||||
static void InitLevelUpBanner(void);
|
||||
|
|
@ -2257,18 +2256,11 @@ static void Cmd_datahpupdate(void)
|
|||
{
|
||||
CMD_ARGS(u8 battler);
|
||||
|
||||
u32 battler, moveType;
|
||||
u32 battler;
|
||||
|
||||
if (gBattleControllerExecFlags)
|
||||
return;
|
||||
|
||||
if (gBattleStruct->dynamicMoveType == 0)
|
||||
moveType = gBattleMoves[gCurrentMove].type;
|
||||
else if (!(gBattleStruct->dynamicMoveType & F_DYNAMIC_TYPE_1))
|
||||
moveType = gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK;
|
||||
else
|
||||
moveType = gBattleMoves[gCurrentMove].type;
|
||||
|
||||
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) || (gHitMarker & HITMARKER_PASSIVE_DAMAGE))
|
||||
{
|
||||
battler = GetBattlerForBattleScript(cmd->battler);
|
||||
|
|
@ -2722,7 +2714,7 @@ void StealTargetItem(u8 battlerStealer, u8 battlerItem)
|
|||
|
||||
void SetMoveEffect(bool32 primary, u32 certain)
|
||||
{
|
||||
s32 i, byTwo, affectsUser = 0;
|
||||
s32 i, affectsUser = 0;
|
||||
bool32 statusChanged = FALSE;
|
||||
bool32 mirrorArmorReflected = (GetBattlerAbility(gBattlerTarget) == ABILITY_MIRROR_ARMOR);
|
||||
u32 flags = 0;
|
||||
|
|
@ -3010,7 +3002,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||
gBattleMons[gEffectBattler].status1 |= STATUS1_SLEEP_TURN(1 + RandomUniform(RNG_SLEEP_TURNS, 1, 3));
|
||||
else
|
||||
gBattleMons[gEffectBattler].status1 |= STATUS1_SLEEP_TURN(1 + RandomUniform(RNG_SLEEP_TURNS, 2, 5));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleMons[gEffectBattler].status1 |= sStatusFlagsForMoveEffects[gBattleScripting.moveEffect];
|
||||
|
|
@ -3474,6 +3466,8 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||
{
|
||||
if (gBattleMons[gBattlerTarget].statStages[i] > DEFAULT_STAT_STAGE && gBattleMons[gBattlerAttacker].statStages[i] != MAX_STAT_STAGE)
|
||||
{
|
||||
bool32 byTwo = FALSE;
|
||||
|
||||
gBattleStruct->stolenStats[0] |= gBitTable[i];
|
||||
// Store by how many stages to raise the stat.
|
||||
gBattleStruct->stolenStats[i] = gBattleMons[gBattlerTarget].statStages[i] - DEFAULT_STAT_STAGE;
|
||||
|
|
@ -8323,7 +8317,7 @@ static bool32 IsTeatimeAffected(u32 battler)
|
|||
sideTimerOpp->structField = BATTLE_OPPOSITE(temp); \
|
||||
} \
|
||||
|
||||
static bool32 CourtChangeSwapSideStatuses(void)
|
||||
static void CourtChangeSwapSideStatuses(void)
|
||||
{
|
||||
struct SideTimer *sideTimerPlayer = &gSideTimers[B_SIDE_PLAYER];
|
||||
struct SideTimer *sideTimerOpp = &gSideTimers[B_SIDE_OPPONENT];
|
||||
|
|
@ -8446,7 +8440,7 @@ static void Cmd_various(void)
|
|||
CMD_ARGS(u8 battler, u8 id);
|
||||
|
||||
struct Pokemon *mon;
|
||||
s32 i, j;
|
||||
s32 i;
|
||||
u8 data[10];
|
||||
u32 side, battler, bits;
|
||||
|
||||
|
|
@ -9434,8 +9428,10 @@ static void Cmd_various(void)
|
|||
// Change species.
|
||||
if (cmd->case_ == 0)
|
||||
{
|
||||
/* What was the idea here?
|
||||
if (!gBattleTextBuff1)
|
||||
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[battler].species);
|
||||
*/
|
||||
BtlController_EmitSetMonData(battler, BUFFER_A, REQUEST_SPECIES_BATTLE, gBitTable[gBattlerPartyIndexes[battler]], sizeof(gBattleMons[battler].species), &gBattleMons[battler].species);
|
||||
MarkBattlerForControllerExec(battler);
|
||||
}
|
||||
|
|
@ -9726,7 +9722,7 @@ static void Cmd_various(void)
|
|||
{
|
||||
VARIOUS_ARGS(const u8 *jumpInstr);
|
||||
if (!IsBattlerGrounded(battler))
|
||||
gBattlescriptCurrInstr = gBattlescriptCurrInstr = cmd->jumpInstr;
|
||||
gBattlescriptCurrInstr = cmd->jumpInstr;
|
||||
else
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
return;
|
||||
|
|
@ -11144,11 +11140,8 @@ static void Cmd_jumpifuproarwakes(void)
|
|||
{
|
||||
CMD_ARGS(const u8 *jumpInstr);
|
||||
|
||||
const u8 *jumpInstr = cmd->jumpInstr;
|
||||
u32 ability = GetBattlerAbility(gBattlerTarget);
|
||||
|
||||
if (UproarWakeUpCheck(gBattlerTarget))
|
||||
gBattlescriptCurrInstr = jumpInstr;
|
||||
gBattlescriptCurrInstr = cmd->jumpInstr;
|
||||
else
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
|
@ -11323,6 +11316,8 @@ static u16 ReverseStatChangeMoveEffect(u16 moveEffect)
|
|||
return MOVE_EFFECT_ACC_PLUS_2;
|
||||
case MOVE_EFFECT_EVS_MINUS_2:
|
||||
return MOVE_EFFECT_EVS_PLUS_2;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -11647,7 +11642,7 @@ static void Cmd_normalisebuffs(void)
|
|||
{
|
||||
CMD_ARGS();
|
||||
|
||||
s32 i, j;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
TryResetBattlerStatChanges(i);
|
||||
|
|
@ -11725,7 +11720,6 @@ static void Cmd_forcerandomswitch(void)
|
|||
|
||||
s32 firstMonId;
|
||||
s32 lastMonId = 0; // + 1
|
||||
s32 monsCount;
|
||||
struct Pokemon *party = NULL;
|
||||
u8 validMons[PARTY_SIZE];
|
||||
s32 validMonsCount = 0;
|
||||
|
|
@ -11781,7 +11775,6 @@ static void Cmd_forcerandomswitch(void)
|
|||
{
|
||||
firstMonId = 0;
|
||||
lastMonId = 6;
|
||||
monsCount = 6;
|
||||
battler2PartyId = gBattlerPartyIndexes[gBattlerTarget];
|
||||
battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)];
|
||||
}
|
||||
|
|
@ -11799,7 +11792,6 @@ static void Cmd_forcerandomswitch(void)
|
|||
firstMonId = 0;
|
||||
lastMonId = PARTY_SIZE / 2;
|
||||
}
|
||||
monsCount = PARTY_SIZE / 2;
|
||||
battler2PartyId = gBattlerPartyIndexes[gBattlerTarget];
|
||||
battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)];
|
||||
}
|
||||
|
|
@ -11816,7 +11808,6 @@ static void Cmd_forcerandomswitch(void)
|
|||
firstMonId = 0;
|
||||
lastMonId = PARTY_SIZE / 2;
|
||||
}
|
||||
monsCount = PARTY_SIZE / 2;
|
||||
battler2PartyId = gBattlerPartyIndexes[gBattlerTarget];
|
||||
battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)];
|
||||
}
|
||||
|
|
@ -11826,7 +11817,6 @@ static void Cmd_forcerandomswitch(void)
|
|||
{
|
||||
firstMonId = 0;
|
||||
lastMonId = PARTY_SIZE;
|
||||
monsCount = PARTY_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -11840,7 +11830,6 @@ static void Cmd_forcerandomswitch(void)
|
|||
firstMonId = 0;
|
||||
lastMonId = PARTY_SIZE / 2;
|
||||
}
|
||||
monsCount = PARTY_SIZE / 2;
|
||||
}
|
||||
battler2PartyId = gBattlerPartyIndexes[gBattlerTarget];
|
||||
battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)];
|
||||
|
|
@ -11849,7 +11838,6 @@ static void Cmd_forcerandomswitch(void)
|
|||
{
|
||||
firstMonId = 0;
|
||||
lastMonId = PARTY_SIZE;
|
||||
monsCount = PARTY_SIZE;
|
||||
battler2PartyId = gBattlerPartyIndexes[gBattlerTarget];
|
||||
battler1PartyId = gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerTarget)];
|
||||
}
|
||||
|
|
@ -11857,7 +11845,6 @@ static void Cmd_forcerandomswitch(void)
|
|||
{
|
||||
firstMonId = 0;
|
||||
lastMonId = PARTY_SIZE;
|
||||
monsCount = PARTY_SIZE;
|
||||
battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; // there is only one pokemon out in single battles
|
||||
battler1PartyId = gBattlerPartyIndexes[gBattlerTarget];
|
||||
}
|
||||
|
|
@ -11916,8 +11903,8 @@ static void Cmd_tryconversiontypechange(void)
|
|||
CMD_ARGS(const u8 *failInstr);
|
||||
|
||||
u8 validMoves = 0;
|
||||
u8 moveChecked;
|
||||
u8 moveType;
|
||||
u8 moveChecked = 0;
|
||||
u8 moveType = 0;
|
||||
|
||||
if (B_UPDATED_CONVERSION >= GEN_6)
|
||||
{
|
||||
|
|
@ -12614,7 +12601,6 @@ static void Cmd_trysetencore(void)
|
|||
gDisableStructs[gBattlerTarget].encoredMove = gBattleMons[gBattlerTarget].moves[i];
|
||||
gDisableStructs[gBattlerTarget].encoredMovePos = i;
|
||||
gDisableStructs[gBattlerTarget].encoreTimer = 3;
|
||||
gDisableStructs[gBattlerTarget].encoreTimer;
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
else
|
||||
|
|
@ -12782,26 +12768,6 @@ static bool8 IsTwoTurnsMove(u16 move)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
// unused
|
||||
static u8 AttacksThisTurn(u8 battler, u16 move) // Note: returns 1 if it's a charging turn, otherwise 2
|
||||
{
|
||||
// first argument is unused
|
||||
if (gBattleMoves[move].effect == EFFECT_SOLAR_BEAM
|
||||
&& IsBattlerWeatherAffected(battler, B_WEATHER_SUN))
|
||||
return 2;
|
||||
|
||||
if (gBattleMoves[move].effect == EFFECT_SKULL_BASH
|
||||
|| gBattleMoves[move].effect == EFFECT_TWO_TURNS_ATTACK
|
||||
|| gBattleMoves[move].effect == EFFECT_SOLAR_BEAM
|
||||
|| gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE
|
||||
|| gBattleMoves[move].effect == EFFECT_BIDE)
|
||||
{
|
||||
if ((gHitMarker & HITMARKER_CHARGING))
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
static void Cmd_trychoosesleeptalkmove(void)
|
||||
{
|
||||
CMD_ARGS(const u8 *failInstr);
|
||||
|
|
@ -15396,17 +15362,14 @@ static void Cmd_removeattackerstatus1(void)
|
|||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
// CMD_ARGS is not needed for these functions as they end the script execution.
|
||||
static void Cmd_finishaction(void)
|
||||
{
|
||||
CMD_ARGS();
|
||||
|
||||
gCurrentActionFuncId = B_ACTION_FINISHED;
|
||||
}
|
||||
|
||||
static void Cmd_finishturn(void)
|
||||
{
|
||||
CMD_ARGS();
|
||||
|
||||
gCurrentActionFuncId = B_ACTION_FINISHED;
|
||||
gCurrentTurnActionNumber = gBattlersCount;
|
||||
}
|
||||
|
|
@ -15698,7 +15661,7 @@ bool32 IsMoveAffectedByParentalBond(u32 move, u32 battler)
|
|||
{
|
||||
if (move != MOVE_NONE && move != MOVE_STRUGGLE
|
||||
&& gBattleMoves[move].split != SPLIT_STATUS
|
||||
&& !gBattleMoves[move].strikeCount > 2)
|
||||
&& gBattleMoves[move].strikeCount <= 2)
|
||||
{
|
||||
u32 i;
|
||||
for (i = 0; i < ARRAY_COUNT(sParentalBondBannedEffects); i++)
|
||||
|
|
@ -15803,7 +15766,7 @@ static void TryUpdateRoundTurnOrder(void)
|
|||
u32 i;
|
||||
u32 j = 0;
|
||||
u32 k = 0;
|
||||
u32 currRounder;
|
||||
u32 currRounder = 0;
|
||||
u8 roundUsers[3] = {0xFF, 0xFF, 0xFF};
|
||||
u8 nonRoundUsers[3] = {0xFF, 0xFF, 0xFF};
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
|
|
|
|||
|
|
@ -3004,7 +3004,7 @@ void TryHideBattleTowerReporter(void)
|
|||
static void FillPartnerParty(u16 trainerId)
|
||||
{
|
||||
s32 i, j;
|
||||
u32 ivs, level;
|
||||
u32 ivs, level, personality;
|
||||
u32 friendship;
|
||||
u16 monId;
|
||||
u32 otID;
|
||||
|
|
@ -3054,22 +3054,22 @@ static void FillPartnerParty(u16 trainerId)
|
|||
u32 otIdType = OT_ID_RANDOM_NO_SHINY;
|
||||
do
|
||||
{
|
||||
j = Random32();
|
||||
} while (IsShinyOtIdPersonality(otID, j));
|
||||
personality = Random32();
|
||||
} while (IsShinyOtIdPersonality(otID, personality));
|
||||
|
||||
if (partyData[i].gender == TRAINER_MON_MALE)
|
||||
j = (j & 0xFFFFFF00) | GeneratePersonalityForGender(MON_MALE, partyData[i].species);
|
||||
personality = (personality & 0xFFFFFF00) | GeneratePersonalityForGender(MON_MALE, partyData[i].species);
|
||||
else if (partyData[i].gender == TRAINER_MON_FEMALE)
|
||||
j = (j & 0xFFFFFF00) | GeneratePersonalityForGender(MON_FEMALE, partyData[i].species);
|
||||
personality = (personality & 0xFFFFFF00) | GeneratePersonalityForGender(MON_FEMALE, partyData[i].species);
|
||||
if (partyData[i].nature != 0)
|
||||
ModifyPersonalityForNature(&j, partyData[i].nature - 1);
|
||||
ModifyPersonalityForNature(&personality, partyData[i].nature - 1);
|
||||
if (partyData[i].isShiny)
|
||||
{
|
||||
otIdType = OT_ID_PRESET;
|
||||
otID = HIHALF(j) ^ LOHALF(j);
|
||||
otID = HIHALF(personality) ^ LOHALF(personality);
|
||||
}
|
||||
|
||||
CreateMon(&gPlayerParty[i + 3], partyData[i].species, partyData[i].lvl, 0, TRUE, j, otIdType, otID);
|
||||
CreateMon(&gPlayerParty[i + 3], partyData[i].species, partyData[i].lvl, 0, TRUE, personality, otIdType, otID);
|
||||
SetMonData(&gPlayerParty[i + 3], MON_DATA_HELD_ITEM, &partyData[i].heldItem);
|
||||
CustomTrainerPartyAssignMoves(&gPlayerParty[i+3], &partyData[i]);
|
||||
|
||||
|
|
|
|||
|
|
@ -1196,7 +1196,7 @@ static bool8 Swirl_Init(struct Task *task)
|
|||
InitTransitionData();
|
||||
ScanlineEffect_Clear();
|
||||
BeginNormalPaletteFade(PALETTES_ALL, 4, 0, 16, RGB_BLACK);
|
||||
SetSinWave(gScanlineEffectRegBuffers[1], sTransitionData->cameraX, 0, 2, 0, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[1], sTransitionData->cameraX, 0, 2, 0, DISPLAY_HEIGHT);
|
||||
|
||||
SetVBlankCallback(VBlankCB_Swirl);
|
||||
SetHBlankCallback(HBlankCB_Swirl);
|
||||
|
|
@ -1213,7 +1213,7 @@ static bool8 Swirl_End(struct Task *task)
|
|||
task->tSinIndex += 4;
|
||||
task->tAmplitude += 8;
|
||||
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], sTransitionData->cameraX, task->tSinIndex, 2, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], sTransitionData->cameraX, task->tSinIndex, 2, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
|
|
@ -1468,7 +1468,7 @@ static bool8 BigPokeball_SetGfx(struct Task *task)
|
|||
SET_TILE(tilemap, i, j, *bigPokeballMap);
|
||||
}
|
||||
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return TRUE;
|
||||
|
|
@ -1480,7 +1480,7 @@ static bool8 Aqua_SetGfx(struct Task *task)
|
|||
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LZ77UnCompVram(sTeamAqua_Tilemap, tilemap);
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
|
|
@ -1492,7 +1492,7 @@ static bool8 Magma_SetGfx(struct Task *task)
|
|||
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LZ77UnCompVram(sTeamMagma_Tilemap, tilemap);
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
|
|
@ -1505,7 +1505,7 @@ static bool8 Regice_SetGfx(struct Task *task)
|
|||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LoadPalette(sRegice_Palette, BG_PLTT_ID(15), sizeof(sRegice_Palette));
|
||||
CpuCopy16(sRegice_Tilemap, tilemap, 0x500);
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
|
|
@ -1518,7 +1518,7 @@ static bool8 Registeel_SetGfx(struct Task *task)
|
|||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LoadPalette(sRegisteel_Palette, BG_PLTT_ID(15), sizeof(sRegisteel_Palette));
|
||||
CpuCopy16(sRegisteel_Tilemap, tilemap, 0x500);
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
|
|
@ -1531,7 +1531,7 @@ static bool8 Regirock_SetGfx(struct Task *task)
|
|||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LoadPalette(sRegirock_Palette, BG_PLTT_ID(15), sizeof(sRegirock_Palette));
|
||||
CpuCopy16(sRegirock_Tilemap, tilemap, 0x500);
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
|
|
@ -1623,7 +1623,7 @@ static bool8 PatternWeave_Blend1(struct Task *task)
|
|||
task->tSinIndex += 8;
|
||||
task->tAmplitude -= 256;
|
||||
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);
|
||||
|
||||
sTransitionData->VBlank_DMA++;
|
||||
return FALSE;
|
||||
|
|
@ -1643,7 +1643,7 @@ static bool8 PatternWeave_Blend2(struct Task *task)
|
|||
task->tSinIndex += 8;
|
||||
task->tAmplitude -= 256;
|
||||
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);
|
||||
|
||||
sTransitionData->VBlank_DMA++;
|
||||
return FALSE;
|
||||
|
|
@ -1655,7 +1655,7 @@ static bool8 PatternWeave_FinishAppear(struct Task *task)
|
|||
task->tSinIndex += 8;
|
||||
task->tAmplitude -= 256;
|
||||
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);
|
||||
|
||||
if (task->tAmplitude <= 0)
|
||||
{
|
||||
|
|
@ -4253,7 +4253,7 @@ static bool8 FrontierLogoWiggle_SetGfx(struct Task *task)
|
|||
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LZ77UnCompVram(sFrontierLogo_Tilemap, tilemap);
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ static bool32 IsUnnerveAbilityOnOpposingSide(u32 battler);
|
|||
static u32 GetFlingPowerFromItemId(u32 itemId);
|
||||
static void SetRandomMultiHitCounter();
|
||||
static u32 GetBattlerItemHoldEffectParam(u32 battler, u32 item);
|
||||
static uq4_12_t GetInverseTypeMultiplier(uq4_12_t multiplier);
|
||||
static uq4_12_t GetSupremeOverlordModifier(u32 battler);
|
||||
static bool32 CanBeInfinitelyConfused(u32 battler);
|
||||
|
||||
|
|
@ -1336,7 +1335,6 @@ void MarkBattlerReceivedLinkData(u32 battler)
|
|||
|
||||
void CancelMultiTurnMoves(u32 battler)
|
||||
{
|
||||
u8 i;
|
||||
gBattleMons[battler].status2 &= ~(STATUS2_MULTIPLETURNS);
|
||||
gBattleMons[battler].status2 &= ~(STATUS2_LOCK_CONFUSE);
|
||||
gBattleMons[battler].status2 &= ~(STATUS2_UPROAR);
|
||||
|
|
@ -3094,9 +3092,6 @@ u8 DoBattlerEndTurnEffects(void)
|
|||
case ENDTURN_SYRUP_BOMB:
|
||||
if ((gStatuses4[battler] & STATUS4_SYRUP_BOMB) && (gBattleMons[battler].hp != 0))
|
||||
{
|
||||
u16 battlerAbility = GetBattlerAbility(battler);
|
||||
u32 battlerHoldEffect = GetBattlerHoldEffect(battler, TRUE);
|
||||
|
||||
gDisableStructs[battler].syrupBombTimer--;
|
||||
if (gDisableStructs[battler].syrupBombTimer == 0)
|
||||
{
|
||||
|
|
@ -3657,8 +3652,8 @@ u8 AtkCanceller_UnableToUseMove(u32 moveType)
|
|||
case CANCELLER_POWDER_MOVE:
|
||||
if ((gBattleMoves[gCurrentMove].powderMove) && (gBattlerAttacker != gBattlerTarget))
|
||||
{
|
||||
if (B_POWDER_GRASS >= GEN_6 && (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_GRASS))
|
||||
|| GetBattlerAbility(gBattlerTarget) == ABILITY_OVERCOAT)
|
||||
if (B_POWDER_GRASS >= GEN_6
|
||||
&& (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_GRASS) || GetBattlerAbility(gBattlerTarget) == ABILITY_OVERCOAT))
|
||||
{
|
||||
gBattlerAbility = gBattlerTarget;
|
||||
effect = 1;
|
||||
|
|
@ -4149,7 +4144,6 @@ static uq4_12_t GetSupremeOverlordModifier(u32 battler)
|
|||
u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 moveArg)
|
||||
{
|
||||
u32 effect = 0;
|
||||
u32 speciesAtk, speciesDef;
|
||||
u32 moveType, move;
|
||||
u32 i, j;
|
||||
|
||||
|
|
@ -4159,9 +4153,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
|||
if (gBattlerAttacker >= gBattlersCount)
|
||||
gBattlerAttacker = battler;
|
||||
|
||||
speciesAtk = gBattleMons[gBattlerAttacker].species;
|
||||
speciesDef = gBattleMons[gBattlerTarget].species;
|
||||
|
||||
if (special)
|
||||
gLastUsedAbility = special;
|
||||
else
|
||||
|
|
@ -4354,7 +4345,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
|||
if (!gSpecialStatuses[battler].switchInAbilityDone && IsDoubleBattle()
|
||||
&& IsBattlerAlive(BATTLE_PARTNER(battler)) && TryResetBattlerStatChanges(BATTLE_PARTNER(battler)))
|
||||
{
|
||||
u32 i;
|
||||
gEffectBattler = BATTLE_PARTNER(battler);
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_CURIOUS_MEDICINE;
|
||||
gSpecialStatuses[battler].switchInAbilityDone = TRUE;
|
||||
|
|
@ -5706,9 +5696,9 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
|||
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||
&& RandomWeighted(RNG_STENCH, 9, 1)
|
||||
&& !IS_MOVE_STATUS(move)
|
||||
&& !gBattleMoves[gCurrentMove].effect != EFFECT_FLINCH_HIT
|
||||
&& !gBattleMoves[gCurrentMove].effect != EFFECT_FLINCH_STATUS
|
||||
&& !gBattleMoves[gCurrentMove].effect != EFFECT_TRIPLE_ARROWS)
|
||||
&& gBattleMoves[gCurrentMove].effect != EFFECT_FLINCH_HIT
|
||||
&& gBattleMoves[gCurrentMove].effect != EFFECT_FLINCH_STATUS
|
||||
&& gBattleMoves[gCurrentMove].effect != EFFECT_TRIPLE_ARROWS)
|
||||
{
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH;
|
||||
BattleScriptPushCursor();
|
||||
|
|
@ -5760,7 +5750,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
|||
case ABILITYEFFECT_OPPORTUNIST:
|
||||
/* Similar to ABILITYEFFECT_IMMUNITY in that it loops through all battlers.
|
||||
* Is called after ABILITYEFFECT_ON_SWITCHIN to copy any boosts
|
||||
* from switch in abilities e.g. intrepid sword, as
|
||||
* from switch in abilities e.g. intrepid sword, as
|
||||
*/
|
||||
for (battler = 0; battler < gBattlersCount; battler++)
|
||||
{
|
||||
|
|
@ -5836,7 +5826,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
|||
effect = 4;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (effect != 0)
|
||||
{
|
||||
switch (effect)
|
||||
|
|
@ -7026,8 +7016,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
|
|||
{
|
||||
int i = 0, moveType;
|
||||
u8 effect = ITEM_NO_EFFECT;
|
||||
u8 changedPP = 0;
|
||||
u32 battlerHoldEffect, atkHoldEffect;
|
||||
u32 battlerHoldEffect = 0, atkHoldEffect;
|
||||
u8 atkHoldEffectParam;
|
||||
u16 atkItem;
|
||||
|
||||
|
|
@ -7645,7 +7634,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
|
|||
{
|
||||
gBattleStruct->blunderPolicy = FALSE;
|
||||
gLastUsedItem = atkItem;
|
||||
gBattleScripting.statChanger = SET_STATCHANGER(STAT_SPEED, 2, FALSE);
|
||||
SET_STATCHANGER(STAT_SPEED, 2, FALSE);
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_AttackerItemStatRaise;
|
||||
|
|
@ -7700,7 +7689,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
|
|||
{
|
||||
gLastUsedItem = atkItem;
|
||||
gBattleScripting.battler = gBattlerAttacker;
|
||||
gBattleScripting.statChanger = SET_STATCHANGER(STAT_SPATK, 1, FALSE);
|
||||
SET_STATCHANGER(STAT_SPATK, 1, FALSE);
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_AttackerItemStatRaise;
|
||||
|
|
@ -7756,7 +7745,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
|
|||
effect = ITEM_STATS_CHANGE;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_TargetItemStatRaise;
|
||||
gBattleScripting.statChanger = SET_STATCHANGER(STAT_ATK, 1, FALSE);
|
||||
SET_STATCHANGER(STAT_ATK, 1, FALSE);
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_LUMINOUS_MOSS:
|
||||
|
|
@ -7767,7 +7756,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
|
|||
effect = ITEM_STATS_CHANGE;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_TargetItemStatRaise;
|
||||
gBattleScripting.statChanger = SET_STATCHANGER(STAT_SPDEF, 1, FALSE);
|
||||
SET_STATCHANGER(STAT_SPDEF, 1, FALSE);
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CELL_BATTERY:
|
||||
|
|
@ -7778,7 +7767,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
|
|||
effect = ITEM_STATS_CHANGE;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_TargetItemStatRaise;
|
||||
gBattleScripting.statChanger = SET_STATCHANGER(STAT_ATK, 1, FALSE);
|
||||
SET_STATCHANGER(STAT_ATK, 1, FALSE);
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_ABSORB_BULB:
|
||||
|
|
@ -7789,7 +7778,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
|
|||
effect = ITEM_STATS_CHANGE;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_TargetItemStatRaise;
|
||||
gBattleScripting.statChanger = SET_STATCHANGER(STAT_SPATK, 1, FALSE);
|
||||
SET_STATCHANGER(STAT_SPATK, 1, FALSE);
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_ENIGMA_BERRY: // consume and heal if hit by super effective move
|
||||
|
|
@ -7953,7 +7942,7 @@ u32 SetRandomTarget(u32 battler)
|
|||
u32 GetMoveTarget(u16 move, u8 setTarget)
|
||||
{
|
||||
u8 targetBattler = 0;
|
||||
u32 i, moveTarget, side;
|
||||
u32 moveTarget, side;
|
||||
|
||||
if (setTarget != NO_TARGET_OVERRIDE)
|
||||
moveTarget = setTarget - 1;
|
||||
|
|
@ -10148,7 +10137,7 @@ bool32 DoesSpeciesUseHoldItemToChangeForm(u16 species, u16 heldItemId)
|
|||
|
||||
bool32 CanMegaEvolve(u32 battler)
|
||||
{
|
||||
u32 itemId, holdEffect, species;
|
||||
u32 itemId, holdEffect;
|
||||
struct Pokemon *mon;
|
||||
u32 battlerPosition = GetBattlerPosition(battler);
|
||||
u8 partnerPosition = GetBattlerPosition(BATTLE_PARTNER(battler));
|
||||
|
|
@ -10182,7 +10171,6 @@ bool32 CanMegaEvolve(u32 battler)
|
|||
else
|
||||
mon = &gPlayerParty[gBattlerPartyIndexes[battler]];
|
||||
|
||||
species = GetMonData(mon, MON_DATA_SPECIES);
|
||||
itemId = GetMonData(mon, MON_DATA_HELD_ITEM);
|
||||
|
||||
if (itemId == ITEM_ENIGMA_BERRY_E_READER)
|
||||
|
|
@ -10212,7 +10200,7 @@ bool32 CanMegaEvolve(u32 battler)
|
|||
|
||||
bool32 CanUltraBurst(u32 battler)
|
||||
{
|
||||
u32 itemId, holdEffect, species;
|
||||
u32 itemId, holdEffect;
|
||||
struct Pokemon *mon;
|
||||
u32 battlerPosition = GetBattlerPosition(battler);
|
||||
u8 partnerPosition = GetBattlerPosition(BATTLE_PARTNER(battler));
|
||||
|
|
@ -10245,7 +10233,6 @@ bool32 CanUltraBurst(u32 battler)
|
|||
else
|
||||
mon = &gPlayerParty[gBattlerPartyIndexes[battler]];
|
||||
|
||||
species = GetMonData(mon, MON_DATA_SPECIES);
|
||||
itemId = GetMonData(mon, MON_DATA_HELD_ITEM);
|
||||
|
||||
// Check if there is an entry in the evolution table for Ultra Burst.
|
||||
|
|
@ -10292,17 +10279,15 @@ bool32 IsBattlerUltraBursted(u32 battler)
|
|||
// Returns SPECIES_NONE if no form change is possible
|
||||
u16 GetBattleFormChangeTargetSpecies(u32 battler, u16 method)
|
||||
{
|
||||
u32 i, j;
|
||||
u32 i;
|
||||
u16 targetSpecies = SPECIES_NONE;
|
||||
u16 species = gBattleMons[battler].species;
|
||||
const struct FormChange *formChanges = gFormChangeTablePointers[species];
|
||||
u16 heldItem;
|
||||
u32 ability;
|
||||
|
||||
if (formChanges != NULL)
|
||||
{
|
||||
heldItem = gBattleMons[battler].item;
|
||||
ability = GetBattlerAbility(battler);
|
||||
|
||||
for (i = 0; formChanges[i].method != FORM_CHANGE_TERMINATOR; i++)
|
||||
{
|
||||
|
|
@ -11014,8 +10999,6 @@ bool32 IsBattlerWeatherAffected(u32 battler, u32 weatherFlags)
|
|||
// Possible return values are defined in battle.h following MOVE_TARGET_SELECTED
|
||||
u32 GetBattlerMoveTargetType(u32 battler, u32 move)
|
||||
{
|
||||
u32 target;
|
||||
|
||||
if (gBattleMoves[move].effect == EFFECT_EXPANDING_FORCE
|
||||
&& IsBattlerTerrainAffected(battler, STATUS_FIELD_PSYCHIC_TERRAIN))
|
||||
return MOVE_TARGET_BOTH;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ static void ZMoveSelectionDisplayPpNumber(u32 battler);
|
|||
static void ZMoveSelectionDisplayPower(u16 move, u16 zMove);
|
||||
static void ShowZMoveTriggerSprite(u8 battleId);
|
||||
static bool32 AreStatsMaxed(u8 battler, u8 n);
|
||||
static u8 GetZMoveScore(u8 battlerAtk, u8 battlerDef, u16 baseMove, u16 zMove);
|
||||
static void ZMoveSelectionDisplayMoveType(u16 zMove, u32 battler);
|
||||
|
||||
// Const Data
|
||||
|
|
@ -158,15 +157,10 @@ void QueueZMove(u8 battler, u16 baseMove)
|
|||
|
||||
bool32 IsViableZMove(u8 battler, u16 move)
|
||||
{
|
||||
struct Pokemon *mon;
|
||||
u8 battlerPosition = GetBattlerPosition(battler);
|
||||
u8 partnerPosition = GetBattlerPosition(BATTLE_PARTNER(battler));
|
||||
u32 item;
|
||||
u16 holdEffect;
|
||||
u16 species;
|
||||
int moveSlotIndex;
|
||||
|
||||
species = gBattleMons[battler].species;
|
||||
item = gBattleMons[battler].item;
|
||||
|
||||
for (moveSlotIndex = 0; moveSlotIndex < MAX_MON_MOVES; moveSlotIndex++)
|
||||
|
|
@ -236,6 +230,8 @@ bool32 TryChangeZIndicator(u8 battler, u8 moveIndex)
|
|||
HideZMoveTriggerSprite(); // Was a viable z move, now is not -> slide out
|
||||
else if (!gBattleStruct->zmove.viable && viableZMove)
|
||||
ShowZMoveTriggerSprite(battler); // Was not a viable z move, now is -> slide back in
|
||||
|
||||
return viableZMove;
|
||||
}
|
||||
|
||||
#define SINGLES_Z_TRIGGER_POS_X_OPTIMAL (29)
|
||||
|
|
@ -267,7 +263,7 @@ void CreateZMoveTriggerSprite(u8 battler, bool8 viable)
|
|||
else
|
||||
{
|
||||
x = gSprites[gHealthboxSpriteIds[battler]].x - SINGLES_Z_TRIGGER_POS_X_SLIDE;
|
||||
y = gSprites[gHealthboxSpriteIds[battler]].y - SINGLES_Z_TRIGGER_POS_Y_DIFF, 0;
|
||||
y = gSprites[gHealthboxSpriteIds[battler]].y - SINGLES_Z_TRIGGER_POS_Y_DIFF;
|
||||
}
|
||||
|
||||
if (gBattleStruct->zmove.triggerSpriteId == 0xFF)
|
||||
|
|
@ -350,7 +346,6 @@ void HideZMoveTriggerSprite(void)
|
|||
|
||||
static void ShowZMoveTriggerSprite(u8 battler)
|
||||
{
|
||||
struct Sprite *sprite = &gSprites[gBattleStruct->zmove.triggerSpriteId];
|
||||
gBattleStruct->zmove.viable = TRUE;
|
||||
CreateZMoveTriggerSprite(battler, TRUE);
|
||||
}
|
||||
|
|
@ -535,13 +530,11 @@ static void ZMoveSelectionDisplayPower(u16 move, u16 zMove)
|
|||
static void ZMoveSelectionDisplayPpNumber(u32 battler)
|
||||
{
|
||||
u8 *txtPtr;
|
||||
struct ChooseMoveStruct *moveInfo;
|
||||
|
||||
if (gBattleResources->bufferA[battler][2] == TRUE) // Check if we didn't want to display pp number
|
||||
return;
|
||||
|
||||
SetPpNumbersPaletteInMoveSelection(battler);
|
||||
moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[battler][4]);
|
||||
txtPtr = ConvertIntToDecimalStringN(gDisplayedStringBattle, 1, STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||
*(txtPtr)++ = CHAR_SLASH;
|
||||
ConvertIntToDecimalStringN(txtPtr, 1, STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||
|
|
@ -551,7 +544,6 @@ static void ZMoveSelectionDisplayPpNumber(u32 battler)
|
|||
static void ZMoveSelectionDisplayMoveType(u16 zMove, u32 battler)
|
||||
{
|
||||
u8 *txtPtr;
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[battler][4]);
|
||||
u8 zMoveType;
|
||||
|
||||
GET_MOVE_TYPE(zMove, zMoveType);
|
||||
|
|
|
|||
10
src/berry.c
10
src/berry.c
|
|
@ -1825,8 +1825,8 @@ bool8 PlayerHasBerries(void)
|
|||
// For all berry trees on screen, allow normal growth
|
||||
void SetBerryTreesSeen(void)
|
||||
{
|
||||
s16 cam_left;
|
||||
s16 cam_top;
|
||||
u16 cam_left;
|
||||
u16 cam_top;
|
||||
s16 left;
|
||||
s16 top;
|
||||
s16 right;
|
||||
|
|
@ -1842,9 +1842,9 @@ void SetBerryTreesSeen(void)
|
|||
{
|
||||
if (gObjectEvents[i].active && gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH)
|
||||
{
|
||||
cam_left = gObjectEvents[i].currentCoords.x;
|
||||
cam_top = gObjectEvents[i].currentCoords.y;
|
||||
if (left <= cam_left && cam_left <= right && top <= cam_top && cam_top <= bottom)
|
||||
s16 x = gObjectEvents[i].currentCoords.x;
|
||||
s16 y = gObjectEvents[i].currentCoords.y;
|
||||
if (left <= x && x <= right && top <= y && y <= bottom)
|
||||
AllowBerryTreeGrowth(gObjectEvents[i].trainerRange_berryTreeId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,8 +174,8 @@ struct BerryBlender
|
|||
u16 progressBarValue;
|
||||
u16 maxProgressBarValue;
|
||||
u16 centerScale;
|
||||
u16 bg_X;
|
||||
u16 bg_Y;
|
||||
s16 bg_X;
|
||||
s16 bg_Y;
|
||||
u8 opponentTaskIds[BLENDER_MAX_PLAYERS - 1];
|
||||
u8 perfectOpponents; // for debugging, NPCs will always hit Best
|
||||
u16 scores[BLENDER_MAX_PLAYERS][NUM_SCORE_TYPES];
|
||||
|
|
|
|||
|
|
@ -5296,7 +5296,6 @@ static u16 SanitizeSpecies(u16 species)
|
|||
|
||||
static void SetMoveSpecificAnimData(u8 contestant)
|
||||
{
|
||||
s32 i;
|
||||
u16 move = SanitizeMove(eContestantStatus[contestant].currMove);
|
||||
u16 species = SanitizeSpecies(gContestMons[contestant].species);
|
||||
u8 targetContestant;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#define LEVEL_UP_MOVE(lvl, moveLearned) {.move = moveLearned, .level = lvl}
|
||||
#define LEVEL_UP_END {.move = LEVEL_UP_MOVE_END, .level = 0}
|
||||
|
||||
static const struct LevelUpMove sBulbasaurLevelUpLearnset[] = {
|
||||
LEVEL_UP_MOVE( 1, MOVE_TACKLE),
|
||||
|
|
|
|||
|
|
@ -952,11 +952,12 @@ void RejectEggFromDayCare(void)
|
|||
RemoveEggFromDayCare(&gSaveBlock1Ptr->daycare);
|
||||
}
|
||||
|
||||
|
||||
static const struct {
|
||||
u16 currSpecies;
|
||||
u16 item;
|
||||
u16 babySpecies;
|
||||
} IncenseBabyTable[][3] =
|
||||
} sIncenseBabyTable[] =
|
||||
{
|
||||
// Regular offspring, Item, Incense Offspring
|
||||
{ SPECIES_WOBBUFFET, ITEM_LAX_INCENSE, SPECIES_WYNAUT },
|
||||
|
|
@ -970,6 +971,7 @@ static const struct {
|
|||
{ SPECIES_MANTINE, ITEM_WAVE_INCENSE, SPECIES_MANTYKE },
|
||||
};
|
||||
|
||||
#if P_INCENSE_BREEDING < GEN_9
|
||||
static void AlterEggSpeciesWithIncenseItem(u16 *species, struct DayCare *daycare)
|
||||
{
|
||||
u32 i;
|
||||
|
|
@ -977,21 +979,22 @@ static void AlterEggSpeciesWithIncenseItem(u16 *species, struct DayCare *daycare
|
|||
motherItem = GetBoxMonData(&daycare->mons[0].mon, MON_DATA_HELD_ITEM);
|
||||
fatherItem = GetBoxMonData(&daycare->mons[1].mon, MON_DATA_HELD_ITEM);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(IncenseBabyTable); i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sIncenseBabyTable); i++)
|
||||
{
|
||||
if (IncenseBabyTable[i]->babySpecies == *species && motherItem != IncenseBabyTable[i]->item && fatherItem != IncenseBabyTable[i]->item)
|
||||
if (sIncenseBabyTable[i].babySpecies == *species && motherItem != sIncenseBabyTable[i].item && fatherItem != sIncenseBabyTable[i].item)
|
||||
{
|
||||
*species = IncenseBabyTable[i]->currSpecies;
|
||||
*species = sIncenseBabyTable[i].currSpecies;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct {
|
||||
u16 offspring;
|
||||
u16 item;
|
||||
u16 move;
|
||||
} BreedingSpecialMoveItemTable[][3] =
|
||||
} sBreedingSpecialMoveItemTable[] =
|
||||
{
|
||||
// Offspring, Item, Move
|
||||
{ SPECIES_PICHU, ITEM_LIGHT_BALL, MOVE_VOLT_TACKLE },
|
||||
|
|
@ -1003,14 +1006,14 @@ static void GiveMoveIfItem(struct Pokemon *mon, struct DayCare *daycare)
|
|||
u32 motherItem = GetBoxMonData(&daycare->mons[0].mon, MON_DATA_HELD_ITEM);
|
||||
u32 fatherItem = GetBoxMonData(&daycare->mons[1].mon, MON_DATA_HELD_ITEM);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(BreedingSpecialMoveItemTable); i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sBreedingSpecialMoveItemTable); i++)
|
||||
{
|
||||
if (BreedingSpecialMoveItemTable[i]->offspring == species
|
||||
&& (motherItem == BreedingSpecialMoveItemTable[i]->item ||
|
||||
fatherItem == BreedingSpecialMoveItemTable[i]->item))
|
||||
if (sBreedingSpecialMoveItemTable[i].offspring == species
|
||||
&& (motherItem == sBreedingSpecialMoveItemTable[i].item ||
|
||||
fatherItem == sBreedingSpecialMoveItemTable[i].item))
|
||||
{
|
||||
if (GiveMoveToMon(mon, BreedingSpecialMoveItemTable[i]->move) == MON_HAS_MAX_MOVES)
|
||||
DeleteFirstMoveAndGiveMoveToMon(mon, BreedingSpecialMoveItemTable[i]->move);
|
||||
if (GiveMoveToMon(mon, sBreedingSpecialMoveItemTable[i].move) == MON_HAS_MAX_MOVES)
|
||||
DeleteFirstMoveAndGiveMoveToMon(mon, sBreedingSpecialMoveItemTable[i].move);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
25
src/debug.c
25
src/debug.c
|
|
@ -260,12 +260,10 @@ EWRAM_DATA u32 gDebugAIFlags = 0;
|
|||
// Define functions
|
||||
static void Debug_ReShowMainMenu(void);
|
||||
static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate);
|
||||
static void Debug_ShowMenuDynamic(u8 taskId);
|
||||
static void Debug_DestroyMenu(u8 taskId);
|
||||
static void Debug_DestroyMenu_Full(u8 taskId);
|
||||
static void DebugAction_Cancel(u8 taskId);
|
||||
static void DebugAction_DestroyExtraWindow(u8 taskId);
|
||||
static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8));
|
||||
static void Debug_InitDebugBattleData(void);
|
||||
static void Debug_RefreshListMenu(u8 taskId);
|
||||
static void Debug_RedrawListMenu(u8 taskId);
|
||||
|
|
@ -282,7 +280,6 @@ static void DebugAction_Util_Script_8(u8 taskId);
|
|||
static void DebugAction_OpenUtilitiesMenu(u8 taskId);
|
||||
static void DebugAction_OpenScriptsMenu(u8 taskId);
|
||||
static void DebugAction_OpenFlagsVarsMenu(u8 taskId);
|
||||
static void DebugAction_OpenBattleMenu(u8 taskId);
|
||||
static void DebugAction_OpenGiveMenu(u8 taskId);
|
||||
static void DebugAction_OpenFillMenu(u8 taskId);
|
||||
static void DebugAction_OpenSoundMenu(u8 taskId);
|
||||
|
|
@ -970,7 +967,6 @@ static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMte
|
|||
gTasks[inputTaskId].data[2] = 0;
|
||||
|
||||
Debug_RefreshListMenu(inputTaskId);
|
||||
//Debug_ShowMenuDynamic(inputTaskId);
|
||||
|
||||
// draw everything
|
||||
CopyWindowToVram(windowId, 3);
|
||||
|
|
@ -1122,10 +1118,8 @@ static void Debug_RefreshListMenu(u8 taskId)
|
|||
u16 i;
|
||||
const u8 sColor_Red[] = _("{COLOR RED}");
|
||||
const u8 sColor_Green[] = _("{COLOR GREEN}");
|
||||
u8 listTaskId = gTasks[taskId].data[0];
|
||||
struct ListMenu *list = (void*) gTasks[listTaskId].data;
|
||||
u8 totalItems, flagResult;
|
||||
u8 const * name;
|
||||
u8 totalItems = 0, flagResult = 0;
|
||||
u8 const *name = NULL;
|
||||
|
||||
if (sDebugMenuListData->listId == 0)
|
||||
{
|
||||
|
|
@ -1179,7 +1173,7 @@ static void Debug_RefreshListMenu(u8 taskId)
|
|||
{
|
||||
flagResult = sDebugBattleData->aiFlags[i];
|
||||
if (i == totalItems - 1)
|
||||
flagResult == 0xFF;
|
||||
flagResult = 0xFF;
|
||||
name = sDebugMenu_Items_Battle_1[i].name;
|
||||
}
|
||||
|
||||
|
|
@ -1347,10 +1341,9 @@ static void DebugTask_HandleBattleMenuReDraw(u8 taskId)
|
|||
}
|
||||
static void DebugTask_HandleMenuInput_Battle(u8 taskId)
|
||||
{
|
||||
void (*func)(u8);
|
||||
u8 listTaskId = gTasks[taskId].data[0];
|
||||
u32 input = ListMenu_ProcessInput(listTaskId);
|
||||
u16 idx;
|
||||
u8 listTaskId = gTasks[taskId].data[0];
|
||||
ListMenu_ProcessInput(listTaskId);
|
||||
|
||||
ListMenuGetCurrentItemArrayId(listTaskId, &idx);
|
||||
|
||||
|
|
@ -1549,12 +1542,6 @@ static void DebugAction_OpenFlagsVarsMenu(u8 taskId)
|
|||
Debug_ShowMenu(DebugTask_HandleMenuInput_FlagsVars, gMultiuseListMenuTemplate);
|
||||
}
|
||||
|
||||
static void DebugAction_OpenBattleMenu(u8 taskId)
|
||||
{
|
||||
Debug_DestroyMenu(taskId);
|
||||
sDebugMenuListData->listId = 1;
|
||||
Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, sDebugMenu_ListTemplate_Battle_0);
|
||||
}
|
||||
|
||||
static void DebugAction_OpenGiveMenu(u8 taskId)
|
||||
{
|
||||
|
|
@ -1950,7 +1937,6 @@ static void DebugAction_Util_SetWallClock(u8 taskId)
|
|||
}
|
||||
static void DebugAction_Util_WatchCredits(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
Debug_DestroyMenu_Full(taskId);
|
||||
SetMainCallback2(CB2_StartCreditsSequence);
|
||||
}
|
||||
|
|
@ -3518,7 +3504,6 @@ static void DebugAction_Fill_PCBoxes_Fast(u8 taskId) //Credit: Sierraffinity
|
|||
static void DebugAction_Fill_PCBoxes_Slow(u8 taskId)
|
||||
{
|
||||
int boxId, boxPosition;
|
||||
u32 personality;
|
||||
struct BoxPokemon boxMon;
|
||||
u32 species = SPECIES_BULBASAUR;
|
||||
bool8 spaceAvailable = FALSE;
|
||||
|
|
|
|||
|
|
@ -360,7 +360,6 @@ static void AddHatchedMonToParty(u8 id)
|
|||
u8 isEgg = 0x46; // ?
|
||||
u16 species;
|
||||
u8 name[POKEMON_NAME_LENGTH + 1];
|
||||
u16 ball;
|
||||
u16 metLevel;
|
||||
u8 metLocation;
|
||||
struct Pokemon *mon = &gPlayerParty[id];
|
||||
|
|
|
|||
|
|
@ -8883,7 +8883,7 @@ static void CreateLevitateMovementTask(struct ObjectEvent *objectEvent)
|
|||
u8 taskId = CreateTask(ApplyLevitateMovement, 0xFF);
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
StoreWordInTwoHalfwords(&task->data[0], (u32)objectEvent);
|
||||
StoreWordInTwoHalfwords((u16*) &task->data[0], (u32)objectEvent);
|
||||
objectEvent->warpArrowSpriteId = taskId;
|
||||
task->data[3] = 0xFFFF;
|
||||
}
|
||||
|
|
@ -8894,7 +8894,7 @@ static void ApplyLevitateMovement(u8 taskId)
|
|||
struct Sprite *sprite;
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
LoadWordFromTwoHalfwords(&task->data[0], (u32 *)&objectEvent); // load the map object pointer.
|
||||
LoadWordFromTwoHalfwords((u16*) &task->data[0], (u32 *)&objectEvent); // load the map object pointer.
|
||||
sprite = &gSprites[objectEvent->spriteId];
|
||||
|
||||
if(!(task->data[2] & 3))
|
||||
|
|
@ -8911,7 +8911,7 @@ static void DestroyLevitateMovementTask(u8 taskId)
|
|||
struct ObjectEvent *objectEvent;
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
LoadWordFromTwoHalfwords(&task->data[0], (u32 *)&objectEvent); // unused objectEvent
|
||||
LoadWordFromTwoHalfwords((u16*) &task->data[0], (u32 *)&objectEvent); // unused objectEvent
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,9 @@ static bool8 TryStartWarpEventScript(struct MapPosition *, u16);
|
|||
static bool8 TryStartMiscWalkingScripts(u16);
|
||||
static bool8 TryStartStepCountScript(u16);
|
||||
static void UpdateFriendshipStepCounter(void);
|
||||
#if OW_POISON_DAMAGE < GEN_5
|
||||
static bool8 UpdatePoisonStepCounter(void);
|
||||
#endif // OW_POISON_DAMAGE
|
||||
|
||||
void FieldClearPlayerInput(struct FieldInput *input)
|
||||
{
|
||||
|
|
@ -655,6 +657,7 @@ void ClearPoisonStepCounter(void)
|
|||
VarSet(VAR_POISON_STEP_COUNTER, 0);
|
||||
}
|
||||
|
||||
#if OW_POISON_DAMAGE < GEN_5
|
||||
static bool8 UpdatePoisonStepCounter(void)
|
||||
{
|
||||
u16 *ptr;
|
||||
|
|
@ -679,6 +682,7 @@ static bool8 UpdatePoisonStepCounter(void)
|
|||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif // OW_POISON_DAMAGE
|
||||
|
||||
void RestartWildEncounterImmunitySteps(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ static void Task_AnimateDoor(u8 taskId)
|
|||
struct DoorAnimFrame *frames = (struct DoorAnimFrame *)(tFramesHi << 16 | tFramesLo);
|
||||
struct DoorGraphics *gfx = (struct DoorGraphics *)(tGfxHi << 16 | tGfxLo);
|
||||
|
||||
if (AnimateDoorFrame(gfx, frames, data) == FALSE)
|
||||
if (AnimateDoorFrame(gfx, frames, gTasks[taskId].data) == FALSE)
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -964,8 +964,8 @@ void FieldShowRegionMap(void)
|
|||
|
||||
static bool8 IsPlayerInFrontOfPC(void)
|
||||
{
|
||||
u16 x, y;
|
||||
u16 tileInFront;
|
||||
s16 x, y;
|
||||
u32 tileInFront;
|
||||
|
||||
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
|
||||
tileInFront = MapGridGetMetatileIdAt(x, y);
|
||||
|
|
|
|||
|
|
@ -938,7 +938,7 @@ static void InitSnowflakeSpriteMovement(struct Sprite *sprite)
|
|||
sprite->tFallCounter = 0;
|
||||
}
|
||||
|
||||
static void WaitSnowflakeSprite(struct Sprite *sprite)
|
||||
static void UNUSED WaitSnowflakeSprite(struct Sprite *sprite)
|
||||
{
|
||||
if (++gWeatherPtr->snowflakeTimer > 18)
|
||||
{
|
||||
|
|
@ -953,7 +953,6 @@ static void WaitSnowflakeSprite(struct Sprite *sprite)
|
|||
static void UpdateSnowflakeSprite(struct Sprite *sprite)
|
||||
{
|
||||
s16 x;
|
||||
s16 y;
|
||||
|
||||
sprite->tPosY += sprite->tDeltaY;
|
||||
sprite->y = sprite->tPosY >> 7;
|
||||
|
|
|
|||
|
|
@ -48,16 +48,12 @@ static const struct MapConnection *GetIncomingConnection(u8 direction, int x, in
|
|||
static bool8 IsPosInIncomingConnectingMap(u8 direction, int x, int y, const struct MapConnection *connection);
|
||||
static bool8 IsCoordInIncomingConnectingMap(int coord, int srcMax, int destMax, int offset);
|
||||
|
||||
#define GetBorderBlockAt(x, y)({ \
|
||||
u16 block; \
|
||||
int i; \
|
||||
const u16 *border = gMapHeader.mapLayout->border; /* Unused, they read it again below */ \
|
||||
\
|
||||
i = (x + 1) & 1; \
|
||||
i += ((y + 1) & 1) * 2; \
|
||||
\
|
||||
block = gMapHeader.mapLayout->border[i] | MAPGRID_COLLISION_MASK; \
|
||||
})
|
||||
static inline u16 GetBorderBlockAt(int x, int y)
|
||||
{
|
||||
int i = (x + 1) & 1;
|
||||
i += ((y + 1) & 1) * 2;
|
||||
return gMapHeader.mapLayout->border[i] | MAPGRID_COLLISION_MASK;
|
||||
}
|
||||
|
||||
#define AreCoordsWithinMapGridBounds(x, y) (x >= 0 && x < gBackupMapLayout.width && y >= 0 && y < gBackupMapLayout.height)
|
||||
|
||||
|
|
@ -681,7 +677,7 @@ bool8 CameraMove(int x, int y)
|
|||
{
|
||||
DebugPrintfLevel(MGBA_LOG_WARN, "GetIncomingConnection returned an invalid connection inside CameraMove!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return gCamera.active;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1478,7 +1478,7 @@ static void UpdateDomeConfetti(struct ConfettiUtil *util)
|
|||
static void Task_DoDomeConfetti(u8 taskId)
|
||||
{
|
||||
u32 id = 0;
|
||||
u16 *data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
switch (tState)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1112,30 +1112,6 @@ void ItemUseInBattle_PokeBall(u8 taskId)
|
|||
}
|
||||
}
|
||||
|
||||
static void Task_CloseStatIncreaseMessage(u8 taskId)
|
||||
{
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||
{
|
||||
if (!InBattlePyramid())
|
||||
Task_FadeAndCloseBagMenu(taskId);
|
||||
else
|
||||
CloseBattlePyramidBag(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
static void Task_UseStatIncreaseItem(u8 taskId)
|
||||
{
|
||||
if(++gTasks[taskId].data[8] > 7)
|
||||
{
|
||||
PlaySE(SE_USE_ITEM);
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
if (!InBattlePyramid())
|
||||
DisplayItemMessage(taskId, FONT_NORMAL, UseStatIncreaseItem(gSpecialVar_ItemId), Task_CloseStatIncreaseMessage);
|
||||
else
|
||||
DisplayItemMessageInBattlePyramid(taskId, UseStatIncreaseItem(gSpecialVar_ItemId), Task_CloseStatIncreaseMessage);
|
||||
}
|
||||
}
|
||||
|
||||
static void ItemUseInBattle_ShowPartyMenu(u8 taskId)
|
||||
{
|
||||
if (!InBattlePyramid())
|
||||
|
|
|
|||
|
|
@ -134,8 +134,6 @@ static const char str_checkMbootLL[] = "RFU-MBOOT";
|
|||
u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p, bool8 copyInterruptToRam)
|
||||
{
|
||||
u16 i;
|
||||
u16 *dst;
|
||||
const u16 *src;
|
||||
u16 buffByteSizeMax;
|
||||
|
||||
// is in EWRAM?
|
||||
|
|
@ -182,11 +180,13 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p
|
|||
}
|
||||
// rfu_REQ_changeMasterSlave is the function next to rfu_STC_fastCopy
|
||||
#if LIBRFU_VERSION < 1026
|
||||
src = (const u16 *)((uintptr_t)&rfu_STC_fastCopy & ~1);
|
||||
dst = gRfuFixed->fastCopyBuffer;
|
||||
{
|
||||
const u16 *src = (const u16 *)((uintptr_t)&rfu_STC_fastCopy & ~1);
|
||||
u16 *dst = gRfuFixed->fastCopyBuffer;
|
||||
buffByteSizeMax = ((void *)rfu_REQ_changeMasterSlave - (void *)rfu_STC_fastCopy) / sizeof(u16);
|
||||
while (buffByteSizeMax-- != 0)
|
||||
*dst++ = *src++;
|
||||
}
|
||||
#else
|
||||
COPY(
|
||||
(uintptr_t)&rfu_STC_fastCopy & ~1,
|
||||
|
|
@ -591,19 +591,17 @@ static void rfu_CB_pollAndEndSearchChild(u8 reqCommand, u16 reqResult)
|
|||
|
||||
static void rfu_STC_readChildList(void)
|
||||
{
|
||||
u32 stwiParam;
|
||||
u8 numSlots = gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[1];
|
||||
u8 *data_p;
|
||||
u8 i;
|
||||
u8 bm_slot_id;
|
||||
#if LIBRFU_VERSION < 1026
|
||||
u8 true_slots[RFU_CHILD_MAX];
|
||||
#endif
|
||||
|
||||
#if LIBRFU_VERSION < 1026
|
||||
u8 true_slots[RFU_CHILD_MAX];
|
||||
|
||||
if (numSlots != 0)
|
||||
{
|
||||
stwiParam = gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket32.data[0];
|
||||
u8 i;
|
||||
u32 stwiParam = gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket32.data[0];
|
||||
STWI_set_Callback_M(rfu_CB_defaultCallback);
|
||||
STWI_send_LinkStatusREQ();
|
||||
if (STWI_poll_CommandEnd() == 0)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include <string.h>
|
||||
#include "gba/m4a_internal.h"
|
||||
#include "global.h"
|
||||
|
||||
extern const u8 gCgb3Vol[];
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ static EWRAM_DATA u16 sTileNum = 0;
|
|||
static EWRAM_DATA u8 sPaletteNum = 0;
|
||||
static EWRAM_DATA u8 sYesNoWindowId = 0;
|
||||
static EWRAM_DATA u8 sHofPCTopBarWindowId = 0;
|
||||
static EWRAM_DATA u16 sFiller = 0; // needed to align
|
||||
static EWRAM_DATA bool8 sScheduledBgCopiesToVram[4] = {FALSE};
|
||||
static EWRAM_DATA u16 sTempTileDataBufferIdx = 0;
|
||||
static EWRAM_DATA void *sTempTileDataBuffer[0x20] = {NULL};
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ static void UpdateAllLinkPlayers(u16 *, s32);
|
|||
static u8 FlipVerticalAndClearForced(u8, u8);
|
||||
static u8 LinkPlayerGetCollision(u8, u8, s16, s16);
|
||||
static void CreateLinkPlayerSprite(u8, u8);
|
||||
static void GetLinkPlayerCoords(u8, u16 *, u16 *);
|
||||
static void GetLinkPlayerCoords(u8, s16 *, s16 *);
|
||||
static u8 GetLinkPlayerFacingDirection(u8);
|
||||
static u8 GetLinkPlayerElevation(u8);
|
||||
static u8 GetLinkPlayerIdAt(s16, s16);
|
||||
|
|
@ -3014,7 +3014,7 @@ static u8 GetSpriteForLinkedPlayer(u8 linkPlayerId)
|
|||
return objEvent->spriteId;
|
||||
}
|
||||
|
||||
static void GetLinkPlayerCoords(u8 linkPlayerId, u16 *x, u16 *y)
|
||||
static void GetLinkPlayerCoords(u8 linkPlayerId, s16 *x, s16 *y)
|
||||
{
|
||||
u8 objEventId = gLinkPlayerObjectEvents[linkPlayerId].objEventId;
|
||||
struct ObjectEvent *objEvent = &gObjectEvents[objEventId];
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ ALIGNED(4) EWRAM_DATA u16 gPlttBufferUnfaded[PLTT_BUFFER_SIZE] = {0};
|
|||
ALIGNED(4) EWRAM_DATA u16 gPlttBufferFaded[PLTT_BUFFER_SIZE] = {0};
|
||||
static EWRAM_DATA struct PaletteStruct sPaletteStructs[NUM_PALETTE_STRUCTS] = {0};
|
||||
EWRAM_DATA struct PaletteFadeControl gPaletteFade = {0};
|
||||
static EWRAM_DATA u32 sFiller = 0;
|
||||
static EWRAM_DATA u32 sPlttBufferTransferPending = 0;
|
||||
EWRAM_DATA u8 ALIGNED(2) gPaletteDecompressionBuffer[PLTT_SIZE] = {0};
|
||||
|
||||
|
|
|
|||
7
src/party_menu.c
Executable file → Normal file
7
src/party_menu.c
Executable file → Normal file
|
|
@ -228,7 +228,6 @@ static EWRAM_DATA u16 *sSlot1TilemapBuffer = 0; // for switching party slots
|
|||
static EWRAM_DATA u16 *sSlot2TilemapBuffer = 0; //
|
||||
EWRAM_DATA u8 gSelectedOrderFromParty[MAX_FRONTIER_PARTY_SIZE] = {0};
|
||||
static EWRAM_DATA u16 sPartyMenuItemId = 0;
|
||||
static EWRAM_DATA u16 sUnused = 0;
|
||||
EWRAM_DATA u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2] = {0}; // bits 0-3 are the current pos of Slot 1, 4-7 are Slot 2, and so on
|
||||
static EWRAM_DATA u8 sInitialLevel = 0;
|
||||
static EWRAM_DATA u8 sFinalLevel = 0;
|
||||
|
|
@ -5297,7 +5296,7 @@ static void Task_TryLearningNextMoveAfterText(u8 taskId)
|
|||
Task_TryLearningNextMove(taskId);
|
||||
}
|
||||
|
||||
static void DisplayExpPoints(u8 taskId, TaskFunc task, u8 holdEffectParam)
|
||||
static void UNUSED DisplayExpPoints(u8 taskId, TaskFunc task, u8 holdEffectParam)
|
||||
{
|
||||
PlaySE(SE_USE_ITEM);
|
||||
ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[holdEffectParam], STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||
|
|
@ -5430,7 +5429,7 @@ static void Task_DisplayLevelUpStatsPg2(u8 taskId)
|
|||
|
||||
static void DisplayLevelUpStatsPg1(u8 taskId)
|
||||
{
|
||||
s16 *arrayPtr = sPartyMenuInternal->data;
|
||||
u16 *arrayPtr = (u16*) sPartyMenuInternal->data;
|
||||
|
||||
arrayPtr[12] = CreateLevelUpStatsWindow();
|
||||
DrawLevelUpWindowPg1(arrayPtr[12], arrayPtr, &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY);
|
||||
|
|
@ -5440,7 +5439,7 @@ static void DisplayLevelUpStatsPg1(u8 taskId)
|
|||
|
||||
static void DisplayLevelUpStatsPg2(u8 taskId)
|
||||
{
|
||||
s16 *arrayPtr = sPartyMenuInternal->data;
|
||||
u16 *arrayPtr = (u16*) sPartyMenuInternal->data;
|
||||
|
||||
DrawLevelUpWindowPg2(arrayPtr[12], &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY);
|
||||
CopyWindowToVram(arrayPtr[12], COPYWIN_GFX);
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ void PlayerPC(void)
|
|||
|
||||
static void InitPlayerPCMenu(u8 taskId)
|
||||
{
|
||||
u16 *data;
|
||||
s16 *data;
|
||||
struct WindowTemplate windowTemplate;
|
||||
data = gTasks[taskId].data;
|
||||
|
||||
|
|
@ -408,7 +408,7 @@ static void InitPlayerPCMenu(u8 taskId)
|
|||
|
||||
static void PlayerPCProcessMenuInput(u8 taskId)
|
||||
{
|
||||
u16 *data;
|
||||
s16 *data;
|
||||
s8 inputOptionId;
|
||||
|
||||
data = gTasks[taskId].data;
|
||||
|
|
@ -503,7 +503,7 @@ static void PlayerPC_TurnOff(u8 taskId)
|
|||
|
||||
static void InitItemStorageMenu(u8 taskId, u8 var)
|
||||
{
|
||||
u16 *data;
|
||||
s16 *data;
|
||||
struct WindowTemplate windowTemplate;
|
||||
|
||||
data = gTasks[taskId].data;
|
||||
|
|
@ -621,7 +621,7 @@ static void ItemStorage_Toss(u8 taskId)
|
|||
|
||||
static void ItemStorage_Enter(u8 taskId, bool8 toss)
|
||||
{
|
||||
u16 *data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
tInTossMenu = toss;
|
||||
ItemStorage_EraseMainMenu(taskId);
|
||||
|
|
@ -654,7 +654,7 @@ static void SetPlayerPCListCount(u8 taskId)
|
|||
|
||||
static void ItemStorage_EraseMainMenu(u8 taskId)
|
||||
{
|
||||
u16 *data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
ClearStdWindowAndFrameToTransparent(tWindowId, FALSE);
|
||||
ClearWindowTilemap(tWindowId);
|
||||
RemoveWindow(tWindowId);
|
||||
|
|
@ -700,7 +700,7 @@ static void Mailbox_DrawMailboxMenu(u8 taskId)
|
|||
|
||||
static void Mailbox_ProcessInput(u8 taskId)
|
||||
{
|
||||
u16 *data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
|
|
@ -1488,7 +1488,6 @@ static void ItemStorage_HandleRemoveItem(u8 taskId)
|
|||
|
||||
static void ItemStorage_HandleErrorMessageInput(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||
{
|
||||
ItemStorage_PrintMessage(ItemStorage_GetMessage(gSaveBlock1Ptr->pcItems[gPlayerPCItemPageInfo.itemsAbove + gPlayerPCItemPageInfo.cursorPos].itemId));
|
||||
|
|
|
|||
|
|
@ -1591,7 +1591,7 @@ static void ResetPokedexView(struct PokedexView *pokedexView)
|
|||
|
||||
void CB2_OpenPokedex(void)
|
||||
{
|
||||
#if POKEDEX_PLUS_HGSS == TRUE
|
||||
#if POKEDEX_PLUS_HGSS == TRUE
|
||||
CB2_OpenPokedexPlusHGSS();
|
||||
return;
|
||||
#endif
|
||||
|
|
@ -3943,11 +3943,12 @@ static void HighlightSubmenuScreenSelectBarItem(u8 a, u16 b)
|
|||
|
||||
u8 DisplayCaughtMonDexPage(u16 dexNum, u32 otId, u32 personality)
|
||||
{
|
||||
#if POKEDEX_PLUS_HGSS == TRUE
|
||||
u8 taskId = CreateTask(Task_DisplayCaughtMonDexPageHGSS, 0);
|
||||
#else
|
||||
u8 taskId = CreateTask(Task_DisplayCaughtMonDexPage, 0);
|
||||
#endif
|
||||
u8 taskId = 0;
|
||||
#if POKEDEX_PLUS_HGSS
|
||||
taskId = CreateTask(Task_DisplayCaughtMonDexPageHGSS, 0);
|
||||
#else
|
||||
taskId = CreateTask(Task_DisplayCaughtMonDexPage, 0);
|
||||
#endif // POKEDEX_PLUS_HGSS
|
||||
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].tDexNum = dexNum;
|
||||
|
|
@ -5103,8 +5104,8 @@ static void Task_SearchCompleteWaitForInput(u8 taskId)
|
|||
static void Task_SelectSearchMenuItem(u8 taskId)
|
||||
{
|
||||
u8 menuItem;
|
||||
u16 *cursorPos;
|
||||
u16 *scrollOffset;
|
||||
s16 *cursorPos;
|
||||
s16 *scrollOffset;
|
||||
|
||||
DrawOrEraseSearchParameterBox(FALSE);
|
||||
menuItem = gTasks[taskId].tMenuItem;
|
||||
|
|
@ -5124,8 +5125,8 @@ static void Task_HandleSearchParameterInput(u8 taskId)
|
|||
{
|
||||
u8 menuItem;
|
||||
const struct SearchOptionText *texts;
|
||||
u16 *cursorPos;
|
||||
u16 *scrollOffset;
|
||||
s16 *cursorPos;
|
||||
s16 *scrollOffset;
|
||||
u16 maxOption;
|
||||
bool8 moved;
|
||||
|
||||
|
|
@ -5442,8 +5443,8 @@ static void DrawOrEraseSearchParameterBox(bool8 erase)
|
|||
static void PrintSearchParameterText(u8 taskId)
|
||||
{
|
||||
const struct SearchOptionText *texts = sSearchOptions[gTasks[taskId].tMenuItem].texts;
|
||||
const u16 *cursorPos = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataCursorPos];
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataScrollOffset];
|
||||
const s16 *cursorPos = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataCursorPos];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataScrollOffset];
|
||||
u16 i;
|
||||
u16 j;
|
||||
|
||||
|
|
@ -5457,8 +5458,8 @@ static void PrintSearchParameterText(u8 taskId)
|
|||
|
||||
static u8 GetSearchModeSelection(u8 taskId, u8 option)
|
||||
{
|
||||
const u16 *cursorPos = &gTasks[taskId].data[sSearchOptions[option].taskDataCursorPos];
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[option].taskDataScrollOffset];
|
||||
const s16 *cursorPos = &gTasks[taskId].data[sSearchOptions[option].taskDataCursorPos];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[option].taskDataScrollOffset];
|
||||
u16 id = *cursorPos + *scrollOffset;
|
||||
|
||||
switch (option)
|
||||
|
|
@ -5529,7 +5530,7 @@ static void SetDefaultSearchModeAndOrder(u8 taskId)
|
|||
static bool8 SearchParamCantScrollUp(u8 taskId)
|
||||
{
|
||||
u8 menuItem = gTasks[taskId].tMenuItem;
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
u16 lastOption = sSearchOptions[menuItem].numOptions - 1;
|
||||
|
||||
if (lastOption > MAX_SEARCH_PARAM_CURSOR_POS && *scrollOffset != 0)
|
||||
|
|
@ -5541,7 +5542,7 @@ static bool8 SearchParamCantScrollUp(u8 taskId)
|
|||
static bool8 SearchParamCantScrollDown(u8 taskId)
|
||||
{
|
||||
u8 menuItem = gTasks[taskId].tMenuItem;
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
u16 lastOption = sSearchOptions[menuItem].numOptions - 1;
|
||||
|
||||
if (lastOption > MAX_SEARCH_PARAM_CURSOR_POS && *scrollOffset < lastOption - MAX_SEARCH_PARAM_CURSOR_POS)
|
||||
|
|
|
|||
|
|
@ -2994,7 +2994,6 @@ static void CreateInterfaceSprites(u8 page)
|
|||
{
|
||||
u8 spriteId;
|
||||
u16 digitNum;
|
||||
u8 color[3];
|
||||
bool32 drawNextDigit;
|
||||
|
||||
// Scroll arrows
|
||||
|
|
@ -3906,7 +3905,7 @@ static void LoadScreenSelectBarSubmenu(u16 unused)
|
|||
CopyBgTilemapBufferToVram(1);
|
||||
}
|
||||
|
||||
static void HighlightScreenSelectBarItem(u8 selectedScreen, u16 unused)
|
||||
static void UNUSED HighlightScreenSelectBarItem(u8 selectedScreen, u16 unused)
|
||||
{
|
||||
u8 i;
|
||||
u8 j;
|
||||
|
|
@ -3933,7 +3932,7 @@ static void HighlightScreenSelectBarItem(u8 selectedScreen, u16 unused)
|
|||
CopyBgTilemapBufferToVram(1);
|
||||
}
|
||||
|
||||
static void HighlightSubmenuScreenSelectBarItem(u8 a, u16 b)
|
||||
static void UNUSED HighlightSubmenuScreenSelectBarItem(u8 a, u16 b)
|
||||
{
|
||||
u8 i;
|
||||
u8 j;
|
||||
|
|
@ -4178,7 +4177,7 @@ static void PrintInfoScreenTextSmall(const u8* str, u8 left, u8 top)
|
|||
|
||||
AddTextPrinterParameterized4(0, 0, left, top, 0, 0, color, 0, str);
|
||||
}
|
||||
static void PrintInfoScreenTextSmallWhite(const u8* str, u8 left, u8 top)
|
||||
static void UNUSED PrintInfoScreenTextSmallWhite(const u8* str, u8 left, u8 top)
|
||||
{
|
||||
u8 color[3];
|
||||
color[0] = TEXT_COLOR_TRANSPARENT;
|
||||
|
|
@ -4256,14 +4255,11 @@ static void SetTypeIconPosAndPal(u8 typeId, u8 x, u8 y, u8 spriteArrayId)
|
|||
}
|
||||
static void PrintCurrentSpeciesTypeInfo(u8 newEntry, u16 species)
|
||||
{
|
||||
u32 i;
|
||||
u16 dexNum = SpeciesToNationalPokedexNum(species);
|
||||
u8 type1, type2;
|
||||
|
||||
if (!newEntry)
|
||||
{
|
||||
species = NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum);
|
||||
dexNum = SpeciesToNationalPokedexNum(species);
|
||||
}
|
||||
//type icon(s)
|
||||
#ifdef TX_RANDOMIZER_AND_CHALLENGES
|
||||
|
|
@ -4454,7 +4450,7 @@ static void PrintMonWeight(u16 weight, u8 left, u8 top)
|
|||
}
|
||||
|
||||
// Unused in the English version, used to print height/weight in versions which use metric system.
|
||||
static void PrintDecimalNum(u8 windowId, u16 num, u8 left, u8 top)
|
||||
static void UNUSED PrintDecimalNum(u8 windowId, u16 num, u8 left, u8 top)
|
||||
{
|
||||
u8 str[6];
|
||||
bool8 outputted = FALSE;
|
||||
|
|
@ -4646,7 +4642,7 @@ static u16 GetNextPosition(u8 direction, u16 position, u16 min, u16 max)
|
|||
|
||||
// Unown and Spinda use the personality of the first seen individual of that species
|
||||
// All others use personality 0
|
||||
static u32 GetPokedexMonPersonality(u16 species)
|
||||
static UNUSED u32 GetPokedexMonPersonality(u16 species)
|
||||
{
|
||||
if (species == SPECIES_UNOWN || species == SPECIES_SPINDA)
|
||||
{
|
||||
|
|
@ -4670,15 +4666,13 @@ static u32 GetPokedexMonPersonality(u16 species)
|
|||
//************************************
|
||||
u16 NationalPokedexNumToSpeciesHGSS(u16 nationalNum)
|
||||
{
|
||||
u16 species;
|
||||
|
||||
if (!nationalNum)
|
||||
return 0;
|
||||
|
||||
if (sPokedexView->formSpecies != 0)
|
||||
return sPokedexView->formSpecies;
|
||||
else
|
||||
return NationalPokedexNumToSpecies(nationalNum);
|
||||
if (sPokedexView->formSpecies != 0)
|
||||
return sPokedexView->formSpecies;
|
||||
else
|
||||
return NationalPokedexNumToSpecies(nationalNum);
|
||||
}
|
||||
|
||||
static void LoadTilesetTilemapHGSS(u8 page)
|
||||
|
|
@ -4785,8 +4779,8 @@ static void ResetStatsWindows(void)
|
|||
static void SaveMonDataInStruct(void)
|
||||
{
|
||||
u16 species = NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum);
|
||||
u8 EVs[6] = {gSpeciesInfo[species].evYield_HP, gSpeciesInfo[species].evYield_Speed, gSpeciesInfo[species].evYield_Attack, gSpeciesInfo[species].evYield_SpAttack, gSpeciesInfo[species].evYield_Defense, gSpeciesInfo[species].evYield_SpDefense};
|
||||
u8 differentEVs;
|
||||
u8 evs[6] = {gSpeciesInfo[species].evYield_HP, gSpeciesInfo[species].evYield_Speed, gSpeciesInfo[species].evYield_Attack, gSpeciesInfo[species].evYield_SpAttack, gSpeciesInfo[species].evYield_Defense, gSpeciesInfo[species].evYield_SpDefense};
|
||||
u8 differentEVs = 0;
|
||||
u8 i;
|
||||
|
||||
//Count how many different EVs
|
||||
|
|
@ -4948,7 +4942,7 @@ static void Task_LoadStatsScreen(u8 taskId)
|
|||
}
|
||||
}
|
||||
|
||||
static void FreeStatsScreenWindowAndBgBuffers(void)
|
||||
static void UNUSED FreeStatsScreenWindowAndBgBuffers(void)
|
||||
{
|
||||
void *tilemapBuffer;
|
||||
|
||||
|
|
@ -5070,7 +5064,6 @@ static bool8 CalculateMoves(void)
|
|||
|
||||
u16 statsMovesEgg[EGG_MOVES_ARRAY_COUNT] = {0};
|
||||
u16 statsMovesLevelUp[MAX_LEVEL_UP_MOVES] = {0};
|
||||
u16 statsMovesTMHM[NUM_TECHNICAL_MACHINES + NUM_HIDDEN_MACHINES] = {0};
|
||||
u16 move;
|
||||
|
||||
u8 numEggMoves = 0;
|
||||
|
|
@ -5310,14 +5303,7 @@ static void PrintStatsScreen_Moves_Bottom(u8 taskId)
|
|||
static void PrintStatsScreen_NameGender(u8 taskId, u32 num, u32 value)
|
||||
{
|
||||
u8 str[16];
|
||||
u8 str2[32];
|
||||
u8 strEV[25];
|
||||
u16 species = NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum);
|
||||
u16 natNum;
|
||||
u8 evVal;
|
||||
const u8 *category;
|
||||
const u8 *description;
|
||||
const u8 *strEVtype;
|
||||
|
||||
u8 base_x = 38;
|
||||
u8 base_y = 0;
|
||||
|
|
@ -5403,7 +5389,6 @@ static void PrintStatsScreen_Left(u8 taskId)
|
|||
{
|
||||
u8 base_x = 8;
|
||||
u8 x_offset_column = 43;
|
||||
u8 x_offset_value = 26;
|
||||
u8 column = 0;
|
||||
u8 base_x_offset = 70;
|
||||
u8 base_x_first_row = 23;
|
||||
|
|
@ -5417,7 +5402,6 @@ static void PrintStatsScreen_Left(u8 taskId)
|
|||
u8 strBase[14];
|
||||
u8 EVs[6] = {sPokedexView->sPokemonStats.evYield_HP, sPokedexView->sPokemonStats.evYield_Speed, sPokedexView->sPokemonStats.evYield_Attack, sPokedexView->sPokemonStats.evYield_SpAttack, sPokedexView->sPokemonStats.evYield_Defense, sPokedexView->sPokemonStats.evYield_SpDefense};
|
||||
u8 differentEVs = 0;
|
||||
u8 i;
|
||||
|
||||
//Base stats
|
||||
if (gTasks[taskId].data[5] == 0)
|
||||
|
|
@ -5816,7 +5800,6 @@ static void PrintStatsScreen_Left(u8 taskId)
|
|||
|
||||
static void PrintStatsScreen_Abilities(u8 taskId)
|
||||
{
|
||||
u16 species = NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum);
|
||||
u8 abilities_x = 5;
|
||||
u8 abilities_y = 3;
|
||||
u16 ability0;
|
||||
|
|
@ -6096,7 +6079,6 @@ static void Task_HandleEvolutionScreenInput(u8 taskId)
|
|||
|
||||
if (sPokedexView->sEvoScreenData.numAllEvolutions != 0 && sPokedexView->sEvoScreenData.numSeen != 0)
|
||||
{
|
||||
u8 i;
|
||||
u8 base_y = 58;
|
||||
u8 base_y_offset = 9;
|
||||
u8 pos = sPokedexView->sEvoScreenData.menuPos;
|
||||
|
|
@ -6263,8 +6245,6 @@ static u8 PrintPreEvolutions(u8 taskId, u16 species)
|
|||
u8 base_x = 13+8;
|
||||
u8 base_y = 51;
|
||||
u8 base_y_offset = 9;
|
||||
u8 base_i = 0;
|
||||
u8 depth_x = 16;
|
||||
|
||||
u16 preEvolutionOne = 0;
|
||||
u16 preEvolutionTwo = 0;
|
||||
|
|
@ -6355,8 +6335,7 @@ static u8 PrintPreEvolutions(u8 taskId, u16 species)
|
|||
static u8 PrintEvolutionTargetSpeciesAndMethod(u8 taskId, u16 species, u8 depth, u8 depth_i)
|
||||
{
|
||||
u16 i;
|
||||
u16 j;
|
||||
const struct MapHeader *mapHeader;
|
||||
const struct MapHeader *mapHeader;
|
||||
u16 targetSpecies = 0;
|
||||
u16 previousTargetSpecies = 0;
|
||||
|
||||
|
|
@ -6469,119 +6448,119 @@ static u8 PrintEvolutionTargetSpeciesAndMethod(u8 taskId, u16 species, u8 depth,
|
|||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, 3); //beauty
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_BEAUTY );
|
||||
break;
|
||||
case EVO_LEVEL_FEMALE:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_FEMALE );
|
||||
break;
|
||||
case EVO_LEVEL_MALE:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_MALE );
|
||||
break;
|
||||
case EVO_LEVEL_NIGHT:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_NIGHT );
|
||||
break;
|
||||
case EVO_LEVEL_DAY:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_DAY );
|
||||
break;
|
||||
case EVO_LEVEL_DUSK:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_DUSK );
|
||||
break;
|
||||
case EVO_ITEM_HOLD_DAY:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_HOLD_DAY );
|
||||
break;
|
||||
case EVO_ITEM_HOLD_NIGHT:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_HOLD_NIGHT );
|
||||
break;
|
||||
case EVO_MOVE:
|
||||
StringCopy(gStringVar2, gMoveNames[gEvolutionTable[species][i].param]);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_MOVE );
|
||||
break;
|
||||
case EVO_FRIENDSHIP_MOVE_TYPE:
|
||||
StringCopy(gStringVar2, gTypeNames[gEvolutionTable[species][i].param]);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_FRIENDSHIP_MOVE_TYPE );
|
||||
break;
|
||||
case EVO_MAPSEC:
|
||||
StringCopy(gStringVar2, gRegionMapEntries[gEvolutionTable[species][i].param].name);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_MAPSEC );
|
||||
break;
|
||||
case EVO_ITEM_MALE:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_MALE );
|
||||
break;
|
||||
case EVO_ITEM_FEMALE:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_FEMALE );
|
||||
break;
|
||||
case EVO_LEVEL_RAIN:
|
||||
//if (j == WEATHER_RAIN || j == WEATHER_RAIN_THUNDERSTORM || j == WEATHER_DOWNPOUR)
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_RAIN );
|
||||
break;
|
||||
case EVO_SPECIFIC_MON_IN_PARTY:
|
||||
StringCopy(gStringVar2, gSpeciesNames[gEvolutionTable[species][i].param]); //mon name
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_SPECIFIC_MON_IN_PARTY );
|
||||
break;
|
||||
case EVO_LEVEL_DARK_TYPE_MON_IN_PARTY:
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_DARK_TYPE_MON_IN_PARTY );
|
||||
break;
|
||||
case EVO_TRADE_SPECIFIC_MON:
|
||||
StringCopy(gStringVar2, gSpeciesNames[gEvolutionTable[species][i].param]); //mon name
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_TRADE_SPECIFIC_MON );
|
||||
break;
|
||||
case EVO_SPECIFIC_MAP:
|
||||
mapHeader = Overworld_GetMapHeaderByGroupAndId(gEvolutionTable[species][i].param >> 8, gEvolutionTable[species][i].param & 0xFF);
|
||||
GetMapName(gStringVar2, mapHeader->regionMapSectionId, 0);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_SPECIFIC_MAP );
|
||||
break;
|
||||
case EVO_LEVEL_NATURE_AMPED:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_NATURE_AMPED);
|
||||
break;
|
||||
case EVO_LEVEL_NATURE_LOW_KEY:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_NATURE_LOW_KEY);
|
||||
break;
|
||||
case EVO_CRITICAL_HITS:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_CRITS_DIGITS); //crits
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_CRITICAL_HITS);
|
||||
break;
|
||||
case EVO_SCRIPT_TRIGGER_DMG:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_DMG_DIGITS); //damage
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_SCRIPT_TRIGGER_DMG);
|
||||
break;
|
||||
case EVO_DARK_SCROLL:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_DARK_SCROLL );
|
||||
break;
|
||||
case EVO_WATER_SCROLL:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_WATER_SCROLL );
|
||||
break;
|
||||
case EVO_ITEM_NIGHT:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_NIGHT );
|
||||
break;
|
||||
case EVO_ITEM_DAY:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_DAY );
|
||||
break;
|
||||
case EVO_ITEM_HOLD:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_HOLD );
|
||||
break;
|
||||
case EVO_LEVEL_FEMALE:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_FEMALE );
|
||||
break;
|
||||
case EVO_LEVEL_MALE:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_MALE );
|
||||
break;
|
||||
case EVO_LEVEL_NIGHT:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_NIGHT );
|
||||
break;
|
||||
case EVO_LEVEL_DAY:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_DAY );
|
||||
break;
|
||||
case EVO_LEVEL_DUSK:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_DUSK );
|
||||
break;
|
||||
case EVO_ITEM_HOLD_DAY:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_HOLD_DAY );
|
||||
break;
|
||||
case EVO_ITEM_HOLD_NIGHT:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_HOLD_NIGHT );
|
||||
break;
|
||||
case EVO_MOVE:
|
||||
StringCopy(gStringVar2, gMoveNames[gEvolutionTable[species][i].param]);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_MOVE );
|
||||
break;
|
||||
case EVO_FRIENDSHIP_MOVE_TYPE:
|
||||
StringCopy(gStringVar2, gTypeNames[gEvolutionTable[species][i].param]);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_FRIENDSHIP_MOVE_TYPE );
|
||||
break;
|
||||
case EVO_MAPSEC:
|
||||
StringCopy(gStringVar2, gRegionMapEntries[gEvolutionTable[species][i].param].name);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_MAPSEC );
|
||||
break;
|
||||
case EVO_ITEM_MALE:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_MALE );
|
||||
break;
|
||||
case EVO_ITEM_FEMALE:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_FEMALE );
|
||||
break;
|
||||
case EVO_LEVEL_RAIN:
|
||||
//if (j == WEATHER_RAIN || j == WEATHER_RAIN_THUNDERSTORM || j == WEATHER_DOWNPOUR)
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_RAIN );
|
||||
break;
|
||||
case EVO_SPECIFIC_MON_IN_PARTY:
|
||||
StringCopy(gStringVar2, gSpeciesNames[gEvolutionTable[species][i].param]); //mon name
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_SPECIFIC_MON_IN_PARTY );
|
||||
break;
|
||||
case EVO_LEVEL_DARK_TYPE_MON_IN_PARTY:
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_DARK_TYPE_MON_IN_PARTY );
|
||||
break;
|
||||
case EVO_TRADE_SPECIFIC_MON:
|
||||
StringCopy(gStringVar2, gSpeciesNames[gEvolutionTable[species][i].param]); //mon name
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_TRADE_SPECIFIC_MON );
|
||||
break;
|
||||
case EVO_SPECIFIC_MAP:
|
||||
mapHeader = Overworld_GetMapHeaderByGroupAndId(gEvolutionTable[species][i].param >> 8, gEvolutionTable[species][i].param & 0xFF);
|
||||
GetMapName(gStringVar2, mapHeader->regionMapSectionId, 0);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_SPECIFIC_MAP );
|
||||
break;
|
||||
case EVO_LEVEL_NATURE_AMPED:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_NATURE_AMPED);
|
||||
break;
|
||||
case EVO_LEVEL_NATURE_LOW_KEY:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_NATURE_LOW_KEY);
|
||||
break;
|
||||
case EVO_CRITICAL_HITS:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_CRITS_DIGITS); //crits
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_CRITICAL_HITS);
|
||||
break;
|
||||
case EVO_SCRIPT_TRIGGER_DMG:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_DMG_DIGITS); //damage
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_SCRIPT_TRIGGER_DMG);
|
||||
break;
|
||||
case EVO_DARK_SCROLL:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_DARK_SCROLL );
|
||||
break;
|
||||
case EVO_WATER_SCROLL:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_WATER_SCROLL );
|
||||
break;
|
||||
case EVO_ITEM_NIGHT:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_NIGHT );
|
||||
break;
|
||||
case EVO_ITEM_DAY:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_DAY );
|
||||
break;
|
||||
case EVO_ITEM_HOLD:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_HOLD );
|
||||
break;
|
||||
default:
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_UNKNOWN );
|
||||
break;
|
||||
|
|
@ -6852,13 +6831,9 @@ static void PrintForms(u8 taskId, u16 species)
|
|||
u8 j = 1;
|
||||
u16 speciesForm;
|
||||
|
||||
|
||||
bool8 left = TRUE;
|
||||
u8 base_x = 5;
|
||||
u8 base_x_offset = 54;
|
||||
u8 base_y = 52;
|
||||
u8 base_y_offset = 9;
|
||||
u8 base_i = 0;
|
||||
u8 times = 0;
|
||||
u8 y_offset_icons = 0; //For unown only
|
||||
|
||||
|
|
@ -6886,10 +6861,13 @@ static void PrintForms(u8 taskId, u16 species)
|
|||
gTasks[taskId].data[4+times] = CreateMonIcon(speciesForm, SpriteCB_MonIcon, 52 + 34*(times-1), 31, 4, 0); //Create pokemon sprite
|
||||
else if (times < 14)
|
||||
gTasks[taskId].data[4+times] = CreateMonIcon(speciesForm, SpriteCB_MonIcon, 18 + 34*(times-7), 70 - y_offset_icons, 4, 0); //Create pokemon sprite
|
||||
// Can't print any more forms, because we're going out of bounds for task data.
|
||||
/*
|
||||
else if (times < 21)
|
||||
gTasks[taskId].data[4+times] = CreateMonIcon(speciesForm, SpriteCB_MonIcon, 18 + 34*(times-14), 104 - y_offset_icons, 4, 0); //Create pokemon sprite
|
||||
else
|
||||
gTasks[taskId].data[4+times] = CreateMonIcon(speciesForm, SpriteCB_MonIcon, 18 + 34*(times-21), 138 - y_offset_icons, 4, 0); //Create pokemon sprite
|
||||
*/
|
||||
gSprites[gTasks[taskId].data[4+times]].oam.priority = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -7550,7 +7528,7 @@ static void Task_ClosePokedexFromSearchResultsStartMenu(u8 taskId)
|
|||
static int DoPokedexSearch(u8 dexMode, u8 order, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2)
|
||||
{
|
||||
u16 species;
|
||||
u16 i,j;
|
||||
u16 i;
|
||||
u16 resultsCount;
|
||||
u8 types[2];
|
||||
|
||||
|
|
@ -7738,7 +7716,7 @@ static void Task_LoadSearchMenu(u8 taskId)
|
|||
case 1:
|
||||
LoadCompressedSpriteSheet(&sInterfaceSpriteSheet[HGSS_DECAPPED]);
|
||||
LoadSpritePalettes(sInterfaceSpritePalette);
|
||||
LoadSpritePalettes(sStatBarSpritePal);
|
||||
LoadSpritePalettes(sStatBarSpritePal);
|
||||
CreateSearchParameterScrollArrows(taskId);
|
||||
for (i = 0; i < NUM_TASK_DATA; i++)
|
||||
gTasks[taskId].data[i] = 0;
|
||||
|
|
@ -8014,8 +7992,8 @@ static void Task_SearchCompleteWaitForInput(u8 taskId)
|
|||
static void Task_SelectSearchMenuItem(u8 taskId)
|
||||
{
|
||||
u8 menuItem;
|
||||
u16 *cursorPos;
|
||||
u16 *scrollOffset;
|
||||
s16 *cursorPos;
|
||||
s16 *scrollOffset;
|
||||
|
||||
DrawOrEraseSearchParameterBox(FALSE);
|
||||
menuItem = gTasks[taskId].tMenuItem;
|
||||
|
|
@ -8035,8 +8013,8 @@ static void Task_HandleSearchParameterInput(u8 taskId)
|
|||
{
|
||||
u8 menuItem;
|
||||
const struct SearchOptionText *texts;
|
||||
u16 *cursorPos;
|
||||
u16 *scrollOffset;
|
||||
s16 *cursorPos;
|
||||
s16 *scrollOffset;
|
||||
u16 maxOption;
|
||||
bool8 moved;
|
||||
|
||||
|
|
@ -8354,8 +8332,8 @@ static void DrawOrEraseSearchParameterBox(bool8 erase)
|
|||
static void PrintSearchParameterText(u8 taskId)
|
||||
{
|
||||
const struct SearchOptionText *texts = sSearchOptions[gTasks[taskId].tMenuItem].texts;
|
||||
const u16 *cursorPos = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataCursorPos];
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataScrollOffset];
|
||||
const s16 *cursorPos = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataCursorPos];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataScrollOffset];
|
||||
u16 i;
|
||||
u16 j;
|
||||
|
||||
|
|
@ -8369,8 +8347,8 @@ static void PrintSearchParameterText(u8 taskId)
|
|||
|
||||
static u8 GetSearchModeSelection(u8 taskId, u8 option)
|
||||
{
|
||||
const u16 *cursorPos = &gTasks[taskId].data[sSearchOptions[option].taskDataCursorPos];
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[option].taskDataScrollOffset];
|
||||
const s16 *cursorPos = &gTasks[taskId].data[sSearchOptions[option].taskDataCursorPos];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[option].taskDataScrollOffset];
|
||||
u16 id = *cursorPos + *scrollOffset;
|
||||
|
||||
switch (option)
|
||||
|
|
@ -8441,7 +8419,7 @@ static void SetDefaultSearchModeAndOrder(u8 taskId)
|
|||
static bool8 SearchParamCantScrollUp(u8 taskId)
|
||||
{
|
||||
u8 menuItem = gTasks[taskId].tMenuItem;
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
u16 lastOption = sSearchOptions[menuItem].numOptions - 1;
|
||||
|
||||
if (lastOption > MAX_SEARCH_PARAM_CURSOR_POS && *scrollOffset != 0)
|
||||
|
|
@ -8453,7 +8431,7 @@ static bool8 SearchParamCantScrollUp(u8 taskId)
|
|||
static bool8 SearchParamCantScrollDown(u8 taskId)
|
||||
{
|
||||
u8 menuItem = gTasks[taskId].tMenuItem;
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
u16 lastOption = sSearchOptions[menuItem].numOptions - 1;
|
||||
|
||||
if (lastOption > MAX_SEARCH_PARAM_CURSOR_POS && *scrollOffset < lastOption - MAX_SEARCH_PARAM_CURSOR_POS)
|
||||
|
|
|
|||
|
|
@ -4090,19 +4090,14 @@ static u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon)
|
|||
return checksum;
|
||||
}
|
||||
|
||||
#if B_FRIENDSHIP_BOOST == TRUE
|
||||
#define CALC_FRIENDSHIP_BOOST() n = n + ((n * 10 * friendship) / (MAX_FRIENDSHIP * 100));
|
||||
#else
|
||||
#define CALC_FRIENDSHIP_BOOST()
|
||||
#endif
|
||||
|
||||
#define CALC_STAT(base, iv, ev, statIndex, field) \
|
||||
{ \
|
||||
u8 baseStat = gSpeciesInfo[species].base; \
|
||||
s32 n = (((2 * baseStat + iv + ev / 4) * level) / 100) + 5; \
|
||||
u8 nature = GetNature(mon); \
|
||||
n = ModifyStatByNature(nature, n, statIndex); \
|
||||
CALC_FRIENDSHIP_BOOST() \
|
||||
if (B_FRIENDSHIP_BOOST == TRUE) \
|
||||
n = n + ((n * 10 * friendship) / (MAX_FRIENDSHIP * 100));\
|
||||
SetMonData(mon, field, &n); \
|
||||
}
|
||||
|
||||
|
|
@ -4288,7 +4283,7 @@ void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon)
|
|||
s32 level = GetLevelFromBoxMonExp(boxMon);
|
||||
s32 i;
|
||||
|
||||
for (i = 0; gLevelUpLearnsets[species][i].move != LEVEL_UP_END; i++)
|
||||
for (i = 0; gLevelUpLearnsets[species][i].move != LEVEL_UP_MOVE_END; i++)
|
||||
{
|
||||
if (gLevelUpLearnsets[species][i].level > level)
|
||||
break;
|
||||
|
|
@ -4308,12 +4303,12 @@ void GiveBoxMonInitialMoveset_Fast(struct BoxPokemon *boxMon) //Credit: Asparagu
|
|||
{
|
||||
u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
|
||||
s32 level = GetLevelFromBoxMonExp(boxMon);
|
||||
s32 i, j;
|
||||
s32 i;
|
||||
u16 levelMoveCount = 0;
|
||||
u16 moves[MAX_MON_MOVES] = {0};
|
||||
u8 addedMoves = 0;
|
||||
|
||||
for (i = 0; gLevelUpLearnsets[species][i].move != LEVEL_UP_END; i++)
|
||||
for (i = 0; gLevelUpLearnsets[species][i].move != LEVEL_UP_MOVE_END; i++)
|
||||
levelMoveCount++;
|
||||
|
||||
for (i = levelMoveCount; (i >= 0 && addedMoves < MAX_MON_MOVES); i--)
|
||||
|
|
@ -4350,7 +4345,7 @@ u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove)
|
|||
while (gLevelUpLearnsets[species][sLearningMoveTableID].level != level)
|
||||
{
|
||||
sLearningMoveTableID++;
|
||||
if (gLevelUpLearnsets[species][sLearningMoveTableID].move == LEVEL_UP_END)
|
||||
if (gLevelUpLearnsets[species][sLearningMoveTableID].move == LEVEL_UP_MOVE_END)
|
||||
return MOVE_NONE;
|
||||
}
|
||||
}
|
||||
|
|
@ -4607,44 +4602,20 @@ static void DecryptBoxMon(struct BoxPokemon *boxMon)
|
|||
#define SUBSTRUCT_CASE(n, v1, v2, v3, v4) \
|
||||
case n: \
|
||||
{ \
|
||||
union PokemonSubstruct *substructs0 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs1 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs2 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs3 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs4 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs5 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs6 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs7 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs8 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs9 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs10 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs11 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs12 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs13 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs14 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs15 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs16 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs17 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs18 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs19 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs20 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs21 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs22 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs23 = boxMon->secure.substructs; \
|
||||
\
|
||||
switch (substructType) \
|
||||
{ \
|
||||
case 0: \
|
||||
substruct = &substructs ## n [v1]; \
|
||||
substruct = &boxMon->secure.substructs[v1]; \
|
||||
break; \
|
||||
case 1: \
|
||||
substruct = &substructs ## n [v2]; \
|
||||
substruct = &boxMon->secure.substructs[v2]; \
|
||||
break; \
|
||||
case 2: \
|
||||
substruct = &substructs ## n [v3]; \
|
||||
substruct = &boxMon->secure.substructs[v3]; \
|
||||
break; \
|
||||
case 3: \
|
||||
substruct = &substructs ## n [v4]; \
|
||||
substruct = &boxMon->secure.substructs[v4]; \
|
||||
break; \
|
||||
} \
|
||||
break; \
|
||||
|
|
@ -6367,7 +6338,6 @@ static void BufferStatRoseMessage(s32 statIdx)
|
|||
|
||||
u8 *UseStatIncreaseItem(u16 itemId)
|
||||
{
|
||||
int i;
|
||||
const u8 *itemEffect;
|
||||
|
||||
if (itemId == ITEM_ENIGMA_BERRY_E_READER)
|
||||
|
|
@ -7502,7 +7472,7 @@ u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves)
|
|||
{
|
||||
u16 moveLevel;
|
||||
|
||||
if (gLevelUpLearnsets[species][i].move == LEVEL_UP_END)
|
||||
if (gLevelUpLearnsets[species][i].move == LEVEL_UP_MOVE_END)
|
||||
break;
|
||||
|
||||
moveLevel = gLevelUpLearnsets[species][i].level;
|
||||
|
|
@ -7531,7 +7501,7 @@ u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves)
|
|||
u8 numMoves = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_LEVEL_UP_MOVES && gLevelUpLearnsets[species][i].move != LEVEL_UP_END; i++)
|
||||
for (i = 0; i < MAX_LEVEL_UP_MOVES && gLevelUpLearnsets[species][i].move != LEVEL_UP_MOVE_END; i++)
|
||||
moves[numMoves++] = gLevelUpLearnsets[species][i].move;
|
||||
|
||||
return numMoves;
|
||||
|
|
@ -7556,7 +7526,7 @@ u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
|
|||
{
|
||||
u16 moveLevel;
|
||||
|
||||
if (gLevelUpLearnsets[species][i].move == LEVEL_UP_END)
|
||||
if (gLevelUpLearnsets[species][i].move == LEVEL_UP_MOVE_END)
|
||||
break;
|
||||
|
||||
moveLevel = gLevelUpLearnsets[species][i].level;
|
||||
|
|
@ -8425,7 +8395,7 @@ u16 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg)
|
|||
// Returns SPECIES_NONE if no form change is possible
|
||||
u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 arg)
|
||||
{
|
||||
u32 i, j;
|
||||
u32 i;
|
||||
u16 targetSpecies = SPECIES_NONE;
|
||||
u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
|
||||
const struct FormChange *formChanges = gFormChangeTablePointers[species];
|
||||
|
|
@ -8496,7 +8466,7 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32
|
|||
|
||||
bool32 DoesSpeciesHaveFormChangeMethod(u16 species, u16 method)
|
||||
{
|
||||
u32 i, j;
|
||||
u32 i;
|
||||
const struct FormChange *formChanges = gFormChangeTablePointers[species];
|
||||
|
||||
if (formChanges != NULL)
|
||||
|
|
@ -8524,7 +8494,7 @@ u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove)
|
|||
{
|
||||
sLearningMoveTableID = 0;
|
||||
}
|
||||
while(gLevelUpLearnsets[species][sLearningMoveTableID].move != LEVEL_UP_END)
|
||||
while(gLevelUpLearnsets[species][sLearningMoveTableID].move != LEVEL_UP_MOVE_END)
|
||||
{
|
||||
while (gLevelUpLearnsets[species][sLearningMoveTableID].level == 0 || gLevelUpLearnsets[species][sLearningMoveTableID].level == level)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ static void ReloadPokemonSprites(struct PokemonDebugMenu *data);
|
|||
static void Exit_Debug_Pokemon(u8);
|
||||
|
||||
//Text handling functions
|
||||
static void PadString(const u8 *src, u8 *dst)
|
||||
static void UNUSED PadString(const u8 *src, u8 *dst)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
|
|
@ -542,7 +542,6 @@ static void ValueToCharDigits(u8 *charDigits, u32 newValue, u8 maxDigits)
|
|||
|
||||
static void SetArrowInvisibility(struct PokemonDebugMenu *data)
|
||||
{
|
||||
bool8 invisible = data->currentSubmenu;
|
||||
switch (data->currentSubmenu)
|
||||
{
|
||||
case 0:
|
||||
|
|
@ -672,7 +671,6 @@ static bool32 TryMoveDigit(struct PokemonDebugModifyArrows *modArrows, bool32 mo
|
|||
|
||||
static void UpdateBattlerValue(struct PokemonDebugMenu *data)
|
||||
{
|
||||
u32 i;
|
||||
switch (data->modifyArrows.typeOfVal)
|
||||
{
|
||||
case VAL_U16:
|
||||
|
|
@ -706,13 +704,8 @@ static const struct CompressedSpritePalette *GetMonSpritePalStructCustom(u16 spe
|
|||
|
||||
static void BattleLoadOpponentMonSpriteGfxCustom(u16 species, bool8 isFemale, bool8 isShiny, u8 battlerId)
|
||||
{
|
||||
u16 paletteOffset;
|
||||
const void *lzPaletteData;
|
||||
const struct CompressedSpritePalette *palette;
|
||||
|
||||
paletteOffset = 0x100 + battlerId * 16;
|
||||
|
||||
palette = GetMonSpritePalStructCustom(species, isFemale, isShiny);
|
||||
u16 paletteOffset = 0x100 + battlerId * 16;;
|
||||
|
||||
if (isShiny)
|
||||
{
|
||||
|
|
@ -1109,9 +1102,7 @@ void CB2_Debug_Pokemon(void)
|
|||
|
||||
FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 15);
|
||||
InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates));
|
||||
data->battleBgType = 0;
|
||||
data->battleTerrain = 0;
|
||||
LoadBattleBg(data->battleBgType , data->battleTerrain);
|
||||
LoadBattleBg(0, BATTLE_TERRAIN_GRASS);
|
||||
|
||||
gMain.state++;
|
||||
break;
|
||||
|
|
@ -1262,7 +1253,7 @@ static void ApplyOffsetSpriteValues(struct PokemonDebugMenu *data)
|
|||
gSprites[data->backspriteId].y = DEBUG_MON_BACK_Y + gMonBackPicCoords[species].y_offset + data->offsetsSpriteValues.offset_back_picCoords;
|
||||
//Front
|
||||
gSprites[data->frontspriteId].y = GetBattlerSpriteFinal_YCustom(species, data->offsetsSpriteValues.offset_front_picCoords, data->offsetsSpriteValues.offset_front_elevation);
|
||||
|
||||
|
||||
if (data->currentSubmenu == 2)
|
||||
UpdateShadowSpriteInvisible(data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -460,20 +460,20 @@ static void Task_MixingRecordsRecv(u8 taskId)
|
|||
task->func = Task_SendPacket;
|
||||
if (Link_AnyPartnersPlayingRubyOrSapphire())
|
||||
{
|
||||
StorePtrInTaskData(sSentRecord, &task->tSentRecord);
|
||||
StorePtrInTaskData(sSentRecord, (u16*) &task->tSentRecord);
|
||||
subTaskId = CreateTask(Task_CopyReceiveBuffer, 80);
|
||||
task->tCopyTaskId = subTaskId;
|
||||
gTasks[subTaskId].tParentTaskId = taskId;
|
||||
StorePtrInTaskData(sReceivedRecords, &gTasks[subTaskId].tRecvRecords);
|
||||
StorePtrInTaskData(sReceivedRecords, (u16*) &gTasks[subTaskId].tRecvRecords);
|
||||
sRecordStructSize = sizeof(struct PlayerRecordRS);
|
||||
}
|
||||
else
|
||||
{
|
||||
StorePtrInTaskData(sSentRecord, &task->tSentRecord);
|
||||
StorePtrInTaskData(sSentRecord, (u16*) &task->tSentRecord);
|
||||
subTaskId = CreateTask(Task_CopyReceiveBuffer, 80);
|
||||
task->tCopyTaskId = subTaskId;
|
||||
gTasks[subTaskId].tParentTaskId = taskId;
|
||||
StorePtrInTaskData(sReceivedRecords, &gTasks[subTaskId].tRecvRecords);
|
||||
StorePtrInTaskData(sReceivedRecords,(u16*) &gTasks[subTaskId].tRecvRecords);
|
||||
sRecordStructSize = sizeof(struct PlayerRecordEmerald);
|
||||
}
|
||||
}
|
||||
|
|
@ -495,7 +495,7 @@ static void Task_SendPacket(u8 taskId)
|
|||
{
|
||||
case 0: // Copy record data chunk to send buffer
|
||||
{
|
||||
void *recordData = LoadPtrFromTaskData(&task->tSentRecord) + task->tNumChunksSent * BUFFER_CHUNK_SIZE;
|
||||
void *recordData = LoadPtrFromTaskData((u16*)&task->tSentRecord) + task->tNumChunksSent * BUFFER_CHUNK_SIZE;
|
||||
|
||||
memcpy(gBlockSendBuffer, recordData, BUFFER_CHUNK_SIZE);
|
||||
task->tState++;
|
||||
|
|
@ -537,7 +537,7 @@ static void Task_CopyReceiveBuffer(u8 taskId)
|
|||
{
|
||||
if ((status >> i) & 1)
|
||||
{
|
||||
void *dest = LoadPtrFromTaskData(&task->tRecvRecords) + task->tNumChunksRecv(i) * BUFFER_CHUNK_SIZE + sRecordStructSize * i;
|
||||
void *dest = LoadPtrFromTaskData((u16*) &task->tRecvRecords) + task->tNumChunksRecv(i) * BUFFER_CHUNK_SIZE + sRecordStructSize * i;
|
||||
void *src = GetPlayerRecvBuffer(i);
|
||||
if ((task->tNumChunksRecv(i) + 1) * BUFFER_CHUNK_SIZE > sRecordStructSize)
|
||||
memcpy(dest, src, sRecordStructSize - task->tNumChunksRecv(i) * BUFFER_CHUNK_SIZE);
|
||||
|
|
@ -765,9 +765,6 @@ static void ReceiveDaycareMailData(struct RecordMixingDaycareMail *records, size
|
|||
struct RecordMixingDaycareMail *mixMail;
|
||||
u8 playerSlot1, playerSlot2;
|
||||
void *ptr;
|
||||
u8 unusedArr1[MAX_LINK_PLAYERS];
|
||||
u8 unusedArr2[MAX_LINK_PLAYERS];
|
||||
struct RecordMixingDaycareMail *unusedMixMail[MAX_LINK_PLAYERS];
|
||||
bool8 canHoldItem[MAX_LINK_PLAYERS][DAYCARE_MON_COUNT];
|
||||
u8 idxs[MAX_LINK_PLAYERS][2];
|
||||
u8 numDaycareCanHold;
|
||||
|
|
@ -782,8 +779,6 @@ static void ReceiveDaycareMailData(struct RecordMixingDaycareMail *records, size
|
|||
linkPlayerCount = GetLinkPlayerCount();
|
||||
for (i = 0; i < MAX_LINK_PLAYERS; i++)
|
||||
{
|
||||
unusedArr1[i] = 0xFF;
|
||||
unusedArr2[i] = 0;
|
||||
canHoldItem[i][0] = FALSE;
|
||||
canHoldItem[i][1] = FALSE;
|
||||
}
|
||||
|
|
@ -924,7 +919,6 @@ static void ReceiveDaycareMailData(struct RecordMixingDaycareMail *records, size
|
|||
for (i = 0; i < MAX_LINK_PLAYERS; i++)
|
||||
{
|
||||
mixMail = &records[multiplayerId * recordSize];
|
||||
unusedMixMail[i] = mixMail;
|
||||
}
|
||||
|
||||
// Choose a random table id to determine who will
|
||||
|
|
|
|||
|
|
@ -1124,8 +1124,8 @@ static void RegionMap_InitializeStateBasedOnSSTidalLocation(void)
|
|||
{
|
||||
u16 y;
|
||||
u16 x;
|
||||
u8 mapGroup;
|
||||
u8 mapNum;
|
||||
s8 mapGroup;
|
||||
s8 mapNum;
|
||||
u16 dimensionScale;
|
||||
s16 xOnMap;
|
||||
s16 yOnMap;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,6 @@ u16 gSaveUnusedVar2;
|
|||
u16 gSaveAttemptStatus;
|
||||
|
||||
EWRAM_DATA struct SaveSector gSaveDataBuffer = {0}; // Buffer used for reading/writing sectors
|
||||
EWRAM_DATA static u8 sUnusedVar = 0;
|
||||
|
||||
void ClearSaveData(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,9 +41,7 @@ enum
|
|||
|
||||
static EWRAM_DATA u16 sSaveFailedType = {0};
|
||||
static EWRAM_DATA u16 sClockInfo[2] = {0};
|
||||
static EWRAM_DATA u8 sUnused1[12] = {0};
|
||||
static EWRAM_DATA u8 sWindowIds[2] = {0};
|
||||
static EWRAM_DATA u8 sUnused2[4] = {0};
|
||||
|
||||
static const struct OamData sClockOamData =
|
||||
{
|
||||
|
|
|
|||
40
src/scrcmd.c
40
src/scrcmd.c
|
|
@ -783,8 +783,8 @@ bool8 ScrCmd_warphole(struct ScriptContext *ctx)
|
|||
{
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
u16 x;
|
||||
u16 y;
|
||||
s16 x;
|
||||
s16 y;
|
||||
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
if (mapGroup == MAP_GROUP(UNDEFINED) && mapNum == MAP_NUM(UNDEFINED))
|
||||
|
|
@ -1420,10 +1420,10 @@ bool8 ScrCmd_multichoicegrid(struct ScriptContext *ctx)
|
|||
|
||||
bool8 ScrCmd_erasebox(struct ScriptContext *ctx)
|
||||
{
|
||||
u8 left = ScriptReadByte(ctx);
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 right = ScriptReadByte(ctx);
|
||||
u8 bottom = ScriptReadByte(ctx);
|
||||
u8 UNUSED left = ScriptReadByte(ctx);
|
||||
u8 UNUSED top = ScriptReadByte(ctx);
|
||||
u8 UNUSED right = ScriptReadByte(ctx);
|
||||
u8 UNUSED bottom = ScriptReadByte(ctx);
|
||||
|
||||
// Menu_EraseWindowRect(left, top, right, bottom);
|
||||
return FALSE;
|
||||
|
|
@ -1431,10 +1431,10 @@ bool8 ScrCmd_erasebox(struct ScriptContext *ctx)
|
|||
|
||||
bool8 ScrCmd_drawboxtext(struct ScriptContext *ctx)
|
||||
{
|
||||
u8 left = ScriptReadByte(ctx);
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 multichoiceId = ScriptReadByte(ctx);
|
||||
bool8 ignoreBPress = ScriptReadByte(ctx);
|
||||
u8 UNUSED left = ScriptReadByte(ctx);
|
||||
u8 UNUSED top = ScriptReadByte(ctx);
|
||||
u8 UNUSED multichoiceId = ScriptReadByte(ctx);
|
||||
bool8 UNUSED ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
/*if (Multichoice(left, top, multichoiceId, ignoreBPress) == TRUE)
|
||||
{
|
||||
|
|
@ -1783,8 +1783,8 @@ bool8 ScrCmd_hidemoneybox(struct ScriptContext *ctx)
|
|||
|
||||
bool8 ScrCmd_updatemoneybox(struct ScriptContext *ctx)
|
||||
{
|
||||
u8 x = ScriptReadByte(ctx);
|
||||
u8 y = ScriptReadByte(ctx);
|
||||
u8 UNUSED x = ScriptReadByte(ctx);
|
||||
u8 UNUSED y = ScriptReadByte(ctx);
|
||||
u8 ignore = ScriptReadByte(ctx);
|
||||
|
||||
if (!ignore)
|
||||
|
|
@ -1803,8 +1803,8 @@ bool8 ScrCmd_showcoinsbox(struct ScriptContext *ctx)
|
|||
|
||||
bool8 ScrCmd_hidecoinsbox(struct ScriptContext *ctx)
|
||||
{
|
||||
u8 x = ScriptReadByte(ctx);
|
||||
u8 y = ScriptReadByte(ctx);
|
||||
u8 UNUSED x = ScriptReadByte(ctx);
|
||||
u8 UNUSED y = ScriptReadByte(ctx);
|
||||
|
||||
HideCoinsWindow();
|
||||
return FALSE;
|
||||
|
|
@ -1812,8 +1812,8 @@ bool8 ScrCmd_hidecoinsbox(struct ScriptContext *ctx)
|
|||
|
||||
bool8 ScrCmd_updatecoinsbox(struct ScriptContext *ctx)
|
||||
{
|
||||
u8 x = ScriptReadByte(ctx);
|
||||
u8 y = ScriptReadByte(ctx);
|
||||
u8 UNUSED x = ScriptReadByte(ctx);
|
||||
u8 UNUSED y = ScriptReadByte(ctx);
|
||||
|
||||
PrintCoinsString(GetCoins());
|
||||
return FALSE;
|
||||
|
|
@ -2128,10 +2128,10 @@ bool8 ScrCmd_setdoorclosed(struct ScriptContext *ctx)
|
|||
// Below two are functions for elevators in RS, do nothing in Emerald
|
||||
bool8 ScrCmd_addelevmenuitem(struct ScriptContext *ctx)
|
||||
{
|
||||
u8 v3 = ScriptReadByte(ctx);
|
||||
u16 v5 = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 v7 = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 v9 = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 UNUSED v3 = ScriptReadByte(ctx);
|
||||
u16 UNUSED v5 = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 UNUSED v7 = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 UNUSED v9 = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
//ScriptAddElevatorMenuItem(v3, v5, v7, v9);
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -273,8 +273,6 @@ static void Task_HandleMultichoiceInput(u8 taskId)
|
|||
|
||||
bool8 ScriptMenu_YesNo(u8 left, u8 top)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
if (FuncIsActiveTask(Task_HandleYesNoInput) == TRUE)
|
||||
{
|
||||
return FALSE;
|
||||
|
|
@ -283,7 +281,7 @@ bool8 ScriptMenu_YesNo(u8 left, u8 top)
|
|||
{
|
||||
gSpecialVar_Result = 0xFF;
|
||||
DisplayYesNoMenuDefaultYes();
|
||||
taskId = CreateTask(Task_HandleYesNoInput, 0x50);
|
||||
CreateTask(Task_HandleYesNoInput, 0x50);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -519,7 +519,7 @@ bool8 CurMapIsSecretBase(void)
|
|||
void InitSecretBaseAppearance(bool8 hidePC)
|
||||
{
|
||||
u16 secretBaseIdx;
|
||||
u16 x, y;
|
||||
s16 x, y;
|
||||
u8 *decorations;
|
||||
u8 *decorPos;
|
||||
|
||||
|
|
@ -915,7 +915,7 @@ void ShowSecretBaseRegistryMenu(void)
|
|||
|
||||
static void Task_ShowSecretBaseRegistryMenu(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *data = (u16*) gTasks[taskId].data;
|
||||
LockPlayerFieldControls();
|
||||
tNumBases = GetNumRegisteredSecretBases();
|
||||
if (tNumBases != 0)
|
||||
|
|
@ -977,7 +977,7 @@ static void RegistryMenu_OnCursorMove(s32 unused, bool8 flag, struct ListMenu *m
|
|||
|
||||
static void FinalizeRegistryMenu(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *data = (u16*) gTasks[taskId].data;
|
||||
SetStandardWindowBorderStyle(tMainWindowId, FALSE);
|
||||
tListTaskId = ListMenuInit(&gMultiuseListMenuTemplate, tScrollOffset, tSelectedRow);
|
||||
AddRegistryMenuScrollArrows(taskId);
|
||||
|
|
@ -986,13 +986,13 @@ static void FinalizeRegistryMenu(u8 taskId)
|
|||
|
||||
static void AddRegistryMenuScrollArrows(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *data = (u16*) gTasks[taskId].data;
|
||||
tArrowTaskId = AddScrollIndicatorArrowPairParameterized(SCROLL_ARROW_UP, 188, 12, 148, tNumBases - tMaxShownItems, TAG_SCROLL_ARROW, TAG_SCROLL_ARROW, &tScrollOffset);
|
||||
}
|
||||
|
||||
static void HandleRegistryMenuInput(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *data = (u16*) gTasks[taskId].data;
|
||||
s32 input = ListMenu_ProcessInput(tListTaskId);
|
||||
ListMenuGetScrollAndRow(tListTaskId, &tScrollOffset, &tSelectedRow);
|
||||
|
||||
|
|
@ -1022,7 +1022,7 @@ static void HandleRegistryMenuInput(u8 taskId)
|
|||
static void ShowRegistryMenuActions(u8 taskId)
|
||||
{
|
||||
struct WindowTemplate template;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *data = (u16*) gTasks[taskId].data;
|
||||
RemoveScrollIndicatorArrowPair(tArrowTaskId);
|
||||
template = sRegistryWindowTemplates[1];
|
||||
template.width = GetMaxWidthInMenuTable(sRegistryMenuActions, 2);
|
||||
|
|
@ -1054,7 +1054,7 @@ static void HandleRegistryMenuActionsInput(u8 taskId)
|
|||
|
||||
static void ShowRegistryMenuDeleteConfirmation(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *data = (u16*) gTasks[taskId].data;
|
||||
ClearStdWindowAndFrame(tMainWindowId, FALSE);
|
||||
ClearStdWindowAndFrame(tActionWindowId, FALSE);
|
||||
ClearWindowTilemap(tMainWindowId);
|
||||
|
|
@ -1074,7 +1074,7 @@ static void ShowRegistryMenuDeleteYesNo(u8 taskId)
|
|||
|
||||
void DeleteRegistry_Yes_Callback(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *data = (u16*) gTasks[taskId].data;
|
||||
ClearDialogWindowAndFrame(0, FALSE);
|
||||
DestroyListMenuTask(tListTaskId, &tScrollOffset, &tSelectedRow);
|
||||
gSaveBlock1Ptr->secretBases[tSelectedBaseId].registryStatus = UNREGISTERED;
|
||||
|
|
@ -1091,7 +1091,7 @@ static void DeleteRegistry_Yes(u8 taskId)
|
|||
|
||||
static void DeleteRegistry_No(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *data = (u16*) gTasks[taskId].data;
|
||||
ClearDialogWindowAndFrame(0, FALSE);
|
||||
DestroyListMenuTask(tListTaskId, &tScrollOffset, &tSelectedRow);
|
||||
FinalizeRegistryMenu(taskId);
|
||||
|
|
@ -1100,7 +1100,7 @@ static void DeleteRegistry_No(u8 taskId)
|
|||
|
||||
static void ReturnToMainRegistryMenu(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
u16 *data = (u16*) gTasks[taskId].data;
|
||||
AddRegistryMenuScrollArrows(taskId);
|
||||
ClearStdWindowAndFrame(tActionWindowId, FALSE);
|
||||
ClearWindowTilemap(tActionWindowId);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@
|
|||
|
||||
extern vu16 GPIOPortDirection;
|
||||
|
||||
static u16 sDummy; // unused variable
|
||||
static bool8 sLocked;
|
||||
|
||||
static int WriteCommand(u8 value);
|
||||
|
|
|
|||
|
|
@ -1116,7 +1116,7 @@ static void PlaySlotMachine_Internal(u8 machineId, MainCallback exitCallback)
|
|||
{
|
||||
struct Task *task = &gTasks[CreateTask(SlotMachineDummyTask, 0xFF)];
|
||||
task->tMachineId = machineId;
|
||||
StoreWordInTwoHalfwords(&task->tExitCallback, (intptr_t)exitCallback);
|
||||
StoreWordInTwoHalfwords((u16*) &task->tExitCallback, (intptr_t)exitCallback);
|
||||
}
|
||||
|
||||
// Extracts and assigns machineId and exit callback from task.
|
||||
|
|
|
|||
|
|
@ -311,11 +311,10 @@ static void BuildStartMenuActions(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
#if DEBUG_OVERWORLD_MENU == TRUE && DEBUG_OVERWORLD_IN_MENU == TRUE
|
||||
BuildDebugStartMenu();
|
||||
#else
|
||||
BuildNormalStartMenu();
|
||||
#endif
|
||||
if (DEBUG_OVERWORLD_MENU == TRUE && DEBUG_OVERWORLD_IN_MENU == TRUE)
|
||||
BuildDebugStartMenu();
|
||||
else
|
||||
BuildNormalStartMenu();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
7
src/tv.c
7
src/tv.c
|
|
@ -128,7 +128,6 @@ static void TVShowDone(void);
|
|||
static void InterviewAfter_FanClubLetter(void);
|
||||
static void InterviewAfter_RecentHappenings(void);
|
||||
static void InterviewAfter_PkmnFanClubOpinions(void);
|
||||
static void InterviewAfter_Dummy(void);
|
||||
static void InterviewAfter_BravoTrainerPokemonProfile(void);
|
||||
static void InterviewAfter_BravoTrainerBattleTowerProfile(void);
|
||||
static void InterviewAfter_ContestLiveUpdates(void);
|
||||
|
|
@ -1078,7 +1077,6 @@ void InterviewAfter(void)
|
|||
InterviewAfter_PkmnFanClubOpinions();
|
||||
break;
|
||||
case TVSHOW_DUMMY:
|
||||
InterviewAfter_Dummy();
|
||||
break;
|
||||
case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE:
|
||||
InterviewAfter_BravoTrainerPokemonProfile();
|
||||
|
|
@ -1620,11 +1618,6 @@ static void InterviewAfter_PkmnFanClubOpinions(void)
|
|||
show->fanclubOpinions.pokemonNameLanguage = GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_LANGUAGE);
|
||||
}
|
||||
|
||||
static void InterviewAfter_Dummy(void)
|
||||
{
|
||||
TVShow *show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot];
|
||||
}
|
||||
|
||||
static void TryStartRandomMassOutbreak(void)
|
||||
{
|
||||
u8 i;
|
||||
|
|
|
|||
|
|
@ -203,7 +203,6 @@ static EWRAM_DATA union
|
|||
struct WirelessLink_Group *group;
|
||||
struct WirelessLink_URoom *uRoom;
|
||||
} sWirelessLinkMain = {};
|
||||
static EWRAM_DATA u32 sUnused = 0;
|
||||
EWRAM_DATA struct RfuGameCompatibilityData gRfuPartnerCompatibilityData = {};
|
||||
EWRAM_DATA u16 gUnionRoomOfferedSpecies = 0;
|
||||
EWRAM_DATA u8 gUnionRoomRequestedMonType = 0;
|
||||
|
|
@ -4066,7 +4065,7 @@ static s32 UnionRoomGetPlayerInteractionResponse(struct RfuPlayerList *list, boo
|
|||
CopyAndTranslatePlayerName(gStringVar1, player);
|
||||
if (overrideGender)
|
||||
{
|
||||
playerGender = (player->rfu.data.compatibility.playerTrainerId[overrideGender + 1] >> 3) & 1;
|
||||
playerGender = (player->rfu.data.compatibility.playerTrainerId[overrideGender - 1] >> 3) & 1;
|
||||
}
|
||||
switch (player->rfu.data.activity & 0x3F)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1953,7 +1953,7 @@ static u8 *GetLimitedMessageStartPtr(void)
|
|||
for (i = 0; i < numChars; i++)
|
||||
{
|
||||
if (*str == CHAR_EXTRA_SYMBOL)
|
||||
*str++;
|
||||
str++;
|
||||
|
||||
str++;
|
||||
}
|
||||
|
|
@ -3115,9 +3115,6 @@ static void DrawKeyboardWindow(void)
|
|||
static void LoadTextEntryWindow(void)
|
||||
{
|
||||
int i;
|
||||
u8 unused[2];
|
||||
unused[0] = 0;
|
||||
unused[1] = 0xFF;
|
||||
|
||||
// Pointless, cleared below. The tiles are nonsense anyway, see LoadChatWindowGfx.
|
||||
for (i = 0; i < MAX_MESSAGE_LENGTH; i++)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ SINGLE_BATTLE_TEST("Protosynthesis boosts either Attack or Special Attack, not b
|
|||
{
|
||||
u16 species;
|
||||
u32 move;
|
||||
u16 damage[2];
|
||||
s16 damage[2];
|
||||
|
||||
PARAMETRIZE { species = SPECIES_BELLSPROUT; move = MOVE_TACKLE; }
|
||||
PARAMETRIZE { species = SPECIES_BELLSPROUT; move = MOVE_ROUND; }
|
||||
|
|
@ -58,7 +58,7 @@ SINGLE_BATTLE_TEST("Protosynthesis either boosts Defense or Special Defense, not
|
|||
{
|
||||
u16 species;
|
||||
u32 move;
|
||||
u16 damage[2];
|
||||
s16 damage[2];
|
||||
|
||||
PARAMETRIZE { species = SPECIES_ONIX; move = MOVE_TACKLE; }
|
||||
PARAMETRIZE { species = SPECIES_ONIX; move = MOVE_ROUND; }
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ SINGLE_BATTLE_TEST("Quark Drive boosts either Attack or Special Attack, not both
|
|||
{
|
||||
u16 species;
|
||||
u32 move;
|
||||
u16 damage[2];
|
||||
s16 damage[2];
|
||||
|
||||
PARAMETRIZE { species = SPECIES_BELLSPROUT; move = MOVE_TACKLE; }
|
||||
PARAMETRIZE { species = SPECIES_BELLSPROUT; move = MOVE_ROUND; }
|
||||
|
|
@ -58,7 +58,7 @@ SINGLE_BATTLE_TEST("Quark Drive either boosts Defense or Special Defense, not bo
|
|||
{
|
||||
u16 species;
|
||||
u32 move;
|
||||
u16 damage[2];
|
||||
s16 damage[2];
|
||||
|
||||
PARAMETRIZE { species = SPECIES_ONIX; move = MOVE_TACKLE; }
|
||||
PARAMETRIZE { species = SPECIES_ONIX; move = MOVE_ROUND; }
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ SINGLE_BATTLE_TEST("Seed Sower sets up Grassy Terrain when hit by an attack")
|
|||
DOUBLE_BATTLE_TEST("Multi-target moves hit correct battlers after Seed Sower is triggered") // #2796
|
||||
{
|
||||
u32 j, k, l;
|
||||
u16 usedMove;
|
||||
u16 usedMove = MOVE_NONE;
|
||||
static const u16 moves[] = {MOVE_HYPER_VOICE, MOVE_SURF};
|
||||
u16 abilities[MAX_BATTLERS_COUNT];
|
||||
u8 attacker;
|
||||
u16 abilities[MAX_BATTLERS_COUNT] = {0};
|
||||
u8 attacker = 0;
|
||||
|
||||
for (j = 0; j < ARRAY_COUNT(moves); j++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ SINGLE_BATTLE_TEST("Wind Power sets up Charge for opponent when hit by a wind mo
|
|||
|
||||
DOUBLE_BATTLE_TEST("Wind Power activates correctly for every battler with the ability when hit by a 2/3 target move")
|
||||
{
|
||||
u16 move, abilityLeft, abilityRight;
|
||||
u16 abilityLeft, abilityRight;
|
||||
|
||||
PARAMETRIZE {abilityLeft = ABILITY_NONE, abilityRight = ABILITY_WIND_POWER;}
|
||||
PARAMETRIZE {abilityLeft = ABILITY_WIND_POWER, abilityRight = ABILITY_NONE; }
|
||||
|
|
|
|||
|
|
@ -142,10 +142,9 @@ AI_SINGLE_BATTLE_TEST("AI prefers moves which deal more damage instead of moves
|
|||
{
|
||||
u8 turns = 0;
|
||||
u16 move1 = MOVE_NONE, move2 = MOVE_NONE, move3 = MOVE_NONE, move4 = MOVE_NONE;
|
||||
u16 expectedMove, abilityAtk, abilityDef, expectedMove2;
|
||||
u16 expectedMove, abilityAtk, abilityDef;
|
||||
|
||||
abilityAtk = ABILITY_NONE;
|
||||
expectedMove2 = MOVE_NONE;
|
||||
|
||||
// Scald and Poison Jab take 3 hits, Waterfall takes 2.
|
||||
PARAMETRIZE { move1 = MOVE_WATERFALL; move2 = MOVE_SCALD; move3 = MOVE_POISON_JAB; move4 = MOVE_WATER_GUN; expectedMove = MOVE_WATERFALL; turns = 2; }
|
||||
|
|
@ -195,7 +194,7 @@ AI_SINGLE_BATTLE_TEST("AI prefers Earthquake over Drill Run if both require the
|
|||
AI_SINGLE_BATTLE_TEST("AI chooses the safest option to faint the target, taking into account accuracy and move effect")
|
||||
{
|
||||
u16 move1 = MOVE_NONE, move2 = MOVE_NONE, move3 = MOVE_NONE, move4 = MOVE_NONE;
|
||||
u16 expectedMove, abilityAtk = ABILITY_NONE, abilityDef;
|
||||
u16 expectedMove, abilityAtk = ABILITY_NONE;
|
||||
u16 expectedMove2 = MOVE_NONE;
|
||||
|
||||
// Psychic is not very effective, but always hits. Solarbeam requires a charging turn, Double Edge has recoil and Focus Blast can miss;
|
||||
|
|
@ -288,7 +287,7 @@ AI_DOUBLE_BATTLE_TEST("AI won't use a Weather changing move if partner already c
|
|||
{
|
||||
u32 j, k;
|
||||
static const u16 weatherMoves[] = {MOVE_SUNNY_DAY, MOVE_HAIL, MOVE_RAIN_DANCE, MOVE_SANDSTORM, MOVE_SNOWSCAPE};
|
||||
u16 weatherMoveLeft, weatherMoveRight;
|
||||
u16 weatherMoveLeft = MOVE_NONE, weatherMoveRight = MOVE_NONE;
|
||||
|
||||
for (j = 0; j < ARRAY_COUNT(weatherMoves); j++)
|
||||
{
|
||||
|
|
@ -341,7 +340,7 @@ AI_DOUBLE_BATTLE_TEST("AI will not use Helping Hand if partner does not have any
|
|||
AI_DOUBLE_BATTLE_TEST("AI will not use a status move if partner already chose Helping Hand")
|
||||
{
|
||||
s32 j;
|
||||
u32 statusMove;
|
||||
u32 statusMove = MOVE_NONE;
|
||||
|
||||
for (j = MOVE_NONE + 1; j < MOVES_COUNT; j++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ WILD_BATTLE_TEST("Pokemon gain exp after catching a Pokemon")
|
|||
|
||||
#endif // B_EXP_CATCH
|
||||
|
||||
WILD_BATTLE_TEST("Higher leveled Pokemon give more exp", u32 exp)
|
||||
WILD_BATTLE_TEST("Higher leveled Pokemon give more exp", s32 exp)
|
||||
{
|
||||
u8 level = 0;
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ WILD_BATTLE_TEST("Higher leveled Pokemon give more exp", u32 exp)
|
|||
}
|
||||
}
|
||||
|
||||
WILD_BATTLE_TEST("Lucky Egg boosts gained exp points by 50%", u32 exp)
|
||||
WILD_BATTLE_TEST("Lucky Egg boosts gained exp points by 50%", s32 exp)
|
||||
{
|
||||
u32 item = 0;
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ WILD_BATTLE_TEST("Lucky Egg boosts gained exp points by 50%", u32 exp)
|
|||
|
||||
#if (B_SCALED_EXP == GEN_5 || B_SCALED_EXP >= GEN_7)
|
||||
|
||||
WILD_BATTLE_TEST("Exp is scaled to player and opponent's levels", u32 exp)
|
||||
WILD_BATTLE_TEST("Exp is scaled to player and opponent's levels", s32 exp)
|
||||
{
|
||||
u8 level = 0;
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ WILD_BATTLE_TEST("Exp is scaled to player and opponent's levels", u32 exp)
|
|||
|
||||
#endif
|
||||
|
||||
WILD_BATTLE_TEST("Large exp gains are supported", u32 exp) // #1455
|
||||
WILD_BATTLE_TEST("Large exp gains are supported", s32 exp) // #1455
|
||||
{
|
||||
u8 level = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ SINGLE_BATTLE_TEST("Clear Amulet prevents secondary effects that reduce stats")
|
|||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_CLEAR_AMULET); };
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_ROCK_SMASH); }
|
||||
TURN { MOVE(player, move); }
|
||||
} SCENE {
|
||||
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
ASSUMPTIONS
|
||||
{
|
||||
gItems[ITEM_ENIGMA_BERRY].holdEffect == HOLD_EFFECT_ENIGMA_BERRY;
|
||||
ASSUME(gItems[ITEM_ENIGMA_BERRY].holdEffect == HOLD_EFFECT_ENIGMA_BERRY);
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Enigma Berry recovers 25% of HP if hit by super effective move")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
ASSUMPTIONS
|
||||
{
|
||||
gItems[ITEM_LEFTOVERS].holdEffect == HOLD_EFFECT_LEFTOVERS;
|
||||
ASSUME(gItems[ITEM_LEFTOVERS].holdEffect == HOLD_EFFECT_LEFTOVERS);
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Leftovers recovers 1/16th HP at end of turn")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
ASSUMPTIONS
|
||||
{
|
||||
gItems[ITEM_METRONOME].holdEffect == HOLD_EFFECT_METRONOME;
|
||||
ASSUME(gItems[ITEM_METRONOME].holdEffect == HOLD_EFFECT_METRONOME);
|
||||
}
|
||||
|
||||
const uq4_12_t MetronomeMultipliers[] = {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
ASSUMPTIONS
|
||||
{
|
||||
gItems[ITEM_SAFETY_GOGGLES].holdEffect == HOLD_EFFECT_SAFETY_GOGGLES;
|
||||
ASSUME(gItems[ITEM_SAFETY_GOGGLES].holdEffect == HOLD_EFFECT_SAFETY_GOGGLES);
|
||||
};
|
||||
|
||||
SINGLE_BATTLE_TEST("Safety Goggles block powder and spore moves")
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ SINGLE_BATTLE_TEST("Steel Roller and Ice Spinner can remove a terrain from the f
|
|||
MOVE_MISTY_TERRAIN,
|
||||
};
|
||||
|
||||
u16 terrainMove;
|
||||
u16 removeTerrainMove;
|
||||
u16 terrainMove = MOVE_NONE;
|
||||
u16 removeTerrainMove = MOVE_NONE;
|
||||
|
||||
for (j = 0; j < ARRAY_COUNT(terrainMoves); j++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ SINGLE_BATTLE_TEST("Reflect reduces physical damage", s16 damage)
|
|||
|
||||
SINGLE_BATTLE_TEST("Reflect applies for 5 turns")
|
||||
{
|
||||
u16 damage[6];
|
||||
s16 damage[6];
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ SINGLE_BATTLE_TEST("Roost fails if the user is under the effects of Heal Block")
|
|||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Roost recovers 50% of the user's Max HP")
|
||||
{
|
||||
s16 hp;
|
||||
{
|
||||
u16 hp;
|
||||
|
||||
KNOWN_FAILING; // All healing is currently rounded down
|
||||
GIVEN {
|
||||
|
|
@ -218,7 +218,7 @@ SINGLE_BATTLE_TEST("Roost, if used by a Mystery/Flying type, treats the user as
|
|||
MESSAGE("It's not very effective…");
|
||||
MESSAGE("It doesn't affect Moltres…");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Tested in ORAS
|
||||
|
|
@ -230,9 +230,9 @@ DOUBLE_BATTLE_TEST("Roost suppresses the user's not-yet-aquired Flying-type this
|
|||
PLAYER(SPECIES_KECLEON) { Speed(40); HP(150); Ability(ABILITY_COLOR_CHANGE); }
|
||||
PLAYER(SPECIES_WOBBUFFET) { Speed(10); }
|
||||
OPPONENT(SPECIES_PIDGEY) { Speed(30); }
|
||||
OPPONENT(SPECIES_SANDSHREW) { Speed(20); }
|
||||
OPPONENT(SPECIES_SANDSHREW) { Speed(20); }
|
||||
} WHEN {
|
||||
TURN { MOVE(playerLeft, MOVE_ROOST);
|
||||
TURN { MOVE(playerLeft, MOVE_ROOST);
|
||||
MOVE(opponentLeft, MOVE_GUST, target: playerLeft);
|
||||
MOVE(opponentRight, MOVE_EARTHQUAKE, target: playerLeft); }
|
||||
} SCENE {
|
||||
|
|
@ -427,6 +427,6 @@ SINGLE_BATTLE_TEST("Roost does not suppress the ungrounded effect of Telekinesis
|
|||
}
|
||||
|
||||
// Tested in ORAS
|
||||
// Transform does not copy the Roost "status" either.
|
||||
// Transform does not copy the Roost "status" either.
|
||||
// Probably better as a Transform test.
|
||||
TO_DO_BATTLE_TEST("Roost's suppression does not prevent others who are Transforming into the user from copying its Flying-type");
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ SINGLE_BATTLE_TEST("Teatime causes other Pokemon to consume their Berry even if
|
|||
|
||||
DOUBLE_BATTLE_TEST("Teatime causes all Pokémon to consume their berry")
|
||||
{
|
||||
struct BattlePokemon *user;
|
||||
struct BattlePokemon *user = NULL;
|
||||
PARAMETRIZE { user = playerLeft; }
|
||||
PARAMETRIZE { user = playerRight; }
|
||||
PARAMETRIZE { user = opponentLeft; }
|
||||
|
|
@ -143,7 +143,7 @@ SINGLE_BATTLE_TEST("Teatime does not affect Pokémon in the semi-invulnerable tu
|
|||
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NONE); }
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_LIECHI_BERRY); }
|
||||
} WHEN {
|
||||
TURN {
|
||||
TURN {
|
||||
MOVE(opponent, MOVE_FLY);
|
||||
MOVE(player, MOVE_TEATIME);
|
||||
}
|
||||
|
|
@ -170,7 +170,7 @@ SINGLE_BATTLE_TEST("Teatime triggers Volt Absorb if it has been affected by Elec
|
|||
PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); Item(item); HP(55); MaxHP(100); }
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_LIECHI_BERRY); }
|
||||
} WHEN {
|
||||
TURN {
|
||||
TURN {
|
||||
MOVE(player, move);
|
||||
MOVE(opponent, MOVE_TEATIME);
|
||||
}
|
||||
|
|
@ -206,7 +206,7 @@ SINGLE_BATTLE_TEST("Teatime triggers Lightning Rod if it has been affected by El
|
|||
PLAYER(SPECIES_PIKACHU) { Ability(ABILITY_LIGHTNING_ROD); Item(item); }
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_LIECHI_BERRY); }
|
||||
} WHEN {
|
||||
TURN {
|
||||
TURN {
|
||||
MOVE(player, move);
|
||||
MOVE(opponent, MOVE_TEATIME);
|
||||
}
|
||||
|
|
@ -246,7 +246,7 @@ SINGLE_BATTLE_TEST("Teatime triggers Motor Drive if it has been affected by Elec
|
|||
PLAYER(SPECIES_ELECTIVIRE) { Ability(ABILITY_MOTOR_DRIVE); Item(item); }
|
||||
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_LIECHI_BERRY); }
|
||||
} WHEN {
|
||||
TURN {
|
||||
TURN {
|
||||
MOVE(player, move);
|
||||
MOVE(opponent, MOVE_TEATIME);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,7 +196,6 @@ TEST("RandomElement generates a uniform distribution")
|
|||
|
||||
TEST("RandomUniform mul-based faster than mod-based (compile-time)")
|
||||
{
|
||||
u32 i;
|
||||
struct Benchmark mulBenchmark, modBenchmark;
|
||||
u32 mulSum = 0, modSum = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -514,6 +514,7 @@ static s32 MgbaVPrintf_(const char *fmt, va_list va)
|
|||
s32 c, d;
|
||||
u32 p;
|
||||
const char *s;
|
||||
const u8 *pokeS;
|
||||
while (*fmt)
|
||||
{
|
||||
switch ((c = *fmt++))
|
||||
|
|
@ -608,8 +609,8 @@ static s32 MgbaVPrintf_(const char *fmt, va_list va)
|
|||
i = MgbaPutchar_(i, c);
|
||||
break;
|
||||
case 'S':
|
||||
s = va_arg(va, const u8 *);
|
||||
while ((c = *s++) != EOS)
|
||||
pokeS = va_arg(va, const u8 *);
|
||||
while ((c = *pokeS++) != EOS)
|
||||
{
|
||||
if ((c = gWireless_RSEtoASCIITable[c]) != '\0')
|
||||
i = MgbaPutchar_(i, c);
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ static void PrintTestName(void)
|
|||
// modifiers.
|
||||
static void SetImplicitSpeeds(void)
|
||||
{
|
||||
s32 i, j;
|
||||
s32 i;
|
||||
u32 speed = 12;
|
||||
u32 hasSpeeds = 0;
|
||||
u32 allSpeeds = ((1 << DATA.playerPartySize) - 1) | (((1 << DATA.opponentPartySize) - 1) << 6);
|
||||
|
|
@ -539,6 +539,7 @@ const void *RandomElementArray(enum RandomTag tag, const void *array, size_t siz
|
|||
STATE->trialRatio = Q_4_12(1) / count;
|
||||
return (const u8 *)array + size * STATE->runTrial;
|
||||
}
|
||||
return (const u8 *)array + size * index;
|
||||
}
|
||||
|
||||
static s32 TryAbilityPopUp(s32 i, s32 n, u32 battlerId, u32 ability)
|
||||
|
|
@ -699,10 +700,10 @@ static s32 TryHP(s32 i, s32 n, u32 battlerId, u32 oldHP, u32 newHP)
|
|||
switch (event->type)
|
||||
{
|
||||
case HP_EVENT_NEW_HP:
|
||||
*(u16 *)event->address = newHP;
|
||||
*(u16 *)(u32)(event->address) = newHP;
|
||||
break;
|
||||
case HP_EVENT_DELTA_HP:
|
||||
*(s16 *)event->address = oldHP - newHP;
|
||||
*(s16 *)(u32)(event->address) = oldHP - newHP;
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
|
|
@ -788,7 +789,7 @@ void TestRunner_Battle_CheckChosenMove(u32 battlerId, u32 moveId, u32 target)
|
|||
|
||||
if (!expectedAction->pass)
|
||||
{
|
||||
u32 i, expectedMoveId, countExpected;
|
||||
u32 i, expectedMoveId = 0, countExpected;
|
||||
bool32 movePasses = FALSE;
|
||||
|
||||
if (expectedAction->type != B_ACTION_USE_MOVE)
|
||||
|
|
@ -1075,10 +1076,10 @@ static s32 TryExp(s32 i, s32 n, u32 battlerId, u32 oldExp, u32 newExp)
|
|||
switch (event->type)
|
||||
{
|
||||
case EXP_EVENT_NEW_EXP:
|
||||
*(u32 *)event->address = newExp;
|
||||
*(u32 *)(u32)(event->address) = newExp;
|
||||
break;
|
||||
case EXP_EVENT_DELTA_EXP:
|
||||
*(s32 *)event->address = oldExp - newExp;
|
||||
*(s32 *)(u32)(event->address) = oldExp - newExp;
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
|
|
@ -1526,7 +1527,6 @@ static const u16 sNaturePersonalities[NUM_NATURES] =
|
|||
|
||||
static u32 GenerateNature(u32 nature, u32 offset)
|
||||
{
|
||||
int i;
|
||||
if (offset <= nature)
|
||||
nature -= offset;
|
||||
else
|
||||
|
|
@ -1991,7 +1991,6 @@ void MoveGetIdAndSlot(s32 battlerId, struct MoveContext *ctx, u32 *moveId, u32 *
|
|||
|
||||
void Move(u32 sourceLine, struct BattlePokemon *battler, struct MoveContext ctx)
|
||||
{
|
||||
s32 i;
|
||||
s32 battlerId = battler - gBattleMons;
|
||||
u32 moveId, moveSlot;
|
||||
s32 target;
|
||||
|
|
@ -2093,7 +2092,6 @@ void ExpectSendOut(u32 sourceLine, struct BattlePokemon *battler, u32 partyIndex
|
|||
}
|
||||
if (!(DATA.actionBattlers & (1 << battlerId)))
|
||||
{
|
||||
const struct BattleTest *test = GetBattleTest();
|
||||
if (IsAITest() && (battlerId & BIT_SIDE) == B_SIDE_OPPONENT) // If Move was not specified, allow any move used.
|
||||
SetAiActionToPass(sourceLine, battlerId);
|
||||
else
|
||||
|
|
@ -2548,7 +2546,7 @@ u32 TestRunner_Battle_GetForcedAbility(u32 side, u32 partyIndex)
|
|||
// to improve performance.
|
||||
struct AILogLine *GetLogLine(u32 battlerId, u32 moveIndex)
|
||||
{
|
||||
s32 i, j;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < MAX_AI_LOG_LINES; i++)
|
||||
{
|
||||
|
|
@ -2560,11 +2558,11 @@ struct AILogLine *GetLogLine(u32 battlerId, u32 moveIndex)
|
|||
}
|
||||
|
||||
Test_ExitWithResult(TEST_RESULT_ERROR, "Too many AI log lines");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void TestRunner_Battle_AILogScore(const char *file, u32 line, u32 battlerId, u32 moveIndex, s32 score, bool32 setScore)
|
||||
{
|
||||
s32 i;
|
||||
struct AILogLine *log;
|
||||
|
||||
if (!DATA.logAI) return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user