Merge branch 'master' into gflib

This commit is contained in:
PikalaxALT
2019-09-27 09:11:22 -04:00
217 changed files with 5479 additions and 5086 deletions
+6 -6
View File
@@ -1100,7 +1100,7 @@ void ResetAllApprenticeData(void)
gSaveBlock2Ptr->apprentices[i].lvlMode = 0;
gSaveBlock2Ptr->apprentices[i].number = 0;
gSaveBlock2Ptr->apprentices[i].field_1 = 0;
for (j = 0; j < 4; j++)
for (j = 0; j < TRAINER_ID_LENGTH; j++)
gSaveBlock2Ptr->apprentices[i].playerId[j] = 0;
gSaveBlock2Ptr->apprentices[i].language = gGameLanguage;
gSaveBlock2Ptr->apprentices[i].checksum = 0;
@@ -1410,7 +1410,7 @@ static void GetLatestLearnedMoves(u16 species, u16 *moves)
static u16 sub_81A0284(u8 arg0, u8 speciesTableId, u8 arg2)
{
u16 moves[4];
u16 moves[MAX_MON_MOVES];
u8 i, count;
if (PLAYER_APPRENTICE.field_B1_1 < 3)
@@ -1559,8 +1559,8 @@ static void CreateMenuWithAnswers(u8 arg0)
pixelWidth = width;
}
width = convert_pixel_width_to_tile_width(pixelWidth);
left = sub_80E2D5C(left, width);
width = ConvertPixelWidthToTileWidth(pixelWidth);
left = ScriptMenu_AdjustLeftCoordFromWidth(left, width);
windowId = CreateAndShowWindow(left, top, width, count * 2);
SetStandardWindowBorderStyle(windowId, 0);
@@ -2063,7 +2063,7 @@ static void sub_81A1370(void)
r10 = 0xFFFF;
r9 = -1;
for (i = 1; i < 4; i++)
for (i = 1; i < TRAINER_ID_LENGTH; i++)
{
if (GetTrainerId(gSaveBlock2Ptr->apprentices[i].playerId) == GetTrainerId(gSaveBlock2Ptr->playerTrainerId)
&& gSaveBlock2Ptr->apprentices[i].number < r10)
@@ -2092,7 +2092,7 @@ static void sub_81A1438(void)
gSaveBlock2Ptr->apprentices[0].number++;
sub_81A0390(gSaveBlock2Ptr->apprentices[0].field_1);
for (i = 0; i < 4; i++)
for (i = 0; i < TRAINER_ID_LENGTH; i++)
gSaveBlock2Ptr->apprentices[0].playerId[i] = gSaveBlock2Ptr->playerTrainerId[i];
StringCopy(gSaveBlock2Ptr->apprentices[0].playerName, gSaveBlock2Ptr->playerName);
+10 -10
View File
@@ -298,7 +298,7 @@ void BattleAI_HandleItemUseBeforeAISetup(u8 defaultScoreMoves)
)
)
{
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_TRAINER_ITEMS; i++)
{
if (gTrainers[gTrainerBattleOpponent_A].items[i] != 0)
{
@@ -397,8 +397,8 @@ u8 BattleAI_ChooseMoveOrAction(void)
static u8 ChooseMoveOrAction_Singles(void)
{
u8 currentMoveArray[4];
u8 consideredMoveArray[4];
u8 currentMoveArray[MAX_MON_MOVES];
u8 consideredMoveArray[MAX_MON_MOVES];
u8 numOfBestMoves;
s32 i;
@@ -452,11 +452,11 @@ static u8 ChooseMoveOrAction_Doubles(void)
s32 i;
s32 j;
s32 scriptsToRun;
s16 bestMovePointsForTarget[4];
s8 mostViableTargetsArray[4];
u8 actionOrMoveIndex[4];
u8 mostViableMovesScores[4];
u8 mostViableMovesIndices[4];
s16 bestMovePointsForTarget[MAX_BATTLERS_COUNT];
s8 mostViableTargetsArray[MAX_BATTLERS_COUNT];
u8 actionOrMoveIndex[MAX_BATTLERS_COUNT];
u8 mostViableMovesScores[MAX_MON_MOVES];
u8 mostViableMovesIndices[MAX_MON_MOVES];
s32 mostViableTargetsNo;
s32 mostViableMovesNo;
s16 mostMovePoints;
@@ -543,7 +543,7 @@ static u8 ChooseMoveOrAction_Doubles(void)
mostViableTargetsArray[0] = 0;
mostViableTargetsNo = 1;
for (i = 1; i < MAX_MON_MOVES; i++)
for (i = 1; i < MAX_BATTLERS_COUNT; i++)
{
if (mostMovePoints == bestMovePointsForTarget[i])
{
@@ -1167,7 +1167,7 @@ static void BattleAICmd_get_considered_move_power(void)
static void BattleAICmd_get_how_powerful_move_is(void)
{
s32 i, checkedMove;
s32 moveDmgs[4];
s32 moveDmgs[MAX_MON_MOVES];
for (i = 0; sDiscouragedPowerfulMoveEffects[i] != 0xFFFF; i++)
{
+1 -1
View File
@@ -820,7 +820,7 @@ static bool8 ShouldUseItem(void)
}
}
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_TRAINER_ITEMS; i++)
{
u16 item;
const u8 *itemEffects;
+1 -1
View File
@@ -664,7 +664,7 @@ u32 sub_8057FBC(void) // unused
static void HandleMoveSwitching(void)
{
u8 perMovePPBonuses[4];
u8 perMovePPBonuses[MAX_MON_MOVES];
struct ChooseMoveStruct moveStruct;
u8 totalPPBonuses;
+3 -3
View File
@@ -1790,9 +1790,9 @@ static void CB2_HandleStartMultiBattle(void)
gBattleCommunication[SPRITES_INIT_STATE2] = 0;
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
{
for (id = 0; id < 4 && (gLinkPlayers[id].version & 0xFF) == 3; id++);
for (id = 0; id < MAX_LINK_PLAYERS && (gLinkPlayers[id].version & 0xFF) == VERSION_EMERALD; id++);
if (id == 4)
if (id == MAX_LINK_PLAYERS)
gBattleCommunication[MULTIUSE_STATE] = 8;
else
gBattleCommunication[MULTIUSE_STATE] = 10;
@@ -4244,7 +4244,7 @@ static void HandleTurnActionSelectionState(void)
moveInfo.monType1 = gBattleMons[gActiveBattler].type1;
moveInfo.monType2 = gBattleMons[gActiveBattler].type2;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
moveInfo.moves[i] = gBattleMons[gActiveBattler].moves[i];
moveInfo.currentPp[i] = gBattleMons[gActiveBattler].pp[i];
+1 -1
View File
@@ -49,7 +49,7 @@ struct PikeWildMon
{
u16 species;
u8 levelDelta;
u16 moves[4];
u16 moves[MAX_MON_MOVES];
};
// IWRAM bss
+1 -1
View File
@@ -77,7 +77,7 @@ struct PyramidWildMon
u16 species;
u8 lvl;
u8 abilityNum;
u16 moves[4];
u16 moves[MAX_MON_MOVES];
};
struct PyramidFloorTemplate
+65 -85
View File
@@ -1681,29 +1681,22 @@ static void atk07_adjustnormaldamage(void)
RecordItemEffectBattle(gBattlerTarget, holdEffect);
gSpecialStatuses[gBattlerTarget].focusBanded = 1;
}
if (gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE)
goto END;
if (gBattleMoves[gCurrentMove].effect != EFFECT_FALSE_SWIPE && !gProtectStructs[gBattlerTarget].endured
&& !gSpecialStatuses[gBattlerTarget].focusBanded)
goto END;
if (gBattleMons[gBattlerTarget].hp > gBattleMoveDamage)
goto END;
gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1;
if (gProtectStructs[gBattlerTarget].endured)
if (!(gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE)
&& (gBattleMoves[gCurrentMove].effect == EFFECT_FALSE_SWIPE || gProtectStructs[gBattlerTarget].endured || gSpecialStatuses[gBattlerTarget].focusBanded)
&& gBattleMons[gBattlerTarget].hp <= gBattleMoveDamage)
{
gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED;
gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1;
if (gProtectStructs[gBattlerTarget].endured)
{
gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED;
}
else if (gSpecialStatuses[gBattlerTarget].focusBanded)
{
gMoveResultFlags |= MOVE_RESULT_FOE_HUNG_ON;
gLastUsedItem = gBattleMons[gBattlerTarget].item;
}
}
else if (gSpecialStatuses[gBattlerTarget].focusBanded)
{
gMoveResultFlags |= MOVE_RESULT_FOE_HUNG_ON;
gLastUsedItem = gBattleMons[gBattlerTarget].item;
}
END:
gBattlescriptCurrInstr++;
gBattlescriptCurrInstr++;
}
static void atk08_adjustnormaldamage2(void) // The same as 0x7 except it doesn't check for false swipe move effect.
@@ -1730,27 +1723,22 @@ static void atk08_adjustnormaldamage2(void) // The same as 0x7 except it doesn't
RecordItemEffectBattle(gBattlerTarget, holdEffect);
gSpecialStatuses[gBattlerTarget].focusBanded = 1;
}
if (gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE)
goto END;
if (!gProtectStructs[gBattlerTarget].endured && !gSpecialStatuses[gBattlerTarget].focusBanded)
goto END;
if (gBattleMons[gBattlerTarget].hp > gBattleMoveDamage)
goto END;
gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1;
if (gProtectStructs[gBattlerTarget].endured)
if (!(gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE)
&& (gProtectStructs[gBattlerTarget].endured || gSpecialStatuses[gBattlerTarget].focusBanded)
&& gBattleMons[gBattlerTarget].hp <= gBattleMoveDamage)
{
gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED;
gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1;
if (gProtectStructs[gBattlerTarget].endured)
{
gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED;
}
else if (gSpecialStatuses[gBattlerTarget].focusBanded)
{
gMoveResultFlags |= MOVE_RESULT_FOE_HUNG_ON;
gLastUsedItem = gBattleMons[gBattlerTarget].item;
}
}
else if (gSpecialStatuses[gBattlerTarget].focusBanded)
{
gMoveResultFlags |= MOVE_RESULT_FOE_HUNG_ON;
gLastUsedItem = gBattleMons[gBattlerTarget].item;
}
END:
gBattlescriptCurrInstr++;
gBattlescriptCurrInstr++;
}
static void atk09_attackanimation(void)
@@ -4564,27 +4552,26 @@ static void atk49_moveend(void)
gBattleScripting.atk49_state++;
break;
case ATK49_CHOICE_MOVE: // update choice band move
if (!(gHitMarker & HITMARKER_OBEYS) || holdEffectAtk != HOLD_EFFECT_CHOICE_BAND
|| gChosenMove == MOVE_STRUGGLE || (*choicedMoveAtk != 0 && *choicedMoveAtk != 0xFFFF))
goto LOOP;
if (gChosenMove == MOVE_BATON_PASS && !(gMoveResultFlags & MOVE_RESULT_FAILED))
if (gHitMarker & HITMARKER_OBEYS
&& holdEffectAtk == HOLD_EFFECT_CHOICE_BAND
&& gChosenMove != MOVE_STRUGGLE
&& (*choicedMoveAtk == 0 || *choicedMoveAtk == 0xFFFF))
{
gBattleScripting.atk49_state++;
break;
}
*choicedMoveAtk = gChosenMove;
LOOP:
{
for (i = 0; i < MAX_MON_MOVES; i++)
if (gChosenMove == MOVE_BATON_PASS && !(gMoveResultFlags & MOVE_RESULT_FAILED))
{
if (gBattleMons[gBattlerAttacker].moves[i] == *choicedMoveAtk)
break;
++gBattleScripting.atk49_state;
break;
}
if (i == MAX_MON_MOVES)
*choicedMoveAtk = 0;
gBattleScripting.atk49_state++;
*choicedMoveAtk = gChosenMove;
}
for (i = 0; i < MAX_MON_MOVES; ++i)
{
if (gBattleMons[gBattlerAttacker].moves[i] == *choicedMoveAtk)
break;
}
if (i == MAX_MON_MOVES)
*choicedMoveAtk = 0;
++gBattleScripting.atk49_state;
break;
case ATK49_CHANGED_ITEMS: // changed held items
for (i = 0; i < gBattlersCount; i++)
@@ -6152,29 +6139,22 @@ static void atk69_adjustsetdamage(void) // The same as 0x7, except there's no ra
RecordItemEffectBattle(gBattlerTarget, holdEffect);
gSpecialStatuses[gBattlerTarget].focusBanded = 1;
}
if (gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE)
goto END;
if (gBattleMoves[gCurrentMove].effect != EFFECT_FALSE_SWIPE && !gProtectStructs[gBattlerTarget].endured
&& !gSpecialStatuses[gBattlerTarget].focusBanded)
goto END;
if (gBattleMons[gBattlerTarget].hp > gBattleMoveDamage)
goto END;
gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1;
if (gProtectStructs[gBattlerTarget].endured)
if (!(gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE)
&& (gBattleMoves[gCurrentMove].effect == EFFECT_FALSE_SWIPE || gProtectStructs[gBattlerTarget].endured || gSpecialStatuses[gBattlerTarget].focusBanded)
&& gBattleMons[gBattlerTarget].hp <= gBattleMoveDamage)
{
gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED;
gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - 1;
if (gProtectStructs[gBattlerTarget].endured)
{
gMoveResultFlags |= MOVE_RESULT_FOE_ENDURED;
}
else if (gSpecialStatuses[gBattlerTarget].focusBanded)
{
gMoveResultFlags |= MOVE_RESULT_FOE_HUNG_ON;
gLastUsedItem = gBattleMons[gBattlerTarget].item;
}
}
else if (gSpecialStatuses[gBattlerTarget].focusBanded)
{
gMoveResultFlags |= MOVE_RESULT_FOE_HUNG_ON;
gLastUsedItem = gBattleMons[gBattlerTarget].item;
}
END:
gBattlescriptCurrInstr++;
gBattlescriptCurrInstr++;
}
static void atk6A_removeitem(void)
@@ -10184,7 +10164,7 @@ static void atkEF_handleballthrow(void)
gBattlescriptCurrInstr = BattleScript_SuccessBallThrow;
SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem);
if (CalculatePlayerPartyCount() == 6)
if (CalculatePlayerPartyCount() == PARTY_SIZE)
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
else
gBattleCommunication[MULTISTRING_CHOOSER] = 1;
@@ -10196,7 +10176,7 @@ static void atkEF_handleballthrow(void)
odds = Sqrt(Sqrt(16711680 / odds));
odds = 1048560 / odds;
for (shakes = 0; shakes < 4 && Random() < odds; shakes++);
for (shakes = 0; shakes < BALL_3_SHAKES_SUCCESS && Random() < odds; shakes++);
if (gLastUsedItem == ITEM_MASTER_BALL)
shakes = BALL_3_SHAKES_SUCCESS; // why calculate the shakes before that check?
@@ -10209,7 +10189,7 @@ static void atkEF_handleballthrow(void)
gBattlescriptCurrInstr = BattleScript_SuccessBallThrow;
SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem);
if (CalculatePlayerPartyCount() == 6)
if (CalculatePlayerPartyCount() == PARTY_SIZE)
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
else
gBattleCommunication[MULTISTRING_CHOOSER] = 1;
@@ -10227,17 +10207,17 @@ static void atkF0_givecaughtmon(void)
{
if (GiveMonToPlayer(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]]) != MON_GIVEN_TO_PARTY)
{
if (!sub_813B21C())
if (!ShouldShowBoxWasFullMessage())
{
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_STORAGE_UNKNOWN)));
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON)));
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2);
}
else
{
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_STORAGE_UNKNOWN)));
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); // box the mon was sent to
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2);
StringCopy(gStringVar3, GetBoxNamePtr(get_unknown_box_id()));
StringCopy(gStringVar3, GetBoxNamePtr(GetPCBoxToSendMon())); //box the mon was going to be sent to
gBattleCommunication[MULTISTRING_CHOOSER] = 2;
}
+4 -4
View File
@@ -1019,7 +1019,7 @@ struct
u8 level;
u8 nature;
u8 evs[6];
u16 moves[4];
u16 moves[MAX_MON_MOVES];
} const sStevenMons[3] =
{
{
@@ -1561,7 +1561,7 @@ void PutNewBattleTowerRecord(struct EmeraldBattleTowerRecord *newRecordEm)
for (i = 0; i < 5; i++)
{
k = 0;
for (j = 0; j < 4; j++)
for (j = 0; j < TRAINER_ID_LENGTH; j++)
{
if (gSaveBlock2Ptr->frontier.towerRecords[i].trainerId[j] != newRecord->trainerId[j])
break;
@@ -3308,7 +3308,7 @@ bool32 RubyBattleTowerRecordToEmerald(struct RSBattleTowerRecord *src, struct Em
for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++)
dst->name[i] = src->name[i];
for (i = 0; i < 4; i++)
for (i = 0; i < TRAINER_ID_LENGTH; i++)
dst->trainerId[i] = src->trainerId[i];
for (i = 0; i < 6; i++)
dst->greeting[i] = src->greeting[i];
@@ -3357,7 +3357,7 @@ bool32 EmeraldBattleTowerRecordToRuby(struct EmeraldBattleTowerRecord *src, stru
for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++)
dst->name[i] = src->name[i];
for (i = 0; i < 4; i++)
for (i = 0; i < TRAINER_ID_LENGTH; i++)
dst->trainerId[i] = src->trainerId[i];
for (i = 0; i < 6; i++)
dst->greeting[i] = src->greeting[i];
+3 -2
View File
@@ -1961,9 +1961,10 @@ static bool8 Phase2_Ripple_Func2(struct Task *task)
for (i = 0; i < 160; i++, r4 += r8)
{
// todo: fix the asm
s16 var = r4 >> 8;
asm("");
var++;
var--;
gScanlineEffectRegBuffers[0][i] = sTransitionStructPtr->field_16 + Sin(var, r3);
}
+11 -11
View File
@@ -1,30 +1,30 @@
#include "global.h"
#include "battle.h"
#include "battle_anim.h"
#include "constants/battle_script_commands.h"
#include "constants/abilities.h"
#include "constants/moves.h"
#include "constants/hold_effects.h"
#include "constants/battle_anim.h"
#include "pokemon.h"
#include "constants/species.h"
#include "item.h"
#include "constants/items.h"
#include "util.h"
#include "constants/battle_move_effects.h"
#include "battle_scripts.h"
#include "random.h"
#include "text.h"
#include "string_util.h"
#include "battle_message.h"
#include "constants/battle_string_ids.h"
#include "constants/weather.h"
#include "battle_ai_script_commands.h"
#include "battle_controllers.h"
#include "event_data.h"
#include "link.h"
#include "berry.h"
#include "field_weather.h"
#include "constants/abilities.h"
#include "constants/battle_anim.h"
#include "constants/battle_move_effects.h"
#include "constants/battle_script_commands.h"
#include "constants/battle_string_ids.h"
#include "constants/berry.h"
#include "constants/hold_effects.h"
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/species.h"
#include "constants/weather.h"
// rom const data
static const u16 sSoundMovesTable[] =
+1
View File
@@ -11,6 +11,7 @@
#include "random.h"
#include "string_util.h"
#include "text.h"
#include "constants/berry.h"
#include "constants/event_object_movement_constants.h"
#include "constants/items.h"
+1
View File
@@ -36,6 +36,7 @@
#include "new_game.h"
#include "save.h"
#include "link.h"
#include "constants/berry.h"
#include "constants/rgb.h"
#define BLENDER_SCORE_BEST 0
+3 -2
View File
@@ -4,7 +4,6 @@
#include "decompress.h"
#include "event_object_movement.h"
#include "item_menu.h"
#include "constants/items.h"
#include "item.h"
#include "item_use.h"
#include "main.h"
@@ -15,7 +14,6 @@
#include "menu_helpers.h"
#include "palette.h"
#include "overworld.h"
#include "constants/songs.h"
#include "sound.h"
#include "sprite.h"
#include "string_util.h"
@@ -28,7 +26,10 @@
#include "item_menu_icons.h"
#include "decompress.h"
#include "international_string_util.h"
#include "constants/berry.h"
#include "constants/items.h"
#include "constants/rgb.h"
#include "constants/songs.h"
// There are 4 windows used in berry tag screen.
enum
+1 -1
View File
@@ -25,7 +25,7 @@ static void InitTimeBasedEvents(void)
void DoTimeBasedEvents(void)
{
if (FlagGet(FLAG_SYS_CLOCK_SET) && !sub_813B9C0())
if (FlagGet(FLAG_SYS_CLOCK_SET) && !InPokemonCenter())
{
RtcCalcLocalTime();
UpdatePerDay(&gLocalTime);
@@ -0,0 +1,99 @@
static const u16 sFrontierExchangeCorner_Decor1[] =
{
DECOR_KISS_POSTER,
DECOR_KISS_CUSHION,
DECOR_SMOOCHUM_DOLL,
DECOR_TOGEPI_DOLL,
DECOR_MEOWTH_DOLL,
DECOR_CLEFAIRY_DOLL,
DECOR_DITTO_DOLL,
DECOR_CYNDAQUIL_DOLL,
DECOR_CHIKORITA_DOLL,
DECOR_TOTODILE_DOLL,
0xFFFF
};
static const u16 sFrontierExchangeCorner_Decor2[] =
{
DECOR_LAPRAS_DOLL,
DECOR_SNORLAX_DOLL,
DECOR_VENUSAUR_DOLL,
DECOR_CHARIZARD_DOLL,
DECOR_BLASTOISE_DOLL,
0xFFFF
};
static const u16 sFrontierExchangeCorner_Vitamins[] =
{
ITEM_PROTEIN,
ITEM_CALCIUM,
ITEM_IRON,
ITEM_ZINC,
ITEM_CARBOS,
ITEM_HP_UP,
0xFFFF
};
static const u16 sFrontierExchangeCorner_HoldItems[] =
{
ITEM_LEFTOVERS,
ITEM_WHITE_HERB,
ITEM_QUICK_CLAW,
ITEM_MENTAL_HERB,
ITEM_BRIGHT_POWDER,
ITEM_CHOICE_BAND,
ITEM_KINGS_ROCK,
ITEM_FOCUS_BAND,
ITEM_SCOPE_LENS,
0xFFFF
};
static const u8 *const sFrontierExchangeCorner_Decor1Descriptions[] =
{
BattleFrontier_BattlePointExchangeServiceCorner_Text_2601AA,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2601D0,
BattleFrontier_BattlePointExchangeServiceCorner_Text_260201,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26022F,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26025B,
BattleFrontier_BattlePointExchangeServiceCorner_Text_260287,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2602B5,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2602E0,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26030F,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26033E,
gText_Exit,
};
static const u8 *const sFrontierExchangeCorner_Decor2Descriptions[] =
{
BattleFrontier_BattlePointExchangeServiceCorner_Text_26036C,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26036C,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26036C,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26036C,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26036C,
gText_Exit
};
static const u8 *const sFrontierExchangeCorner_VitaminsDescriptions[] =
{
BattleFrontier_BattlePointExchangeServiceCorner_Text_260397,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2603BE,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2603E6,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26040E,
BattleFrontier_BattlePointExchangeServiceCorner_Text_260436,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26045C,
gText_Exit
};
static const u8 *const sFrontierExchangeCorner_HoldItemsDescriptions[] =
{
BattleFrontier_BattlePointExchangeServiceCorner_Text_26047A,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2604AC,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2604D8,
BattleFrontier_BattlePointExchangeServiceCorner_Text_26050F,
BattleFrontier_BattlePointExchangeServiceCorner_Text_260542,
BattleFrontier_BattlePointExchangeServiceCorner_Text_260575,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2605A8,
BattleFrontier_BattlePointExchangeServiceCorner_Text_2605E2,
BattleFrontier_BattlePointExchangeServiceCorner_Text_260613,
gText_Exit
};
+123 -122
View File
@@ -1,123 +1,124 @@
const u32 *const gUnknown_085A6BE8[][2] = {
{gItemIcon_QuestionMark, gItemIconPalette_QuestionMark},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB7AA0, gUnknown_08DB7B34},
{gUnknown_08DB7B5C, gUnknown_08DB7BEC},
{gUnknown_08DB7C08, gUnknown_08DB7CE8},
{gUnknown_08DB7D08, gUnknown_08DB7DCC},
{gUnknown_08DB7DF4, gUnknown_08DB7EA0},
{gUnknown_08DB7EC4, gUnknown_08DB7F60},
{gUnknown_08DB7F7C, gUnknown_08DB8070},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB808C, gUnknown_08DB8138},
{gUnknown_08DB8160, gUnknown_08DB8218},
{gUnknown_08DB823C, gUnknown_08DB8300},
{gUnknown_08DB8328, gUnknown_08DB8430},
{gUnknown_08DB8458, gUnknown_08DB8528},
{gUnknown_08DB854C, gUnknown_08DB862C},
{gUnknown_08DB8654, gUnknown_08DB86C4},
{gUnknown_08DB86E0, gUnknown_08DB8750},
{gUnknown_08DB876C, gUnknown_08DB87DC},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB87F8, gUnknown_08DB88D8},
{gUnknown_08DB8900, gUnknown_08DB89E0},
{gUnknown_08DB8A08, gUnknown_08DB8A68},
{gUnknown_08DB8A84, gUnknown_08DB8B40},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB8B68, gUnknown_08DB8C40},
{gUnknown_08DB8C5C, gUnknown_08DB8CF4},
{NULL, NULL},
{gUnknown_08DB8D18, gUnknown_08DB8DB0},
{gUnknown_08DB8DD4, gUnknown_08DB8E80},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB8EA0, gUnknown_08DB8F58},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB8F7C, gUnknown_08DB9038},
{gUnknown_08DB9058, gUnknown_08DB9130},
{gUnknown_08DB9154, gUnknown_08DB9218},
{gUnknown_08DB9234, gUnknown_08DB92FC},
{gUnknown_08DB931C, gUnknown_08DB93E8},
{gUnknown_08DB940C, gUnknown_08DB94CC},
{gUnknown_08DB94E8, gUnknown_08DB95AC},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{gUnknown_08DB95D0, gUnknown_08DB96C4},
{gUnknown_08DB96EC, gUnknown_08DB97F4},
{gUnknown_08DB981C, gUnknown_08DB9908},
{gUnknown_08DB9930, gUnknown_08DB9A54},
{gUnknown_08DB9A7C, gUnknown_08DB9B7C},
{gUnknown_08DB9BA4, gUnknown_08DB9CB0},
{gUnknown_08DB9CD8, gUnknown_08DB9DAC},
{gUnknown_08DB9F08, gUnknown_08DB9FFC},
{gUnknown_08DB9DD4, gUnknown_08DB9EE4},
{gUnknown_08DBA020, gUnknown_08DBA12C}
const u32 *const gDecorIconTable[][2] =
{
[DECOR_NONE] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark},
[DECOR_SMALL_DESK] = {NULL, NULL},
[DECOR_POKEMON_DESK] = {NULL, NULL},
[DECOR_HEAVY_DESK] = {gDecorIcon_HeavyDesk, gDecorIconPalette_HeavyDesk},
[DECOR_RAGGED_DESK] = {gDecorIcon_RaggedDesk, gDecorIconPalette_RaggedDesk},
[DECOR_COMFORT_DESK] = {gDecorIcon_ComfortDesk, gDecorIconPalette_ComfortDesk},
[DECOR_PRETTY_DESK] = {gDecorIcon_PrettyDesk, gDecorIconPalette_PrettyDesk},
[DECOR_BRICK_DESK] = {gDecorIcon_BrickDesk, gDecorIconPalette_BrickDesk},
[DECOR_CAMP_DESK] = {gDecorIcon_CampDesk, gDecorIconPalette_CampDesk},
[DECOR_HARD_DESK] = {gDecorIcon_HardDesk, gDecorIconPalette_HardDesk},
[DECOR_SMALL_CHAIR] = {NULL, NULL},
[DECOR_POKEMON_CHAIR] = {NULL, NULL},
[DECOR_HEAVY_CHAIR] = {NULL, NULL},
[DECOR_PRETTY_CHAIR] = {NULL, NULL},
[DECOR_COMFORT_CHAIR] = {NULL, NULL},
[DECOR_RAGGED_CHAIR] = {NULL, NULL},
[DECOR_BRICK_CHAIR] = {NULL, NULL},
[DECOR_CAMP_CHAIR] = {NULL, NULL},
[DECOR_HARD_CHAIR] = {NULL, NULL},
[DECOR_RED_PLANT] = {gDecorIcon_RedPlant, gDecorIconPalette_RedPlant},
[DECOR_TROPICAL_PLANT] = {gDecorIcon_TropicalPlant, gDecorIconPalette_TropicalPlant},
[DECOR_PRETTY_FLOWERS] = {gDecorIcon_PrettyFlowers, gDecorIconPalette_PrettyFlowers},
[DECOR_COLORFUL_PLANT] = {gDecorIcon_ColorfulPlant, gDecorIconPalette_ColorfulPlant},
[DECOR_BIG_PLANT] = {gDecorIcon_BigPlant, gDecorIconPalette_BigPlant},
[DECOR_GORGEOUS_PLANT] = {gDecorIcon_GorgeousPlant, gDecorIconPalette_GorgeousPlant},
[DECOR_RED_BRICK] = {gDecorIcon_RedBrick, gDecorIconPalette_RedBrick},
[DECOR_YELLOW_BRICK] = {gDecorIcon_YellowBrick, gDecorIconPalette_YellowBrick},
[DECOR_BLUE_BRICK] = {gDecorIcon_BlueBrick, gDecorIconPalette_BlueBrick},
[DECOR_RED_BALLOON] = {NULL, NULL},
[DECOR_BLUE_BALLOON] = {NULL, NULL},
[DECOR_YELLOW_BALLOON] = {NULL, NULL},
[DECOR_RED_TENT] = {gDecorIcon_RedTent, gDecorIconPalette_RedTent},
[DECOR_BLUE_TENT] = {gDecorIcon_BlueTent, gDecorIconPalette_BlueTent},
[DECOR_SOLID_BOARD] = {gDecorIcon_SolidBoard, gDecorIconPalette_SolidBoard},
[DECOR_SLIDE] = {gDecorIcon_Slide, gDecorIconPalette_Slide},
[DECOR_FENCE_LENGTH] = {NULL, NULL},
[DECOR_FENCE_WIDTH] = {NULL, NULL},
[DECOR_TIRE] = {gDecorIcon_Tire, gDecorIconPalette_Tire},
[DECOR_STAND] = {gDecorIcon_Stand, gDecorIconPalette_Stand},
[DECOR_MUD_BALL] = {NULL, NULL},
[DECOR_BREAKABLE_DOOR] = {gDecorIcon_BreakableDoor, gDecorIconPalette_BreakableDoor},
[DECOR_SAND_ORNAMENT] = {gDecorIcon_SandOrnament, gDecorIconPalette_SandOrnament},
[DECOR_SILVER_SHIELD] = {NULL, NULL},
[DECOR_GOLD_SHIELD] = {NULL, NULL},
[DECOR_GLASS_ORNAMENT] = {gDecorIcon_GlassOrnament, gDecorIconPalette_GlassOrnament},
[DECOR_TV] = {NULL, NULL},
[DECOR_ROUND_TV] = {NULL, NULL},
[DECOR_CUTE_TV] = {NULL, NULL},
[DECOR_GLITTER_MAT] = {NULL, NULL},
[DECOR_JUMP_MAT] = {NULL, NULL},
[DECOR_SPIN_MAT] = {NULL, NULL},
[DECOR_C_LOW_NOTE_MAT] = {NULL, NULL},
[DECOR_D_NOTE_MAT] = {NULL, NULL},
[DECOR_E_NOTE_MAT] = {NULL, NULL},
[DECOR_F_NOTE_MAT] = {NULL, NULL},
[DECOR_G_NOTE_MAT] = {NULL, NULL},
[DECOR_A_NOTE_MAT] = {NULL, NULL},
[DECOR_B_NOTE_MAT] = {NULL, NULL},
[DECOR_C_HIGH_NOTE_MAT] = {NULL, NULL},
[DECOR_SURF_MAT] = {gDecorIcon_SurfMat, gDecorIconPalette_SurfMat},
[DECOR_THUNDER_MAT] = {gDecorIcon_ThunderMat, gDecorIconPalette_ThunderMat},
[DECOR_FIRE_BLAST_MAT] = {gDecorIcon_FireBlastMat, gDecorIconPalette_FireBlastMat},
[DECOR_POWDER_SNOW_MAT] = {gDecorIcon_PowderSnowMat, gDecorIconPalette_PowderSnowMat},
[DECOR_ATTRACT_MAT] = {gDecorIcon_AttractMat, gDecorIconPalette_AttractMat},
[DECOR_FISSURE_MAT] = {gDecorIcon_FissureMat, gDecorIconPalette_FissureMat},
[DECOR_SPIKES_MAT] = {gDecorIcon_SpikesMat, gDecorIconPalette_SpikesMat},
[DECOR_BALL_POSTER] = {NULL, NULL},
[DECOR_GREEN_POSTER] = {NULL, NULL},
[DECOR_RED_POSTER] = {NULL, NULL},
[DECOR_BLUE_POSTER] = {NULL, NULL},
[DECOR_CUTE_POSTER] = {NULL, NULL},
[DECOR_PIKA_POSTER] = {NULL, NULL},
[DECOR_LONG_POSTER] = {NULL, NULL},
[DECOR_SEA_POSTER] = {NULL, NULL},
[DECOR_SKY_POSTER] = {NULL, NULL},
[DECOR_KISS_POSTER] = {NULL, NULL},
[DECOR_PICHU_DOLL] = {NULL, NULL},
[DECOR_PIKACHU_DOLL] = {NULL, NULL},
[DECOR_MARILL_DOLL] = {NULL, NULL},
[DECOR_TOGEPI_DOLL] = {NULL, NULL},
[DECOR_CYNDAQUIL_DOLL] = {NULL, NULL},
[DECOR_CHIKORITA_DOLL] = {NULL, NULL},
[DECOR_TOTODILE_DOLL] = {NULL, NULL},
[DECOR_JIGGLYPUFF_DOLL] = {NULL, NULL},
[DECOR_MEOWTH_DOLL] = {NULL, NULL},
[DECOR_CLEFAIRY_DOLL] = {NULL, NULL},
[DECOR_DITTO_DOLL] = {NULL, NULL},
[DECOR_SMOOCHUM_DOLL] = {NULL, NULL},
[DECOR_TREECKO_DOLL] = {NULL, NULL},
[DECOR_TORCHIC_DOLL] = {NULL, NULL},
[DECOR_MUDKIP_DOLL] = {NULL, NULL},
[DECOR_DUSKULL_DOLL] = {NULL, NULL},
[DECOR_WYNAUT_DOLL] = {NULL, NULL},
[DECOR_BALTOY_DOLL] = {NULL, NULL},
[DECOR_KECLEON_DOLL] = {NULL, NULL},
[DECOR_AZURILL_DOLL] = {NULL, NULL},
[DECOR_SKITTY_DOLL] = {NULL, NULL},
[DECOR_SWABLU_DOLL] = {NULL, NULL},
[DECOR_GULPIN_DOLL] = {NULL, NULL},
[DECOR_LOTAD_DOLL] = {NULL, NULL},
[DECOR_SEEDOT_DOLL] = {NULL, NULL},
[DECOR_PIKA_CUSHION] = {NULL, NULL},
[DECOR_ROUND_CUSHION] = {NULL, NULL},
[DECOR_KISS_CUSHION] = {NULL, NULL},
[DECOR_ZIGZAG_CUSHION] = {NULL, NULL},
[DECOR_SPIN_CUSHION] = {NULL, NULL},
[DECOR_DIAMOND_CUSHION] = {NULL, NULL},
[DECOR_BALL_CUSHION] = {NULL, NULL},
[DECOR_GRASS_CUSHION] = {NULL, NULL},
[DECOR_FIRE_CUSHION] = {NULL, NULL},
[DECOR_WATER_CUSHION] = {NULL, NULL},
[DECOR_SNORLAX_DOLL] = {gDecorIcon_SnorlaxDoll, gDecorIconPalette_SnorlaxDoll},
[DECOR_RHYDON_DOLL] = {gDecorIcon_RhydonDoll, gDecorIconPalette_RhydonDoll},
[DECOR_LAPRAS_DOLL] = {gDecorIcon_LaprasDoll, gDecorIconPalette_LaprasDoll},
[DECOR_VENUSAUR_DOLL] = {gDecorIcon_VenusaurDoll, gDecorIconPalette_VenusaurDoll},
[DECOR_CHARIZARD_DOLL] = {gDecorIcon_CharizardDoll, gDecorIconPalette_CharizardDoll},
[DECOR_BLASTOISE_DOLL] = {gDecorIcon_BlastoiseDoll, gDecorIconPalette_BlastoiseDoll},
[DECOR_WAILMER_DOLL] = {gDecorIcon_WailmerDoll, gDecorIconPalette_WailmerDoll},
[DECOR_REGIROCK_DOLL] = {gDecorIcon_RegirockDoll, gDecorIconPalette_RegirockDoll},
[DECOR_REGICE_DOLL] = {gDecorIcon_RegiceDoll, gDecorIconPalette_RegiceDoll},
[DECOR_REGISTEEL_DOLL] = {gDecorIcon_RegisteelDoll, gDecorIconPalette_RegisteelDoll}
};
+84 -84
View File
@@ -1,125 +1,125 @@
const u32 gUnknown_08DB7AA0[] = INCBIN_U32("graphics/decorations/decor_heavy_desk.4bpp.lz");
const u32 gUnknown_08DB7B34[] = INCBIN_U32("graphics/decorations/decor_heavy_desk.gbapal.lz");
const u32 gDecorIcon_HeavyDesk[] = INCBIN_U32("graphics/decorations/decor_heavy_desk.4bpp.lz");
const u32 gDecorIconPalette_HeavyDesk[] = INCBIN_U32("graphics/decorations/decor_heavy_desk.gbapal.lz");
const u32 gUnknown_08DB7B5C[] = INCBIN_U32("graphics/decorations/decor_ragged_desk.4bpp.lz");
const u32 gUnknown_08DB7BEC[] = INCBIN_U32("graphics/decorations/decor_ragged_desk.gbapal.lz");
const u32 gDecorIcon_RaggedDesk[] = INCBIN_U32("graphics/decorations/decor_ragged_desk.4bpp.lz");
const u32 gDecorIconPalette_RaggedDesk[] = INCBIN_U32("graphics/decorations/decor_ragged_desk.gbapal.lz");
const u32 gUnknown_08DB7C08[] = INCBIN_U32("graphics/decorations/decor_comfort_desk.4bpp.lz");
const u32 gUnknown_08DB7CE8[] = INCBIN_U32("graphics/decorations/decor_comfort_desk.gbapal.lz");
const u32 gDecorIcon_ComfortDesk[] = INCBIN_U32("graphics/decorations/decor_comfort_desk.4bpp.lz");
const u32 gDecorIconPalette_ComfortDesk[] = INCBIN_U32("graphics/decorations/decor_comfort_desk.gbapal.lz");
const u32 gUnknown_08DB7D08[] = INCBIN_U32("graphics/decorations/decor_pretty_desk.4bpp.lz");
const u32 gUnknown_08DB7DCC[] = INCBIN_U32("graphics/decorations/decor_pretty_desk.gbapal.lz");
const u32 gDecorIcon_PrettyDesk[] = INCBIN_U32("graphics/decorations/decor_pretty_desk.4bpp.lz");
const u32 gDecorIconPalette_PrettyDesk[] = INCBIN_U32("graphics/decorations/decor_pretty_desk.gbapal.lz");
const u32 gUnknown_08DB7DF4[] = INCBIN_U32("graphics/decorations/decor_brick_desk.4bpp.lz");
const u32 gUnknown_08DB7EA0[] = INCBIN_U32("graphics/decorations/decor_brick_desk.gbapal.lz");
const u32 gDecorIcon_BrickDesk[] = INCBIN_U32("graphics/decorations/decor_brick_desk.4bpp.lz");
const u32 gDecorIconPalette_BrickDesk[] = INCBIN_U32("graphics/decorations/decor_brick_desk.gbapal.lz");
const u32 gUnknown_08DB7EC4[] = INCBIN_U32("graphics/decorations/decor_camp_desk.4bpp.lz");
const u32 gUnknown_08DB7F60[] = INCBIN_U32("graphics/decorations/decor_camp_desk.gbapal.lz");
const u32 gDecorIcon_CampDesk[] = INCBIN_U32("graphics/decorations/decor_camp_desk.4bpp.lz");
const u32 gDecorIconPalette_CampDesk[] = INCBIN_U32("graphics/decorations/decor_camp_desk.gbapal.lz");
const u32 gUnknown_08DB7F7C[] = INCBIN_U32("graphics/decorations/decor_hard_desk.4bpp.lz");
const u32 gUnknown_08DB8070[] = INCBIN_U32("graphics/decorations/decor_hard_desk.gbapal.lz");
const u32 gDecorIcon_HardDesk[] = INCBIN_U32("graphics/decorations/decor_hard_desk.4bpp.lz");
const u32 gDecorIconPalette_HardDesk[] = INCBIN_U32("graphics/decorations/decor_hard_desk.gbapal.lz");
const u32 gUnknown_08DB808C[] = INCBIN_U32("graphics/decorations/decor_red_plant.4bpp.lz");
const u32 gUnknown_08DB8138[] = INCBIN_U32("graphics/decorations/decor_red_plant.gbapal.lz");
const u32 gDecorIcon_RedPlant[] = INCBIN_U32("graphics/decorations/decor_red_plant.4bpp.lz");
const u32 gDecorIconPalette_RedPlant[] = INCBIN_U32("graphics/decorations/decor_red_plant.gbapal.lz");
const u32 gUnknown_08DB8160[] = INCBIN_U32("graphics/decorations/decor_tropical_plant.4bpp.lz");
const u32 gUnknown_08DB8218[] = INCBIN_U32("graphics/decorations/decor_tropical_plant.gbapal.lz");
const u32 gDecorIcon_TropicalPlant[] = INCBIN_U32("graphics/decorations/decor_tropical_plant.4bpp.lz");
const u32 gDecorIconPalette_TropicalPlant[] = INCBIN_U32("graphics/decorations/decor_tropical_plant.gbapal.lz");
const u32 gUnknown_08DB823C[] = INCBIN_U32("graphics/decorations/decor_pretty_flowers.4bpp.lz");
const u32 gUnknown_08DB8300[] = INCBIN_U32("graphics/decorations/decor_pretty_flowers.gbapal.lz");
const u32 gDecorIcon_PrettyFlowers[] = INCBIN_U32("graphics/decorations/decor_pretty_flowers.4bpp.lz");
const u32 gDecorIconPalette_PrettyFlowers[] = INCBIN_U32("graphics/decorations/decor_pretty_flowers.gbapal.lz");
const u32 gUnknown_08DB8328[] = INCBIN_U32("graphics/decorations/decor_colorful_plant.4bpp.lz");
const u32 gUnknown_08DB8430[] = INCBIN_U32("graphics/decorations/decor_colorful_plant.gbapal.lz");
const u32 gDecorIcon_ColorfulPlant[] = INCBIN_U32("graphics/decorations/decor_colorful_plant.4bpp.lz");
const u32 gDecorIconPalette_ColorfulPlant[] = INCBIN_U32("graphics/decorations/decor_colorful_plant.gbapal.lz");
const u32 gUnknown_08DB8458[] = INCBIN_U32("graphics/decorations/decor_big_plant.4bpp.lz");
const u32 gUnknown_08DB8528[] = INCBIN_U32("graphics/decorations/decor_big_plant.gbapal.lz");
const u32 gDecorIcon_BigPlant[] = INCBIN_U32("graphics/decorations/decor_big_plant.4bpp.lz");
const u32 gDecorIconPalette_BigPlant[] = INCBIN_U32("graphics/decorations/decor_big_plant.gbapal.lz");
const u32 gUnknown_08DB854C[] = INCBIN_U32("graphics/decorations/decor_gorgeous_plant.4bpp.lz");
const u32 gUnknown_08DB862C[] = INCBIN_U32("graphics/decorations/decor_gorgeous_plant.gbapal.lz");
const u32 gDecorIcon_GorgeousPlant[] = INCBIN_U32("graphics/decorations/decor_gorgeous_plant.4bpp.lz");
const u32 gDecorIconPalette_GorgeousPlant[] = INCBIN_U32("graphics/decorations/decor_gorgeous_plant.gbapal.lz");
const u32 gUnknown_08DB8654[] = INCBIN_U32("graphics/decorations/decor_red_brick.4bpp.lz");
const u32 gUnknown_08DB86C4[] = INCBIN_U32("graphics/decorations/decor_red_brick.gbapal.lz");
const u32 gDecorIcon_RedBrick[] = INCBIN_U32("graphics/decorations/decor_red_brick.4bpp.lz");
const u32 gDecorIconPalette_RedBrick[] = INCBIN_U32("graphics/decorations/decor_red_brick.gbapal.lz");
const u32 gUnknown_08DB86E0[] = INCBIN_U32("graphics/decorations/decor_yellow_brick.4bpp.lz");
const u32 gUnknown_08DB8750[] = INCBIN_U32("graphics/decorations/decor_yellow_brick.gbapal.lz");
const u32 gDecorIcon_YellowBrick[] = INCBIN_U32("graphics/decorations/decor_yellow_brick.4bpp.lz");
const u32 gDecorIconPalette_YellowBrick[] = INCBIN_U32("graphics/decorations/decor_yellow_brick.gbapal.lz");
const u32 gUnknown_08DB876C[] = INCBIN_U32("graphics/decorations/decor_blue_brick.4bpp.lz");
const u32 gUnknown_08DB87DC[] = INCBIN_U32("graphics/decorations/decor_blue_brick.gbapal.lz");
const u32 gDecorIcon_BlueBrick[] = INCBIN_U32("graphics/decorations/decor_blue_brick.4bpp.lz");
const u32 gDecorIconPalette_BlueBrick[] = INCBIN_U32("graphics/decorations/decor_blue_brick.gbapal.lz");
const u32 gUnknown_08DB87F8[] = INCBIN_U32("graphics/decorations/decor_red_tent.4bpp.lz");
const u32 gUnknown_08DB88D8[] = INCBIN_U32("graphics/decorations/decor_red_tent.gbapal.lz");
const u32 gDecorIcon_RedTent[] = INCBIN_U32("graphics/decorations/decor_red_tent.4bpp.lz");
const u32 gDecorIconPalette_RedTent[] = INCBIN_U32("graphics/decorations/decor_red_tent.gbapal.lz");
const u32 gUnknown_08DB8900[] = INCBIN_U32("graphics/decorations/decor_blue_tent.4bpp.lz");
const u32 gUnknown_08DB89E0[] = INCBIN_U32("graphics/decorations/decor_blue_tent.gbapal.lz");
const u32 gDecorIcon_BlueTent[] = INCBIN_U32("graphics/decorations/decor_blue_tent.4bpp.lz");
const u32 gDecorIconPalette_BlueTent[] = INCBIN_U32("graphics/decorations/decor_blue_tent.gbapal.lz");
const u32 gUnknown_08DB8A08[] = INCBIN_U32("graphics/decorations/decor_solid_board.4bpp.lz");
const u32 gUnknown_08DB8A68[] = INCBIN_U32("graphics/decorations/decor_solid_board.gbapal.lz");
const u32 gDecorIcon_SolidBoard[] = INCBIN_U32("graphics/decorations/decor_solid_board.4bpp.lz");
const u32 gDecorIconPalette_SolidBoard[] = INCBIN_U32("graphics/decorations/decor_solid_board.gbapal.lz");
const u32 gUnknown_08DB8A84[] = INCBIN_U32("graphics/decorations/decor_slide.4bpp.lz");
const u32 gUnknown_08DB8B40[] = INCBIN_U32("graphics/decorations/decor_slide.gbapal.lz");
const u32 gDecorIcon_Slide[] = INCBIN_U32("graphics/decorations/decor_slide.4bpp.lz");
const u32 gDecorIconPalette_Slide[] = INCBIN_U32("graphics/decorations/decor_slide.gbapal.lz");
const u32 gUnknown_08DB8B68[] = INCBIN_U32("graphics/decorations/decor_tire.4bpp.lz");
const u32 gUnknown_08DB8C40[] = INCBIN_U32("graphics/decorations/decor_tire.gbapal.lz");
const u32 gDecorIcon_Tire[] = INCBIN_U32("graphics/decorations/decor_tire.4bpp.lz");
const u32 gDecorIconPalette_Tire[] = INCBIN_U32("graphics/decorations/decor_tire.gbapal.lz");
const u32 gUnknown_08DB8C5C[] = INCBIN_U32("graphics/decorations/decor_stand.4bpp.lz");
const u32 gUnknown_08DB8CF4[] = INCBIN_U32("graphics/decorations/decor_stand.gbapal.lz");
const u32 gDecorIcon_Stand[] = INCBIN_U32("graphics/decorations/decor_stand.4bpp.lz");
const u32 gDecorIconPalette_Stand[] = INCBIN_U32("graphics/decorations/decor_stand.gbapal.lz");
const u32 gUnknown_08DB8D18[] = INCBIN_U32("graphics/decorations/decor_breakable_door.4bpp.lz");
const u32 gUnknown_08DB8DB0[] = INCBIN_U32("graphics/decorations/decor_breakable_door.gbapal.lz");
const u32 gDecorIcon_BreakableDoor[] = INCBIN_U32("graphics/decorations/decor_breakable_door.4bpp.lz");
const u32 gDecorIconPalette_BreakableDoor[] = INCBIN_U32("graphics/decorations/decor_breakable_door.gbapal.lz");
const u32 gUnknown_08DB8DD4[] = INCBIN_U32("graphics/decorations/decor_sand_ornament.4bpp.lz");
const u32 gUnknown_08DB8E80[] = INCBIN_U32("graphics/decorations/decor_sand_ornament.gbapal.lz");
const u32 gDecorIcon_SandOrnament[] = INCBIN_U32("graphics/decorations/decor_sand_ornament.4bpp.lz");
const u32 gDecorIconPalette_SandOrnament[] = INCBIN_U32("graphics/decorations/decor_sand_ornament.gbapal.lz");
const u32 gUnknown_08DB8EA0[] = INCBIN_U32("graphics/decorations/decor_glass_ornament.4bpp.lz");
const u32 gUnknown_08DB8F58[] = INCBIN_U32("graphics/decorations/decor_glass_ornament.gbapal.lz");
const u32 gDecorIcon_GlassOrnament[] = INCBIN_U32("graphics/decorations/decor_glass_ornament.4bpp.lz");
const u32 gDecorIconPalette_GlassOrnament[] = INCBIN_U32("graphics/decorations/decor_glass_ornament.gbapal.lz");
const u32 gUnknown_08DB8F7C[] = INCBIN_U32("graphics/decorations/decor_surf_mat.4bpp.lz");
const u32 gUnknown_08DB9038[] = INCBIN_U32("graphics/decorations/decor_surf_mat.gbapal.lz");
const u32 gDecorIcon_SurfMat[] = INCBIN_U32("graphics/decorations/decor_surf_mat.4bpp.lz");
const u32 gDecorIconPalette_SurfMat[] = INCBIN_U32("graphics/decorations/decor_surf_mat.gbapal.lz");
const u32 gUnknown_08DB9058[] = INCBIN_U32("graphics/decorations/decor_thunder_mat.4bpp.lz");
const u32 gUnknown_08DB9130[] = INCBIN_U32("graphics/decorations/decor_thunder_mat.gbapal.lz");
const u32 gDecorIcon_ThunderMat[] = INCBIN_U32("graphics/decorations/decor_thunder_mat.4bpp.lz");
const u32 gDecorIconPalette_ThunderMat[] = INCBIN_U32("graphics/decorations/decor_thunder_mat.gbapal.lz");
const u32 gUnknown_08DB9154[] = INCBIN_U32("graphics/decorations/decor_fire_blast_mat.4bpp.lz");
const u32 gUnknown_08DB9218[] = INCBIN_U32("graphics/decorations/decor_fire_blast_mat.gbapal.lz");
const u32 gDecorIcon_FireBlastMat[] = INCBIN_U32("graphics/decorations/decor_fire_blast_mat.4bpp.lz");
const u32 gDecorIconPalette_FireBlastMat[] = INCBIN_U32("graphics/decorations/decor_fire_blast_mat.gbapal.lz");
const u32 gUnknown_08DB9234[] = INCBIN_U32("graphics/decorations/decor_powder_snow_mat.4bpp.lz");
const u32 gUnknown_08DB92FC[] = INCBIN_U32("graphics/decorations/decor_powder_snow_mat.gbapal.lz");
const u32 gDecorIcon_PowderSnowMat[] = INCBIN_U32("graphics/decorations/decor_powder_snow_mat.4bpp.lz");
const u32 gDecorIconPalette_PowderSnowMat[] = INCBIN_U32("graphics/decorations/decor_powder_snow_mat.gbapal.lz");
const u32 gUnknown_08DB931C[] = INCBIN_U32("graphics/decorations/decor_attract_mat.4bpp.lz");
const u32 gUnknown_08DB93E8[] = INCBIN_U32("graphics/decorations/decor_attract_mat.gbapal.lz");
const u32 gDecorIcon_AttractMat[] = INCBIN_U32("graphics/decorations/decor_attract_mat.4bpp.lz");
const u32 gDecorIconPalette_AttractMat[] = INCBIN_U32("graphics/decorations/decor_attract_mat.gbapal.lz");
const u32 gUnknown_08DB940C[] = INCBIN_U32("graphics/decorations/decor_fissure_mat.4bpp.lz");
const u32 gUnknown_08DB94CC[] = INCBIN_U32("graphics/decorations/decor_fissure_mat.gbapal.lz");
const u32 gDecorIcon_FissureMat[] = INCBIN_U32("graphics/decorations/decor_fissure_mat.4bpp.lz");
const u32 gDecorIconPalette_FissureMat[] = INCBIN_U32("graphics/decorations/decor_fissure_mat.gbapal.lz");
const u32 gUnknown_08DB94E8[] = INCBIN_U32("graphics/decorations/decor_spikes_mat.4bpp.lz");
const u32 gUnknown_08DB95AC[] = INCBIN_U32("graphics/decorations/decor_spikes_mat.gbapal.lz");
const u32 gDecorIcon_SpikesMat[] = INCBIN_U32("graphics/decorations/decor_spikes_mat.4bpp.lz");
const u32 gDecorIconPalette_SpikesMat[] = INCBIN_U32("graphics/decorations/decor_spikes_mat.gbapal.lz");
const u32 gUnknown_08DB95D0[] = INCBIN_U32("graphics/decorations/decor_snorlax_doll.4bpp.lz");
const u32 gUnknown_08DB96C4[] = INCBIN_U32("graphics/decorations/decor_snorlax_doll.gbapal.lz");
const u32 gDecorIcon_SnorlaxDoll[] = INCBIN_U32("graphics/decorations/decor_snorlax_doll.4bpp.lz");
const u32 gDecorIconPalette_SnorlaxDoll[] = INCBIN_U32("graphics/decorations/decor_snorlax_doll.gbapal.lz");
const u32 gUnknown_08DB96EC[] = INCBIN_U32("graphics/decorations/decor_rhydon_doll.4bpp.lz");
const u32 gUnknown_08DB97F4[] = INCBIN_U32("graphics/decorations/decor_rhydon_doll.gbapal.lz");
const u32 gDecorIcon_RhydonDoll[] = INCBIN_U32("graphics/decorations/decor_rhydon_doll.4bpp.lz");
const u32 gDecorIconPalette_RhydonDoll[] = INCBIN_U32("graphics/decorations/decor_rhydon_doll.gbapal.lz");
const u32 gUnknown_08DB981C[] = INCBIN_U32("graphics/decorations/decor_lapras_doll.4bpp.lz");
const u32 gUnknown_08DB9908[] = INCBIN_U32("graphics/decorations/decor_lapras_doll.gbapal.lz");
const u32 gDecorIcon_LaprasDoll[] = INCBIN_U32("graphics/decorations/decor_lapras_doll.4bpp.lz");
const u32 gDecorIconPalette_LaprasDoll[] = INCBIN_U32("graphics/decorations/decor_lapras_doll.gbapal.lz");
const u32 gUnknown_08DB9930[] = INCBIN_U32("graphics/decorations/decor_venusaur_doll.4bpp.lz");
const u32 gUnknown_08DB9A54[] = INCBIN_U32("graphics/decorations/decor_venusaur_doll.gbapal.lz");
const u32 gDecorIcon_VenusaurDoll[] = INCBIN_U32("graphics/decorations/decor_venusaur_doll.4bpp.lz");
const u32 gDecorIconPalette_VenusaurDoll[] = INCBIN_U32("graphics/decorations/decor_venusaur_doll.gbapal.lz");
const u32 gUnknown_08DB9A7C[] = INCBIN_U32("graphics/decorations/decor_charizard_doll.4bpp.lz");
const u32 gUnknown_08DB9B7C[] = INCBIN_U32("graphics/decorations/decor_charizard_doll.gbapal.lz");
const u32 gDecorIcon_CharizardDoll[] = INCBIN_U32("graphics/decorations/decor_charizard_doll.4bpp.lz");
const u32 gDecorIconPalette_CharizardDoll[] = INCBIN_U32("graphics/decorations/decor_charizard_doll.gbapal.lz");
const u32 gUnknown_08DB9BA4[] = INCBIN_U32("graphics/decorations/decor_blastoise_doll.4bpp.lz");
const u32 gUnknown_08DB9CB0[] = INCBIN_U32("graphics/decorations/decor_blastoise_doll.gbapal.lz");
const u32 gDecorIcon_BlastoiseDoll[] = INCBIN_U32("graphics/decorations/decor_blastoise_doll.4bpp.lz");
const u32 gDecorIconPalette_BlastoiseDoll[] = INCBIN_U32("graphics/decorations/decor_blastoise_doll.gbapal.lz");
const u32 gUnknown_08DB9CD8[] = INCBIN_U32("graphics/decorations/decor_wailmer_doll.4bpp.lz");
const u32 gUnknown_08DB9DAC[] = INCBIN_U32("graphics/decorations/decor_wailmer_doll.gbapal.lz");
const u32 gDecorIcon_WailmerDoll[] = INCBIN_U32("graphics/decorations/decor_wailmer_doll.4bpp.lz");
const u32 gDecorIconPalette_WailmerDoll[] = INCBIN_U32("graphics/decorations/decor_wailmer_doll.gbapal.lz");
const u32 gUnknown_08DB9DD4[] = INCBIN_U32("graphics/decorations/decor_regice_doll.4bpp.lz");
const u32 gUnknown_08DB9EE4[] = INCBIN_U32("graphics/decorations/decor_regice_doll.gbapal.lz");
const u32 gDecorIcon_RegiceDoll[] = INCBIN_U32("graphics/decorations/decor_regice_doll.4bpp.lz");
const u32 gDecorIconPalette_RegiceDoll[] = INCBIN_U32("graphics/decorations/decor_regice_doll.gbapal.lz");
const u32 gUnknown_08DB9F08[] = INCBIN_U32("graphics/decorations/decor_regirock_doll.4bpp.lz");
const u32 gUnknown_08DB9FFC[] = INCBIN_U32("graphics/decorations/decor_regirock_doll.gbapal.lz");
const u32 gDecorIcon_RegirockDoll[] = INCBIN_U32("graphics/decorations/decor_regirock_doll.4bpp.lz");
const u32 gDecorIconPalette_RegirockDoll[] = INCBIN_U32("graphics/decorations/decor_regirock_doll.gbapal.lz");
const u32 gUnknown_08DBA020[] = INCBIN_U32("graphics/decorations/decor_registeel_doll.4bpp.lz");
const u32 gUnknown_08DBA12C[] = INCBIN_U32("graphics/decorations/decor_registeel_doll.gbapal.lz");
const u32 gDecorIcon_RegisteelDoll[] = INCBIN_U32("graphics/decorations/decor_registeel_doll.4bpp.lz");
const u32 gDecorIconPalette_RegisteelDoll[] = INCBIN_U32("graphics/decorations/decor_registeel_doll.gbapal.lz");
+1 -32
View File
@@ -1,35 +1,4 @@
#define TUTOR_MOVE_MEGA_PUNCH 0
#define TUTOR_MOVE_SWORDS_DANCE 1
#define TUTOR_MOVE_MEGA_KICK 2
#define TUTOR_MOVE_BODY_SLAM 3
#define TUTOR_MOVE_DOUBLE_EDGE 4
#define TUTOR_MOVE_COUNTER 5
#define TUTOR_MOVE_SEISMIC_TOSS 6
#define TUTOR_MOVE_MIMIC 7
#define TUTOR_MOVE_METRONOME 8
#define TUTOR_MOVE_SOFT_BOILED 9
#define TUTOR_MOVE_DREAM_EATER 10
#define TUTOR_MOVE_THUNDER_WAVE 11
#define TUTOR_MOVE_EXPLOSION 12
#define TUTOR_MOVE_ROCK_SLIDE 13
#define TUTOR_MOVE_SUBSTITUTE 14
#define TUTOR_MOVE_DYNAMIC_PUNCH 15
#define TUTOR_MOVE_ROLLOUT 16
#define TUTOR_MOVE_PSYCH_UP 17
#define TUTOR_MOVE_SNORE 18
#define TUTOR_MOVE_ICY_WIND 19
#define TUTOR_MOVE_ENDURE 20
#define TUTOR_MOVE_MUD_SLAP 21
#define TUTOR_MOVE_ICE_PUNCH 22
#define TUTOR_MOVE_SWAGGER 23
#define TUTOR_MOVE_SLEEP_TALK 24
#define TUTOR_MOVE_SWIFT 25
#define TUTOR_MOVE_DEFENSE_CURL 26
#define TUTOR_MOVE_THUNDER_PUNCH 27
#define TUTOR_MOVE_FIRE_PUNCH 28
#define TUTOR_MOVE_FURY_CUTTER 29
const u16 gTutorMoves[] =
const u16 gTutorMoves[TUTOR_MOVE_COUNT] =
{
[TUTOR_MOVE_MEGA_PUNCH] = MOVE_MEGA_PUNCH,
[TUTOR_MOVE_SWORDS_DANCE] = MOVE_SWORDS_DANCE,
File diff suppressed because it is too large Load Diff
+138 -144
View File
@@ -3,14 +3,11 @@
#include "battle.h"
#include "daycare.h"
#include "string_util.h"
#include "constants/species.h"
#include "constants/items.h"
#include "mail.h"
#include "pokemon_storage_system.h"
#include "event_data.h"
#include "random.h"
#include "main.h"
#include "constants/moves.h"
#include "egg_hatch.h"
#include "text.h"
#include "menu.h"
@@ -22,9 +19,10 @@
#include "party_menu.h"
#include "list_menu.h"
#include "overworld.h"
#define EGG_MOVES_ARRAY_COUNT 10
#define EGG_LVL_UP_MOVES_ARRAY_COUNT 50
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/region_map_sections.h"
#include "constants/species.h"
// this file's functions
static void ClearDaycareMonMail(struct DayCareMail *mail);
@@ -34,10 +32,10 @@ static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y);
// RAM buffers used to assist with BuildEggMoveset()
EWRAM_DATA static u16 sHatchedEggLevelUpMoves[EGG_LVL_UP_MOVES_ARRAY_COUNT] = {0};
EWRAM_DATA static u16 sHatchedEggFatherMoves[4] = {0};
EWRAM_DATA static u16 sHatchedEggFinalMoves[4] = {0};
EWRAM_DATA static u16 sHatchedEggFatherMoves[MAX_MON_MOVES] = {0};
EWRAM_DATA static u16 sHatchedEggFinalMoves[MAX_MON_MOVES] = {0};
EWRAM_DATA static u16 sHatchedEggEggMoves[EGG_MOVES_ARRAY_COUNT] = {0};
EWRAM_DATA static u16 sHatchedEggMotherMoves[4] = {0};
EWRAM_DATA static u16 sHatchedEggMotherMoves[MAX_MON_MOVES] = {0};
#include "data/pokemon/egg_moves.h"
@@ -52,11 +50,13 @@ static const struct WindowTemplate sDaycareLevelMenuWindowTemplate =
.baseBlock = 8
};
// Indices here are assigned by Task_HandleDaycareLevelMenuInput to VAR_RESULT,
// which is copied to VAR_0x8004 and used as an index for GetDaycareCost
static const struct ListMenuItem sLevelMenuItems[] =
{
{gExpandedPlaceholder_Empty, 0},
{gExpandedPlaceholder_Empty, 1},
{gText_Exit, 5}
{gText_Exit, DAYCARE_LEVEL_MENU_EXIT}
};
static const struct ListMenuTemplate sDaycareListMenuLevelTemplate =
@@ -91,7 +91,7 @@ static const u8 *const sCompatibilityMessages[] =
static const u8 sJapaneseEggNickname[] = _("タマゴ"); // "tamago" ("egg" in Japanese)
u8 *GetMonNick(struct Pokemon *mon, u8 *dest)
u8 *GetMonNickname2(struct Pokemon *mon, u8 *dest)
{
u8 nickname[POKEMON_NAME_LENGTH * 2];
@@ -99,7 +99,7 @@ u8 *GetMonNick(struct Pokemon *mon, u8 *dest)
return StringCopy10(dest, nickname);
}
u8 *GetBoxMonNick(struct BoxPokemon *mon, u8 *dest)
u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest)
{
u8 nickname[POKEMON_NAME_LENGTH * 2];
@@ -169,7 +169,7 @@ static void StorePokemonInDaycare(struct Pokemon *mon, struct DaycareMon *daycar
u8 mailId;
StringCopy(daycareMon->mail.OT_name, gSaveBlock2Ptr->playerName);
GetMonNick(mon, daycareMon->mail.monName);
GetMonNickname2(mon, daycareMon->mail.monName);
StripExtCtrlCodes(daycareMon->mail.monName);
daycareMon->mail.gameLanguage = LANGUAGE_ENGLISH;
daycareMon->mail.monLanguage = GetMonData(mon, MON_DATA_LANGUAGE);
@@ -202,8 +202,8 @@ void StoreSelectedPokemonInDaycare(void)
static void ShiftDaycareSlots(struct DayCare *daycare)
{
// This condition is only satisfied when the player takes out the first pokemon from the daycare.
if (GetBoxMonData(&daycare->mons[1].mon, MON_DATA_SPECIES) != 0
&& GetBoxMonData(&daycare->mons[0].mon, MON_DATA_SPECIES) == 0)
if (GetBoxMonData(&daycare->mons[1].mon, MON_DATA_SPECIES) != SPECIES_NONE
&& GetBoxMonData(&daycare->mons[0].mon, MON_DATA_SPECIES) == SPECIES_NONE)
{
daycare->mons[0].mon = daycare->mons[1].mon;
ZeroBoxMonData(&daycare->mons[1].mon);
@@ -254,7 +254,7 @@ static u16 TakeSelectedPokemonFromDaycare(struct DaycareMon *daycareMon)
u32 experience;
struct Pokemon pokemon;
GetBoxMonNick(&daycareMon->mon, gStringVar1);
GetBoxMonNickname(&daycareMon->mon, gStringVar1);
species = GetBoxMonData(&daycareMon->mon, MON_DATA_SPECIES);
BoxMonToMon(&daycareMon->mon, &pokemon);
@@ -314,7 +314,7 @@ static u8 GetNumLevelsGainedForDaycareMon(struct DaycareMon *daycareMon)
{
u8 numLevelsGained = GetNumLevelsGainedFromSteps(daycareMon);
ConvertIntToDecimalStringN(gStringVar2, numLevelsGained, STR_CONV_MODE_LEFT_ALIGN, 2);
GetBoxMonNick(&daycareMon->mon, gStringVar1);
GetBoxMonNickname(&daycareMon->mon, gStringVar1);
return numLevelsGained;
}
@@ -323,7 +323,7 @@ static u32 GetDaycareCostForSelectedMon(struct DaycareMon *daycareMon)
u32 cost;
u8 numLevelsGained = GetNumLevelsGainedFromSteps(daycareMon);
GetBoxMonNick(&daycareMon->mon, gStringVar1);
GetBoxMonNickname(&daycareMon->mon, gStringVar1);
cost = 100 + 100 * numLevelsGained;
ConvertIntToDecimalStringN(gStringVar2, cost, STR_CONV_MODE_LEFT_ALIGN, 5);
return cost;
@@ -419,18 +419,18 @@ static u16 GetEggSpecies(u16 species)
return species;
}
static s32 GetSlotToInheritNature(struct DayCare *daycare)
static s32 GetParentToInheritNature(struct DayCare *daycare)
{
u32 species[DAYCARE_MON_COUNT];
s32 i;
s32 dittoCount;
s32 slot = -1;
s32 parent = -1;
// search for female gender
for (i = 0; i < DAYCARE_MON_COUNT; i++)
{
if (GetBoxMonGender(&daycare->mons[i].mon) == MON_FEMALE)
slot = i;
parent = i;
}
// search for ditto
@@ -438,50 +438,52 @@ static s32 GetSlotToInheritNature(struct DayCare *daycare)
{
species[i] = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES);
if (species[i] == SPECIES_DITTO)
dittoCount++, slot = i;
dittoCount++, parent = i;
}
// coin flip on ...two Dittos
if (dittoCount == 2)
if (dittoCount == DAYCARE_MON_COUNT)
{
if (Random() >= USHRT_MAX / 2)
slot = 0;
parent = 0;
else
slot = 1;
parent = 1;
}
// nature inheritance only if holds everstone
if (GetBoxMonData(&daycare->mons[slot].mon, MON_DATA_HELD_ITEM) != ITEM_EVERSTONE
// Don't inherit nature if not holding Everstone
if (GetBoxMonData(&daycare->mons[parent].mon, MON_DATA_HELD_ITEM) != ITEM_EVERSTONE
|| Random() >= USHRT_MAX / 2)
{
return -1;
}
return slot;
return parent;
}
static void _TriggerPendingDaycareEgg(struct DayCare *daycare)
{
s32 natureSlot;
s32 parent;
s32 natureTries = 0;
SeedRng2(gMain.vblankCounter2);
natureSlot = GetSlotToInheritNature(daycare);
parent = GetParentToInheritNature(daycare);
if (natureSlot < 0)
// don't inherit nature
if (parent < 0)
{
daycare->offspringPersonality = (Random2() << 0x10) | ((Random() % 0xfffe) + 1);
daycare->offspringPersonality = (Random2() << 16) | ((Random() % 0xfffe) + 1);
}
// inherit nature
else
{
u8 wantedNature = GetNatureFromPersonality(GetBoxMonData(&daycare->mons[natureSlot].mon, MON_DATA_PERSONALITY, NULL));
u8 wantedNature = GetNatureFromPersonality(GetBoxMonData(&daycare->mons[parent].mon, MON_DATA_PERSONALITY, NULL));
u32 personality;
do
{
personality = (Random2() << 0x10) | (Random());
personality = (Random2() << 16) | (Random());
if (wantedNature == GetNatureFromPersonality(personality) && personality != 0)
break; // we found a personality with the same nature
break; // found a personality with the same nature
natureTries++;
} while (natureTries <= 2400);
@@ -492,9 +494,10 @@ static void _TriggerPendingDaycareEgg(struct DayCare *daycare)
FlagSet(FLAG_PENDING_DAYCARE_EGG);
}
// Functionally unused
static void _TriggerPendingDaycareMaleEgg(struct DayCare *daycare)
{
daycare->offspringPersonality = (Random()) | (0x8000);
daycare->offspringPersonality = (Random()) | (EGG_GENDER_MALE);
FlagSet(FLAG_PENDING_DAYCARE_EGG);
}
@@ -503,6 +506,7 @@ void TriggerPendingDaycareEgg(void)
_TriggerPendingDaycareEgg(&gSaveBlock1Ptr->daycare);
}
// Unused
static void TriggerPendingDaycareMaleEgg(void)
{
_TriggerPendingDaycareMaleEgg(&gSaveBlock1Ptr->daycare);
@@ -532,9 +536,9 @@ static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv)
static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare)
{
u8 i;
u8 selectedIvs[3];
u8 selectedIvs[INHERITED_IV_COUNT];
u8 availableIVs[NUM_STATS];
u8 whichParent[ARRAY_COUNT(selectedIvs)];
u8 whichParents[INHERITED_IV_COUNT];
u8 iv;
// Initialize a list of IV indices.
@@ -544,48 +548,46 @@ static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare)
}
// Select the 3 IVs that will be inherited.
for (i = 0; i < ARRAY_COUNT(selectedIvs); i++)
for (i = 0; i < INHERITED_IV_COUNT; i++)
{
// Randomly pick an IV from the available list.
// Randomly pick an IV from the available list and stop from being chosen again.
selectedIvs[i] = availableIVs[Random() % (NUM_STATS - i)];
// Remove the selected IV index from the available IV indices.
RemoveIVIndexFromList(availableIVs, i);
}
// Determine which parent each of the selected IVs should inherit from.
for (i = 0; i < ARRAY_COUNT(selectedIvs); i++)
for (i = 0; i < INHERITED_IV_COUNT; i++)
{
whichParent[i] = Random() % 2;
whichParents[i] = Random() % DAYCARE_MON_COUNT;
}
// Set each of inherited IVs on the egg mon.
for (i = 0; i < ARRAY_COUNT(selectedIvs); i++)
for (i = 0; i < INHERITED_IV_COUNT; i++)
{
switch (selectedIvs[i])
{
case 0:
iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_HP_IV);
iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_HP_IV);
SetMonData(egg, MON_DATA_HP_IV, &iv);
break;
case 1:
iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_ATK_IV);
iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_ATK_IV);
SetMonData(egg, MON_DATA_ATK_IV, &iv);
break;
case 2:
iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_DEF_IV);
iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_DEF_IV);
SetMonData(egg, MON_DATA_DEF_IV, &iv);
break;
case 3:
iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_SPEED_IV);
iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_SPEED_IV);
SetMonData(egg, MON_DATA_SPEED_IV, &iv);
break;
case 4:
iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_SPATK_IV);
iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_SPATK_IV);
SetMonData(egg, MON_DATA_SPATK_IV, &iv);
break;
case 5:
iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_SPDEF_IV);
iv = GetBoxMonData(&daycare->mons[whichParents[i]].mon, MON_DATA_SPDEF_IV);
SetMonData(egg, MON_DATA_SPDEF_IV, &iv);
break;
}
@@ -638,14 +640,14 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru
numSharedParentMoves = 0;
for (i = 0; i < MAX_MON_MOVES; i++)
{
sHatchedEggMotherMoves[i] = 0;
sHatchedEggFatherMoves[i] = 0;
sHatchedEggFinalMoves[i] = 0;
sHatchedEggMotherMoves[i] = MOVE_NONE;
sHatchedEggFatherMoves[i] = MOVE_NONE;
sHatchedEggFinalMoves[i] = MOVE_NONE;
}
for (i = 0; i < EGG_MOVES_ARRAY_COUNT; i++)
sHatchedEggEggMoves[i] = 0;
sHatchedEggEggMoves[i] = MOVE_NONE;
for (i = 0; i < EGG_LVL_UP_MOVES_ARRAY_COUNT; i++)
sHatchedEggLevelUpMoves[i] = 0;
sHatchedEggLevelUpMoves[i] = MOVE_NONE;
numLevelUpMoves = GetLevelUpMovesBySpecies(GetMonData(egg, MON_DATA_SPECIES), sHatchedEggLevelUpMoves);
for (i = 0; i < MAX_MON_MOVES; i++)
@@ -761,13 +763,10 @@ static void GiveVoltTackleIfLightBall(struct Pokemon *mon, struct DayCare *dayca
static u16 DetermineEggSpeciesAndParentSlots(struct DayCare *daycare, u8 *parentSlots)
{
u16 i;
u16 species[2];
u16 species[DAYCARE_MON_COUNT];
u16 eggSpecies;
// Determine which of the daycare mons is the mother and father of the egg.
// The 0th index of the parentSlots array is considered the mother slot, and the
// 1st index is the father slot.
for (i = 0; i < 2; i++)
for (i = 0; i < DAYCARE_MON_COUNT; i++)
{
species[i] = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES);
if (species[i] == SPECIES_DITTO)
@@ -783,11 +782,11 @@ static u16 DetermineEggSpeciesAndParentSlots(struct DayCare *daycare, u8 *parent
}
eggSpecies = GetEggSpecies(species[parentSlots[0]]);
if (eggSpecies == SPECIES_NIDORAN_F && daycare->offspringPersonality & 0x8000)
if (eggSpecies == SPECIES_NIDORAN_F && daycare->offspringPersonality & EGG_GENDER_MALE)
{
eggSpecies = SPECIES_NIDORAN_M;
}
if (eggSpecies == SPECIES_ILLUMISE && daycare->offspringPersonality & 0x8000)
if (eggSpecies == SPECIES_ILLUMISE && daycare->offspringPersonality & EGG_GENDER_MALE)
{
eggSpecies = SPECIES_VOLBEAT;
}
@@ -795,19 +794,19 @@ static u16 DetermineEggSpeciesAndParentSlots(struct DayCare *daycare, u8 *parent
// Make Ditto the "mother" slot if the other daycare mon is male.
if (species[parentSlots[1]] == SPECIES_DITTO && GetBoxMonGender(&daycare->mons[parentSlots[0]].mon) != MON_FEMALE)
{
u8 temp = parentSlots[1];
u8 ditto = parentSlots[1];
parentSlots[1] = parentSlots[0];
parentSlots[0] = temp;
parentSlots[0] = ditto;
}
return eggSpecies;
}
static void _GiveEggFromDaycare(struct DayCare *daycare) // give_egg
static void _GiveEggFromDaycare(struct DayCare *daycare)
{
struct Pokemon egg;
u16 species;
u8 parentSlots[2]; // 0th index is "mother" daycare slot, 1st is "father"
u8 parentSlots[DAYCARE_MON_COUNT];
bool8 isEgg;
species = DetermineEggSpeciesAndParentSlots(daycare, parentSlots);
@@ -835,7 +834,7 @@ void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation)
u8 metLocation;
u8 isEgg;
CreateMon(mon, species, EGG_HATCH_LEVEL, 0x20, FALSE, 0, OT_ID_PLAYER_ID, 0);
CreateMon(mon, species, EGG_HATCH_LEVEL, 32, FALSE, 0, OT_ID_PLAYER_ID, 0);
metLevel = 0;
ball = ITEM_POKE_BALL;
language = LANGUAGE_JAPANESE;
@@ -846,7 +845,7 @@ void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation)
SetMonData(mon, MON_DATA_LANGUAGE, &language);
if (setHotSpringsLocation)
{
metLocation = 253; // hot springs; see PokemonSummaryScreen_PrintEggTrainerMemo
metLocation = METLOC_SPECIAL_EGG;
SetMonData(mon, MON_DATA_MET_LOCATION, &metLocation);
}
@@ -862,7 +861,7 @@ static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *
u8 language;
personality = daycare->offspringPersonality;
CreateMon(mon, species, EGG_HATCH_LEVEL, 0x20, TRUE, personality, OT_ID_PLAYER_ID, 0);
CreateMon(mon, species, EGG_HATCH_LEVEL, 32, TRUE, personality, OT_ID_PLAYER_ID, 0);
metLevel = 0;
ball = ITEM_POKE_BALL;
language = LANGUAGE_JAPANESE;
@@ -878,7 +877,7 @@ void GiveEggFromDaycare(void)
_GiveEggFromDaycare(&gSaveBlock1Ptr->daycare);
}
static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare)
static bool8 TryProduceOrHatchEgg(struct DayCare *daycare)
{
u32 i, validEggs = 0;
@@ -888,15 +887,16 @@ static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare)
daycare->mons[i].steps++, validEggs++;
}
// try to trigger poke sex
if (daycare->offspringPersonality == 0 && validEggs == 2 && (daycare->mons[1].steps & 0xFF) == 0xFF)
// Check if an egg should be produced
if (daycare->offspringPersonality == 0 && validEggs == DAYCARE_MON_COUNT && (daycare->mons[1].steps & 0xFF) == 0xFF)
{
u8 loveScore = GetDaycareCompatibilityScore(daycare);
if (loveScore > (Random() * 100u) / USHRT_MAX)
u8 compatability = GetDaycareCompatibilityScore(daycare);
if (compatability > (Random() * 100u) / USHRT_MAX)
TriggerPendingDaycareEgg();
}
if (++daycare->stepCounter == 255) // hatch an egg
// Hatch Egg
if (++daycare->stepCounter == 255)
{
u32 steps;
u8 toSub = GetEggStepsToSubtract();
@@ -909,7 +909,7 @@ static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare)
continue;
steps = GetMonData(&gPlayerParty[i], MON_DATA_FRIENDSHIP);
if (steps != 0) // subtract needed steps
if (steps != 0)
{
if (steps >= toSub)
steps -= toSub;
@@ -918,7 +918,7 @@ static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare)
SetMonData(&gPlayerParty[i], MON_DATA_FRIENDSHIP, &steps);
}
else // hatch the egg
else
{
gSpecialVar_0x8004 = i;
return TRUE;
@@ -926,12 +926,12 @@ static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare)
}
}
return FALSE; // no hatching
return FALSE;
}
bool8 ShouldEggHatch(void)
{
return _DoEggActions_CheckHatch(&gSaveBlock1Ptr->daycare);
return TryProduceOrHatchEgg(&gSaveBlock1Ptr->daycare);
}
static bool8 IsEggPending(struct DayCare *daycare)
@@ -947,20 +947,20 @@ static void _GetDaycareMonNicknames(struct DayCare *daycare)
u8 text[12];
if (GetBoxMonData(&daycare->mons[0].mon, MON_DATA_SPECIES) != 0)
{
GetBoxMonNick(&daycare->mons[0].mon, gStringVar1);
GetBoxMonNickname(&daycare->mons[0].mon, gStringVar1);
GetBoxMonData(&daycare->mons[0].mon, MON_DATA_OT_NAME, text);
StringCopy(gStringVar3, text);
}
if (GetBoxMonData(&daycare->mons[1].mon, MON_DATA_SPECIES) != 0)
{
GetBoxMonNick(&daycare->mons[1].mon, gStringVar2);
GetBoxMonNickname(&daycare->mons[1].mon, gStringVar2);
}
}
u16 GetSelectedMonNickAndSpecies(void)
u16 GetSelectedMonNicknameAndSpecies(void)
{
GetBoxMonNick(&gPlayerParty[GetCursorSelectionMonId()].box, gStringVar1);
GetBoxMonNickname(&gPlayerParty[GetCursorSelectionMonId()].box, gStringVar1);
return GetBoxMonData(&gPlayerParty[GetCursorSelectionMonId()].box, MON_DATA_SPECIES);
}
@@ -971,26 +971,19 @@ void GetDaycareMonNicknames(void)
u8 GetDaycareState(void)
{
// The daycare can be in 4 possible states:
// 0: default state--no deposited mons, no egg
// 1: there is an egg waiting for the player to pick it up
// 2: there is a single pokemon in the daycare
// 3: there are two pokemon in the daycare, no egg
u8 numMons;
if (IsEggPending(&gSaveBlock1Ptr->daycare))
{
// There is an Egg waiting for the player.
return 1;
return DAYCARE_EGG_WAITING;
}
numMons = CountPokemonInDaycare(&gSaveBlock1Ptr->daycare);
if (numMons != 0)
{
return numMons + 1;
return numMons + 1; // DAYCARE_ONE_MON or DAYCARE_TWO_MONS
}
return 0;
return DAYCARE_NO_MONS;
}
static u8 GetDaycarePokemonCount(void)
@@ -1002,15 +995,15 @@ static u8 GetDaycarePokemonCount(void)
return 0;
}
// Determine if the two given egg group lists contain any of the
// same egg groups.
static bool8 EggGroupsOverlap(u16 *eggGroups1, u16 *eggGroups2)
{
// Determine if the two given egg group lists contain any of the
// same egg groups.
s32 i, j;
for (i = 0; i < 2; i++)
for (i = 0; i < EGG_GROUPS_PER_MON; i++)
{
for (j = 0; j < 2; j++)
for (j = 0; j < EGG_GROUPS_PER_MON; j++)
{
if (eggGroups1[i] == eggGroups2[j])
return TRUE;
@@ -1023,12 +1016,12 @@ static bool8 EggGroupsOverlap(u16 *eggGroups1, u16 *eggGroups2)
static u8 GetDaycareCompatibilityScore(struct DayCare *daycare)
{
u32 i;
u16 eggGroups[2][2];
u16 species[2];
u32 trainerIds[2];
u32 genders[2];
u16 eggGroups[DAYCARE_MON_COUNT][EGG_GROUPS_PER_MON];
u16 species[DAYCARE_MON_COUNT];
u32 trainerIds[DAYCARE_MON_COUNT];
u32 genders[DAYCARE_MON_COUNT];
for (i = 0; i < 2; i++)
for (i = 0; i < DAYCARE_MON_COUNT; i++)
{
u32 personality;
@@ -1042,41 +1035,42 @@ static u8 GetDaycareCompatibilityScore(struct DayCare *daycare)
// check unbreedable egg group
if (eggGroups[0][0] == EGG_GROUP_UNDISCOVERED || eggGroups[1][0] == EGG_GROUP_UNDISCOVERED)
return 0;
return PARENTS_INCOMPATIBLE;
// two Ditto can't breed
if (eggGroups[0][0] == EGG_GROUP_DITTO && eggGroups[1][0] == EGG_GROUP_DITTO)
return 0;
return PARENTS_INCOMPATIBLE;
// now that we checked, one ditto can breed with any other mon
// one parent is Ditto
if (eggGroups[0][0] == EGG_GROUP_DITTO || eggGroups[1][0] == EGG_GROUP_DITTO)
{
if (trainerIds[0] == trainerIds[1]) // same trainer
return 20;
if (trainerIds[0] == trainerIds[1])
return PARENTS_LOW_COMPATIBILITY;
return 50; // different trainers, more chance of poke sex
return PARENTS_MED_COMPATABILITY;
}
// neither parent is Ditto
else
{
if (genders[0] == genders[1]) // no homo
return 0;
if (genders[0] == genders[1])
return PARENTS_INCOMPATIBLE;
if (genders[0] == MON_GENDERLESS || genders[1] == MON_GENDERLESS)
return 0;
if (!EggGroupsOverlap(eggGroups[0], eggGroups[1])) // not compatible with each other
return 0;
return PARENTS_INCOMPATIBLE;
if (!EggGroupsOverlap(eggGroups[0], eggGroups[1]))
return PARENTS_INCOMPATIBLE;
if (species[0] == species[1]) // same species
if (species[0] == species[1])
{
if (trainerIds[0] == trainerIds[1]) // same species and trainer
return 50;
if (trainerIds[0] == trainerIds[1])
return PARENTS_MED_COMPATABILITY; // same species, same trainer
return 70; // different trainers, same species
return PARENTS_MAX_COMPATABILITY; // same species, different trainers
}
else
{
if (trainerIds[0] != trainerIds[1]) // different trainers, different species
return 50;
if (trainerIds[0] != trainerIds[1])
return PARENTS_MED_COMPATABILITY; // different species, different trainers
return 20; // different species, same trainer
return PARENTS_LOW_COMPATIBILITY; // different species, same trainer
}
}
}
@@ -1093,13 +1087,13 @@ void SetDaycareCompatibilityString(void)
relationshipScore = GetDaycareCompatibilityScoreFromSave();
whichString = 0;
if (relationshipScore == 0)
if (relationshipScore == PARENTS_INCOMPATIBLE)
whichString = 3;
if (relationshipScore == 20)
if (relationshipScore == PARENTS_LOW_COMPATIBILITY)
whichString = 2;
if (relationshipScore == 50)
if (relationshipScore == PARENTS_MED_COMPATABILITY)
whichString = 1;
if (relationshipScore == 70)
if (relationshipScore == PARENTS_MAX_COMPATABILITY)
whichString = 0;
StringCopy(gStringVar4, sCompatibilityMessages[whichString]);
@@ -1108,20 +1102,20 @@ void SetDaycareCompatibilityString(void)
bool8 NameHasGenderSymbol(const u8 *name, u8 genderRatio)
{
u8 i;
u8 symbolsCount[2]; // male, female
symbolsCount[0] = symbolsCount[1] = 0;
u8 symbolsCount[GENDER_COUNT];
symbolsCount[MALE] = symbolsCount[FEMALE] = 0;
for (i = 0; name[i] != EOS; i++)
{
if (name[i] == CHAR_MALE)
symbolsCount[0]++;
symbolsCount[MALE]++;
if (name[i] == CHAR_FEMALE)
symbolsCount[1]++;
symbolsCount[FEMALE]++;
}
if (genderRatio == MON_MALE && symbolsCount[0] != 0 && symbolsCount[1] == 0)
if (genderRatio == MON_MALE && symbolsCount[MALE] != 0 && symbolsCount[FEMALE] == 0)
return TRUE;
if (genderRatio == MON_FEMALE && symbolsCount[1] != 0 && symbolsCount[0] == 0)
if (genderRatio == MON_FEMALE && symbolsCount[FEMALE] != 0 && symbolsCount[MALE] == 0)
return TRUE;
return FALSE;
@@ -1150,13 +1144,13 @@ static u8 *AppendMonGenderSymbol(u8 *name, struct BoxPokemon *boxMon)
static void GetDaycareLevelMenuText(struct DayCare *daycare, u8 *dest)
{
u8 monNames[2][20];
u8 monNames[DAYCARE_MON_COUNT][20];
u8 i;
*dest = EOS;
for (i = 0; i < 2; i++)
for (i = 0; i < DAYCARE_MON_COUNT; i++)
{
GetBoxMonNick(&daycare->mons[i].mon, monNames[i]);
GetBoxMonNickname(&daycare->mons[i].mon, monNames[i]);
AppendMonGenderSymbol(monNames[i], &daycare->mons[i].mon);
}
@@ -1174,7 +1168,7 @@ static void GetDaycareLevelMenuLevelText(struct DayCare *daycare, u8 *dest)
u8 text[20];
*dest = EOS;
for (i = 0; i < 2; i++)
for (i = 0; i < DAYCARE_MON_COUNT; i++)
{
StringAppend(dest, gText_Lv);
level = GetLevelAfterDaycareSteps(&daycare->mons[i].mon, daycare->mons[i].steps);
@@ -1206,13 +1200,13 @@ static void DaycareAddTextPrinter(u8 windowId, const u8 *text, u32 x, u32 y)
AddTextPrinter(&printer, 0xFF, NULL);
}
static void DaycarePrintMonNick(struct DayCare *daycare, u8 windowId, u32 daycareSlotId, u32 y)
static void DaycarePrintMonNickname(struct DayCare *daycare, u8 windowId, u32 daycareSlotId, u32 y)
{
u8 nick[POKEMON_NAME_LENGTH * 2];
u8 nickname[POKEMON_NAME_LENGTH * 2];
GetBoxMonNick(&daycare->mons[daycareSlotId].mon, nick);
AppendMonGenderSymbol(nick, &daycare->mons[daycareSlotId].mon);
DaycareAddTextPrinter(windowId, nick, 8, y);
GetBoxMonNickname(&daycare->mons[daycareSlotId].mon, nickname);
AppendMonGenderSymbol(nickname, &daycare->mons[daycareSlotId].mon);
DaycareAddTextPrinter(windowId, nickname, 8, y);
}
static void DaycarePrintMonLvl(struct DayCare *daycare, u8 windowId, u32 daycareSlotId, u32 y)
@@ -1234,7 +1228,7 @@ static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y)
{
if (daycareSlotId < (unsigned) DAYCARE_MON_COUNT)
{
DaycarePrintMonNick(&gSaveBlock1Ptr->daycare, windowId, daycareSlotId, y);
DaycarePrintMonNickname(&gSaveBlock1Ptr->daycare, windowId, daycareSlotId, y);
DaycarePrintMonLvl(&gSaveBlock1Ptr->daycare, windowId, daycareSlotId, y);
}
}
@@ -1254,8 +1248,8 @@ static void Task_HandleDaycareLevelMenuInput(u8 taskId)
case 1:
gSpecialVar_Result = input;
break;
case 5:
gSpecialVar_Result = 2;
case DAYCARE_LEVEL_MENU_EXIT:
gSpecialVar_Result = DAYCARE_EXITED_LEVEL_MENU;
break;
}
DestroyListMenuTask(gTasks[taskId].tMenuListTaskId, NULL, NULL);
@@ -1266,7 +1260,7 @@ static void Task_HandleDaycareLevelMenuInput(u8 taskId)
}
else if (gMain.newKeys & B_BUTTON)
{
gSpecialVar_Result = 2;
gSpecialVar_Result = DAYCARE_EXITED_LEVEL_MENU;
DestroyListMenuTask(gTasks[taskId].tMenuListTaskId, NULL, NULL);
ClearStdWindowAndFrame(gTasks[taskId].tWindowId, TRUE);
RemoveWindow(gTasks[taskId].tWindowId);
+2 -2
View File
@@ -2043,7 +2043,7 @@ const u32 *GetDecorationIconPicOrPalette(u16 decor, u8 mode)
if (decor > NUM_DECORATIONS)
decor = DECOR_NONE;
return gUnknown_085A6BE8[decor][mode];
return gDecorIconTable[decor][mode];
}
u8 AddDecorationIconObjectFromEventObject(u16 tilesTag, u16 paletteTag, u8 decor)
@@ -2095,7 +2095,7 @@ u8 AddDecorationIconObject(u8 decor, s16 x, s16 y, u8 priority, u16 tilesTag, u1
gSprites[spriteId].pos2.x = x + 4;
gSprites[spriteId].pos2.y = y + 4;
}
else if (gUnknown_085A6BE8[decor][0] == NULL)
else if (gDecorIconTable[decor][0] == NULL)
{
spriteId = AddDecorationIconObjectFromEventObject(tilesTag, paletteTag, decor);
if (spriteId == MAX_SPRITES)
+19 -19
View File
@@ -56,7 +56,7 @@ struct EggHatchData
extern const u32 gUnknown_08331F60[]; // tilemap gameboy circle
extern const u8 gText_HatchedFromEgg[];
extern const u8 gText_NickHatchPrompt[];
extern const u8 gText_NicknameHatchPrompt[];
static void Task_EggHatch(u8 taskID);
static void CB2_EggHatch_0(void);
@@ -298,13 +298,13 @@ static void CreatedHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
u16 species;
u32 personality, pokerus;
u8 i, friendship, language, gameMet, markings, obedience;
u16 moves[4];
u16 moves[MAX_MON_MOVES];
u32 ivs[NUM_STATS];
species = GetMonData(egg, MON_DATA_SPECIES);
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
moves[i] = GetMonData(egg, MON_DATA_MOVE1 + i);
}
@@ -324,7 +324,7 @@ static void CreatedHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
CreateMon(temp, species, EGG_HATCH_LEVEL, 32, TRUE, personality, OT_ID_PLAYER_ID, 0);
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_MON_MOVES; i++)
{
SetMonData(temp, MON_DATA_MOVE1 + i, &moves[i]);
}
@@ -368,7 +368,7 @@ static void AddHatchedMonToParty(u8 id)
GetSetPokedexFlag(pokeNum, FLAG_SET_SEEN);
GetSetPokedexFlag(pokeNum, FLAG_SET_CAUGHT);
GetMonNick(mon, gStringVar1);
GetMonNickname2(mon, gStringVar1);
ball = ITEM_POKE_BALL;
SetMonData(mon, MON_DATA_POKEBALL, &ball);
@@ -388,17 +388,17 @@ void ScriptHatchMon(void)
AddHatchedMonToParty(gSpecialVar_0x8004);
}
static bool8 sub_807158C(struct DayCare *daycare, u8 daycareId)
static bool8 _CheckDaycareMonReceivedMail(struct DayCare *daycare, u8 daycareId)
{
u8 nick[0x20];
u8 nickname[32];
struct DaycareMon *daycareMon = &daycare->mons[daycareId];
GetBoxMonNick(&daycareMon->mon, nick);
if (daycareMon->mail.message.itemId != 0
&& (StringCompareWithoutExtCtrlCodes(nick, daycareMon->mail.monName) != 0
GetBoxMonNickname(&daycareMon->mon, nickname);
if (daycareMon->mail.message.itemId != ITEM_NONE
&& (StringCompareWithoutExtCtrlCodes(nickname, daycareMon->mail.monName) != 0
|| StringCompareWithoutExtCtrlCodes(gSaveBlock2Ptr->playerName, daycareMon->mail.OT_name) != 0))
{
StringCopy(gStringVar1, nick);
StringCopy(gStringVar1, nickname);
TVShowConvertInternationalString(gStringVar2, daycareMon->mail.OT_name, daycareMon->mail.gameLanguage);
TVShowConvertInternationalString(gStringVar3, daycareMon->mail.monName, daycareMon->mail.monLanguage);
return TRUE;
@@ -406,9 +406,9 @@ static bool8 sub_807158C(struct DayCare *daycare, u8 daycareId)
return FALSE;
}
bool8 sub_8071614(void)
bool8 CheckDaycareMonReceivedMail(void)
{
return sub_807158C(&gSaveBlock1Ptr->daycare, gSpecialVar_0x8004);
return _CheckDaycareMonReceivedMail(&gSaveBlock1Ptr->daycare, gSpecialVar_0x8004);
}
static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16* speciesLoc)
@@ -634,7 +634,7 @@ static void CB2_EggHatch_1(void)
}
break;
case 5:
GetMonNick(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar1);
GetMonNickname2(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar1);
StringExpandPlaceholders(gStringVar4, gText_HatchedFromEgg);
EggHatchPrintMessage(sEggHatchData->windowId, gStringVar4, 0, 3, 0xFF);
PlayFanfare(MUS_FANFA5);
@@ -651,8 +651,8 @@ static void CB2_EggHatch_1(void)
sEggHatchData->CB2_state++;
break;
case 8:
GetMonNick(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar1);
StringExpandPlaceholders(gStringVar4, gText_NickHatchPrompt);
GetMonNickname2(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar1);
StringExpandPlaceholders(gStringVar4, gText_NicknameHatchPrompt);
EggHatchPrintMessage(sEggHatchData->windowId, gStringVar4, 0, 2, 1);
sEggHatchData->CB2_state++;
break;
@@ -668,7 +668,7 @@ static void CB2_EggHatch_1(void)
switch (Menu_ProcessInputNoWrapClearOnChoose())
{
case 0:
GetMonNick(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar3);
GetMonNickname2(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar3);
species = GetMonData(&gPlayerParty[sEggHatchData->eggPartyID], MON_DATA_SPECIES);
gender = GetMonGender(&gPlayerParty[sEggHatchData->eggPartyID]);
personality = GetMonData(&gPlayerParty[sEggHatchData->eggPartyID], MON_DATA_PERSONALITY, 0);
@@ -880,9 +880,9 @@ u8 GetEggStepsToSubtract(void)
return 1;
}
u16 sub_80722E0(void)
u16 CountPartyAliveNonEggMons(void)
{
u16 aliveNonEggMonsCount = CountStorageNonEggMons();
aliveNonEggMonsCount += CountPartyAliveNonEggMonsExcept(6);
aliveNonEggMonsCount += CountPartyAliveNonEggMonsExcept(PARTY_SIZE);
return aliveNonEggMonsCount;
}
+2 -2
View File
@@ -92,7 +92,7 @@ void ScriptUnfreezeEventObjects(void)
{
u8 playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]);
sub_80D338C();
ScriptMovement_UnfreezeEventObjects();
UnfreezeEventObjects();
}
@@ -104,7 +104,7 @@ void sub_8098524(void)
EventObjectClearHeldMovementIfFinished(&gEventObjects[gSelectedEventObject]);
playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]);
sub_80D338C();
ScriptMovement_UnfreezeEventObjects();
UnfreezeEventObjects();
}
+864 -785
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -794,15 +794,15 @@ static void sub_81A17A0(void)
case 0:
break;
case 1:
sub_813A878(0);
FrontierGamblerSetWonOrLost(FALSE);
VarSet(VAR_TEMP_0, gSaveBlock2Ptr->frontier.field_CA8);
break;
case 4:
sub_813A878(0);
FrontierGamblerSetWonOrLost(FALSE);
VarSet(VAR_TEMP_0, gSaveBlock2Ptr->frontier.field_CA8);
break;
case 3:
sub_813A878(1);
FrontierGamblerSetWonOrLost(TRUE);
VarSet(VAR_TEMP_0, gSaveBlock2Ptr->frontier.field_CA8);
break;
case 2:
+1 -1
View File
@@ -27,7 +27,7 @@ static void ReshowPCMenuAfterHallOfFamePC(void)
{
ScriptContext2_Enable();
Overworld_PlaySpecialMapMusic();
ScrSpecial_CreatePCMenu();
ScriptMenu_CreatePCMultichoice();
ScriptMenu_DisplayPCStartupPrompt();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK);
CreateTask(Task_WaitForPaletteFade, 10);
+2 -2
View File
@@ -45,7 +45,7 @@ int GetMaxWidthInMenuTable(const struct MenuAction *str, int arg1)
var = stringWidth;
}
return convert_pixel_width_to_tile_width(var);
return ConvertPixelWidthToTileWidth(var);
}
int sub_81DB3D8(const struct MenuAction *str, const u8* arg1, int arg2)
@@ -59,7 +59,7 @@ int sub_81DB3D8(const struct MenuAction *str, const u8* arg1, int arg2)
var = stringWidth;
}
return convert_pixel_width_to_tile_width(var);
return ConvertPixelWidthToTileWidth(var);
}
int Intl_GetListMenuWidth(const struct ListMenuTemplate *listMenu)
+1 -1
View File
@@ -1290,7 +1290,7 @@ static bool32 sub_81963F0(u8 taskId)
sub_81973A4();
playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]);
sub_80D338C();
ScriptMovement_UnfreezeEventObjects();
UnfreezeEventObjects();
ScriptContext2_Disable();
}
+1 -1
View File
@@ -1155,7 +1155,7 @@ static void PrintStoryList(void)
if (curWidth > width)
width = curWidth;
}
sStorytellerWindowId = CreateWindowFromRect(0, 0, convert_pixel_width_to_tile_width(width), GetFreeStorySlot() * 2 + 2);
sStorytellerWindowId = CreateWindowFromRect(0, 0, ConvertPixelWidthToTileWidth(width), GetFreeStorySlot() * 2 + 2);
SetStandardWindowBorderStyle(sStorytellerWindowId, 0);
for (i = 0; i < 4; i++)
{
+4 -4
View File
@@ -350,7 +350,7 @@ void sub_811FAA4(u8 markings, s16 x, s16 y)
u16 i;
sMenu->cursorPos = 0;
sMenu->markings = markings;
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_MON_MARKINGS; i++)
sMenu->markingsArray[i] = (sMenu->markings >> i) & 1;
sub_811FC80(x, y, sMenu->baseTileTag, sMenu->basePaletteTag);
}
@@ -371,7 +371,7 @@ void sub_811FAF8(void)
DestroySprite(sMenu->menuWindowSprites[i]);
sMenu->menuWindowSprites[i] = NULL;
}
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_MON_MARKINGS; i++)
{
if (!sMenu->menuMarkingSprites[i])
return;
@@ -422,7 +422,7 @@ bool8 sub_811FBA4(void)
{
case 4:
sMenu->markings = 0;
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_MON_MARKINGS; i++)
sMenu->markings |= sMenu->markingsArray[i] << i;
return FALSE;
case 5:
@@ -498,7 +498,7 @@ static void sub_811FC80(s16 x, s16 y, u16 baseTileTag, u16 basePaletteTag)
sprTemplate.callback = sub_811FF40;
sprTemplate.oam = &gUnknown_0859EE84;
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_MON_MARKINGS; i++)
{
spriteId = CreateSprite(&sprTemplate, x + 32, y + 16 + 16 * i, 0);
if (spriteId != MAX_SPRITES)
+1 -1
View File
@@ -55,7 +55,7 @@ void FinishMossdeepGymTiles(void)
id = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
EventObjectClearHeldMovementIfFinished(&gEventObjects[id]);
sub_80D338C();
ScriptMovement_UnfreezeEventObjects();
}
u16 MossdeepGym_MoveEvents(u8 arg0)
+1 -1
View File
@@ -154,7 +154,7 @@ static EWRAM_DATA struct
{
u8 state;
u8 heartSpriteIds[16]; /*0x001*/
u16 movesToLearn[4]; /*0x012*/
u16 movesToLearn[MAX_MON_MOVES]; /*0x012*/
u8 filler1A[0x44 - 0x1A]; /*0x01A*/
u8 partyMon; /*0x044*/
u8 moveSlot; /*0x045*/
+4 -4
View File
@@ -541,16 +541,16 @@ static void DisplaySentToPCMessage(void)
{
u8 stringToDisplay = 0;
if (!sub_813B260())
if (!IsDestinationBoxFull())
{
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_STORAGE_UNKNOWN)));
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON)));
StringCopy(gStringVar2, gNamingScreenData->destBuffer);
}
else
{
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_STORAGE_UNKNOWN)));
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON)));
StringCopy(gStringVar2, gNamingScreenData->destBuffer);
StringCopy(gStringVar3, GetBoxNamePtr(get_unknown_box_id()));
StringCopy(gStringVar3, GetBoxNamePtr(GetPCBoxToSendMon()));
stringToDisplay = 2;
}
+1 -1
View File
@@ -81,7 +81,7 @@ u32 GetTrainerId(u8 *trainerId)
void CopyTrainerId(u8 *dst, u8 *src)
{
s32 i;
for (i = 0; i < 4; i++)
for (i = 0; i < TRAINER_ID_LENGTH; i++)
dst[i] = src[i];
}
+30 -23
View File
@@ -48,6 +48,13 @@ enum
WIN_OPTIONS
};
#define YPOS_TEXTSPEED (MENUITEM_TEXTSPEED * 16)
#define YPOS_BATTLESCENE (MENUITEM_BATTLESCENE * 16)
#define YPOS_BATTLESTYLE (MENUITEM_BATTLESTYLE * 16)
#define YPOS_SOUND (MENUITEM_SOUND * 16)
#define YPOS_BUTTONMODE (MENUITEM_BUTTONMODE * 16)
#define YPOS_FRAMETYPE (MENUITEM_FRAMETYPE * 16)
// this file's functions
static void Task_OptionMenuFadeIn(u8 taskId);
static void Task_OptionMenuProcessInput(u8 taskId);
@@ -80,13 +87,13 @@ static const u8 sEqualSignGfx[] = INCBIN_U8("graphics/misc/option_menu_equals_si
static const u8 *const sOptionMenuItemsNames[MENUITEM_COUNT] =
{
gText_TextSpeed,
gText_BattleScene,
gText_BattleStyle,
gText_Sound,
gText_ButtonMode,
gText_Frame,
gText_OptionMenuCancel,
[MENUITEM_TEXTSPEED] = gText_TextSpeed,
[MENUITEM_BATTLESCENE] = gText_BattleScene,
[MENUITEM_BATTLESTYLE] = gText_BattleStyle,
[MENUITEM_SOUND] = gText_Sound,
[MENUITEM_BUTTONMODE] = gText_ButtonMode,
[MENUITEM_FRAMETYPE] = gText_Frame,
[MENUITEM_CANCEL] = gText_OptionMenuCancel,
};
static const struct WindowTemplate sOptionMenuWinTemplates[] =
@@ -280,12 +287,12 @@ static void Task_OptionMenuProcessInput(u8 taskId)
if (gTasks[taskId].data[TD_MENUSELECTION] > 0)
gTasks[taskId].data[TD_MENUSELECTION]--;
else
gTasks[taskId].data[TD_MENUSELECTION] = 6;
gTasks[taskId].data[TD_MENUSELECTION] = MENUITEM_CANCEL;
HighlightOptionMenuItem(gTasks[taskId].data[TD_MENUSELECTION]);
}
else if (gMain.newKeys & DPAD_DOWN)
{
if (gTasks[taskId].data[TD_MENUSELECTION] <= 5)
if (gTasks[taskId].data[TD_MENUSELECTION] < MENUITEM_CANCEL)
gTasks[taskId].data[TD_MENUSELECTION]++;
else
gTasks[taskId].data[TD_MENUSELECTION] = 0;
@@ -431,7 +438,7 @@ static void TextSpeed_DrawChoices(u8 selection)
styles[2] = 0;
styles[selection] = 1;
DrawOptionMenuChoice(gText_TextSpeedSlow, 104, 0, styles[0]);
DrawOptionMenuChoice(gText_TextSpeedSlow, 104, YPOS_TEXTSPEED, styles[0]);
widthSlow = GetStringWidth(1, gText_TextSpeedSlow, 0);
widthMid = GetStringWidth(1, gText_TextSpeedMid, 0);
@@ -439,9 +446,9 @@ static void TextSpeed_DrawChoices(u8 selection)
widthMid -= 94;
xMid = (widthSlow - widthMid - widthFast) / 2 + 104;
DrawOptionMenuChoice(gText_TextSpeedMid, xMid, 0, styles[1]);
DrawOptionMenuChoice(gText_TextSpeedMid, xMid, YPOS_TEXTSPEED, styles[1]);
DrawOptionMenuChoice(gText_TextSpeedFast, GetStringRightAlignXOffset(1, gText_TextSpeedFast, 198), 0, styles[2]);
DrawOptionMenuChoice(gText_TextSpeedFast, GetStringRightAlignXOffset(1, gText_TextSpeedFast, 198), YPOS_TEXTSPEED, styles[2]);
}
static u8 BattleScene_ProcessInput(u8 selection)
@@ -463,8 +470,8 @@ static void BattleScene_DrawChoices(u8 selection)
styles[1] = 0;
styles[selection] = 1;
DrawOptionMenuChoice(gText_BattleSceneOn, 104, 16, styles[0]);
DrawOptionMenuChoice(gText_BattleSceneOff, GetStringRightAlignXOffset(1, gText_BattleSceneOff, 198), 16, styles[1]);
DrawOptionMenuChoice(gText_BattleSceneOn, 104, YPOS_BATTLESCENE, styles[0]);
DrawOptionMenuChoice(gText_BattleSceneOff, GetStringRightAlignXOffset(1, gText_BattleSceneOff, 198), YPOS_BATTLESCENE, styles[1]);
}
static u8 BattleStyle_ProcessInput(u8 selection)
@@ -486,8 +493,8 @@ static void BattleStyle_DrawChoices(u8 selection)
styles[1] = 0;
styles[selection] = 1;
DrawOptionMenuChoice(gText_BattleStyleShift, 104, 32, styles[0]);
DrawOptionMenuChoice(gText_BattleStyleSet, GetStringRightAlignXOffset(1, gText_BattleStyleSet, 198), 32, styles[1]);
DrawOptionMenuChoice(gText_BattleStyleShift, 104, YPOS_BATTLESTYLE, styles[0]);
DrawOptionMenuChoice(gText_BattleStyleSet, GetStringRightAlignXOffset(1, gText_BattleStyleSet, 198), YPOS_BATTLESTYLE, styles[1]);
}
static u8 Sound_ProcessInput(u8 selection)
@@ -510,8 +517,8 @@ static void Sound_DrawChoices(u8 selection)
styles[1] = 0;
styles[selection] = 1;
DrawOptionMenuChoice(gText_SoundMono, 104, 48, styles[0]);
DrawOptionMenuChoice(gText_SoundStereo, GetStringRightAlignXOffset(1, gText_SoundStereo, 198), 48, styles[1]);
DrawOptionMenuChoice(gText_SoundMono, 104, YPOS_SOUND, styles[0]);
DrawOptionMenuChoice(gText_SoundStereo, GetStringRightAlignXOffset(1, gText_SoundStereo, 198), YPOS_SOUND, styles[1]);
}
static u8 FrameType_ProcessInput(u8 selection)
@@ -568,8 +575,8 @@ static void FrameType_DrawChoices(u8 selection)
text[i] = EOS;
DrawOptionMenuChoice(gText_FrameType, 104, 80, 0);
DrawOptionMenuChoice(text, 128, 80, 1);
DrawOptionMenuChoice(gText_FrameType, 104, YPOS_FRAMETYPE, 0);
DrawOptionMenuChoice(text, 128, YPOS_FRAMETYPE, 1);
}
static u8 ButtonMode_ProcessInput(u8 selection)
@@ -605,7 +612,7 @@ static void ButtonMode_DrawChoices(u8 selection)
styles[2] = 0;
styles[selection] = 1;
DrawOptionMenuChoice(gText_ButtonTypeNormal, 104, 64, styles[0]);
DrawOptionMenuChoice(gText_ButtonTypeNormal, 104, YPOS_BUTTONMODE, styles[0]);
widthNormal = GetStringWidth(1, gText_ButtonTypeNormal, 0);
widthLR = GetStringWidth(1, gText_ButtonTypeLR, 0);
@@ -613,9 +620,9 @@ static void ButtonMode_DrawChoices(u8 selection)
widthLR -= 94;
xLR = (widthNormal - widthLR - widthLA) / 2 + 104;
DrawOptionMenuChoice(gText_ButtonTypeLR, xLR, 64, styles[1]);
DrawOptionMenuChoice(gText_ButtonTypeLR, xLR, YPOS_BUTTONMODE, styles[1]);
DrawOptionMenuChoice(gText_ButtonTypeLEqualsA, GetStringRightAlignXOffset(1, gText_ButtonTypeLEqualsA, 198), 64, styles[2]);
DrawOptionMenuChoice(gText_ButtonTypeLEqualsA, GetStringRightAlignXOffset(1, gText_ButtonTypeLEqualsA, 198), YPOS_BUTTONMODE, styles[2]);
}
static void DrawTextOption(void)
+3 -3
View File
@@ -1759,7 +1759,7 @@ void CB2_ContinueSavedGame(void)
static void FieldClearVBlankHBlankCallbacks(void)
{
if (warp0_in_pokecenter() == TRUE)
if (UsedPokemonCenterWarp() == TRUE)
CloseLink();
if (gWirelessCommType != 0)
@@ -2435,7 +2435,7 @@ static void UpdateAllLinkPlayers(u16 *keys, s32 selfId)
struct TradeRoomPlayer trainer;
s32 i;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_LINK_PLAYERS; i++)
{
u8 key = keys[i];
u16 setFacing = FACING_NONE;
@@ -3026,7 +3026,7 @@ static s32 sub_80878E4(u8 linkPlayerId)
static u8 GetLinkPlayerIdAt(s16 x, s16 y)
{
u8 i;
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_LINK_PLAYERS; i++)
{
if (gLinkPlayerEventObjects[i].active
&& (gLinkPlayerEventObjects[i].movementMode == 0 || gLinkPlayerEventObjects[i].movementMode == 2))
+1 -1
View File
@@ -3,7 +3,6 @@
#include "battle.h"
#include "battle_controllers.h"
#include "battle_message.h"
#include "berry.h"
#include "bg.h"
#include "decompress.h"
#include "event_data.h"
@@ -30,6 +29,7 @@
#include "task.h"
#include "text.h"
#include "text_window.h"
#include "constants/berry.h"
#include "constants/items.h"
#include "constants/songs.h"
#include "constants/rgb.h"
+23 -23
View File
@@ -2989,11 +2989,11 @@ u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove)
void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move)
{
s32 i;
u16 moves[4];
u8 pp[4];
u16 moves[MAX_MON_MOVES];
u8 pp[MAX_MON_MOVES];
u8 ppBonuses;
for (i = 0; i < 3; i++)
for (i = 0; i < MAX_MON_MOVES - 1; i++)
{
moves[i] = GetMonData(mon, MON_DATA_MOVE2 + i, NULL);
pp[i] = GetMonData(mon, MON_DATA_PP2 + i, NULL);
@@ -3016,11 +3016,11 @@ void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move)
void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
{
s32 i;
u16 moves[4];
u8 pp[4];
u16 moves[MAX_MON_MOVES];
u8 pp[MAX_MON_MOVES];
u8 ppBonuses;
for (i = 0; i < 3; i++)
for (i = 0; i < MAX_MON_MOVES - 1; i++)
{
moves[i] = GetBoxMonData(boxMon, MON_DATA_MOVE2 + i, NULL);
pp[i] = GetBoxMonData(boxMon, MON_DATA_PP2 + i, NULL);
@@ -3304,21 +3304,21 @@ u8 CountAliveMonsInBattle(u8 caseId)
switch (caseId)
{
case BATTLE_ALIVE_EXCEPT_ACTIVE:
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
if (i != gActiveBattler && !(gAbsentBattlerFlags & gBitTable[i]))
retVal++;
}
break;
case BATTLE_ALIVE_ATK_SIDE:
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
if (GetBattlerSide(i) == GetBattlerSide(gBattlerAttacker) && !(gAbsentBattlerFlags & gBitTable[i]))
retVal++;
}
break;
case BATTLE_ALIVE_DEF_SIDE:
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
if (GetBattlerSide(i) == GetBattlerSide(gBattlerTarget) && !(gAbsentBattlerFlags & gBitTable[i]))
retVal++;
@@ -4329,7 +4329,7 @@ u8 SendMonToPC(struct Pokemon* mon)
{
s32 boxNo, boxPos;
set_unknown_box_id(VarGet(VAR_STORAGE_UNKNOWN));
SetPCBoxToSendMon(VarGet(VAR_PC_BOX_TO_SEND_MON));
boxNo = StorageGetCurrentBox();
@@ -4344,9 +4344,9 @@ u8 SendMonToPC(struct Pokemon* mon)
CopyMon(checkingMon, &mon->box, sizeof(mon->box));
gSpecialVar_MonBoxId = boxNo;
gSpecialVar_MonBoxPos = boxPos;
if (get_unknown_box_id() != boxNo)
FlagClear(FLAG_SYS_STORAGE_UNKNOWN_FLAG);
VarSet(VAR_STORAGE_UNKNOWN, boxNo);
if (GetPCBoxToSendMon() != boxNo)
FlagClear(FLAG_SHOWN_BOX_WAS_FULL_MESSAGE);
VarSet(VAR_PC_BOX_TO_SEND_MON, boxNo);
return MON_GIVEN_TO_PC;
}
}
@@ -4817,11 +4817,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
{
if (evCount >= MAX_TOTAL_EVS)
return TRUE;
if (dataSigned >= 100)
if (dataSigned >= EV_ITEM_RAISE_LIMIT)
break;
if (dataSigned + r2 > 100)
r5 = 100 - (dataSigned + r2) + r2;
if (dataSigned + r2 > EV_ITEM_RAISE_LIMIT)
r5 = EV_ITEM_RAISE_LIMIT - (dataSigned + r2) + r2;
else
r5 = r2;
@@ -5021,11 +5021,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
{
if (evCount >= MAX_TOTAL_EVS)
return TRUE;
if (dataSigned >= 100)
if (dataSigned >= EV_ITEM_RAISE_LIMIT)
break;
if (dataSigned + r2 > 100)
r5 = 100 - (dataSigned + r2) + r2;
if (dataSigned + r2 > EV_ITEM_RAISE_LIMIT)
r5 = EV_ITEM_RAISE_LIMIT - (dataSigned + r2) + r2;
else
r5 = r2;
@@ -6096,7 +6096,7 @@ u32 CanSpeciesLearnTMHM(u16 species, u8 tm)
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves)
{
u16 learnedMoves[4];
u16 learnedMoves[MAX_MON_MOVES];
u8 numMoves = 0;
u16 species = GetMonData(mon, MON_DATA_SPECIES, 0);
u8 level = GetMonData(mon, MON_DATA_LEVEL, 0);
@@ -6146,7 +6146,7 @@ u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves)
u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
{
u16 learnedMoves[4];
u16 learnedMoves[MAX_MON_MOVES];
u16 moves[20];
u8 numMoves = 0;
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
@@ -6683,7 +6683,7 @@ u8 sub_806EF08(u8 arg0)
var = (arg0 != 0) ? 2 : 0;
break;
}
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_LINK_PLAYERS; i++)
{
if (gLinkPlayers[i].id == (s16)(var))
break;
@@ -6706,7 +6706,7 @@ u8 sub_806EF84(u8 arg0, u8 arg1)
var = (arg0 != 0) ? 2 : 0;
break;
}
for (i = 0; i < 4; i++)
for (i = 0; i < MAX_LINK_PLAYERS; i++)
{
if (gLinkPlayers[i].id == (s16)(var))
break;
+5 -5
View File
@@ -453,7 +453,7 @@ EWRAM_DATA static bool8 sInPartyMenu = 0;
EWRAM_DATA static u8 sCurrentBoxOption = 0;
EWRAM_DATA static u8 gUnknown_02039D0E = 0;
EWRAM_DATA static u8 sWhichToReshow = 0;
EWRAM_DATA static u8 gUnknown_02039D10 = 0;
EWRAM_DATA static u8 sLastUsedBox = 0;
EWRAM_DATA static u16 gUnknown_02039D12 = 0;
EWRAM_DATA static struct Pokemon gUnknown_02039D14 = {0};
EWRAM_DATA static s8 sBoxCursorArea = 0;
@@ -2167,7 +2167,7 @@ static void Cb2_EnterPSS(u8 boxOption)
gUnknown_02039D12 = 0;
sPSSData->state = 0;
sPSSData->taskId = CreateTask(Cb_InitPSS, 3);
gUnknown_02039D10 = StorageGetCurrentBox();
sLastUsedBox = StorageGetCurrentBox();
SetMainCallback2(Cb2_PSS);
}
}
@@ -4366,10 +4366,10 @@ static bool8 DoShowPartyMenu(void)
static void sub_80CABE0(void)
{
if (gUnknown_02039D10 != StorageGetCurrentBox())
if (sLastUsedBox != StorageGetCurrentBox())
{
FlagClear(FLAG_SYS_STORAGE_UNKNOWN_FLAG);
VarSet(VAR_STORAGE_UNKNOWN, StorageGetCurrentBox());
FlagClear(FLAG_SHOWN_BOX_WAS_FULL_MESSAGE);
VarSet(VAR_PC_BOX_TO_SEND_MON, StorageGetCurrentBox());
}
}
+22 -22
View File
@@ -121,8 +121,8 @@ static EWRAM_DATA struct PokemonSummaryScreenData
u8 metGame; // 0xB
u32 pid; // 0xC
u32 exp; // 0x10
u16 moves[4]; // 0x14
u8 pp[4]; // 0x1C
u16 moves[MAX_MON_MOVES]; // 0x14
u8 pp[MAX_MON_MOVES]; // 0x1C
u16 currentHP; // 0x20
u16 maxHP; // 0x22
u16 atk; // 0x24
@@ -224,10 +224,10 @@ static void DrawExperienceProgressBar(struct Pokemon* mon);
static void DrawContestMoveHearts(u16 move);
static void LimitEggSummaryPageDisplay(void);
static void ResetWindows(void);
static void sub_81C25E8(void);
static void sub_81C2628(void);
static void sub_81C2794(void);
static void sub_81C27DC(struct Pokemon *mon, u16 a);
static void PrintMonInfo(void);
static void PrintNotEggInfo(void);
static void PrintEggInfo(void);
static void PrintGenderSymbol(struct Pokemon *mon, u16 a);
static void PrintPageNamesAndStatsPageToWindows(void);
static void CreatePageWindowTilemaps(u8 a);
static void ClearPageWindowTilemaps(u8 a);
@@ -1173,7 +1173,7 @@ static bool8 SummaryScreen_LoadGraphics(void)
gMain.state++;
break;
case 11:
sub_81C25E8();
PrintMonInfo();
gMain.state++;
break;
case 12:
@@ -1449,7 +1449,7 @@ static void sub_81C0348(void)
DrawPokerusCuredSymbol(&sMonSummaryScreen->currentMon);
}
static void sub_81C0434(void)
static void FreeSummaryScreen(void)
{
FreeAllWindowBuffers();
Free(sMonSummaryScreen);
@@ -1474,7 +1474,7 @@ static void CloseSummaryScreen(u8 taskId)
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
if (gMonSpritesGfxPtr == 0)
sub_806F47C(0);
sub_81C0434();
FreeSummaryScreen();
DestroyTask(taskId);
}
}
@@ -1625,7 +1625,7 @@ static void sub_81C0704(u8 taskId)
SetTypeIcons();
break;
case 10:
sub_81C25E8();
PrintMonInfo();
break;
case 11:
PrintPageSpecificText(sMonSummaryScreen->currPageIndex);
@@ -2571,7 +2571,7 @@ static void DrawPokerusCuredSymbol(struct Pokemon *mon) // This checks if the mo
schedule_bg_copy_tilemap_to_vram(3);
}
static void sub_81C228C(bool8 isMonShiny)
static void SetDexNumberColor(bool8 isMonShiny)
{
if (!isMonShiny)
sub_8199C30(3, 1, 4, 8, 8, 0);
@@ -2695,19 +2695,19 @@ static void SummaryScreen_PrintTextOnWindow(u8 windowId, const u8 *string, u8 x,
AddTextPrinterParameterized4(windowId, 1, x, y, 0, lineSpacing, sTextColors_861CD2C[colorId], 0, string);
}
static void sub_81C25E8(void)
static void PrintMonInfo(void)
{
FillWindowPixelBuffer(PSS_LABEL_WINDOW_PORTRAIT_DEX_NUMBER, PIXEL_FILL(0));
FillWindowPixelBuffer(PSS_LABEL_WINDOW_PORTRAIT_NICKNAME, PIXEL_FILL(0));
FillWindowPixelBuffer(PSS_LABEL_WINDOW_PORTRAIT_SPECIES, PIXEL_FILL(0));
if (!sMonSummaryScreen->summary.isEgg)
sub_81C2628();
PrintNotEggInfo();
else
sub_81C2794();
PrintEggInfo();
schedule_bg_copy_tilemap_to_vram(0);
}
static void sub_81C2628(void)
static void PrintNotEggInfo(void)
{
u8 strArray[16];
struct Pokemon *mon = &sMonSummaryScreen->currentMon;
@@ -2721,12 +2721,12 @@ static void sub_81C2628(void)
if (!IsMonShiny(mon))
{
SummaryScreen_PrintTextOnWindow(PSS_LABEL_WINDOW_PORTRAIT_DEX_NUMBER, gStringVar1, 0, 1, 0, 1);
sub_81C228C(FALSE);
SetDexNumberColor(FALSE);
}
else
{
SummaryScreen_PrintTextOnWindow(PSS_LABEL_WINDOW_PORTRAIT_DEX_NUMBER, gStringVar1, 0, 1, 0, 7);
sub_81C228C(TRUE);
SetDexNumberColor(TRUE);
}
PutWindowTilemap(PSS_LABEL_WINDOW_PORTRAIT_DEX_NUMBER);
}
@@ -2734,9 +2734,9 @@ static void sub_81C2628(void)
{
ClearWindowTilemap(PSS_LABEL_WINDOW_PORTRAIT_DEX_NUMBER);
if (!IsMonShiny(mon))
sub_81C228C(FALSE);
SetDexNumberColor(FALSE);
else
sub_81C228C(TRUE);
SetDexNumberColor(TRUE);
}
StringCopy(gStringVar1, &gText_LevelSymbol[0]);
ConvertIntToDecimalStringN(gStringVar2, summary->level, 0, 3);
@@ -2747,12 +2747,12 @@ static void sub_81C2628(void)
strArray[0] = CHAR_SLASH;
StringCopy(&strArray[1], &gSpeciesNames[summary->species2][0]);
SummaryScreen_PrintTextOnWindow(PSS_LABEL_WINDOW_PORTRAIT_SPECIES, &strArray[0], 0, 1, 0, 1);
sub_81C27DC(mon, summary->species2);
PrintGenderSymbol(mon, summary->species2);
PutWindowTilemap(PSS_LABEL_WINDOW_PORTRAIT_NICKNAME);
PutWindowTilemap(PSS_LABEL_WINDOW_PORTRAIT_SPECIES);
}
static void sub_81C2794(void)
static void PrintEggInfo(void)
{
GetMonNickname(&sMonSummaryScreen->currentMon, gStringVar1);
SummaryScreen_PrintTextOnWindow(PSS_LABEL_WINDOW_PORTRAIT_NICKNAME, gStringVar1, 0, 1, 0, 1);
@@ -2761,7 +2761,7 @@ static void sub_81C2794(void)
ClearWindowTilemap(PSS_LABEL_WINDOW_PORTRAIT_SPECIES);
}
static void sub_81C27DC(struct Pokemon *mon, u16 species)
static void PrintGenderSymbol(struct Pokemon *mon, u16 species)
{
if (species != SPECIES_NIDORAN_M && species != SPECIES_NIDORAN_F)
{
+7 -7
View File
@@ -37,8 +37,8 @@ struct PlayerInfo
struct MovePp
{
u16 moves[4];
u8 pp[4];
u16 moves[MAX_MON_MOVES];
u8 pp[MAX_MON_MOVES];
};
struct RecordedBattleSave
@@ -91,7 +91,7 @@ EWRAM_DATA static u32 sBattleFlags = 0;
EWRAM_DATA static u32 sAI_Scripts = 0;
EWRAM_DATA static struct Pokemon sSavedPlayerParty[PARTY_SIZE] = {0};
EWRAM_DATA static struct Pokemon sSavedOpponentParty[PARTY_SIZE] = {0};
EWRAM_DATA static u16 sPlayerMonMoves[2][4] = {0};
EWRAM_DATA static u16 sPlayerMonMoves[2][MAX_MON_MOVES] = {0};
EWRAM_DATA static struct PlayerInfo sPlayers[MAX_BATTLERS_COUNT] = {0};
EWRAM_DATA static u8 sUnknown_0203CCD0 = 0;
EWRAM_DATA static u8 sRecordMixFriendName[PLAYER_NAME_LENGTH + 1] = {0};
@@ -766,11 +766,11 @@ void sub_818603C(u8 arg0)
{
if (sBattleRecords[battlerId][sRecordedBytesNo[battlerId]] == ACTION_MOVE_CHANGE)
{
u8 ppBonuses[4];
u8 array1[4];
u8 array2[4];
u8 ppBonuses[MAX_MON_MOVES];
u8 array1[MAX_MON_MOVES];
u8 array2[MAX_MON_MOVES];
struct MovePp movePp;
u8 array3[8];
u8 array3[(MAX_MON_MOVES * 2)];
u8 var;
RecordedBattle_GetBattlerAction(battlerId);
+6 -5
View File
@@ -24,6 +24,7 @@
#include "region_map.h"
#include "constants/region_map_sections.h"
#include "heal_location.h"
#include "constants/field_specials.h"
#include "constants/heal_locations.h"
#include "constants/map_types.h"
#include "constants/rgb.h"
@@ -1144,20 +1145,20 @@ static void RegionMap_InitializeStateBasedOnSSTidalLocation(void)
x = 0;
switch (GetSSTidalLocation(&mapGroup, &mapNum, &xOnMap, &yOnMap))
{
case 1:
case SS_TIDAL_LOCATION_SLATEPORT:
gRegionMap->mapSecId = MAPSEC_SLATEPORT_CITY;
break;
case 2:
case SS_TIDAL_LOCATION_LILYCOVE:
gRegionMap->mapSecId = MAPSEC_LILYCOVE_CITY;
break;
case 3:
case SS_TIDAL_LOCATION_ROUTE124:
gRegionMap->mapSecId = MAPSEC_ROUTE_124;
break;
case 4:
case SS_TIDAL_LOCATION_ROUTE131:
gRegionMap->mapSecId = MAPSEC_ROUTE_131;
break;
default:
case 0:
case SS_TIDAL_LOCATION_OTHER:
mapHeader = Overworld_GetMapHeaderByGroupAndId(mapGroup, mapNum);
gRegionMap->mapSecId = mapHeader->regionMapSectionId;
+3 -3
View File
@@ -1247,7 +1247,7 @@ bool8 ScrCmd_releaseall(struct ScriptContext *ctx)
HideFieldMessageBox();
playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]);
sub_80D338C();
ScriptMovement_UnfreezeEventObjects();
UnfreezeEventObjects();
return FALSE;
}
@@ -1261,7 +1261,7 @@ bool8 ScrCmd_release(struct ScriptContext *ctx)
EventObjectClearHeldMovementIfFinished(&gEventObjects[gSelectedEventObject]);
playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]);
sub_80D338C();
ScriptMovement_UnfreezeEventObjects();
UnfreezeEventObjects();
return FALSE;
}
@@ -1624,7 +1624,7 @@ bool8 ScrCmd_bufferstdstring(struct ScriptContext *ctx)
u8 stringVarIndex = ScriptReadByte(ctx);
u16 index = VarGet(ScriptReadHalfword(ctx));
StringCopy(sScriptStringVars[stringVarIndex], gUnknown_0858BAF0[index]);
StringCopy(sScriptStringVars[stringVarIndex], gStdStrings[index]);
return FALSE;
}
+146 -1138
View File
File diff suppressed because it is too large Load Diff
+88 -86
View File
@@ -3,20 +3,22 @@
#include "event_object_movement.h"
#include "task.h"
#include "util.h"
#include "constants/event_objects.h"
#include "constants/event_object_movement_constants.h"
// static functions
static void sub_80D33AC(u8);
static u8 sub_80D33F4(void);
static bool8 sub_80D3408(u8, u8, const u8 *);
static u8 sub_80D3474(u8, u8);
static bool8 sub_80D3584(u8, u8);
static void sub_80D35DC(u8, u8, u8, const u8 *);
static void UnfreezeObjects(u8);
static void sub_80D3660(u8);
static void sub_80A2490(u8, u8, u8, const u8 *);
static void ScriptMovement_StartMoveObjects(u8 priority);
static u8 GetMoveObjectsTaskId(void);
static bool8 ScriptMovement_TryAddNewMovement(u8 taskId, u8 eventObjId, const u8 *movementScript);
static u8 GetMovementScriptIdFromEventObjectId(u8 taskId, u8 eventObjId);
static bool8 IsMovementScriptFinished(u8 taskId, u8 moveScrId);
static void ScriptMovement_AddNewMovement(u8 taskId, u8 moveScrId, u8 eventObjId, const u8 *movementScript);
static void ScriptMovement_UnfreezeActiveObjects(u8 taskId);
static void ScriptMovement_MoveObjects(u8 taskId);
static void ScriptMovement_TakeStep(u8 taskId, u8 moveScrId, u8 eventObjId, const u8 *movementScript);
// EWRAM_DATA
static EWRAM_DATA const u8 *gUnknown_02039D90[16] = {0};
static EWRAM_DATA const u8 *gMovementScripts[EVENT_OBJECTS_COUNT] = {0};
// text
bool8 ScriptMovement_StartObjectMovementScript(u8 localId, u8 mapNum, u8 mapGroup, const u8 *movementScript)
@@ -25,207 +27,207 @@ bool8 ScriptMovement_StartObjectMovementScript(u8 localId, u8 mapNum, u8 mapGrou
if (TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &eventObjId))
return TRUE;
if (!FuncIsActiveTask(sub_80D3660))
sub_80D33AC(50);
return sub_80D3408(sub_80D33F4(), eventObjId, movementScript);
if (!FuncIsActiveTask(ScriptMovement_MoveObjects))
ScriptMovement_StartMoveObjects(50);
return ScriptMovement_TryAddNewMovement(GetMoveObjectsTaskId(), eventObjId, movementScript);
}
bool8 ScriptMovement_IsObjectMovementFinished(u8 localId, u8 mapNum, u8 mapBank)
bool8 ScriptMovement_IsObjectMovementFinished(u8 localId, u8 mapNum, u8 mapGroup)
{
u8 eventObjId;
u8 r4;
u8 r1;
u8 taskId;
u8 moveScrId;
if (TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapBank, &eventObjId))
if (TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &eventObjId))
return TRUE;
r4 = sub_80D33F4();
r1 = sub_80D3474(r4, eventObjId);
if (r1 == 16)
taskId = GetMoveObjectsTaskId();
moveScrId = GetMovementScriptIdFromEventObjectId(taskId, eventObjId);
if (moveScrId == EVENT_OBJECTS_COUNT)
return TRUE;
return sub_80D3584(r4, r1);
return IsMovementScriptFinished(taskId, moveScrId);
}
void sub_80D338C(void)
void ScriptMovement_UnfreezeEventObjects(void)
{
u8 taskId;
taskId = sub_80D33F4();
taskId = GetMoveObjectsTaskId();
if (taskId != 0xFF)
{
UnfreezeObjects(taskId);
ScriptMovement_UnfreezeActiveObjects(taskId);
DestroyTask(taskId);
}
}
static void sub_80D33AC(u8 priority)
static void ScriptMovement_StartMoveObjects(u8 priority)
{
u8 taskId;
u8 i;
taskId = CreateTask(sub_80D3660, priority);
for (i = 1; i < 16; i++)
taskId = CreateTask(ScriptMovement_MoveObjects, priority);
for (i = 1; i < NUM_TASK_DATA; i++)
gTasks[taskId].data[i] = 0xFFFF;
}
static u8 sub_80D33F4(void)
static u8 GetMoveObjectsTaskId(void)
{
return FindTaskIdByFunc(sub_80D3660);
return FindTaskIdByFunc(ScriptMovement_MoveObjects);
}
static bool8 sub_80D3408(u8 taskId, u8 eventObjId, const u8 *movementScript)
static bool8 ScriptMovement_TryAddNewMovement(u8 taskId, u8 eventObjId, const u8 *movementScript)
{
u8 r4;
u8 moveScrId;
r4 = sub_80D3474(taskId, eventObjId);
if (r4 != 16)
moveScrId = GetMovementScriptIdFromEventObjectId(taskId, eventObjId);
if (moveScrId != EVENT_OBJECTS_COUNT)
{
if (sub_80D3584(taskId, r4) == 0)
if (IsMovementScriptFinished(taskId, moveScrId) == 0)
{
return TRUE;
}
else
{
sub_80D35DC(taskId, r4, eventObjId, movementScript);
ScriptMovement_AddNewMovement(taskId, moveScrId, eventObjId, movementScript);
return FALSE;
}
}
r4 = sub_80D3474(taskId, 0xFF);
if (r4 == 16)
moveScrId = GetMovementScriptIdFromEventObjectId(taskId, EVENT_OBJ_ID_PLAYER);
if (moveScrId == EVENT_OBJECTS_COUNT)
{
return TRUE;
}
else
{
sub_80D35DC(taskId, r4, eventObjId, movementScript);
ScriptMovement_AddNewMovement(taskId, moveScrId, eventObjId, movementScript);
return FALSE;
}
}
static u8 sub_80D3474(u8 taskId, u8 b)
static u8 GetMovementScriptIdFromEventObjectId(u8 taskId, u8 eventObjId)
{
u8 *ptr;
u8 *moveScriptId;
u8 i;
ptr = (u8 *)&gTasks[taskId].data[1];
for (i = 0; i < 16; i++, ptr++)
moveScriptId = (u8 *)&gTasks[taskId].data[1];
for (i = 0; i < EVENT_OBJECTS_COUNT; i++, moveScriptId++)
{
if (*ptr == b)
if (*moveScriptId == eventObjId)
return i;
}
return 16;
return EVENT_OBJECTS_COUNT;
}
static void sub_80D34B0(u8 taskId, u8 b, u8 **c)
static void LoadEventObjectIdPtrFromMovementScript(u8 taskId, u8 moveScrId, u8 **pEventObjId)
{
u8 i;
*c = (u8 *)&gTasks[taskId].data[1];
for (i = 0; i < b; i++, (*c)++)
*pEventObjId = (u8 *)&gTasks[taskId].data[1];
for (i = 0; i < moveScrId; i++, (*pEventObjId)++)
;
}
static void sub_80D34E4(u8 taskId, u8 b, u8 c)
static void SetEventObjectIdAtMovementScript(u8 taskId, u8 moveScrId, u8 eventObjId)
{
u8 *ptr;
sub_80D34B0(taskId, b, &ptr);
*ptr = c; //what is this supposed to do?
LoadEventObjectIdPtrFromMovementScript(taskId, moveScrId, &ptr);
*ptr = eventObjId;
}
static void sub_80D3508(u8 taskId, u8 b, u8 *c)
static void LoadEventObjectIdFromMovementScript(u8 taskId, u8 moveScrId, u8 *eventObjId)
{
u8 *ptr;
sub_80D34B0(taskId, b, &ptr);
*c = *ptr;
LoadEventObjectIdPtrFromMovementScript(taskId, moveScrId, &ptr);
*eventObjId = *ptr;
}
static void sub_80D352C(u8 a, u8 b)
static void ClearMovementScriptFinished(u8 taskId, u8 moveScrId)
{
u16 var = ~gBitTable[b];
u16 mask = ~gBitTable[moveScrId];
gTasks[a].data[0] &= var;
gTasks[taskId].data[0] &= mask;
}
static void sub_80D355C(u8 taskId, u8 b)
static void SetMovementScriptFinished(u8 taskId, u8 moveScrId)
{
gTasks[taskId].data[0] |= gBitTable[b];
gTasks[taskId].data[0] |= gBitTable[moveScrId];
}
static bool8 sub_80D3584(u8 taskId, u8 b)
static bool8 IsMovementScriptFinished(u8 taskId, u8 moveScrId)
{
u16 var = (u16)gTasks[taskId].data[0] & gBitTable[b];
u16 moveScriptFinished = (u16)gTasks[taskId].data[0] & gBitTable[moveScrId];
if (var != 0)
if (moveScriptFinished != 0)
return TRUE;
else
return FALSE;
}
static void npc_obj_offscreen_culling_and_flag_update(u8 a, const u8 *movementScript)
static void SetMovementScript(u8 moveScrId, const u8 *movementScript)
{
gUnknown_02039D90[a] = movementScript;
gMovementScripts[moveScrId] = movementScript;
}
static const u8 *sub_80D35CC(u8 a)
static const u8 *GetMovementScript(u8 moveScrId)
{
return gUnknown_02039D90[a];
return gMovementScripts[moveScrId];
}
static void sub_80D35DC(u8 taskId, u8 b, u8 eventObjId, const u8 *movementScript)
static void ScriptMovement_AddNewMovement(u8 taskId, u8 moveScrId, u8 eventObjId, const u8 *movementScript)
{
sub_80D352C(taskId, b);
npc_obj_offscreen_culling_and_flag_update(b, movementScript);
sub_80D34E4(taskId, b, eventObjId);
ClearMovementScriptFinished(taskId, moveScrId);
SetMovementScript(moveScrId, movementScript);
SetEventObjectIdAtMovementScript(taskId, moveScrId, eventObjId);
}
static void UnfreezeObjects(u8 taskId)
static void ScriptMovement_UnfreezeActiveObjects(u8 taskId)
{
u8 *pEventObjId;
u8 i;
pEventObjId = (u8 *)&gTasks[taskId].data[1];
for (i = 0; i < 16; i++, pEventObjId++)
for (i = 0; i < EVENT_OBJECTS_COUNT; i++, pEventObjId++)
{
if (*pEventObjId != 0xFF)
UnfreezeEventObject(&gEventObjects[*pEventObjId]);
}
}
static void sub_80D3660(u8 taskId)
static void ScriptMovement_MoveObjects(u8 taskId)
{
u8 i;
u8 var;
u8 eventObjId;
for (i = 0; i < 16; i++)
for (i = 0; i < EVENT_OBJECTS_COUNT; i++)
{
sub_80D3508(taskId, i, &var);
if (var != 0xFF)
sub_80A2490(taskId, i, var, sub_80D35CC(i));
LoadEventObjectIdFromMovementScript(taskId, i, &eventObjId);
if (eventObjId != 0xFF)
ScriptMovement_TakeStep(taskId, i, eventObjId, GetMovementScript(i));
}
}
static void sub_80A2490(u8 taskId, u8 b, u8 eventObjId, const u8 *d)
static void ScriptMovement_TakeStep(u8 taskId, u8 moveScrId, u8 eventObjId, const u8 *movementScript)
{
u8 var;
u8 nextMoveActionId;
if (EventObjectIsHeldMovementActive(&gEventObjects[eventObjId])
&& !EventObjectClearHeldMovementIfFinished(&gEventObjects[eventObjId]))
return;
var = *d;
if (var == 0xFE)
nextMoveActionId = *movementScript;
if (nextMoveActionId == MOVEMENT_ACTION_STEP_END)
{
sub_80D355C(taskId, b);
SetMovementScriptFinished(taskId, moveScrId);
FreezeEventObject(&gEventObjects[eventObjId]);
}
else
{
if (!EventObjectSetHeldMovement(&gEventObjects[eventObjId], var))
if (!EventObjectSetHeldMovement(&gEventObjects[eventObjId], nextMoveActionId))
{
d++;
npc_obj_offscreen_culling_and_flag_update(b, d);
movementScript++;
SetMovementScript(moveScrId, movementScript);
}
}
}
+6 -6
View File
@@ -585,14 +585,14 @@ void HasEnoughMonsForDoubleBattle(void)
{
switch (GetMonsStateToDoubles())
{
case 0:
gSpecialVar_Result = 0;
case PLAYER_HAS_TWO_USABLE_MONS:
gSpecialVar_Result = PLAYER_HAS_TWO_USABLE_MONS;
break;
case 1:
gSpecialVar_Result = 1;
case PLAYER_HAS_ONE_MON:
gSpecialVar_Result = PLAYER_HAS_ONE_MON;
break;
case 2:
gSpecialVar_Result = 2;
case PLAYER_HAS_ONE_USABLE_MON:
gSpecialVar_Result = PLAYER_HAS_ONE_USABLE_MON;
break;
}
}
+3 -3
View File
@@ -349,7 +349,7 @@ void SetPlayerSecretBase(void)
u16 i;
gSaveBlock1Ptr->secretBases[0].secretBaseId = sCurSecretBaseId;
for (i = 0; i < 4; i++)
for (i = 0; i < TRAINER_ID_LENGTH; i++)
gSaveBlock1Ptr->secretBases[0].trainerId[i] = gSaveBlock2Ptr->playerTrainerId[i];
VarSet(VAR_CURRENT_SECRET_BASE, 0);
@@ -1291,7 +1291,7 @@ static void SetSecretBaseDataAndLanguage(u8 secretBaseId, struct SecretBase *sec
static bool8 SecretBasesHaveSameTrainerId(struct SecretBase *secretBase1, struct SecretBase *secretBase2)
{
u8 i;
for (i = 0; i < 4; i++)
for (i = 0; i < TRAINER_ID_LENGTH; i++)
{
if (secretBase1->trainerId[i] != secretBase2->trainerId[i])
return FALSE;
@@ -1445,7 +1445,7 @@ bool8 SecretBaseBelongsToPlayer(struct SecretBase *secretBase)
return FALSE;
// Check if the player's trainer Id matches the secret base's id.
for (i = 0; i < 4; i++)
for (i = 0; i < TRAINER_ID_LENGTH; i++)
{
if (secretBase->trainerId[i] != gSaveBlock2Ptr->playerTrainerId[i])
return FALSE;
+128 -129
View File
@@ -599,89 +599,89 @@ const u8 gText_Brawly[] = _("BRAWLY");
const u8 gText_Winona[] = _("WINONA");
const u8 gText_Phoebe[] = _("PHOEBE");
const u8 gText_Glacia[] = _("GLACIA");
const u8 gUnknown_085EAD37[] = _("PETALBURG");
const u8 gUnknown_085EAD41[] = _("SLATEPORT");
const u8 gUnknown_085EAD4B[] = _("LITTLEROOT");
const u8 gUnknown_085EAD56[] = _("LILYCOVE");
const u8 gUnknown_085EAD5F[] = _("DEWFORD");
const u8 gUnknown_085EAD67[] = _("ENTER");
const u8 gUnknown_085EAD6D[] = _("INFO");
const u8 gUnknown_085EAD72[] = _("What's a CONTEST?");
const u8 gUnknown_085EAD84[] = _("Types of CONTESTS");
const u8 gUnknown_085EAD96[] = _("Ranks");
const u8 gUnknown_085EAD9C[] = _("Judging");
const u8 gText_Petalburg[] = _("PETALBURG");
const u8 gText_Slateport[] = _("SLATEPORT");
const u8 gText_Littleroot[] = _("LITTLEROOT"); // Unused. Given the context, Briney may at one point have been able to sail the player here
const u8 gText_Lilycove[] = _("LILYCOVE"); // Unused. Given the context, Briney may at one point have been able to sail the player here
const u8 gText_Dewford[] = _("DEWFORD");
const u8 gText_Enter2[] = _("ENTER");
const u8 gText_Info2[] = _("INFO");
const u8 gText_WhatsAContest[] = _("What's a CONTEST?");
const u8 gText_TypesOfContests[] = _("Types of CONTESTS");
const u8 gText_Ranks[] = _("Ranks");
const u8 gText_Judging[] = _("Judging"); //unused
const u8 gText_CoolnessContest[] = _("COOLNESS CONTEST");
const u8 gText_BeautyContest[] = _("BEAUTY CONTEST");
const u8 gText_CutenessContest[] = _("CUTENESS CONTEST");
const u8 gText_SmartnessContest[] = _("SMARTNESS CONTEST");
const u8 gText_ToughnessContest[] = _("TOUGHNESS CONTEST");
const u8 gUnknown_085EADF9[] = _("DECORATION");
const u8 gUnknown_085EAE04[] = _("PACK UP");
const u8 gUnknown_085EAE0C[] = _("COUNT");
const u8 gUnknown_085EAE12[] = _("REGISTRY");
const u8 gUnknown_085EAE1B[] = _("INFORMATION");
const u8 gUnknown_085EAE27[] = _("MACH");
const u8 gUnknown_085EAE2C[] = _("ACRO");
const u8 gUnknown_085EAE31[] = _("PSN");
const u8 gUnknown_085EAE35[] = _("PAR");
const u8 gUnknown_085EAE39[] = _("SLP");
const u8 gUnknown_085EAE3D[] = _("BRN");
const u8 gUnknown_085EAE41[] = _("FRZ");
const u8 gText_Decoration2[] = _("DECORATION");
const u8 gText_PackUp[] = _("PACK UP");
const u8 gText_Count[] = _("COUNT"); //unused
const u8 gText_Registry[] = _("REGISTRY");
const u8 gText_Information[] = _("INFORMATION");
const u8 gText_Mach[] = _("MACH");
const u8 gText_Acro[] = _("ACRO");
const u8 gText_Psn[] = _("PSN");
const u8 gText_Par[] = _("PAR");
const u8 gText_Slp[] = _("SLP");
const u8 gText_Brn[] = _("BRN");
const u8 gText_Frz[] = _("FRZ");
const u8 gUnknown_085EAE45[] = _("TOXIC");
const u8 gUnknown_085EAE4B[] = _("OK");
const u8 gUnknown_085EAE4E[] = _("QUIT");
const u8 gUnknown_085EAE53[] = _("Saw it");
const u8 gUnknown_085EAE5A[] = _("Not yet");
const u8 gText_SawIt[] = _("Saw it");
const u8 gText_NotYet[] = _("Not yet");
const u8 gText_Yes[] = _("YES");
const u8 gText_No[] = _("NO");
const u8 gUnknown_085EAE69[] = _("INFO");
const u8 gUnknown_085EAE6E[] = _("SINGLE BATTLE");
const u8 gUnknown_085EAE7C[] = _("DOUBLE BATTLE");
const u8 gUnknown_085EAE8A[] = _("MULTI BATTLE");
const u8 gText_SingleBattle[] = _("SINGLE BATTLE");
const u8 gText_DoubleBattle[] = _("DOUBLE BATTLE");
const u8 gText_MultiBattle[] = _("MULTI BATTLE");
const u8 gUnknown_085EAE97[] = _("MR. BRINEY");
const u8 gUnknown_085EAEA2[] = _("CHALLENGE");
const u8 gUnknown_085EAEAC[] = _("INFO");
const u8 gText_Challenge[] = _("CHALLENGE");
const u8 gText_Info3[] = _("INFO");
const u8 gText_Lv50[] = _("LV. 50");
const u8 gText_OpenLevel[] = _("OPEN LEVEL");
const u8 gUnknown_085EAEC3[] = _("FRESH WATER{CLEAR_TO 0x48}¥200");
const u8 gUnknown_085EAED6[] = _("SODA POP{CLEAR_TO 0x48}¥300");
const u8 gUnknown_085EAEE6[] = _("LEMONADE{CLEAR_TO 0x48}¥350");
const u8 gUnknown_085EAEF6[] = _("HOW TO RIDE");
const u8 gUnknown_085EAF02[] = _("HOW TO TURN");
const u8 gUnknown_085EAF0E[] = _("SANDY SLOPES");
const u8 gUnknown_085EAF1B[] = _("WHEELIES");
const u8 gUnknown_085EAF24[] = _("BUNNY-HOPS");
const u8 gUnknown_085EAF2F[] = _("JUMP");
const u8 gUnknown_085EAF34[] = _("Satisfied");
const u8 gUnknown_085EAF3E[] = _("Dissatisfied");
const u8 gUnknown_085EAF4B[] = _("DEEPSEATOOTH");
const u8 gUnknown_085EAF58[] = _("DEEPSEASCALE");
const u8 gUnknown_085EAF65[] = _("BLUE FLUTE");
const u8 gUnknown_085EAF70[] = _("YELLOW FLUTE");
const u8 gUnknown_085EAF7D[] = _("RED FLUTE");
const u8 gUnknown_085EAF87[] = _("WHITE FLUTE");
const u8 gUnknown_085EAF93[] = _("BLACK FLUTE");
const u8 gUnknown_085EAF9F[] = _("GLASS CHAIR");
const u8 gUnknown_085EAFAB[] = _("GLASS DESK");
const u8 gUnknown_085EAFB6[] = _("TREECKO DOLL 1,000 COINS");
const u8 gUnknown_085EAFCF[] = _("TORCHIC DOLL 1,000 COINS");
const u8 gUnknown_085EAFE8[] = _("MUDKIP DOLL 1,000 COINS");
const u8 gUnknown_085EB002[] = _(" 50 COINS ¥1,000");
const u8 gUnknown_085EB017[] = _("500 COINS ¥10,000");
const u8 gUnknown_085EB02A[] = _("Excellent");
const u8 gUnknown_085EB034[] = _("Not so good");
const u8 gUnknown_085EB040[] = _("RED SHARD");
const u8 gUnknown_085EB04A[] = _("YELLOW SHARD");
const u8 gUnknown_085EB057[] = _("BLUE SHARD");
const u8 gUnknown_085EB062[] = _("GREEN SHARD");
const u8 gText_FreshWaterAndPrice[] = _("FRESH WATER{CLEAR_TO 0x48}¥200");
const u8 gText_SodaPopAndPrice[] = _("SODA POP{CLEAR_TO 0x48}¥300");
const u8 gText_LemonadeAndPrice[] = _("LEMONADE{CLEAR_TO 0x48}¥350");
const u8 gText_HowToRide[] = _("HOW TO RIDE");
const u8 gText_HowToTurn[] = _("HOW TO TURN");
const u8 gText_SandySlopes[] = _("SANDY SLOPES");
const u8 gText_Wheelies[] = _("WHEELIES");
const u8 gText_BunnyHops[] = _("BUNNY-HOPS");
const u8 gText_Jump[] = _("JUMP");
const u8 gText_Satisfied[] = _("Satisfied");
const u8 gText_Dissatisfied[] = _("Dissatisfied");
const u8 gText_DeepSeaTooth[] = _("DEEPSEATOOTH");
const u8 gText_DeepSeaScale[] = _("DEEPSEASCALE");
const u8 gText_BlueFlute2[] = _("BLUE FLUTE");
const u8 gText_YellowFlute2[] = _("YELLOW FLUTE");
const u8 gText_RedFlute2[] = _("RED FLUTE");
const u8 gText_WhiteFlute2[] = _("WHITE FLUTE");
const u8 gText_BlackFlute2[] = _("BLACK FLUTE");
const u8 gText_GlassChair[] = _("GLASS CHAIR");
const u8 gText_GlassDesk[] = _("GLASS DESK");
const u8 gText_TreeckoDollAndPrice[] = _("TREECKO DOLL 1,000 COINS");
const u8 gText_TorchicDollAndPrice[] = _("TORCHIC DOLL 1,000 COINS");
const u8 gText_MudkipDollAndPrice[] = _("MUDKIP DOLL 1,000 COINS");
const u8 gText_50CoinsAndPrice[] = _(" 50 COINS ¥1,000");
const u8 gText_500CoinsAndPrice[] = _("500 COINS ¥10,000");
const u8 gText_Excellent2[] = _("Excellent");
const u8 gText_NotSoGood[] = _("Not so good");
const u8 gText_RedShard[] = _("RED SHARD");
const u8 gText_YellowShard[] = _("YELLOW SHARD");
const u8 gText_BlueShard[] = _("BLUE SHARD");
const u8 gText_GreenShard[] = _("GREEN SHARD");
const u8 gText_BattleFrontier[] = _("BATTLE FRONTIER");
const u8 gUnknown_085EB07E[] = _("Right");
const u8 gUnknown_085EB084[] = _("Left");
const u8 gUnknown_085EB089[] = _("TM32{CLEAR_TO 0x48}1,500 COINS");
const u8 gUnknown_085EB09C[] = _("TM29{CLEAR_TO 0x48}3,500 COINS");
const u8 gUnknown_085EB0AF[] = _("TM35{CLEAR_TO 0x48}4,000 COINS");
const u8 gUnknown_085EB0C2[] = _("TM24{CLEAR_TO 0x48}4,000 COINS");
const u8 gUnknown_085EB0D5[] = _("TM13{CLEAR_TO 0x48}4,000 COINS");
const u8 gText_Right[] = _("Right");
const u8 gText_Left[] = _("Left");
const u8 gText_TM32AndPrice[] = _("TM32{CLEAR_TO 0x48}1,500 COINS");
const u8 gText_TM29AndPrice[] = _("TM29{CLEAR_TO 0x48}3,500 COINS");
const u8 gText_TM35AndPrice[] = _("TM35{CLEAR_TO 0x48}4,000 COINS");
const u8 gText_TM24AndPrice[] = _("TM24{CLEAR_TO 0x48}4,000 COINS");
const u8 gText_TM13AndPrice[] = _("TM13{CLEAR_TO 0x48}4,000 COINS");
const u8 gText_Cool[] = _("COOL");
const u8 gText_Beauty[] = _("BEAUTY");
const u8 gText_Cute[] = _("CUTE");
@@ -728,82 +728,81 @@ const u8 gText_MenuOptionPokedex[] = _("POKéDEX");
const u8 gText_MenuOptionPokemon[] = _("POKéMON");
const u8 gText_MenuOptionBag[] = _("BAG");
const u8 gText_MenuOptionPokenav[] = _("POKéNAV");
const u8 gUnknown_085EB278[] = _("");
const u8 gText_Blank[] = _("");
const u8 gText_MenuOptionSave[] = _("SAVE");
const u8 gText_MenuOptionOption[] = _("OPTION");
const u8 gText_MenuOptionExit[] = _("EXIT");
const u8 gUnknown_085EB28A[] = __(" ");
const u8 gUnknown_085EB28C[] = _("5BP");
const u8 gUnknown_085EB290[] = _("10BP");
const u8 gUnknown_085EB295[] = _("15BP");
const u8 gUnknown_085EB29A[] = _("RED TENT");
const u8 gUnknown_085EB2A3[] = _("BLUE TENT");
const u8 gText_5BP[] = _(" 5BP");
const u8 gText_10BP[] = _("10BP");
const u8 gText_15BP[] = _("15BP");
const u8 gText_RedTent[] = _("RED TENT");
const u8 gText_BlueTent[] = _("BLUE TENT");
const u8 gText_SouthernIsland[] = _("SOUTHERN ISLAND");
const u8 gText_BirthIsland[] = _("BIRTH ISLAND");
const u8 gText_FarawayIsland[] = _("FARAWAY ISLAND");
const u8 gText_NavelRock[] = _("NAVEL ROCK");
const u8 gUnknown_085EB2E4[] = _("CLAW FOSSIL");
const u8 gUnknown_085EB2F0[] = _("ROOT FOSSIL");
const u8 gUnknown_085EB2FC[] = _("NO");
const u8 gUnknown_085EB2FF[] = _("I'll battle now!");
const u8 gUnknown_085EB310[] = _("I won!");
const u8 gUnknown_085EB317[] = _("I lost!");
const u8 gUnknown_085EB31F[] = _("I won't tell.");
const u8 gText_ClawFossil[] = _("CLAW FOSSIL");
const u8 gText_RootFossil[] = _("ROOT FOSSIL");
const u8 gText_No4[] = _("NO");
const u8 gText_IllBattleNow[] = _("I'll battle now!");
const u8 gText_IWon[] = _("I won!");
const u8 gText_ILost[] = _("I lost!");
const u8 gText_IWontTell[] = _("I won't tell.");
const u8 gText_NormalTagMatch[] = _("NORMAL TAG MATCH");
const u8 gText_VarietyTagMatch[] = _("VARIETY TAG MATCH");
const u8 gText_UniqueTagMatch[] = _("UNIQUE TAG MATCH");
const u8 gText_ExpertTagMatch[] = _("EXPERT TAG MATCH");
const u8 gUnknown_085EB372[] = _("TRADE CENTER");
const u8 gUnknown_085EB37F[] = _("COLOSSEUM");
const u8 gUnknown_085EB389[] = _("RECORD CORNER");
const u8 gUnknown_085EB397[] = _("BERRY CRUSH");
const u8 gText_TradeCenter[] = _("TRADE CENTER");
const u8 gText_Colosseum[] = _("COLOSSEUM");
const u8 gText_RecordCorner[] = _("RECORD CORNER");
const u8 gText_BerryCrush3[] = _("BERRY CRUSH");
const u8 gUnknown_085EB3A3[] = _("");
const u8 gUnknown_085EB3A4[] = _("POKéMON JUMP");
const u8 gUnknown_085EB3B1[] = _("DODRIO BERRY-PICKING");
const u8 gUnknown_085EB3C6[] = _("BECOME LEADER");
const u8 gUnknown_085EB3D4[] = _("JOIN GROUP");
const u8 gUnknown_085EB3DF[] = _("TWO STYLES");
const u8 gUnknown_085EB3EA[] = _("LV. 50");
const u8 gUnknown_085EB3F1[] = _("OPEN LEVEL");
const u8 gUnknown_085EB3FC[] = _("{PKMN} TYPE & NO.");
const u8 gUnknown_085EB40A[] = _("HOLD ITEMS");
const u8 gUnknown_085EB415[] = _("SYMBOLS");
const u8 gUnknown_085EB41D[] = _("RECORD");
const u8 gUnknown_085EB424[] = _("BATTLE PTS");
const u8 gUnknown_085EB42F[] = _("TOWER INFO");
const u8 gUnknown_085EB43A[] = _("BATTLE {PKMN}");
const u8 gUnknown_085EB444[] = _("BATTLE SALON");
const u8 gUnknown_085EB451[] = _("MULTI-LINK");
const u8 gUnknown_085EB45C[] = _("BATTLE RULES");
const u8 gUnknown_085EB469[] = _("JUDGE: MIND");
const u8 gUnknown_085EB475[] = _("JUDGE: SKILL");
const u8 gUnknown_085EB482[] = _("JUDGE: BODY");
const u8 gUnknown_085EB48E[] = _("MATCHUP");
const u8 gUnknown_085EB496[] = _("TOURNEY TREE");
const u8 gUnknown_085EB4A3[] = _("DOUBLE KO");
const u8 gUnknown_085EB4AD[] = _("BASIC RULES");
const u8 gUnknown_085EB4B9[] = _("SWAP: PARTNER");
const u8 gUnknown_085EB4C7[] = _("SWAP: NUMBER");
const u8 gUnknown_085EB4D4[] = _("SWAP: NOTES");
const u8 gUnknown_085EB4E0[] = _("OPEN LEVEL");
const u8 gText_PokemonJump[] = _("POKéMON JUMP");
const u8 gText_DodrioBerryPicking[] = _("DODRIO BERRY-PICKING");
const u8 gText_BecomeLeader[] = _("BECOME LEADER");
const u8 gText_JoinGroup[] = _("JOIN GROUP");
const u8 gText_TwoStyles[] = _("TWO STYLES");
const u8 gText_Lv50_3[] = _("LV. 50");
const u8 gText_OpenLevel2[] = _("OPEN LEVEL");
const u8 gText_MonTypeAndNo[] = _("{PKMN} TYPE & NO.");
const u8 gText_HoldItems[] = _("HOLD ITEMS");
const u8 gText_Symbols2[] = _("SYMBOLS");
const u8 gText_Record3[] = _("RECORD");
const u8 gText_BattlePts[] = _("BATTLE PTS");
const u8 gText_TowerInfo[] = _("TOWER INFO");
const u8 gText_BattleMon[] = _("BATTLE {PKMN}");
const u8 gText_BattleSalon[] = _("BATTLE SALON");
const u8 gText_MultiLink2[] = _("MULTI-LINK");
const u8 gText_BattleRules[] = _("BATTLE RULES");
const u8 gText_JudgeMind[] = _("JUDGE: MIND");
const u8 gText_JudgeSkill[] = _("JUDGE: SKILL");
const u8 gText_JudgeBody[] = _("JUDGE: BODY");
const u8 gText_Matchup[] = _("MATCHUP");
const u8 gText_TourneyTree[] = _("TOURNEY TREE");
const u8 gText_DoubleKO[] = _("DOUBLE KO");
const u8 gText_BasicRules[] = _("BASIC RULES");
const u8 gText_SwapPartners[] = _("SWAP: PARTNER");
const u8 gText_SwapNumber[] = _("SWAP: NUMBER");
const u8 gText_SwapNotes[] = _("SWAP: NOTES");
const u8 gText_OpenLevel3[] = _("OPEN LEVEL");
const u8 gText_BattleBasics[] = _("BATTLE BASICS");
const u8 gText_PokemonNature[] = _("POKéMON NATURE");
const u8 gText_PokemonMoves[] = _("POKéMON MOVES");
const u8 gText_Underpowered[] = _("UNDERPOWERED");
const u8 gText_WhenInDanger[] = _("WHEN IN DANGER");
const u8 gUnknown_085EB532[] = _("PYRAMID: POKéMON");
const u8 gUnknown_085EB543[] = _("PYRAMID: TRAINERS");
const u8 gUnknown_085EB555[] = _("PYRAMID: MAZE");
const u8 gUnknown_085EB563[] = _("BATTLE BAG");
const u8 gUnknown_085EB56E[] = _("POKéNAV AND BAG");
const u8 gUnknown_085EB57E[] = _("HELD ITEMS");
const u8 gUnknown_085EB589[] = _("POKéMON ORDER");
const u8 gUnknown_085EB597[] = _("BATTLE POKéMON");
const u8 gText_PyramidPokemon[] = _("PYRAMID: POKéMON");
const u8 gText_PyramidTrainers[] = _("PYRAMID: TRAINERS");
const u8 gText_PyramidMaze[] = _("PYRAMID: MAZE");
const u8 gText_BattleBag2[] = _("BATTLE BAG");
const u8 gText_PokenavAndBag[] = _("POKéNAV AND BAG");
const u8 gText_HeldItems[] = _("HELD ITEMS");
const u8 gText_PokemonOrder[] = _("POKéMON ORDER");
const u8 gText_BattlePokemon[] = _("BATTLE POKéMON");
const u8 gText_BattleTrainers[] = _("BATTLE TRAINERS");
const u8 gUnknown_085EB5B6[] = _("GO ON");
const u8 gUnknown_085EB5BC[] = _("RECORD");
const u8 gUnknown_085EB5C3[] = _("REST");
const u8 gUnknown_085EB5C8[] = _("RETIRE");
const u8 gText_GoOn[] = _("GO ON");
const u8 gText_Record2[] = _("RECORD");
const u8 gText_Rest[] = _("REST");
const u8 gText_Retire[] = _("RETIRE");
const u8 gText_99TimesPlus[] = _("99 times +");
const u8 gText_1MinutePlus[] = _("1 minute +");
const u8 gText_SpaceSeconds[] = _(" seconds");
@@ -1292,7 +1291,7 @@ const u8 gMatchCall_MayTrainersPokemonText[] = _("I'll use any POKéMON!");
const u8 gMatchCall_MaySelfIntroductionText_Line1[] = _("My POKéMON and I help");
const u8 gMatchCall_MaySelfIntroductionText_Line2[] = _("my father's research.");
const u8 gText_HatchedFromEgg[] = _("{STR_VAR_1} hatched from the EGG!");
const u8 gText_NickHatchPrompt[] = _("Would you like to nickname the newly\nhatched {STR_VAR_1}?");
const u8 gText_NicknameHatchPrompt[] = _("Would you like to nickname the newly\nhatched {STR_VAR_1}?");
ALIGNED(4) const u8 gText_ReadyToBerryCrush[] = _("Are you ready to BERRY-CRUSH?\nPlease pick a BERRY for use.\p");
ALIGNED(4) const u8 gText_WaitForAllChooseBerry[] = _("Please wait while each member\nchooses a BERRY.");
ALIGNED(4) const u8 gText_EndedWithXUnitsPowder[] = _("{PAUSE_MUSIC}{PLAY_BGM MUS_FANFA1}You ended up with {STR_VAR_1} units of\nsilky-smooth BERRY POWDER.{RESUME_MUSIC}\pYour total amount of BERRY POWDER\nis {STR_VAR_2}.\p");
@@ -1419,8 +1418,8 @@ const u8 gUnknown_085EE0FA[] = _("つうしん しゅうりょう!");
const u8 gUnknown_085EE107[] = _("あらたな トレーナーが\nホウエンに やってきた!");
const u8 gUnknown_085EE120[] = _("しばらく おまちください");
const u8 gUnknown_085EE12D[] = _("かきこみ エラー です\nデータが ほぞん できませんでした");
const u8 gUnknown_085EE14B[] = _("RED");
const u8 gUnknown_085EE14F[] = _("BLUE");
const u8 gText_Red[] = _("RED");
const u8 gText_Blue[] = _("BLUE");
const u8 gUnknown_085EE154[] = _("---");
const u8 gText_SingleBattleRoomResults[] = _("{PLAYER}'s Single Battle Room Results");
const u8 gText_DoubleBattleRoomResults[] = _("{PLAYER}'s Double Battle Room Results");
+5 -5
View File
@@ -3032,7 +3032,7 @@ static u8 sub_8079A3C(u8 *str, u8 whichParty, u8 monIdx)
static void sub_8079AA4(u8 *a0, u8 a1, u8 a2)
{
u16 arr[4];
u16 moves[MAX_MON_MOVES];
u16 i;
if (!gUnknown_0203229C->unk_51[a1][a2])
@@ -3041,11 +3041,11 @@ static void sub_8079AA4(u8 *a0, u8 a1, u8 a2)
{
if (!a1)
{
arr[i] = GetMonData(&gPlayerParty[a2], i + MON_DATA_MOVE1, NULL);
moves[i] = GetMonData(&gPlayerParty[a2], i + MON_DATA_MOVE1, NULL);
}
else
{
arr[i] = GetMonData(&gEnemyParty[a2], i + MON_DATA_MOVE1, NULL);
moves[i] = GetMonData(&gEnemyParty[a2], i + MON_DATA_MOVE1, NULL);
}
}
@@ -3053,9 +3053,9 @@ static void sub_8079AA4(u8 *a0, u8 a1, u8 a2)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (arr[i] != MOVE_NONE)
if (moves[i] != MOVE_NONE)
{
StringAppend(a0, gMoveNames[arr[i]]);
StringAppend(a0, gMoveNames[moves[i]]);
}
StringAppend(a0, gText_NewLine3);
+1 -1
View File
@@ -71,7 +71,7 @@ void CreateAvailableDecorationsMenu(u8 taskId)
if (curWidth > windowWidth)
windowWidth = curWidth;
}
windowTemplate.width = convert_pixel_width_to_tile_width(windowWidth);
windowTemplate.width = ConvertPixelWidthToTileWidth(windowWidth);
data[3] = AddWindow(&windowTemplate);
DrawStdFrameWithCustomTileAndPalette(data[3], FALSE, 0x214, 14);
for (i = 0; i < 4; i++)
+24 -22
View File
@@ -38,8 +38,10 @@
#include "secret_base.h"
#include "tv.h"
#include "data.h"
#include "constants/contest.h"
#include "constants/layouts.h"
#include "constants/metatile_behaviors.h"
#include "constants/script_menu.h"
// Static type declarations
@@ -182,7 +184,7 @@ static void DoTVShowPokemonContestLiveUpdates2(void);
static const struct {
u16 species;
u16 moves[4];
u16 moves[MAX_MON_MOVES];
u8 level;
u8 location;
} sPokeOutbreakSpeciesList[] = {
@@ -2329,7 +2331,7 @@ void sub_80EE35C(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u1
show->battleSeminar.foeSpecies = foeSpecies;
show->battleSeminar.species = species;
show->battleSeminar.move = movePtr[moveIdx];
for (i = 0, j = 0; i < 4; i ++)
for (i = 0, j = 0; i < MAX_MON_MOVES; i ++)
{
if (i != moveIdx && movePtr[i])
{
@@ -2786,11 +2788,11 @@ bool8 GetPriceReduction(u8 newsKind)
{
u8 i;
if (newsKind == 0)
if (newsKind == POKENEWS_NONE)
{
return FALSE;
}
for (i = 0; i < 16; i ++)
for (i = 0; i < POKE_NEWS_COUNT; i ++)
{
if (gSaveBlock1Ptr->pokeNews[i].kind == newsKind)
{
@@ -2870,17 +2872,17 @@ void CopyContestRankToStringVar(u8 varIdx, u8 rank)
{
switch (rank)
{
case 0: // NORMAL
StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[5]);
case CONTEST_RANK_NORMAL:
StringCopy(gTVStringVarPtrs[varIdx], gStdStrings[STDSTRING_NORMAL]);
break;
case 1: // SUPER
StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[6]);
case CONTEST_RANK_SUPER:
StringCopy(gTVStringVarPtrs[varIdx], gStdStrings[STDSTRING_SUPER]);
break;
case 2: // HYPER
StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[7]);
case CONTEST_RANK_HYPER:
StringCopy(gTVStringVarPtrs[varIdx], gStdStrings[STDSTRING_HYPER]);
break;
case 3: // MASTER
StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[8]);
case CONTEST_RANK_MASTER:
StringCopy(gTVStringVarPtrs[varIdx], gStdStrings[STDSTRING_MASTER]);
break;
}
}
@@ -2889,20 +2891,20 @@ void CopyContestCategoryToStringVar(u8 varIdx, u8 category)
{
switch (category)
{
case 0: // COOL
StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[0]);
case CONTEST_CATEGORY_COOL:
StringCopy(gTVStringVarPtrs[varIdx], gStdStrings[STDSTRING_COOL]);
break;
case 1: // BEAUTY
StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[1]);
case CONTEST_CATEGORY_BEAUTY:
StringCopy(gTVStringVarPtrs[varIdx], gStdStrings[STDSTRING_BEAUTY]);
break;
case 2: // CUTE
StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[2]);
case CONTEST_CATEGORY_CUTE:
StringCopy(gTVStringVarPtrs[varIdx], gStdStrings[STDSTRING_CUTE]);
break;
case 3: // SMART
StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[3]);
case CONTEST_CATEGORY_SMART:
StringCopy(gTVStringVarPtrs[varIdx], gStdStrings[STDSTRING_SMART]);
break;
case 4: // TOUGH
StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[4]);
case CONTEST_CATEGORY_TOUGH:
StringCopy(gTVStringVarPtrs[varIdx], gStdStrings[STDSTRING_TOUGH]);
break;
}
}