Merge branch 'master' into clone-union
This commit is contained in:
+9
-16
@@ -9,13 +9,6 @@
|
||||
#include "util.h"
|
||||
#include "constants/battle_anim.h"
|
||||
|
||||
#define GET_UNOWN_LETTER(personality) (( \
|
||||
(((personality & 0x03000000) >> 24) << 6) \
|
||||
| (((personality & 0x00030000) >> 16) << 4) \
|
||||
| (((personality & 0x00000300) >> 8) << 2) \
|
||||
| (((personality & 0x00000003) >> 0) << 0) \
|
||||
) % 28)
|
||||
|
||||
#define IS_DOUBLE_BATTLE() (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
|
||||
static u8 GetBattlerSpriteFinal_Y(u8 battlerId, u16 species, bool8 a3);
|
||||
@@ -811,8 +804,8 @@ bool8 IsDoubleBattle(void)
|
||||
|
||||
void GetBattleAnimBg1Data(struct BattleAnimBgData *animBgData)
|
||||
{
|
||||
animBgData->bgTiles = gBattleAnimMons_BgTilesBuffer;
|
||||
animBgData->bgTilemap = (u16 *)gBattleAnimMons_BgTilemapBuffer;
|
||||
animBgData->bgTiles = gBattleAnimBgTileBuffer;
|
||||
animBgData->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer;
|
||||
animBgData->paletteId = 8;
|
||||
animBgData->bgId = 1;
|
||||
animBgData->tilesOffset = 0x200;
|
||||
@@ -827,8 +820,8 @@ void GetBattleAnimBgData(struct BattleAnimBgData *animBgData, u32 bgId)
|
||||
}
|
||||
else
|
||||
{
|
||||
animBgData->bgTiles = gBattleAnimMons_BgTilesBuffer;
|
||||
animBgData->bgTilemap = (u16 *)gBattleAnimMons_BgTilemapBuffer;
|
||||
animBgData->bgTiles = gBattleAnimBgTileBuffer;
|
||||
animBgData->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer;
|
||||
animBgData->paletteId = 9;
|
||||
animBgData->bgId = 2;
|
||||
animBgData->tilesOffset = 0x300;
|
||||
@@ -838,8 +831,8 @@ void GetBattleAnimBgData(struct BattleAnimBgData *animBgData, u32 bgId)
|
||||
|
||||
void GetBattleAnimBgDataByPriorityRank(struct BattleAnimBgData *animBgData, u8 unused)
|
||||
{
|
||||
animBgData->bgTiles = gBattleAnimMons_BgTilesBuffer;
|
||||
animBgData->bgTilemap = (u16 *)gBattleAnimMons_BgTilemapBuffer;
|
||||
animBgData->bgTiles = gBattleAnimBgTileBuffer;
|
||||
animBgData->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer;
|
||||
if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1)
|
||||
{
|
||||
animBgData->paletteId = 8;
|
||||
@@ -869,9 +862,9 @@ void InitBattleAnimBg(u32 bgId)
|
||||
|
||||
void AnimLoadCompressedBgGfx(u32 bgId, const u32 *src, u32 tilesOffset)
|
||||
{
|
||||
CpuFill32(0, gBattleAnimMons_BgTilesBuffer, 0x2000);
|
||||
LZDecompressWram(src, gBattleAnimMons_BgTilesBuffer);
|
||||
LoadBgTiles(bgId, gBattleAnimMons_BgTilesBuffer, 0x2000, tilesOffset);
|
||||
CpuFill32(0, gBattleAnimBgTileBuffer, 0x2000);
|
||||
LZDecompressWram(src, gBattleAnimBgTileBuffer);
|
||||
LoadBgTiles(bgId, gBattleAnimBgTileBuffer, 0x2000, tilesOffset);
|
||||
}
|
||||
|
||||
void InitAnimBgTilemapBuffer(u32 bgId, const void *src)
|
||||
|
||||
@@ -337,7 +337,7 @@ static void HandleInputChooseTarget(void)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||
BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
|
||||
EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX);
|
||||
PlayerBufferExecCompleted();
|
||||
@@ -345,7 +345,7 @@ static void HandleInputChooseTarget(void)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||
gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseMove;
|
||||
DoBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX, 7, 1);
|
||||
DoBounceEffect(gActiveBattler, BOUNCE_MON, 7, 1);
|
||||
@@ -354,7 +354,7 @@ static void HandleInputChooseTarget(void)
|
||||
else if (JOY_NEW(DPAD_LEFT | DPAD_UP))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -389,12 +389,12 @@ static void HandleInputChooseTarget(void)
|
||||
i = 0;
|
||||
}
|
||||
while (i == 0);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_RIGHT | DPAD_DOWN))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -429,7 +429,7 @@ static void HandleInputChooseTarget(void)
|
||||
i = 0;
|
||||
}
|
||||
while (i == 0);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ void HandleInputChooseMove(void)
|
||||
gMultiUsePlayerCursor = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
|
||||
else
|
||||
gMultiUsePlayerCursor = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
|
||||
}
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
|
||||
@@ -1100,13 +1100,13 @@ void BtlController_EmitIntroTrainerBallThrow(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 param)
|
||||
void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 flags)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_DRAWPARTYSTATUSSUMMARY;
|
||||
sBattleBuffersTransferData[1] = param & 0x7F;
|
||||
sBattleBuffersTransferData[2] = (param & 0x80) >> 7;
|
||||
sBattleBuffersTransferData[1] = flags & ~PARTY_SUMM_SKIP_DRAW_DELAY; // If true, skip player side
|
||||
sBattleBuffersTransferData[2] = (flags & PARTY_SUMM_SKIP_DRAW_DELAY) >> 7; // If true, skip delay after drawing. True during intro
|
||||
sBattleBuffersTransferData[3] = CONTROLLER_DRAWPARTYSTATUSSUMMARY;
|
||||
for (i = 0; i < (s32)(sizeof(struct HpAndStatus) * PARTY_SIZE); ++i)
|
||||
sBattleBuffersTransferData[4 + i] = *(i + (u8 *)(hpAndStatus));
|
||||
|
||||
@@ -140,7 +140,7 @@ void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite)
|
||||
gSprites[spriteId].animPaused = 0;
|
||||
else if (gSprites[spriteId].animEnded)
|
||||
{
|
||||
gSprites[spriteId].callback = SpriteCB_SetToDummy3;
|
||||
gSprites[spriteId].callback = SetIdleSpriteCallback;
|
||||
StartSpriteAffineAnim(&gSprites[spriteId], 0);
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
}
|
||||
|
||||
+14
-7
@@ -1137,8 +1137,9 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo,
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
{
|
||||
if (partyInfo[i].hp == 0xFFFF) // empty slot or an egg
|
||||
if (partyInfo[i].hp == HP_EMPTY_SLOT)
|
||||
{
|
||||
// empty slot or an egg
|
||||
gSprites[ballIconSpritesIds[i]].oam.tileNum += 1;
|
||||
gSprites[ballIconSpritesIds[i]].data[7] = 1;
|
||||
}
|
||||
@@ -1153,17 +1154,20 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i >= nValidMons) // empty slot or an egg
|
||||
if (i >= nValidMons)
|
||||
{
|
||||
// empty slot or an egg
|
||||
gSprites[ballIconSpritesIds[i]].oam.tileNum += 1;
|
||||
gSprites[ballIconSpritesIds[i]].data[7] = 1;
|
||||
}
|
||||
else if (partyInfo[i].hp == 0) // fainted mon
|
||||
else if (partyInfo[i].hp == 0)
|
||||
{
|
||||
// fainted mon
|
||||
gSprites[ballIconSpritesIds[i]].oam.tileNum += 3;
|
||||
}
|
||||
else if (partyInfo[i].status != 0) // mon with major status
|
||||
else if (partyInfo[i].status != 0)
|
||||
{
|
||||
// mon with major status
|
||||
gSprites[ballIconSpritesIds[i]].oam.tileNum += 2;
|
||||
}
|
||||
}
|
||||
@@ -1175,17 +1179,20 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo,
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
{
|
||||
if (partyInfo[i].hp == 0xFFFF) // empty slot or an egg
|
||||
if (partyInfo[i].hp == HP_EMPTY_SLOT)
|
||||
{
|
||||
// empty slot or an egg
|
||||
gSprites[ballIconSpritesIds[5 - i]].oam.tileNum += 1;
|
||||
gSprites[ballIconSpritesIds[5 - i]].data[7] = 1;
|
||||
}
|
||||
else if (partyInfo[i].hp == 0) // fainted mon
|
||||
else if (partyInfo[i].hp == 0)
|
||||
{
|
||||
// fainted mon
|
||||
gSprites[ballIconSpritesIds[5 - i]].oam.tileNum += 3;
|
||||
}
|
||||
else if (partyInfo[i].status != 0) // mon with major status
|
||||
else if (partyInfo[i].status != 0)
|
||||
{
|
||||
// mon with major status
|
||||
gSprites[ballIconSpritesIds[5 - i]].oam.tileNum += 2;
|
||||
}
|
||||
}
|
||||
|
||||
+668
-571
File diff suppressed because it is too large
Load Diff
+10
-4
@@ -2378,7 +2378,13 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = {
|
||||
{PIXEL_FILL(0x1), 4, 0x00, 1, 0, 1, 1, 0x2, 0x1, 0x3}
|
||||
};
|
||||
|
||||
const u8 gUnknown_83FEC90[] = {0x04, 0x05, 0x02, 0x02};
|
||||
static const u8 sNpcTextColorToFont[] =
|
||||
{
|
||||
[NPC_TEXT_COLOR_MALE] = FONT_4,
|
||||
[NPC_TEXT_COLOR_FEMALE] = FONT_5,
|
||||
[NPC_TEXT_COLOR_MON] = FONT_2,
|
||||
[NPC_TEXT_COLOR_NEUTRAL] = FONT_2,
|
||||
};
|
||||
|
||||
// windowId: Upper 2 bits are text flags
|
||||
// x40: Use NPC context-defined font
|
||||
@@ -2388,15 +2394,15 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId) {
|
||||
struct TextPrinterTemplate printerTemplate;
|
||||
u8 speed;
|
||||
int x;
|
||||
u8 context;
|
||||
u8 color;
|
||||
|
||||
u8 textFlags = windowId & 0xC0;
|
||||
windowId &= 0x3F;
|
||||
if (!(textFlags & 0x80))
|
||||
FillWindowPixelBuffer(windowId, sTextOnWindowsInfo_Normal[windowId].fillValue);
|
||||
if (textFlags & 0x40) {
|
||||
context = ContextNpcGetTextColor();
|
||||
printerTemplate.fontId = gUnknown_83FEC90[context];
|
||||
color = ContextNpcGetTextColor();
|
||||
printerTemplate.fontId = sNpcTextColorToFont[color];
|
||||
}
|
||||
else {
|
||||
printerTemplate.fontId = sTextOnWindowsInfo_Normal[windowId].fontId;
|
||||
|
||||
+662
-608
File diff suppressed because it is too large
Load Diff
+22
-10
@@ -2,8 +2,8 @@
|
||||
#include "bg.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "pokemon.h"
|
||||
#include "malloc.h"
|
||||
#include "pokemon.h"
|
||||
#include "trainer_tower.h"
|
||||
|
||||
void AllocateBattleResources(void)
|
||||
@@ -14,10 +14,12 @@ void AllocateBattleResources(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 4; ++i)
|
||||
for (i = 0; i < 4; i++)
|
||||
gPokedudeBattlerStates[i] = AllocZeroed(sizeof(struct PokedudeBattlerState));
|
||||
}
|
||||
|
||||
gBattleStruct = AllocZeroed(sizeof(*gBattleStruct));
|
||||
|
||||
gBattleResources = AllocZeroed(sizeof(*gBattleResources));
|
||||
gBattleResources->secretBase = AllocZeroed(sizeof(*gBattleResources->secretBase));
|
||||
gBattleResources->flags = AllocZeroed(sizeof(*gBattleResources->flags));
|
||||
@@ -27,12 +29,15 @@ void AllocateBattleResources(void)
|
||||
gBattleResources->ai = AllocZeroed(sizeof(*gBattleResources->ai));
|
||||
gBattleResources->battleHistory = AllocZeroed(sizeof(*gBattleResources->battleHistory));
|
||||
gBattleResources->AI_ScriptsStack = AllocZeroed(sizeof(*gBattleResources->AI_ScriptsStack));
|
||||
|
||||
gLinkBattleSendBuffer = AllocZeroed(BATTLE_BUFFER_LINK_SIZE);
|
||||
gLinkBattleRecvBuffer = AllocZeroed(BATTLE_BUFFER_LINK_SIZE);
|
||||
gBattleAnimMons_BgTilesBuffer = AllocZeroed(0x2000);
|
||||
gBattleAnimMons_BgTilemapBuffer = AllocZeroed(0x1000);
|
||||
SetBgTilemapBuffer(1, gBattleAnimMons_BgTilemapBuffer);
|
||||
SetBgTilemapBuffer(2, gBattleAnimMons_BgTilemapBuffer);
|
||||
|
||||
gBattleAnimBgTileBuffer = AllocZeroed(0x2000);
|
||||
gBattleAnimBgTilemapBuffer = AllocZeroed(0x1000);
|
||||
|
||||
SetBgTilemapBuffer(1, gBattleAnimBgTilemapBuffer);
|
||||
SetBgTilemapBuffer(2, gBattleAnimBgTilemapBuffer);
|
||||
}
|
||||
|
||||
void FreeBattleResources(void)
|
||||
@@ -43,7 +48,7 @@ void FreeBattleResources(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 4; ++i)
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
FREE_AND_SET_NULL(gPokedudeBattlerStates[i]);
|
||||
}
|
||||
@@ -51,6 +56,7 @@ void FreeBattleResources(void)
|
||||
if (gBattleResources != NULL)
|
||||
{
|
||||
FREE_AND_SET_NULL(gBattleStruct);
|
||||
|
||||
FREE_AND_SET_NULL(gBattleResources->secretBase);
|
||||
FREE_AND_SET_NULL(gBattleResources->flags);
|
||||
FREE_AND_SET_NULL(gBattleResources->battleScriptsStack);
|
||||
@@ -60,21 +66,26 @@ void FreeBattleResources(void)
|
||||
FREE_AND_SET_NULL(gBattleResources->battleHistory);
|
||||
FREE_AND_SET_NULL(gBattleResources->AI_ScriptsStack);
|
||||
FREE_AND_SET_NULL(gBattleResources);
|
||||
|
||||
FREE_AND_SET_NULL(gLinkBattleSendBuffer);
|
||||
FREE_AND_SET_NULL(gLinkBattleRecvBuffer);
|
||||
FREE_AND_SET_NULL(gBattleAnimMons_BgTilesBuffer);
|
||||
FREE_AND_SET_NULL(gBattleAnimMons_BgTilemapBuffer);
|
||||
|
||||
FREE_AND_SET_NULL(gBattleAnimBgTileBuffer);
|
||||
FREE_AND_SET_NULL(gBattleAnimBgTilemapBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
void AdjustFriendshipOnBattleFaint(u8 battlerId)
|
||||
{
|
||||
u8 opposingBattlerId, opposingBattlerId2;
|
||||
u8 opposingBattlerId;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
{
|
||||
u8 opposingBattlerId2;
|
||||
|
||||
opposingBattlerId = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||
opposingBattlerId2 = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
|
||||
|
||||
if (gBattleMons[opposingBattlerId2].level > gBattleMons[opposingBattlerId].level)
|
||||
opposingBattlerId = opposingBattlerId2;
|
||||
}
|
||||
@@ -82,6 +93,7 @@ void AdjustFriendshipOnBattleFaint(u8 battlerId)
|
||||
{
|
||||
opposingBattlerId = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||
}
|
||||
|
||||
if (gBattleMons[opposingBattlerId].level > gBattleMons[battlerId].level)
|
||||
{
|
||||
if (gBattleMons[opposingBattlerId].level - gBattleMons[battlerId].level > 29)
|
||||
|
||||
+107
-100
@@ -8,36 +8,38 @@
|
||||
#include "constants/battle_ai.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
const struct SpriteFrameImage gSpriteImages_BattlerPlayerLeft[] =
|
||||
#define BATTLER_OFFSET(i) (gHeap + 0x8000 + MON_PIC_SIZE * (i))
|
||||
|
||||
const struct SpriteFrameImage gBattlerPicTable_PlayerLeft[] =
|
||||
{
|
||||
gHeap + 0x8000, 0x800,
|
||||
gHeap + 0x8800, 0x800,
|
||||
gHeap + 0x9000, 0x800,
|
||||
gHeap + 0x9800, 0x800,
|
||||
BATTLER_OFFSET(0), MON_PIC_SIZE,
|
||||
BATTLER_OFFSET(1), MON_PIC_SIZE,
|
||||
BATTLER_OFFSET(2), MON_PIC_SIZE,
|
||||
BATTLER_OFFSET(3), MON_PIC_SIZE,
|
||||
};
|
||||
|
||||
const struct SpriteFrameImage gSpriteImages_BattlerOpponentLeft[] =
|
||||
const struct SpriteFrameImage gBattlerPicTable_OpponentLeft[] =
|
||||
{
|
||||
gHeap + 0xA000, 0x800,
|
||||
gHeap + 0xA800, 0x800,
|
||||
gHeap + 0xB000, 0x800,
|
||||
gHeap + 0xB800, 0x800,
|
||||
BATTLER_OFFSET(4), MON_PIC_SIZE,
|
||||
BATTLER_OFFSET(5), MON_PIC_SIZE,
|
||||
BATTLER_OFFSET(6), MON_PIC_SIZE,
|
||||
BATTLER_OFFSET(7), MON_PIC_SIZE,
|
||||
};
|
||||
|
||||
const struct SpriteFrameImage gSpriteImages_BattlerPlayerRight[] =
|
||||
const struct SpriteFrameImage gBattlerPicTable_PlayerRight[] =
|
||||
{
|
||||
gHeap + 0xC000, 0x800,
|
||||
gHeap + 0xC800, 0x800,
|
||||
gHeap + 0xD000, 0x800,
|
||||
gHeap + 0xD800, 0x800,
|
||||
BATTLER_OFFSET(8), MON_PIC_SIZE,
|
||||
BATTLER_OFFSET(9), MON_PIC_SIZE,
|
||||
BATTLER_OFFSET(10), MON_PIC_SIZE,
|
||||
BATTLER_OFFSET(11), MON_PIC_SIZE,
|
||||
};
|
||||
|
||||
const struct SpriteFrameImage gSpriteImages_BattlerOpponentRight[] =
|
||||
const struct SpriteFrameImage gBattlerPicTable_OpponentRight[] =
|
||||
{
|
||||
gHeap + 0xE000, 0x800,
|
||||
gHeap + 0xE800, 0x800,
|
||||
gHeap + 0xF000, 0x800,
|
||||
gHeap + 0xF800, 0x800,
|
||||
BATTLER_OFFSET(12), MON_PIC_SIZE,
|
||||
BATTLER_OFFSET(13), MON_PIC_SIZE,
|
||||
BATTLER_OFFSET(14), MON_PIC_SIZE,
|
||||
BATTLER_OFFSET(15), MON_PIC_SIZE,
|
||||
};
|
||||
|
||||
const struct SpriteFrameImage gTrainerBackPicTable_Red[] =
|
||||
@@ -102,172 +104,177 @@ static const union AnimCmd sAnim_GeneralFrame3[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_82347F8[] =
|
||||
// Many of these affine anims seem to go unused, and
|
||||
// instead SetSpriteRotScale is used to manipulate
|
||||
// the battler sprites directly (for instance, in AnimTask_SwitchOutShrinkMon).
|
||||
// Those with explicit indexes are referenced elsewhere.
|
||||
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_Normal[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x0100, 0x0100, 0x00, 0x00),
|
||||
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_8234808[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_Flipped[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0xff00, 0x0100, 0x00, 0x00),
|
||||
AFFINEANIMCMD_FRAME(-0x100, 0x0100, 0, 0),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_8234818[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_Emerge[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x0028, 0x0028, 0x00, 0x00),
|
||||
AFFINEANIMCMD_FRAME(0x0012, 0x0012, 0x00, 0x0c),
|
||||
AFFINEANIMCMD_FRAME(0x28, 0x28, 0, 0),
|
||||
AFFINEANIMCMD_FRAME(0x12, 0x12, 0, 12),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_8234830[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_Return[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0xfffe, 0xfffe, 0x00, 0x12),
|
||||
AFFINEANIMCMD_FRAME(0xfff0, 0xfff0, 0x00, 0x0f),
|
||||
AFFINEANIMCMD_FRAME(-0x2, -0x2, 0, 18),
|
||||
AFFINEANIMCMD_FRAME(-0x10, -0x10, 0, 15),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_8234848[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_HorizontalSquishLoop[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x00a0, 0x0100, 0x00, 0x00),
|
||||
AFFINEANIMCMD_FRAME(0x0004, 0x0000, 0x00, 0x08),
|
||||
AFFINEANIMCMD_FRAME(0xfffc, 0x0000, 0x00, 0x08),
|
||||
AFFINEANIMCMD_FRAME(0xA0, 0x100, 0, 0),
|
||||
AFFINEANIMCMD_FRAME( 0x4, 0x0, 0, 8),
|
||||
AFFINEANIMCMD_FRAME(-0x4, 0x0, 0, 8),
|
||||
AFFINEANIMCMD_JUMP(1),
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_8234868[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_Grow[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x0002, 0x0002, 0x00, 0x14),
|
||||
AFFINEANIMCMD_FRAME(0x2, 0x2, 0, 20),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_8234878[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_Shrink[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0xfffe, 0xfffe, 0x00, 0x14),
|
||||
AFFINEANIMCMD_FRAME(-0x2, -0x2, 0, 20),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_8234888[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_BigToSmall[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x0100, 0x0100, 0x00, 0000),
|
||||
AFFINEANIMCMD_FRAME(0xfff0, 0xfff0, 0x00, 0x09),
|
||||
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
|
||||
AFFINEANIMCMD_FRAME(-0x10, -0x10, 0, 9),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_82348A0[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_GrowLarge[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x0004, 0x0004, 0x00, 0x3f),
|
||||
AFFINEANIMCMD_FRAME(0x4, 0x4, 0, 63),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_82348B0[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_TipRight[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0xfd, 0x05),
|
||||
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x03, 0x05),
|
||||
AFFINEANIMCMD_FRAME(0x0, 0x0, -3, 5),
|
||||
AFFINEANIMCMD_FRAME(0x0, 0x0, 3, 5),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AffineAnimCmd *const gSpriteAffineAnimTable_BattlerPlayer[] =
|
||||
const union AffineAnimCmd *const gAffineAnims_BattleSpritePlayerSide[] =
|
||||
{
|
||||
gSpriteAffineAnim_82347F8,
|
||||
gSpriteAffineAnim_8234818,
|
||||
gSpriteAffineAnim_8234830,
|
||||
gSpriteAffineAnim_8234848,
|
||||
gSpriteAffineAnim_8234868,
|
||||
gSpriteAffineAnim_8234878,
|
||||
gSpriteAffineAnim_82348A0,
|
||||
gSpriteAffineAnim_82348B0,
|
||||
gSpriteAffineAnim_8234888,
|
||||
[BATTLER_AFFINE_NORMAL] = sAffineAnim_Battler_Normal,
|
||||
[BATTLER_AFFINE_EMERGE] = sAffineAnim_Battler_Emerge,
|
||||
[BATTLER_AFFINE_RETURN] = sAffineAnim_Battler_Return,
|
||||
sAffineAnim_Battler_HorizontalSquishLoop,
|
||||
sAffineAnim_Battler_Grow,
|
||||
sAffineAnim_Battler_Shrink,
|
||||
sAffineAnim_Battler_GrowLarge,
|
||||
sAffineAnim_Battler_TipRight,
|
||||
sAffineAnim_Battler_BigToSmall,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_82348EC[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_SpinShrink[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0xfffc, 0xfffc, 0x04, 0x3f),
|
||||
AFFINEANIMCMD_FRAME(-0x4, -0x4, 4, 63),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_82348FC[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_TipLeft[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x03, 0x05),
|
||||
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0xfd, 0x05),
|
||||
AFFINEANIMCMD_FRAME(0x0, 0x0, 3, 5),
|
||||
AFFINEANIMCMD_FRAME(0x0, 0x0, -3, 5),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_8234914[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_RotateUpAndBack[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0xfb, 0x14),
|
||||
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x00, 0x14),
|
||||
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x05, 0x14),
|
||||
AFFINEANIMCMD_FRAME(0x0, 0x0, -5, 20),
|
||||
AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 20),
|
||||
AFFINEANIMCMD_FRAME(0x0, 0x0, 5, 20),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_8234934[] =
|
||||
static const union AffineAnimCmd sAffineAnim_Battler_Spin[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x0000, 0x0000, 0x09, 0x6e),
|
||||
AFFINEANIMCMD_FRAME(0x0, 0x0, 9, 110),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AffineAnimCmd *const gSpriteAffineAnimTable_BattlerOpponent[] =
|
||||
const union AffineAnimCmd *const gAffineAnims_BattleSpriteOpponentSide[] =
|
||||
{
|
||||
gSpriteAffineAnim_82347F8,
|
||||
gSpriteAffineAnim_8234818,
|
||||
gSpriteAffineAnim_8234830,
|
||||
gSpriteAffineAnim_8234848,
|
||||
gSpriteAffineAnim_8234868,
|
||||
gSpriteAffineAnim_8234878,
|
||||
gSpriteAffineAnim_82348EC,
|
||||
gSpriteAffineAnim_82348FC,
|
||||
gSpriteAffineAnim_8234914,
|
||||
gSpriteAffineAnim_8234888,
|
||||
gSpriteAffineAnim_8234934,
|
||||
[BATTLER_AFFINE_NORMAL] = sAffineAnim_Battler_Normal,
|
||||
[BATTLER_AFFINE_EMERGE] = sAffineAnim_Battler_Emerge,
|
||||
[BATTLER_AFFINE_RETURN] = sAffineAnim_Battler_Return,
|
||||
sAffineAnim_Battler_HorizontalSquishLoop,
|
||||
sAffineAnim_Battler_Grow,
|
||||
sAffineAnim_Battler_Shrink,
|
||||
sAffineAnim_Battler_SpinShrink,
|
||||
sAffineAnim_Battler_TipLeft,
|
||||
sAffineAnim_Battler_RotateUpAndBack,
|
||||
sAffineAnim_Battler_BigToSmall,
|
||||
sAffineAnim_Battler_Spin,
|
||||
};
|
||||
|
||||
const union AffineAnimCmd *const gSpriteAffineAnimTable_82349470[] =
|
||||
const union AffineAnimCmd *const gAffineAnims_BattleSpriteContest[] =
|
||||
{
|
||||
gSpriteAffineAnim_8234808,
|
||||
gSpriteAffineAnim_8234818,
|
||||
gSpriteAffineAnim_8234830,
|
||||
gSpriteAffineAnim_8234848,
|
||||
gSpriteAffineAnim_8234868,
|
||||
gSpriteAffineAnim_8234878,
|
||||
gSpriteAffineAnim_82348EC,
|
||||
gSpriteAffineAnim_82348FC,
|
||||
gSpriteAffineAnim_8234914,
|
||||
gSpriteAffineAnim_8234888,
|
||||
gSpriteAffineAnim_8234934,
|
||||
[BATTLER_AFFINE_NORMAL] = sAffineAnim_Battler_Flipped,
|
||||
[BATTLER_AFFINE_EMERGE] = sAffineAnim_Battler_Emerge,
|
||||
[BATTLER_AFFINE_RETURN] = sAffineAnim_Battler_Return,
|
||||
sAffineAnim_Battler_HorizontalSquishLoop,
|
||||
sAffineAnim_Battler_Grow,
|
||||
sAffineAnim_Battler_Shrink,
|
||||
sAffineAnim_Battler_SpinShrink,
|
||||
sAffineAnim_Battler_TipLeft,
|
||||
sAffineAnim_Battler_RotateUpAndBack,
|
||||
sAffineAnim_Battler_BigToSmall,
|
||||
sAffineAnim_Battler_Spin,
|
||||
};
|
||||
|
||||
static const union AnimCmd gSpriteAnim_823499C[] =
|
||||
static const union AnimCmd sAnim_MonPic_0[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 0),
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AnimCmd gSpriteAnim_82349A4[] =
|
||||
static const union AnimCmd sAnim_MonPic_1[] =
|
||||
{
|
||||
ANIMCMD_FRAME(1, 0),
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AnimCmd gSpriteAnim_82349AC[] =
|
||||
static const union AnimCmd sAnim_MonPic_2[] =
|
||||
{
|
||||
ANIMCMD_FRAME(2, 0),
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AnimCmd gSpriteAnim_82349B4[] =
|
||||
static const union AnimCmd sAnim_MonPic_3[] =
|
||||
{
|
||||
ANIMCMD_FRAME(3, 0),
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd *const gSpriteAnimTable_82349BC[] =
|
||||
const union AnimCmd *const gAnims_MonPic[] =
|
||||
{
|
||||
gSpriteAnim_823499C,
|
||||
gSpriteAnim_82349A4,
|
||||
gSpriteAnim_82349AC,
|
||||
gSpriteAnim_82349B4,
|
||||
sAnim_MonPic_0,
|
||||
sAnim_MonPic_1,
|
||||
sAnim_MonPic_2,
|
||||
sAnim_MonPic_3,
|
||||
};
|
||||
|
||||
#define SPECIES_SPRITE(species, sprite) [SPECIES_##species] = {sprite, 0x800, SPECIES_##species}
|
||||
|
||||
@@ -1,247 +0,0 @@
|
||||
#ifndef GUARD_DATA_DODRIO_BERRY_PICKING_H
|
||||
#define GUARD_DATA_DODRIO_BERRY_PICKING_H
|
||||
|
||||
static const struct BgTemplate sUnknown_847565C[] =
|
||||
{
|
||||
{
|
||||
.bg = 0,
|
||||
.charBaseIndex = 0,
|
||||
.mapBaseIndex = 30,
|
||||
.screenSize = 0,
|
||||
.paletteMode = 0,
|
||||
.priority = 0,
|
||||
.baseTile = 0
|
||||
},
|
||||
{
|
||||
.bg = 1,
|
||||
.charBaseIndex = 2,
|
||||
.mapBaseIndex = 12,
|
||||
.screenSize = 1,
|
||||
.paletteMode = 0,
|
||||
.priority = 1,
|
||||
.baseTile = 0
|
||||
},
|
||||
{
|
||||
.bg = 2,
|
||||
.charBaseIndex = 2,
|
||||
.mapBaseIndex = 14,
|
||||
.screenSize = 1,
|
||||
.paletteMode = 0,
|
||||
.priority = 1,
|
||||
.baseTile = 0
|
||||
},
|
||||
{
|
||||
.bg = 3,
|
||||
.charBaseIndex = 3,
|
||||
.mapBaseIndex = 31,
|
||||
.screenSize = 0,
|
||||
.paletteMode = 0,
|
||||
.priority = 2,
|
||||
.baseTile = 0
|
||||
},
|
||||
};
|
||||
|
||||
// Unknown unreferenced data, feel free to remove.
|
||||
static const u32 sUnused[] = {255, 0};
|
||||
|
||||
static const struct WindowTemplate sUnknown_8475674[] =
|
||||
{
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 1,
|
||||
.width = 28,
|
||||
.height = 3,
|
||||
.paletteNum = 13,
|
||||
.baseBlock = 0x13,
|
||||
},
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 6,
|
||||
.width = 28,
|
||||
.height = 13,
|
||||
.paletteNum = 13,
|
||||
.baseBlock = 0x67,
|
||||
}
|
||||
};
|
||||
|
||||
static const struct WindowTemplate sUnknown_8475684 =
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 6,
|
||||
.width = 28,
|
||||
.height = 7,
|
||||
.paletteNum = 13,
|
||||
.baseBlock = 0x67,
|
||||
};
|
||||
|
||||
static const struct WindowTemplate sUnknown_847568C[] =
|
||||
{
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 8,
|
||||
.width = 19,
|
||||
.height = 3,
|
||||
.paletteNum = 13,
|
||||
.baseBlock = 0x13,
|
||||
},
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 22,
|
||||
.tilemapTop = 7,
|
||||
.width = 6,
|
||||
.height = 4,
|
||||
.paletteNum = 13,
|
||||
.baseBlock = 0x4C,
|
||||
}
|
||||
};
|
||||
|
||||
static const struct WindowTemplate sUnknown_847569C =
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 4,
|
||||
.tilemapTop = 6,
|
||||
.width = 22,
|
||||
.height = 5,
|
||||
.paletteNum = 13,
|
||||
.baseBlock = 0x13,
|
||||
};
|
||||
|
||||
static const struct WindowTemplate sUnknown_84756A4 =
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 5,
|
||||
.tilemapTop = 8,
|
||||
.width = 19,
|
||||
.height = 3,
|
||||
.paletteNum = 13,
|
||||
.baseBlock = 0x13,
|
||||
};
|
||||
|
||||
static const u8 sUnknown_8471F50[5][5][11] =
|
||||
{
|
||||
{
|
||||
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0},
|
||||
},
|
||||
{
|
||||
{0, 1, 2, 3, 4, 5, 6, 3, 8, 9, 0},
|
||||
{0, 1, 2, 5, 6, 3, 4, 5, 8, 9, 0},
|
||||
},
|
||||
{
|
||||
{0, 1, 2, 3, 4, 5, 6, 7, 2, 9, 0},
|
||||
{0, 1, 4, 5, 6, 7, 2, 3, 4, 9, 0},
|
||||
{0, 1, 6, 7, 2, 3, 4, 5, 6, 9, 0},
|
||||
},
|
||||
{
|
||||
{0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 0},
|
||||
{0, 3, 4, 5, 6, 7, 8, 1, 2, 3, 0},
|
||||
{0, 5, 6, 7, 8, 1, 2, 3, 4, 5, 0},
|
||||
{0, 7, 8, 1, 2, 3, 4, 5, 6, 7, 0},
|
||||
},
|
||||
{
|
||||
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0},
|
||||
{2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2},
|
||||
{4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4},
|
||||
{6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6},
|
||||
{8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8},
|
||||
},
|
||||
};
|
||||
|
||||
static const u8 sUnknown_8472063[5][5][3] =
|
||||
{
|
||||
{
|
||||
{4, 5, 6},
|
||||
},
|
||||
{
|
||||
{3, 4, 5},
|
||||
{5, 6, 3},
|
||||
},
|
||||
{
|
||||
{4, 5, 6},
|
||||
{6, 7, 2},
|
||||
{2, 3, 4},
|
||||
},
|
||||
{
|
||||
{3, 4, 5},
|
||||
{5, 6, 7},
|
||||
{7, 8, 1},
|
||||
{1, 2, 3},
|
||||
},
|
||||
{
|
||||
{4, 5, 6},
|
||||
{6, 7, 8},
|
||||
{8, 9, 0},
|
||||
{0, 1, 2},
|
||||
{2, 3, 4},
|
||||
},
|
||||
};
|
||||
|
||||
static const u8 sUnknown_84720AE[5][5][3] =
|
||||
{
|
||||
{
|
||||
{1, 0, 1},
|
||||
},
|
||||
{
|
||||
{1, 0, 1},
|
||||
{0, 1, 0},
|
||||
},
|
||||
{
|
||||
{2, 0, 1},
|
||||
{0, 1, 2},
|
||||
{1, 2, 0},
|
||||
},
|
||||
{
|
||||
{3, 0, 1},
|
||||
{0, 1, 2},
|
||||
{1, 2, 3},
|
||||
{2, 3, 0},
|
||||
},
|
||||
{
|
||||
{4, 0, 1},
|
||||
{0, 1, 2},
|
||||
{1, 2, 3},
|
||||
{2, 3, 4},
|
||||
{3, 4, 0},
|
||||
},
|
||||
};
|
||||
|
||||
ALIGNED(4)
|
||||
static const u8 sUnknown_84720FC[5][11] =
|
||||
{
|
||||
{9, 9, 9, 9, 1, 1, 1, 9, 9, 9, 9},
|
||||
{9, 9, 9, 0, 0, 1, 1, 0, 9, 9, 9},
|
||||
{9, 9, 2, 2, 0, 0, 1, 1, 1, 9, 9},
|
||||
{9, 3, 3, 0, 0, 1, 1, 2, 2, 3, 9},
|
||||
{3, 3, 4, 4, 0, 0, 1, 1, 2, 2, 3},
|
||||
};
|
||||
|
||||
static const u8 sUnknown_8472133[5][5] =
|
||||
{
|
||||
{5},
|
||||
{4, 6},
|
||||
{3, 5, 7},
|
||||
{2, 4, 6, 8},
|
||||
{1, 3, 5, 6, 9},
|
||||
};
|
||||
|
||||
static const u16 sDodrioBerryBgPal1[] = INCBIN_U16("graphics/link_games/dodrioberry_bg1.gbapal",
|
||||
"graphics/link_games/dodrioberry_bg2.gbapal");
|
||||
static const u16 sDodrioBerryPkmnPal[] = INCBIN_U16("graphics/link_games/dodrioberry_pkmn.gbapal");
|
||||
static const u16 sDodrioBerryShinyPal[] = INCBIN_U16("graphics/link_games/dodrioberry_shiny.gbapal");
|
||||
static const u16 sDodrioBerryStatusPal[] = INCBIN_U16("graphics/link_games/dodrioberry_status.gbapal");
|
||||
static const u16 sDodrioBerrySpritesPal[] = INCBIN_U16("graphics/link_games/dodrioberry_berrysprites.gbapal");
|
||||
static const u32 sDodrioBerrySpritesGfx[] = INCBIN_U32("graphics/link_games/dodrioberry_berrysprites.4bpp.lz");
|
||||
static const u16 sDodrioBerryPlatformPal[] = INCBIN_U16("graphics/link_games/dodrioberry_platform.gbapal");
|
||||
static const u32 sDodrioBerryBgGfx1[] = INCBIN_U32("graphics/link_games/dodrioberry_bg1.4bpp.lz");
|
||||
static const u32 sDodrioBerryBgGfx2[] = INCBIN_U32("graphics/link_games/dodrioberry_bg2.4bpp.lz");
|
||||
static const u32 sDodrioBerryStatusGfx[] = INCBIN_U32("graphics/link_games/dodrioberry_status.4bpp.lz");
|
||||
static const u32 sDodrioBerryPlatformGfx[] = INCBIN_U32("graphics/link_games/dodrioberry_platform.4bpp.lz");
|
||||
static const u32 sDodrioBerryPkmnGfx[] = INCBIN_U32("graphics/link_games/dodrioberry_pkmn.4bpp.lz");
|
||||
static const u32 sDodrioBerryBgTilemap1[] = INCBIN_U32("graphics/link_games/dodrioberry_bg1.bin.lz");
|
||||
static const u32 sDodrioBerryBgTilemap2Right[] = INCBIN_U32("graphics/link_games/dodrioberry_bg2right.bin.lz");
|
||||
static const u32 sDodrioBerryBgTilemap2Left[] = INCBIN_U32("graphics/link_games/dodrioberry_bg2left.bin.lz");
|
||||
|
||||
#endif //GUARD_DATA_DODRIO_BERRY_PICKING_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -141,12 +141,12 @@ static bool8 MovementType_MoveInPlace_Step1(struct ObjectEvent *objectEvent, str
|
||||
static bool8 MovementType_Invisible_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_Invisible_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_Invisible_Step2(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_VsSeeker4D_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_VsSeeker4D_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_VsSeeker4D_Step2(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_VsSeeker4E_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_VsSeeker4F_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_VsSeeker4E_VsSeeker4F_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_RaiseHandAndStop_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_RaiseHandAndStop_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_RaiseHandAndStop_Step2(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_RaiseHandAndJump_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_RaiseHandAndSwim_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
static bool8 MovementType_RaiseHandAndMove_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite);
|
||||
|
||||
static u8 GetVectorDirection(s16 dx, s16 dy, s16 absdx, s16 absdy);
|
||||
static u8 GetLimitedVectorDirection_SouthNorth(s16 dx, s16 dy, s16 absdx, s16 absdy);
|
||||
@@ -596,18 +596,18 @@ u8 (*const gMovementTypeFuncs_Invisible[])(struct ObjectEvent *, struct Sprite *
|
||||
MovementType_Invisible_Step2,
|
||||
};
|
||||
|
||||
u8 (*const gMovementTypeFuncs_VsSeeker4D[])(struct ObjectEvent *, struct Sprite *) = {
|
||||
MovementType_VsSeeker4D_Step0,
|
||||
MovementType_VsSeeker4D_Step1,
|
||||
MovementType_VsSeeker4D_Step2,
|
||||
u8 (*const gMovementTypeFuncs_RaiseHandAndStop[])(struct ObjectEvent *, struct Sprite *) = {
|
||||
MovementType_RaiseHandAndStop_Step0,
|
||||
MovementType_RaiseHandAndStop_Step1,
|
||||
MovementType_RaiseHandAndStop_Step2,
|
||||
};
|
||||
|
||||
u8 (*const gMovementTypeFuncs_VsSeeker4E[])(struct ObjectEvent *, struct Sprite *) = {
|
||||
MovementType_VsSeeker4E_Step0,
|
||||
MovementType_VsSeeker4E_VsSeeker4F_Step1,
|
||||
u8 (*const gMovementTypeFuncs_RaiseHandAndJump[])(struct ObjectEvent *, struct Sprite *) = {
|
||||
MovementType_RaiseHandAndJump_Step0,
|
||||
MovementType_RaiseHandAndMove_Step1,
|
||||
};
|
||||
|
||||
u8 (*const gMovementTypeFuncs_VsSeeker4F[])(struct ObjectEvent *, struct Sprite *) = {
|
||||
MovementType_VsSeeker4F_Step0,
|
||||
MovementType_VsSeeker4E_VsSeeker4F_Step1,
|
||||
u8 (*const gMovementTypeFuncs_RaiseHandAndSwim[])(struct ObjectEvent *, struct Sprite *) = {
|
||||
MovementType_RaiseHandAndSwim_Step0,
|
||||
MovementType_RaiseHandAndMove_Step1,
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1969,7 +1969,7 @@ static void CB2_EggHatch_1(void)
|
||||
species = GetMonData(&gPlayerParty[sEggHatchData->eggPartyID], MON_DATA_SPECIES);
|
||||
gender = GetMonGender(&gPlayerParty[sEggHatchData->eggPartyID]);
|
||||
personality = GetMonData(&gPlayerParty[sEggHatchData->eggPartyID], MON_DATA_PERSONALITY, 0);
|
||||
DoNamingScreen(NAMING_SCREEN_NAME_RATER, gStringVar3, species, gender, personality, EggHatchSetMonNickname);
|
||||
DoNamingScreen(NAMING_SCREEN_NICKNAME, gStringVar3, species, gender, personality, EggHatchSetMonNickname);
|
||||
break;
|
||||
case 1:
|
||||
case -1:
|
||||
|
||||
+3747
-1228
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,241 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "dodrio_berry_picking.h"
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
|
||||
void sub_815A5BC(s32 a0)
|
||||
{
|
||||
struct Padded_U8 data[2];
|
||||
data[0].value = 1;
|
||||
data[1].value = a0;
|
||||
Rfu_SendPacket(data);
|
||||
}
|
||||
|
||||
u8 sub_815A5E8(s32 a0)
|
||||
{
|
||||
u8 * r1;
|
||||
if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00)
|
||||
return 0;
|
||||
r1 = (u8 *)&gRecvCmds[a0][1];
|
||||
if (r1[0] == 1)
|
||||
return r1[4];
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct UnkPacket2
|
||||
{
|
||||
u8 id;
|
||||
u8 unk1_0:4;
|
||||
u8 unk1_1:4;
|
||||
u16 unk2_0:4;
|
||||
u16 unk2_1:4;
|
||||
u16 unk3_0:4;
|
||||
u16 unk3_1:4;
|
||||
u16 unk4_0:4;
|
||||
u16 unk4_1:4;
|
||||
u16 unk5_0:4;
|
||||
u16 unk5_1:4;
|
||||
u16 unk6_0:2;
|
||||
u16 unk6_1:2;
|
||||
u16 unk6_2:2;
|
||||
u16 unk6_3:2;
|
||||
u16 unk7_0:2;
|
||||
u16 unk7_1:2;
|
||||
u16 unk7_2:2;
|
||||
u16 unk7_3:2;
|
||||
u8 unk8_0:2;
|
||||
u8 unk8_1:2;
|
||||
u8 unk8_2:2;
|
||||
u8 unk8_3:2;
|
||||
u8 unk9_0:2;
|
||||
u8 unk9_1:2;
|
||||
u8 unk9_2:2;
|
||||
u8 unk9_3:1;
|
||||
u8 unk9_4:1;
|
||||
u8 unkA_0:1;
|
||||
u8 unkA_1:1;
|
||||
u8 unkA_2:1;
|
||||
u8 unkA_3:5;
|
||||
u8 unkB_0:1;
|
||||
u8 unkB_1:1;
|
||||
u8 unkB_2:1;
|
||||
u8 unkB_3:1;
|
||||
u8 unkB_4:1;
|
||||
u8 unkB_5:1;
|
||||
u8 unkB_6:1;
|
||||
};
|
||||
|
||||
void sub_815A61C(struct DodrioSubstruct_31A0 * arg0, struct DodrioSubstruct_31A0_2C * arg1, struct DodrioSubstruct_31A0_2C * arg2, struct DodrioSubstruct_31A0_2C * arg3, struct DodrioSubstruct_31A0_2C * arg4, struct DodrioSubstruct_31A0_2C * arg5, u8 arg6, u32 arg7, u32 arg8)
|
||||
{
|
||||
struct UnkPacket2 packet;
|
||||
struct DodrioSubstruct_31A0_14 * ptr = &arg0->unk14;
|
||||
|
||||
packet.id = 2;
|
||||
packet.unk1_0 = ptr->unkB[0];
|
||||
packet.unk1_1 = ptr->unkB[1];
|
||||
packet.unk2_0 = ptr->unkB[2];
|
||||
packet.unk2_1 = ptr->unkB[3];
|
||||
packet.unk3_0 = ptr->unkB[4];
|
||||
packet.unk3_1 = ptr->unkB[5];
|
||||
packet.unk4_0 = ptr->unkB[6];
|
||||
packet.unk4_1 = ptr->unkB[7];
|
||||
packet.unk5_0 = ptr->unkB[8];
|
||||
packet.unk5_1 = ptr->unkB[9];
|
||||
|
||||
packet.unk6_0 = ptr->unk0[0];
|
||||
packet.unk6_1 = ptr->unk0[1];
|
||||
packet.unk6_2 = ptr->unk0[2];
|
||||
packet.unk6_3 = ptr->unk0[3];
|
||||
packet.unk7_0 = ptr->unk0[4];
|
||||
packet.unk7_1 = ptr->unk0[5];
|
||||
packet.unk7_2 = ptr->unk0[6];
|
||||
packet.unk7_3 = ptr->unk0[7];
|
||||
packet.unk8_0 = ptr->unk0[8];
|
||||
packet.unk8_1 = ptr->unk0[9];
|
||||
|
||||
packet.unk8_2 = arg1->unk0;
|
||||
packet.unk8_3 = arg2->unk0;
|
||||
packet.unk9_0 = arg3->unk0;
|
||||
packet.unk9_1 = arg4->unk0;
|
||||
packet.unk9_2 = arg5->unk0;
|
||||
|
||||
packet.unk9_3 = arg1->unk4;
|
||||
packet.unk9_4 = arg2->unk4;
|
||||
packet.unkA_0 = arg3->unk4;
|
||||
packet.unkA_1 = arg4->unk4;
|
||||
packet.unkA_2 = arg5->unk4;
|
||||
|
||||
packet.unkB_2 = arg1->unk8;
|
||||
packet.unkB_3 = arg2->unk8;
|
||||
packet.unkB_4 = arg3->unk8;
|
||||
packet.unkB_5 = arg4->unk8;
|
||||
packet.unkB_6 = arg5->unk8;
|
||||
|
||||
packet.unkA_3 = arg6;
|
||||
packet.unkB_1 = arg7;
|
||||
packet.unkB_0 = arg8;
|
||||
Rfu_SendPacket(&packet);
|
||||
}
|
||||
|
||||
u32 sub_815A950(u32 unused, struct DodrioSubstruct_31A0 * arg0, struct DodrioSubstruct_31A0_2C * arg1, struct DodrioSubstruct_31A0_2C * arg2, struct DodrioSubstruct_31A0_2C * arg3, struct DodrioSubstruct_31A0_2C * arg4, struct DodrioSubstruct_31A0_2C * arg5, u8 *arg6, u32 *arg7, u32 *arg8)
|
||||
{
|
||||
struct UnkPacket2 * packet;
|
||||
struct DodrioSubstruct_31A0_14 * ptr = &arg0->unk14;
|
||||
|
||||
if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00)
|
||||
return 0;
|
||||
|
||||
packet = (void *)&gRecvCmds[0][1];
|
||||
if (packet->id == 2)
|
||||
{
|
||||
ptr->unkB[0] = packet->unk1_0;
|
||||
ptr->unkB[1] = packet->unk1_1;
|
||||
ptr->unkB[2] = packet->unk2_0;
|
||||
ptr->unkB[3] = packet->unk2_1;
|
||||
ptr->unkB[4] = packet->unk3_0;
|
||||
ptr->unkB[5] = packet->unk3_1;
|
||||
ptr->unkB[6] = packet->unk4_0;
|
||||
ptr->unkB[7] = packet->unk4_1;
|
||||
ptr->unkB[8] = packet->unk5_0;
|
||||
ptr->unkB[9] = packet->unk5_1;
|
||||
ptr->unkB[10] = packet->unk1_0;
|
||||
|
||||
ptr->unk0[0] = packet->unk6_0;
|
||||
ptr->unk0[1] = packet->unk6_1;
|
||||
ptr->unk0[2] = packet->unk6_2;
|
||||
ptr->unk0[3] = packet->unk6_3;
|
||||
ptr->unk0[4] = packet->unk7_0;
|
||||
ptr->unk0[5] = packet->unk7_1;
|
||||
ptr->unk0[6] = packet->unk7_2;
|
||||
ptr->unk0[7] = packet->unk7_3;
|
||||
ptr->unk0[8] = packet->unk8_0;
|
||||
ptr->unk0[9] = packet->unk8_1;
|
||||
ptr->unk0[10] = packet->unk6_0;
|
||||
|
||||
arg1->unk0 = packet->unk8_2;
|
||||
arg1->unk4 = packet->unk9_3;
|
||||
arg1->unk8 = packet->unkB_2;
|
||||
|
||||
arg2->unk0 = packet->unk8_3;
|
||||
arg2->unk4 = packet->unk9_4;
|
||||
arg2->unk8 = packet->unkB_3;
|
||||
|
||||
arg3->unk0 = packet->unk9_0;
|
||||
arg3->unk4 = packet->unkA_0;
|
||||
arg3->unk8 = packet->unkB_4;
|
||||
|
||||
arg4->unk0 = packet->unk9_1;
|
||||
arg4->unk4 = packet->unkA_1;
|
||||
arg4->unk8 = packet->unkB_5;
|
||||
|
||||
arg5->unk0 = packet->unk9_2;
|
||||
arg5->unk4 = packet->unkA_2;
|
||||
arg5->unk8 = packet->unkB_6;
|
||||
|
||||
*arg6 = packet->unkA_3;
|
||||
*arg7 = packet->unkB_1;
|
||||
*arg8 = packet->unkB_0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct UnkPacket3
|
||||
{
|
||||
u8 id;
|
||||
u8 ALIGNED(4) unk4;
|
||||
};
|
||||
|
||||
void sub_815AAD8(u8 arg0)
|
||||
{
|
||||
struct UnkPacket3 packet;
|
||||
packet.id = 3;
|
||||
packet.unk4 = arg0;
|
||||
Rfu_SendPacket(&packet);
|
||||
}
|
||||
|
||||
u32 sub_815AB04(u32 arg0, u8 *arg1)
|
||||
{
|
||||
struct UnkPacket3 * packet;
|
||||
|
||||
if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00)
|
||||
return 0;
|
||||
|
||||
packet = (void *)&gRecvCmds[arg0][1];
|
||||
if (packet->id == 3)
|
||||
{
|
||||
*arg1 = packet->unk4;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct UnkPacket4
|
||||
{
|
||||
u8 id;
|
||||
u32 unk4;
|
||||
};
|
||||
|
||||
void sub_815AB3C(u32 arg0)
|
||||
{
|
||||
struct UnkPacket4 packet;
|
||||
packet.id = 4;
|
||||
packet.unk4 = arg0;
|
||||
Rfu_SendPacket(&packet);
|
||||
}
|
||||
|
||||
u32 sub_815AB60(u32 arg0)
|
||||
{
|
||||
struct UnkPacket4 * packet;
|
||||
|
||||
if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00)
|
||||
return 0;
|
||||
|
||||
packet = (void *)&gRecvCmds[arg0][1];
|
||||
if (packet->id == 4)
|
||||
return packet->unk4;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,274 @@
|
||||
#include "global.h"
|
||||
#include "dodrio_berry_picking.h"
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
|
||||
enum {
|
||||
PACKET_READY_START = 1,
|
||||
PACKET_GAME_STATE,
|
||||
PACKET_PICK_STATE,
|
||||
PACKET_READY_END,
|
||||
};
|
||||
|
||||
struct ReadyToStartPacket
|
||||
{
|
||||
u8 id;
|
||||
bool8 ALIGNED(4) ready;
|
||||
};
|
||||
|
||||
struct GameStatePacket
|
||||
{
|
||||
u8 id;
|
||||
u8 fallDist_Col0:4;
|
||||
u8 fallDist_Col1:4;
|
||||
u16 fallDist_Col2:4;
|
||||
u16 fallDist_Col3:4;
|
||||
u16 fallDist_Col4:4;
|
||||
u16 fallDist_Col5:4;
|
||||
u16 fallDist_Col6:4;
|
||||
u16 fallDist_Col7:4;
|
||||
u16 fallDist_Col8:4;
|
||||
u16 fallDist_Col9:4;
|
||||
u16 berryId_Col0:2;
|
||||
u16 berryId_Col1:2;
|
||||
u16 berryId_Col2:2;
|
||||
u16 berryId_Col3:2;
|
||||
u16 berryId_Col4:2;
|
||||
u16 berryId_Col5:2;
|
||||
u16 berryId_Col6:2;
|
||||
u16 berryId_Col7:2;
|
||||
u8 berryId_Col8:2;
|
||||
u8 berryId_Col9:2;
|
||||
u8 pickState_Player1:2;
|
||||
u8 pickState_Player2:2;
|
||||
u8 pickState_Player3:2;
|
||||
u8 pickState_Player4:2;
|
||||
u8 pickState_Player5:2;
|
||||
bool8 ateBerry_Player1:1;
|
||||
bool8 ateBerry_Player2:1;
|
||||
bool8 ateBerry_Player3:1;
|
||||
bool8 ateBerry_Player4:1;
|
||||
bool8 ateBerry_Player5:1;
|
||||
u8 numGraySquares:5;
|
||||
bool8 allReadyToEnd:1;
|
||||
bool8 berriesFalling:1;
|
||||
bool8 missedBerry_Player1:1;
|
||||
bool8 missedBerry_Player2:1;
|
||||
bool8 missedBerry_Player3:1;
|
||||
bool8 missedBerry_Player4:1;
|
||||
bool8 missedBerry_Player5:1;
|
||||
};
|
||||
|
||||
struct PickStatePacket
|
||||
{
|
||||
u8 id;
|
||||
u8 ALIGNED(4) pickState;
|
||||
};
|
||||
|
||||
struct ReadyToEndPacket
|
||||
{
|
||||
u8 id;
|
||||
bool32 ready;
|
||||
};
|
||||
|
||||
void SendPacket_ReadyToStart(bool32 ready)
|
||||
{
|
||||
struct ReadyToStartPacket packet;
|
||||
packet.id = PACKET_READY_START;
|
||||
packet.ready = ready;
|
||||
Rfu_SendPacket(&packet);
|
||||
}
|
||||
|
||||
bool8 RecvPacket_ReadyToStart(s32 playerId)
|
||||
{
|
||||
struct ReadyToStartPacket *packet;
|
||||
|
||||
if ((gRecvCmds[0][0] & RFUCMD_MASK) != RFUCMD_SEND_PACKET)
|
||||
return FALSE;
|
||||
|
||||
packet = (void *)&gRecvCmds[playerId][1];
|
||||
if (packet->id == PACKET_READY_START)
|
||||
return packet->ready;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void SendPacket_GameState(struct DodrioGame_Player *player,
|
||||
struct DodrioGame_PlayerCommData *player1,
|
||||
struct DodrioGame_PlayerCommData *player2,
|
||||
struct DodrioGame_PlayerCommData *player3,
|
||||
struct DodrioGame_PlayerCommData *player4,
|
||||
struct DodrioGame_PlayerCommData *player5,
|
||||
u8 numGraySquares,
|
||||
bool32 berriesFalling,
|
||||
bool32 allReadyToEnd)
|
||||
{
|
||||
struct GameStatePacket packet;
|
||||
struct DodrioGame_Berries *berries = &player->berries;
|
||||
|
||||
packet.id = PACKET_GAME_STATE;
|
||||
packet.fallDist_Col0 = berries->fallDist[0];
|
||||
packet.fallDist_Col1 = berries->fallDist[1];
|
||||
packet.fallDist_Col2 = berries->fallDist[2];
|
||||
packet.fallDist_Col3 = berries->fallDist[3];
|
||||
packet.fallDist_Col4 = berries->fallDist[4];
|
||||
packet.fallDist_Col5 = berries->fallDist[5];
|
||||
packet.fallDist_Col6 = berries->fallDist[6];
|
||||
packet.fallDist_Col7 = berries->fallDist[7];
|
||||
packet.fallDist_Col8 = berries->fallDist[8];
|
||||
packet.fallDist_Col9 = berries->fallDist[9];
|
||||
|
||||
packet.berryId_Col0 = berries->ids[0];
|
||||
packet.berryId_Col1 = berries->ids[1];
|
||||
packet.berryId_Col2 = berries->ids[2];
|
||||
packet.berryId_Col3 = berries->ids[3];
|
||||
packet.berryId_Col4 = berries->ids[4];
|
||||
packet.berryId_Col5 = berries->ids[5];
|
||||
packet.berryId_Col6 = berries->ids[6];
|
||||
packet.berryId_Col7 = berries->ids[7];
|
||||
packet.berryId_Col8 = berries->ids[8];
|
||||
packet.berryId_Col9 = berries->ids[9];
|
||||
|
||||
packet.pickState_Player1 = player1->pickState;
|
||||
packet.pickState_Player2 = player2->pickState;
|
||||
packet.pickState_Player3 = player3->pickState;
|
||||
packet.pickState_Player4 = player4->pickState;
|
||||
packet.pickState_Player5 = player5->pickState;
|
||||
|
||||
packet.ateBerry_Player1 = player1->ateBerry;
|
||||
packet.ateBerry_Player2 = player2->ateBerry;
|
||||
packet.ateBerry_Player3 = player3->ateBerry;
|
||||
packet.ateBerry_Player4 = player4->ateBerry;
|
||||
packet.ateBerry_Player5 = player5->ateBerry;
|
||||
|
||||
packet.missedBerry_Player1 = player1->missedBerry;
|
||||
packet.missedBerry_Player2 = player2->missedBerry;
|
||||
packet.missedBerry_Player3 = player3->missedBerry;
|
||||
packet.missedBerry_Player4 = player4->missedBerry;
|
||||
packet.missedBerry_Player5 = player5->missedBerry;
|
||||
|
||||
packet.numGraySquares = numGraySquares;
|
||||
packet.berriesFalling = berriesFalling;
|
||||
packet.allReadyToEnd = allReadyToEnd;
|
||||
Rfu_SendPacket(&packet);
|
||||
}
|
||||
|
||||
bool32 RecvPacket_GameState(u32 playerId,
|
||||
struct DodrioGame_Player *player,
|
||||
struct DodrioGame_PlayerCommData *player1,
|
||||
struct DodrioGame_PlayerCommData *player2,
|
||||
struct DodrioGame_PlayerCommData *player3,
|
||||
struct DodrioGame_PlayerCommData *player4,
|
||||
struct DodrioGame_PlayerCommData *player5,
|
||||
u8 *numGraySquares,
|
||||
bool32 *berriesFalling,
|
||||
bool32 *allReadyToEnd)
|
||||
{
|
||||
struct GameStatePacket *packet;
|
||||
struct DodrioGame_Berries *berries = &player->berries;
|
||||
|
||||
if ((gRecvCmds[0][0] & RFUCMD_MASK) != RFUCMD_SEND_PACKET)
|
||||
return FALSE;
|
||||
|
||||
packet = (void *)&gRecvCmds[0][1];
|
||||
if (packet->id == PACKET_GAME_STATE)
|
||||
{
|
||||
berries->fallDist[0] = packet->fallDist_Col0;
|
||||
berries->fallDist[1] = packet->fallDist_Col1;
|
||||
berries->fallDist[2] = packet->fallDist_Col2;
|
||||
berries->fallDist[3] = packet->fallDist_Col3;
|
||||
berries->fallDist[4] = packet->fallDist_Col4;
|
||||
berries->fallDist[5] = packet->fallDist_Col5;
|
||||
berries->fallDist[6] = packet->fallDist_Col6;
|
||||
berries->fallDist[7] = packet->fallDist_Col7;
|
||||
berries->fallDist[8] = packet->fallDist_Col8;
|
||||
berries->fallDist[9] = packet->fallDist_Col9;
|
||||
berries->fallDist[10] = packet->fallDist_Col0;
|
||||
|
||||
berries->ids[0] = packet->berryId_Col0;
|
||||
berries->ids[1] = packet->berryId_Col1;
|
||||
berries->ids[2] = packet->berryId_Col2;
|
||||
berries->ids[3] = packet->berryId_Col3;
|
||||
berries->ids[4] = packet->berryId_Col4;
|
||||
berries->ids[5] = packet->berryId_Col5;
|
||||
berries->ids[6] = packet->berryId_Col6;
|
||||
berries->ids[7] = packet->berryId_Col7;
|
||||
berries->ids[8] = packet->berryId_Col8;
|
||||
berries->ids[9] = packet->berryId_Col9;
|
||||
berries->ids[10] = packet->berryId_Col0;
|
||||
|
||||
player1->pickState = packet->pickState_Player1;
|
||||
player1->ateBerry = packet->ateBerry_Player1;
|
||||
player1->missedBerry = packet->missedBerry_Player1;
|
||||
|
||||
player2->pickState = packet->pickState_Player2;
|
||||
player2->ateBerry = packet->ateBerry_Player2;
|
||||
player2->missedBerry = packet->missedBerry_Player2;
|
||||
|
||||
player3->pickState = packet->pickState_Player3;
|
||||
player3->ateBerry = packet->ateBerry_Player3;
|
||||
player3->missedBerry = packet->missedBerry_Player3;
|
||||
|
||||
player4->pickState = packet->pickState_Player4;
|
||||
player4->ateBerry = packet->ateBerry_Player4;
|
||||
player4->missedBerry = packet->missedBerry_Player4;
|
||||
|
||||
player5->pickState = packet->pickState_Player5;
|
||||
player5->ateBerry = packet->ateBerry_Player5;
|
||||
player5->missedBerry = packet->missedBerry_Player5;
|
||||
|
||||
*numGraySquares = packet->numGraySquares;
|
||||
*berriesFalling = packet->berriesFalling;
|
||||
*allReadyToEnd = packet->allReadyToEnd;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void SendPacket_PickState(u8 pickState)
|
||||
{
|
||||
struct PickStatePacket packet;
|
||||
packet.id = PACKET_PICK_STATE;
|
||||
packet.pickState = pickState;
|
||||
Rfu_SendPacket(&packet);
|
||||
}
|
||||
|
||||
bool32 RecvPacket_PickState(u32 playerId, u8 *pickState)
|
||||
{
|
||||
struct PickStatePacket * packet;
|
||||
|
||||
if ((gRecvCmds[0][0] & RFUCMD_MASK) != RFUCMD_SEND_PACKET)
|
||||
return FALSE;
|
||||
|
||||
packet = (void *)&gRecvCmds[playerId][1];
|
||||
if (packet->id == PACKET_PICK_STATE)
|
||||
{
|
||||
*pickState = packet->pickState;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void SendPacket_ReadyToEnd(bool32 ready)
|
||||
{
|
||||
struct ReadyToEndPacket packet;
|
||||
packet.id = PACKET_READY_END;
|
||||
packet.ready = ready;
|
||||
Rfu_SendPacket(&packet);
|
||||
}
|
||||
|
||||
bool32 RecvPacket_ReadyToEnd(u32 playerId)
|
||||
{
|
||||
struct ReadyToEndPacket * packet;
|
||||
|
||||
if ((gRecvCmds[0][0] & RFUCMD_MASK) != RFUCMD_SEND_PACKET)
|
||||
return FALSE;
|
||||
|
||||
packet = (void *)&gRecvCmds[playerId][1];
|
||||
if (packet->id == PACKET_READY_END)
|
||||
return packet->ready;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -4,85 +4,87 @@
|
||||
|
||||
static EWRAM_DATA const u8 *sStringPointers[8] = {0};
|
||||
|
||||
#define COLORS(a, b)((a) | (b << 4))
|
||||
|
||||
static const u8 sTextColorTable[] =
|
||||
{
|
||||
// [LOW_NYBBLE / 2] = 0xXY, // HIGH_NYBBLE
|
||||
[OBJ_EVENT_GFX_RED_NORMAL / 2] = 0x00, // OBJ_EVENT_GFX_RED_BIKE
|
||||
[OBJ_EVENT_GFX_RED_SURF / 2] = 0x00, // OBJ_EVENT_GFX_RED_FIELD_MOVE
|
||||
[OBJ_EVENT_GFX_RED_FISH / 2] = 0x00, // OBJ_EVENT_GFX_RED_VS_SEEKER
|
||||
[OBJ_EVENT_GFX_RED_VS_SEEKER_BIKE / 2] = 0x10, // OBJ_EVENT_GFX_GREEN_NORMAL
|
||||
[OBJ_EVENT_GFX_GREEN_BIKE / 2] = 0x11, // OBJ_EVENT_GFX_GREEN_SURF
|
||||
[OBJ_EVENT_GFX_GREEN_FIELD_MOVE / 2] = 0x11, // OBJ_EVENT_GFX_GREEN_FISH
|
||||
[OBJ_EVENT_GFX_GREEN_VS_SEEKER / 2] = 0x11, // OBJ_EVENT_GFX_GREEN_VS_SEEKER_BIKE
|
||||
[OBJ_EVENT_GFX_RS_BRENDAN / 2] = 0x10, // OBJ_EVENT_GFX_RS_MAY
|
||||
[OBJ_EVENT_GFX_LITTLE_BOY / 2] = 0x10, // OBJ_EVENT_GFX_LITTLE_GIRL
|
||||
[OBJ_EVENT_GFX_YOUNGSTER / 2] = 0x00, // OBJ_EVENT_GFX_BOY
|
||||
[OBJ_EVENT_GFX_BUG_CATCHER / 2] = 0x00, // OBJ_EVENT_GFX_SITTING_BOY
|
||||
[OBJ_EVENT_GFX_LASS / 2] = 0x11, // OBJ_EVENT_GFX_WOMAN_1
|
||||
[OBJ_EVENT_GFX_BATTLE_GIRL / 2] = 0x01, // OBJ_EVENT_GFX_MAN
|
||||
[OBJ_EVENT_GFX_ROCKER / 2] = 0x00, // OBJ_EVENT_GFX_FAT_MAN
|
||||
[OBJ_EVENT_GFX_WOMAN_2 / 2] = 0x11, // OBJ_EVENT_GFX_BEAUTY
|
||||
[OBJ_EVENT_GFX_BALDING_MAN / 2] = 0x10, // OBJ_EVENT_GFX_WOMAN_3
|
||||
[OBJ_EVENT_GFX_OLD_MAN_1 / 2] = 0x00, // OBJ_EVENT_GFX_OLD_MAN_2
|
||||
[OBJ_EVENT_GFX_OLD_MAN_LYING_DOWN / 2] = 0x10, // OBJ_EVENT_GFX_OLD_WOMAN
|
||||
[OBJ_EVENT_GFX_TUBER_M_WATER / 2] = 0x10, // OBJ_EVENT_GFX_TUBER_F
|
||||
[OBJ_EVENT_GFX_TUBER_M_LAND / 2] = 0x00, // OBJ_EVENT_GFX_CAMPER
|
||||
[OBJ_EVENT_GFX_PICNICKER / 2] = 0x01, // OBJ_EVENT_GFX_COOLTRAINER_M
|
||||
[OBJ_EVENT_GFX_COOLTRAINER_F / 2] = 0x01, // OBJ_EVENT_GFX_SWIMMER_M_WATER
|
||||
[OBJ_EVENT_GFX_SWIMMER_F_WATER / 2] = 0x01, // OBJ_EVENT_GFX_SWIMMER_M_LAND
|
||||
[OBJ_EVENT_GFX_SWIMMER_F_LAND / 2] = 0x01, // OBJ_EVENT_GFX_WORKER_M
|
||||
[OBJ_EVENT_GFX_WORKER_F / 2] = 0x01, // OBJ_EVENT_GFX_ROCKET_M
|
||||
[OBJ_EVENT_GFX_ROCKET_F / 2] = 0x01, // OBJ_EVENT_GFX_GBA_KID
|
||||
[OBJ_EVENT_GFX_SUPER_NERD / 2] = 0x00, // OBJ_EVENT_GFX_BIKER
|
||||
[OBJ_EVENT_GFX_BLACKBELT / 2] = 0x00, // OBJ_EVENT_GFX_SCIENTIST
|
||||
[OBJ_EVENT_GFX_HIKER / 2] = 0x00, // OBJ_EVENT_GFX_FISHER
|
||||
[OBJ_EVENT_GFX_CHANNELER / 2] = 0x01, // OBJ_EVENT_GFX_CHEF
|
||||
[OBJ_EVENT_GFX_POLICEMAN / 2] = 0x00, // OBJ_EVENT_GFX_GENTLEMAN
|
||||
[OBJ_EVENT_GFX_SAILOR / 2] = 0x00, // OBJ_EVENT_GFX_CAPTAIN
|
||||
[OBJ_EVENT_GFX_NURSE / 2] = 0x11, // OBJ_EVENT_GFX_CABLE_CLUB_RECEPTIONIST
|
||||
[OBJ_EVENT_GFX_UNION_ROOM_RECEPTIONIST / 2] = 0x01, // OBJ_EVENT_GFX_UNUSED_MALE_RECEPTIONIST
|
||||
[OBJ_EVENT_GFX_CLERK / 2] = 0x00, // OBJ_EVENT_GFX_MG_DELIVERYMAN
|
||||
[OBJ_EVENT_GFX_TRAINER_TOWER_DUDE / 2] = 0x00, // OBJ_EVENT_GFX_PROF_OAK
|
||||
[OBJ_EVENT_GFX_BLUE / 2] = 0x00, // OBJ_EVENT_GFX_BILL
|
||||
[OBJ_EVENT_GFX_LANCE / 2] = 0x10, // OBJ_EVENT_GFX_AGATHA
|
||||
[OBJ_EVENT_GFX_DAISY / 2] = 0x11, // OBJ_EVENT_GFX_LORELEI
|
||||
[OBJ_EVENT_GFX_MR_FUJI / 2] = 0x00, // OBJ_EVENT_GFX_BRUNO
|
||||
[OBJ_EVENT_GFX_BROCK / 2] = 0x10, // OBJ_EVENT_GFX_MISTY
|
||||
[OBJ_EVENT_GFX_LT_SURGE / 2] = 0x10, // OBJ_EVENT_GFX_ERIKA
|
||||
[OBJ_EVENT_GFX_KOGA / 2] = 0x10, // OBJ_EVENT_GFX_SABRINA
|
||||
[OBJ_EVENT_GFX_BLAINE / 2] = 0x00, // OBJ_EVENT_GFX_GIOVANNI
|
||||
[OBJ_EVENT_GFX_MOM / 2] = 0x01, // OBJ_EVENT_GFX_CELIO
|
||||
[OBJ_EVENT_GFX_TEACHY_TV_HOST / 2] = 0x00, // OBJ_EVENT_GFX_GYM_GUY
|
||||
[OBJ_EVENT_GFX_ITEM_BALL / 2] = 0x33, // OBJ_EVENT_GFX_TOWN_MAP
|
||||
[OBJ_EVENT_GFX_POKEDEX / 2] = 0x33, // OBJ_EVENT_GFX_CUT_TREE
|
||||
[OBJ_EVENT_GFX_ROCK_SMASH_ROCK / 2] = 0x33, // OBJ_EVENT_GFX_PUSHABLE_BOULDER
|
||||
[OBJ_EVENT_GFX_FOSSIL / 2] = 0x33, // OBJ_EVENT_GFX_RUBY
|
||||
[OBJ_EVENT_GFX_SAPPHIRE / 2] = 0x33, // OBJ_EVENT_GFX_OLD_AMBER
|
||||
[OBJ_EVENT_GFX_GYM_SIGN / 2] = 0x33, // OBJ_EVENT_GFX_SIGN
|
||||
[OBJ_EVENT_GFX_TRAINER_TIPS / 2] = 0x33, // OBJ_EVENT_GFX_CLIPBOARD
|
||||
[OBJ_EVENT_GFX_METEORITE / 2] = 0x33, // OBJ_EVENT_GFX_LAPRAS_DOLL
|
||||
[OBJ_EVENT_GFX_SEAGALLOP / 2] = 0x23, // OBJ_EVENT_GFX_SNORLAX
|
||||
[OBJ_EVENT_GFX_SPEAROW / 2] = 0x22, // OBJ_EVENT_GFX_CUBONE
|
||||
[OBJ_EVENT_GFX_POLIWRATH / 2] = 0x22, // OBJ_EVENT_GFX_CLEFAIRY
|
||||
[OBJ_EVENT_GFX_PIDGEOT / 2] = 0x22, // OBJ_EVENT_GFX_JIGGLYPUFF
|
||||
[OBJ_EVENT_GFX_PIDGEY / 2] = 0x22, // OBJ_EVENT_GFX_CHANSEY
|
||||
[OBJ_EVENT_GFX_OMANYTE / 2] = 0x22, // OBJ_EVENT_GFX_KANGASKHAN
|
||||
[OBJ_EVENT_GFX_PIKACHU / 2] = 0x22, // OBJ_EVENT_GFX_PSYDUCK
|
||||
[OBJ_EVENT_GFX_NIDORAN_F / 2] = 0x22, // OBJ_EVENT_GFX_NIDORAN_M
|
||||
[OBJ_EVENT_GFX_NIDORINO / 2] = 0x22, // OBJ_EVENT_GFX_MEOWTH
|
||||
[OBJ_EVENT_GFX_SEEL / 2] = 0x22, // OBJ_EVENT_GFX_VOLTORB
|
||||
[OBJ_EVENT_GFX_SLOWPOKE / 2] = 0x22, // OBJ_EVENT_GFX_SLOWBRO
|
||||
[OBJ_EVENT_GFX_MACHOP / 2] = 0x22, // OBJ_EVENT_GFX_WIGGLYTUFF
|
||||
[OBJ_EVENT_GFX_DODUO / 2] = 0x22, // OBJ_EVENT_GFX_FEAROW
|
||||
[OBJ_EVENT_GFX_MACHOKE / 2] = 0x22, // OBJ_EVENT_GFX_LAPRAS
|
||||
[OBJ_EVENT_GFX_ZAPDOS / 2] = 0x22, // OBJ_EVENT_GFX_MOLTRES
|
||||
[OBJ_EVENT_GFX_ARTICUNO / 2] = 0x22, // OBJ_EVENT_GFX_MEWTWO
|
||||
[OBJ_EVENT_GFX_MEW / 2] = 0x22, // OBJ_EVENT_GFX_ENTEI
|
||||
[OBJ_EVENT_GFX_SUICUNE / 2] = 0x22, // OBJ_EVENT_GFX_RAIKOU
|
||||
[OBJ_EVENT_GFX_LUGIA / 2] = 0x22, // OBJ_EVENT_GFX_HO_OH
|
||||
[OBJ_EVENT_GFX_CELEBI / 2] = 0x22, // OBJ_EVENT_GFX_KABUTO
|
||||
[OBJ_EVENT_GFX_DEOXYS_D / 2] = 0x22, // OBJ_EVENT_GFX_DEOXYS_A
|
||||
[OBJ_EVENT_GFX_DEOXYS_N / 2] = 0x32, // OBJ_EVENT_GFX_SS_ANNE
|
||||
[OBJ_EVENT_GFX_RED_NORMAL / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_RED_BIKE
|
||||
[OBJ_EVENT_GFX_RED_SURF / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_RED_FIELD_MOVE
|
||||
[OBJ_EVENT_GFX_RED_FISH / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_RED_VS_SEEKER
|
||||
[OBJ_EVENT_GFX_RED_VS_SEEKER_BIKE / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_GREEN_NORMAL
|
||||
[OBJ_EVENT_GFX_GREEN_BIKE / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_GREEN_SURF
|
||||
[OBJ_EVENT_GFX_GREEN_FIELD_MOVE / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_GREEN_FISH
|
||||
[OBJ_EVENT_GFX_GREEN_VS_SEEKER / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_GREEN_VS_SEEKER_BIKE
|
||||
[OBJ_EVENT_GFX_RS_BRENDAN / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_RS_MAY
|
||||
[OBJ_EVENT_GFX_LITTLE_BOY / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_LITTLE_GIRL
|
||||
[OBJ_EVENT_GFX_YOUNGSTER / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_BOY
|
||||
[OBJ_EVENT_GFX_BUG_CATCHER / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_SITTING_BOY
|
||||
[OBJ_EVENT_GFX_LASS / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_WOMAN_1
|
||||
[OBJ_EVENT_GFX_BATTLE_GIRL / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_MAN
|
||||
[OBJ_EVENT_GFX_ROCKER / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_FAT_MAN
|
||||
[OBJ_EVENT_GFX_WOMAN_2 / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_BEAUTY
|
||||
[OBJ_EVENT_GFX_BALDING_MAN / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_WOMAN_3
|
||||
[OBJ_EVENT_GFX_OLD_MAN_1 / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_OLD_MAN_2
|
||||
[OBJ_EVENT_GFX_OLD_MAN_LYING_DOWN / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_OLD_WOMAN
|
||||
[OBJ_EVENT_GFX_TUBER_M_WATER / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_TUBER_F
|
||||
[OBJ_EVENT_GFX_TUBER_M_LAND / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_CAMPER
|
||||
[OBJ_EVENT_GFX_PICNICKER / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_COOLTRAINER_M
|
||||
[OBJ_EVENT_GFX_COOLTRAINER_F / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_SWIMMER_M_WATER
|
||||
[OBJ_EVENT_GFX_SWIMMER_F_WATER / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_SWIMMER_M_LAND
|
||||
[OBJ_EVENT_GFX_SWIMMER_F_LAND / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_WORKER_M
|
||||
[OBJ_EVENT_GFX_WORKER_F / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_ROCKET_M
|
||||
[OBJ_EVENT_GFX_ROCKET_F / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_GBA_KID
|
||||
[OBJ_EVENT_GFX_SUPER_NERD / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_BIKER
|
||||
[OBJ_EVENT_GFX_BLACKBELT / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_SCIENTIST
|
||||
[OBJ_EVENT_GFX_HIKER / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_FISHER
|
||||
[OBJ_EVENT_GFX_CHANNELER / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_CHEF
|
||||
[OBJ_EVENT_GFX_POLICEMAN / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_GENTLEMAN
|
||||
[OBJ_EVENT_GFX_SAILOR / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_CAPTAIN
|
||||
[OBJ_EVENT_GFX_NURSE / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_CABLE_CLUB_RECEPTIONIST
|
||||
[OBJ_EVENT_GFX_UNION_ROOM_RECEPTIONIST / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_UNUSED_MALE_RECEPTIONIST
|
||||
[OBJ_EVENT_GFX_CLERK / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_MG_DELIVERYMAN
|
||||
[OBJ_EVENT_GFX_TRAINER_TOWER_DUDE / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_PROF_OAK
|
||||
[OBJ_EVENT_GFX_BLUE / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_BILL
|
||||
[OBJ_EVENT_GFX_LANCE / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_AGATHA
|
||||
[OBJ_EVENT_GFX_DAISY / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_LORELEI
|
||||
[OBJ_EVENT_GFX_MR_FUJI / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_BRUNO
|
||||
[OBJ_EVENT_GFX_BROCK / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_MISTY
|
||||
[OBJ_EVENT_GFX_LT_SURGE / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_ERIKA
|
||||
[OBJ_EVENT_GFX_KOGA / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_SABRINA
|
||||
[OBJ_EVENT_GFX_BLAINE / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_GIOVANNI
|
||||
[OBJ_EVENT_GFX_MOM / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_CELIO
|
||||
[OBJ_EVENT_GFX_TEACHY_TV_HOST / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_GYM_GUY
|
||||
[OBJ_EVENT_GFX_ITEM_BALL / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_TOWN_MAP
|
||||
[OBJ_EVENT_GFX_POKEDEX / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_CUT_TREE
|
||||
[OBJ_EVENT_GFX_ROCK_SMASH_ROCK / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_PUSHABLE_BOULDER
|
||||
[OBJ_EVENT_GFX_FOSSIL / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_RUBY
|
||||
[OBJ_EVENT_GFX_SAPPHIRE / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_OLD_AMBER
|
||||
[OBJ_EVENT_GFX_GYM_SIGN / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_SIGN
|
||||
[OBJ_EVENT_GFX_TRAINER_TIPS / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_CLIPBOARD
|
||||
[OBJ_EVENT_GFX_METEORITE / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_LAPRAS_DOLL
|
||||
[OBJ_EVENT_GFX_SEAGALLOP / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_SNORLAX
|
||||
[OBJ_EVENT_GFX_SPEAROW / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_CUBONE
|
||||
[OBJ_EVENT_GFX_POLIWRATH / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_CLEFAIRY
|
||||
[OBJ_EVENT_GFX_PIDGEOT / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_JIGGLYPUFF
|
||||
[OBJ_EVENT_GFX_PIDGEY / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_CHANSEY
|
||||
[OBJ_EVENT_GFX_OMANYTE / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_KANGASKHAN
|
||||
[OBJ_EVENT_GFX_PIKACHU / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_PSYDUCK
|
||||
[OBJ_EVENT_GFX_NIDORAN_F / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_NIDORAN_M
|
||||
[OBJ_EVENT_GFX_NIDORINO / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_MEOWTH
|
||||
[OBJ_EVENT_GFX_SEEL / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_VOLTORB
|
||||
[OBJ_EVENT_GFX_SLOWPOKE / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_SLOWBRO
|
||||
[OBJ_EVENT_GFX_MACHOP / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_WIGGLYTUFF
|
||||
[OBJ_EVENT_GFX_DODUO / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_FEAROW
|
||||
[OBJ_EVENT_GFX_MACHOKE / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_LAPRAS
|
||||
[OBJ_EVENT_GFX_ZAPDOS / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_MOLTRES
|
||||
[OBJ_EVENT_GFX_ARTICUNO / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_MEWTWO
|
||||
[OBJ_EVENT_GFX_MEW / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_ENTEI
|
||||
[OBJ_EVENT_GFX_SUICUNE / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_RAIKOU
|
||||
[OBJ_EVENT_GFX_LUGIA / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_HO_OH
|
||||
[OBJ_EVENT_GFX_CELEBI / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_KABUTO
|
||||
[OBJ_EVENT_GFX_DEOXYS_D / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_DEOXYS_A
|
||||
[OBJ_EVENT_GFX_DEOXYS_N / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_SS_ANNE
|
||||
};
|
||||
|
||||
void DynamicPlaceholderTextUtil_Reset(void)
|
||||
|
||||
@@ -23,7 +23,7 @@ void Task_WaitPlayerStopMoving(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
bool8 NativeScript_WaitPlayerStopMoving(void)
|
||||
bool8 IsFreezePlayerFinished(void)
|
||||
{
|
||||
if (FuncIsActiveTask(Task_WaitPlayerStopMoving))
|
||||
return FALSE;
|
||||
@@ -34,7 +34,7 @@ bool8 NativeScript_WaitPlayerStopMoving(void)
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptFreezeObjectEvents(void)
|
||||
void FreezeObjects_WaitForPlayer(void)
|
||||
{
|
||||
FreezeObjectEvents();
|
||||
CreateTask(Task_WaitPlayerStopMoving, 80);
|
||||
@@ -60,7 +60,7 @@ void Task_WaitPlayerAndTargetNPCStopMoving(u8 taskId)
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
bool8 NativeScript_WaitPlayerAndTargetNPCStopMoving(void)
|
||||
bool8 IsFreezeSelectedObjectAndPlayerFinished(void)
|
||||
{
|
||||
if (FuncIsActiveTask(Task_WaitPlayerAndTargetNPCStopMoving))
|
||||
return FALSE;
|
||||
@@ -71,7 +71,7 @@ bool8 NativeScript_WaitPlayerAndTargetNPCStopMoving(void)
|
||||
}
|
||||
}
|
||||
|
||||
void LockSelectedObjectEvent(void)
|
||||
void FreezeObjects_WaitForPlayerAndSelected(void)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
|
||||
+413
-380
File diff suppressed because it is too large
Load Diff
@@ -767,7 +767,7 @@ static bool8 PlayerAnimIsMultiFrameStationary(void)
|
||||
|
||||
if (movementActionId <= MOVEMENT_ACTION_FACE_RIGHT_FAST
|
||||
|| (movementActionId >= MOVEMENT_ACTION_DELAY_1 && movementActionId <= MOVEMENT_ACTION_DELAY_16)
|
||||
|| (movementActionId >= MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN && movementActionId <= MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_RIGHT)
|
||||
|| (movementActionId >= MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN && movementActionId <= MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_RIGHT)
|
||||
|| (movementActionId >= MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN && movementActionId <= MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT)
|
||||
|| (movementActionId >= MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN && movementActionId <= MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT))
|
||||
return TRUE;
|
||||
|
||||
+14
-6
@@ -1542,18 +1542,26 @@ void SetSeenMon(void)
|
||||
void ResetContextNpcTextColor(void)
|
||||
{
|
||||
gSelectedObjectEvent = 0;
|
||||
gSpecialVar_TextColor = 0xFF;
|
||||
gSpecialVar_TextColor = NPC_TEXT_COLOR_DEFAULT;
|
||||
}
|
||||
|
||||
u8 ContextNpcGetTextColor(void)
|
||||
{
|
||||
u8 gfxId;
|
||||
if (gSpecialVar_TextColor != 0xFF)
|
||||
if (gSpecialVar_TextColor != NPC_TEXT_COLOR_DEFAULT)
|
||||
{
|
||||
// A text color has been specified, use that
|
||||
return gSpecialVar_TextColor;
|
||||
}
|
||||
else if (gSelectedObjectEvent == 0)
|
||||
return 3;
|
||||
{
|
||||
// No text color specified and no object selected, use neutral
|
||||
return NPC_TEXT_COLOR_NEUTRAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
// An object is selected and no color has been specified.
|
||||
// Use the text color normally associated with this object's sprite.
|
||||
gfxId = gObjectEvents[gSelectedObjectEvent].graphicsId;
|
||||
if (gfxId >= OBJ_EVENT_GFX_VAR_0)
|
||||
gfxId = VarGetObjectEventGraphicsId(gfxId - OBJ_EVENT_GFX_VAR_0);
|
||||
@@ -1631,7 +1639,7 @@ void ChangeBoxPokemonNickname(void)
|
||||
species = GetBoxMonData(pokemon, MON_DATA_SPECIES, NULL);
|
||||
gender = GetBoxMonGender(pokemon);
|
||||
personality = GetBoxMonData(pokemon, MON_DATA_PERSONALITY, NULL);
|
||||
DoNamingScreen(NAMING_SCREEN_NAME_RATER, gStringVar2, species, gender, personality, ChangeBoxPokemonNickname_CB);
|
||||
DoNamingScreen(NAMING_SCREEN_NICKNAME, gStringVar2, species, gender, personality, ChangeBoxPokemonNickname_CB);
|
||||
}
|
||||
|
||||
static void ChangeBoxPokemonNickname_CB(void)
|
||||
@@ -1651,7 +1659,7 @@ void ChangePokemonNickname(void)
|
||||
species = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES, NULL);
|
||||
gender = GetMonGender(&gPlayerParty[gSpecialVar_0x8004]);
|
||||
personality = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_PERSONALITY, NULL);
|
||||
DoNamingScreen(NAMING_SCREEN_NAME_RATER, gStringVar2, species, gender, personality, ChangePokemonNickname_CB);
|
||||
DoNamingScreen(NAMING_SCREEN_NICKNAME, gStringVar2, species, gender, personality, ChangePokemonNickname_CB);
|
||||
}
|
||||
|
||||
static void ChangePokemonNickname_CB(void)
|
||||
@@ -2419,7 +2427,7 @@ static void MoveDeoxysObject(u8 num)
|
||||
else
|
||||
gFieldEffectArguments[5] = 5;
|
||||
FieldEffectStart(FLDEFF_MOVE_DEOXYS_ROCK);
|
||||
Overworld_SetMapObjTemplateCoords(1, sDeoxysCoords[num][0], sDeoxysCoords[num][1]);
|
||||
SetObjEventTemplateCoords(1, sDeoxysCoords[num][0], sDeoxysCoords[num][1]);
|
||||
}
|
||||
|
||||
static void Task_WaitDeoxysFieldEffect(u8 taskId)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
static u8 TranslateWeatherNum(u8 weather);
|
||||
static void UpdateRainCounter(u8 newWeather, u8 oldWeather);
|
||||
|
||||
void SetSav1Weather(u32 weather)
|
||||
void SetSavedWeather(u32 weather)
|
||||
{
|
||||
u8 oldWeather = gSaveBlock1Ptr->weather;
|
||||
gSaveBlock1Ptr->weather = TranslateWeatherNum(weather);
|
||||
@@ -18,7 +18,7 @@ u8 GetSav1Weather(void)
|
||||
return gSaveBlock1Ptr->weather;
|
||||
}
|
||||
|
||||
void SetSav1WeatherFromCurrMapHeader(void)
|
||||
void SetSavedWeatherFromCurrMapHeader(void)
|
||||
{
|
||||
u8 oldWeather = gSaveBlock1Ptr->weather;
|
||||
gSaveBlock1Ptr->weather = TranslateWeatherNum(gMapHeader.weather);
|
||||
@@ -27,13 +27,13 @@ void SetSav1WeatherFromCurrMapHeader(void)
|
||||
|
||||
void SetWeather(u32 weather)
|
||||
{
|
||||
SetSav1Weather(weather);
|
||||
SetSavedWeather(weather);
|
||||
SetNextWeather(GetSav1Weather());
|
||||
}
|
||||
|
||||
void SetWeather_Unused(u32 weather)
|
||||
{
|
||||
SetSav1Weather(weather);
|
||||
SetSavedWeather(weather);
|
||||
SetCurrentAndNextWeather(GetSav1Weather());
|
||||
}
|
||||
|
||||
|
||||
+28
-25
@@ -1181,33 +1181,36 @@ const u16 gUnknown_8E97DDC[] = INCBIN_U16("graphics/interface/learn_move.gbapal"
|
||||
const u32 gUnknown_8E97DFC[] = INCBIN_U32("graphics/interface/learn_move.4bpp.lz");
|
||||
const u32 gUnknown_8E97EC4[] = INCBIN_U32("graphics/interface/learn_move.bin.lz");
|
||||
|
||||
const u16 gUnknown_8E97FE4[] = INCBIN_U16("graphics/interface/naming_screen_8E97FE4.gbapal");
|
||||
const u16 gUnknown_8E98004[] = INCBIN_U16("graphics/interface/naming_screen_8E98004.gbapal");
|
||||
const u16 gNamingScreenMenu_Pal[] = INCBIN_U16("graphics/interface/naming_screen_8E98024.gbapal");
|
||||
const u16 gUnknown_8E98044[] = INCBIN_U16("graphics/interface/naming_screen_8E98044.gbapal");
|
||||
const u16 gUnknown_8E98064[] = INCBIN_U16("graphics/interface/naming_screen_8E98064.gbapal");
|
||||
const u16 gUnknown_8E98084[] = INCBIN_U16("graphics/interface/naming_screen_8E98084.gbapal");
|
||||
const u16 gUnknown_8E980A4[] = INCBIN_U16("graphics/interface/naming_screen_8E980A4.gbapal");
|
||||
const u16 gUnknown_8E980C4[] = INCBIN_U16("graphics/interface/naming_screen_8E980C4.gbapal");
|
||||
const u16 gNamingScreenKeyboard_Pal[] = INCBIN_U16("graphics/naming_screen/keyboard.gbapal");
|
||||
const u16 gNamingScreenRival_Pal[] = INCBIN_U16("graphics/naming_screen/rival.gbapal");
|
||||
const u16 gNamingScreenMenu_Pal[6][16] =
|
||||
{
|
||||
INCBIN_U16("graphics/naming_screen/menu.gbapal"),
|
||||
INCBIN_U16("graphics/naming_screen/page_swap_upper.gbapal"),
|
||||
INCBIN_U16("graphics/naming_screen/page_swap_lower.gbapal"),
|
||||
INCBIN_U16("graphics/naming_screen/page_swap_others.gbapal"),
|
||||
INCBIN_U16("graphics/naming_screen/buttons.gbapal"),
|
||||
INCBIN_U16("graphics/naming_screen/cursor.gbapal"),
|
||||
};
|
||||
|
||||
const u32 gNamingScreenMenu_Gfx[] = INCBIN_U32("graphics/interface/naming_screen_menu.4bpp.lz");
|
||||
const u32 gUnknown_8E982BC[] = INCBIN_U32("graphics/interface/naming_screen_menu.bin.lz");
|
||||
const u32 gUnknown_8E98398[] = INCBIN_U32("graphics/interface/naming_screen_E98398.bin.lz");
|
||||
const u32 gUnknown_8E98458[] = INCBIN_U32("graphics/interface/naming_screen_E98458.bin.lz");
|
||||
const u32 gUnknown_8E98518[] = INCBIN_U32("graphics/interface/naming_screen_E98518.bin.lz");
|
||||
const u32 gNamingScreenMenu_Gfx[] = INCBIN_U32("graphics/naming_screen/menu.4bpp.lz");
|
||||
const u32 gNamingScreenBackground_Tilemap[] = INCBIN_U32("graphics/naming_screen/background.bin.lz");
|
||||
const u32 gNamingScreenKeyboardUpper_Tilemap[] = INCBIN_U32("graphics/naming_screen/keyboard_upper.bin.lz");
|
||||
const u32 gNamingScreenKeyboardLower_Tilemap[] = INCBIN_U32("graphics/naming_screen/keyboard_lower.bin.lz");
|
||||
const u32 gNamingScreenKeyboardSymbols_Tilemap[] = INCBIN_U32("graphics/naming_screen/keyboard_symbols.bin.lz");
|
||||
|
||||
const u32 gUnknown_8E985D8[] = INCBIN_U32("graphics/interface/naming_screen_8E985D8.4bpp");
|
||||
const u32 gUnknown_8E98858[] = INCBIN_U32("graphics/interface/naming_screen_8E98858.4bpp");
|
||||
const u32 gUnknown_8E98A38[] = INCBIN_U32("graphics/interface/naming_screen_8E98A38.4bpp");
|
||||
const u32 gUnknown_8E98C18[] = INCBIN_U32("graphics/interface/naming_screen_8E98C18.4bpp");
|
||||
const u32 gUnknown_8E98CB8[] = INCBIN_U32("graphics/interface/naming_screen_8E98CB8.4bpp");
|
||||
const u32 gUnknown_8E98D58[] = INCBIN_U32("graphics/interface/naming_screen_8E98D58.4bpp");
|
||||
const u32 gUnknown_8E98DF8[] = INCBIN_U32("graphics/interface/naming_screen_8E98DF8.4bpp");
|
||||
const u32 gUnknown_8E98E98[] = INCBIN_U32("graphics/interface/naming_screen_8E98E98.4bpp");
|
||||
const u32 gUnknown_8E98F38[] = INCBIN_U32("graphics/interface/naming_screen_8E98F38.4bpp");
|
||||
const u32 gUnknown_8E98FD8[] = INCBIN_U32("graphics/interface/naming_screen_8E98FD8.4bpp");
|
||||
const u32 gUnknown_8E990D8[] = INCBIN_U32("graphics/interface/naming_screen_8E990D8.4bpp");
|
||||
const u32 gUnknown_8E990F8[] = INCBIN_U32("graphics/interface/naming_screen_8E990F8.4bpp");
|
||||
const u32 gNamingScreenPageSwapFrame_Gfx[] = INCBIN_U32("graphics/naming_screen/page_swap_frame.4bpp");
|
||||
const u32 gNamingScreenBackButton_Gfx[] = INCBIN_U32("graphics/naming_screen/back_button.4bpp");
|
||||
const u32 gNamingScreenOKButton_Gfx[] = INCBIN_U32("graphics/naming_screen/ok_button.4bpp");
|
||||
const u32 gNamingScreenPageSwapUpper_Gfx[] = INCBIN_U32("graphics/naming_screen/page_swap_upper.4bpp");
|
||||
const u32 gNamingScreenPageSwapLower_Gfx[] = INCBIN_U32("graphics/naming_screen/page_swap_lower.4bpp");
|
||||
const u32 gNamingScreenPageSwapOthers_Gfx[] = INCBIN_U32("graphics/naming_screen/page_swap_others.4bpp");
|
||||
const u32 gNamingScreenCursor_Gfx[] = INCBIN_U32("graphics/naming_screen/cursor.4bpp");
|
||||
const u32 gNamingScreenCursorSquished_Gfx[] = INCBIN_U32("graphics/naming_screen/cursor_squished.4bpp");
|
||||
const u32 gNamingScreenCursorFilled_Gfx[] = INCBIN_U32("graphics/naming_screen/cursor_filled.4bpp");
|
||||
const u32 gNamingScreenPageSwapButton_Gfx[] = INCBIN_U32("graphics/naming_screen/page_swap_button.4bpp");
|
||||
const u32 gNamingScreenInputArrow_Gfx[] = INCBIN_U32("graphics/naming_screen/input_arrow.4bpp");
|
||||
const u32 gNamingScreenUnderscore_Gfx[] = INCBIN_U32("graphics/naming_screen/underscore.4bpp");
|
||||
|
||||
const u8 gUnknown_8E99118[] = INCBIN_U8("graphics/tm_case/unk_8E99118.4bpp");
|
||||
|
||||
|
||||
+5
-3
@@ -5,6 +5,8 @@
|
||||
#include "constants/items.h"
|
||||
#include "pokemon_icon.h"
|
||||
|
||||
#define UNOWN_OFFSET 30000
|
||||
|
||||
void ClearMailData(void)
|
||||
{
|
||||
u8 i;
|
||||
@@ -73,7 +75,7 @@ u8 GiveMailToMon(struct Pokemon *mon, u16 itemId)
|
||||
u16 SpeciesToMailSpecies(u16 species, u32 personality)
|
||||
{
|
||||
if (species == SPECIES_UNOWN) {
|
||||
u32 mailSpecies = GetUnownLetterByPersonality(personality) + 30000;
|
||||
u32 mailSpecies = GetUnownLetterByPersonality(personality) + UNOWN_OFFSET;
|
||||
return mailSpecies;
|
||||
}
|
||||
return species;
|
||||
@@ -83,10 +85,10 @@ u16 MailSpeciesToSpecies(u16 mailSpecies, u16 *unownLetter)
|
||||
{
|
||||
u16 result;
|
||||
|
||||
if (mailSpecies >= 30000 && mailSpecies < (30000 + UNOWN_FORM_COUNT))
|
||||
if (mailSpecies >= UNOWN_OFFSET && mailSpecies < (UNOWN_OFFSET + NUM_UNOWN_FORMS))
|
||||
{
|
||||
result = SPECIES_UNOWN;
|
||||
*unownLetter = mailSpecies - 30000;
|
||||
*unownLetter = mailSpecies - UNOWN_OFFSET;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+1
-1
@@ -241,7 +241,7 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *quantity_p, u16 qmax)
|
||||
|
||||
u8 GetDialogBoxFontId(void)
|
||||
{
|
||||
if (!ContextNpcGetTextColor())
|
||||
if (ContextNpcGetTextColor() == NPC_TEXT_COLOR_MALE)
|
||||
return FONT_4;
|
||||
else
|
||||
return FONT_5;
|
||||
|
||||
+1
-1
@@ -251,7 +251,7 @@ static u32 common_mainseq_4(struct mevent_srv_common * svr)
|
||||
break;
|
||||
case 28:
|
||||
AGB_ASSERT_EX(cmd->flag == FALSE && cmd->parameter == NULL, ABSPATH("mevent_server.c"), 517);
|
||||
svr->sendBuffer1 = sub_8069E48();
|
||||
svr->sendBuffer1 = GetSavedRamScriptIfValid();
|
||||
break;
|
||||
case 29:
|
||||
mevent_srv_common_init_send(svr, 0x1b, cmd->parameter, cmd->flag);
|
||||
|
||||
+985
-885
File diff suppressed because it is too large
Load Diff
@@ -425,16 +425,16 @@ u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed
|
||||
|
||||
void AddTextPrinterDiffStyle(bool8 allowSkippingDelayWithButtonPress)
|
||||
{
|
||||
u8 result;
|
||||
u8 color;
|
||||
void *nptr = NULL;
|
||||
|
||||
gTextFlags.canABSpeedUpPrint = allowSkippingDelayWithButtonPress;
|
||||
result = ContextNpcGetTextColor();
|
||||
if (result == 0)
|
||||
color = ContextNpcGetTextColor();
|
||||
if (color == NPC_TEXT_COLOR_MALE)
|
||||
AddTextPrinterParameterized2(0, FONT_4, gStringVar4, GetTextSpeedSetting(), nptr, TEXT_COLOR_BLUE, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
else if (result == 1)
|
||||
else if (color == NPC_TEXT_COLOR_FEMALE)
|
||||
AddTextPrinterParameterized2(0, FONT_5, gStringVar4, GetTextSpeedSetting(), nptr, TEXT_COLOR_RED, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
else
|
||||
else // NPC_TEXT_COLOR_MON / NPC_TEXT_COLOR_NEUTRAL
|
||||
AddTextPrinterParameterized2(0, FONT_2, gStringVar4, GetTextSpeedSetting(), nptr, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -439,7 +439,7 @@ static void LoadSaveblockObjEventScripts(void)
|
||||
}
|
||||
}
|
||||
|
||||
void Overworld_SetMapObjTemplateCoords(u8 localId, s16 x, s16 y)
|
||||
void SetObjEventTemplateCoords(u8 localId, s16 x, s16 y)
|
||||
{
|
||||
int i;
|
||||
struct ObjectEventTemplate * savObjTemplates = gSaveBlock1Ptr->objectEventTemplates;
|
||||
@@ -454,7 +454,7 @@ void Overworld_SetMapObjTemplateCoords(u8 localId, s16 x, s16 y)
|
||||
}
|
||||
}
|
||||
|
||||
void Overworld_SetObjEventTemplateMovementType(u8 localId, u8 movementType)
|
||||
void SetObjEventTemplateMovementType(u8 localId, u8 movementType)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@@ -757,7 +757,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum)
|
||||
ResetCyclingRoadChallengeData();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
MapResetTrainerRematches(mapGroup, mapNum);
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
SetSavedWeatherFromCurrMapHeader();
|
||||
ChooseAmbientCrySpecies();
|
||||
SetDefaultFlashLevel();
|
||||
Overworld_ClearSavedMusic();
|
||||
@@ -792,7 +792,7 @@ static void LoadMapFromWarp(bool32 unused)
|
||||
ResetCyclingRoadChallengeData();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
MapResetTrainerRematches(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum);
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
SetSavedWeatherFromCurrMapHeader();
|
||||
ChooseAmbientCrySpecies();
|
||||
if (isOutdoors)
|
||||
FlagClear(FLAG_SYS_FLASH_ACTIVE);
|
||||
@@ -814,7 +814,7 @@ static void sub_80559A8(void)
|
||||
LoadObjEventTemplatesFromHeader();
|
||||
isOutdoors = IsMapTypeOutdoors(gMapHeader.mapType);
|
||||
TrySetMapSaveWarpStatus();
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
SetSavedWeatherFromCurrMapHeader();
|
||||
ChooseAmbientCrySpecies();
|
||||
SetDefaultFlashLevel();
|
||||
sub_8110920();
|
||||
@@ -957,7 +957,7 @@ static void SetDefaultFlashLevel(void)
|
||||
gSaveBlock1Ptr->flashLevel = gMaxFlashLevel;
|
||||
}
|
||||
|
||||
void Overworld_SetFlashLevel(s32 flashLevel)
|
||||
void SetFlashLevel(s32 flashLevel)
|
||||
{
|
||||
if (flashLevel < 0 || flashLevel > gMaxFlashLevel)
|
||||
flashLevel = 0;
|
||||
|
||||
@@ -797,7 +797,7 @@ const u8 (*const sCategoryPageIconCoords[])[4] = {
|
||||
sPageIconCoords_4Mons,
|
||||
};
|
||||
|
||||
static const u8 * const sDexCategoryNamePtrs[] = {
|
||||
static const u8 *const sDexCategoryNamePtrs[] = {
|
||||
gText_DexCategory_GrasslandPkmn,
|
||||
gText_DexCategory_ForestPkmn,
|
||||
gText_DexCategory_WatersEdgePkmn,
|
||||
|
||||
+18
-18
@@ -1473,8 +1473,8 @@ const struct SpriteTemplate gSpriteTemplates_Battlers[] =
|
||||
.paletteTag = 0,
|
||||
.oam = &gOamData_BattlerPlayer,
|
||||
.anims = NULL,
|
||||
.images = gSpriteImages_BattlerPlayerLeft,
|
||||
.affineAnims = gSpriteAffineAnimTable_BattlerPlayer,
|
||||
.images = gBattlerPicTable_PlayerLeft,
|
||||
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
|
||||
.callback = SpriteCB_AllyMon,
|
||||
},
|
||||
[B_POSITION_OPPONENT_LEFT] = {
|
||||
@@ -1482,8 +1482,8 @@ const struct SpriteTemplate gSpriteTemplates_Battlers[] =
|
||||
.paletteTag = 0,
|
||||
.oam = &gOamData_BattlerOpponent,
|
||||
.anims = NULL,
|
||||
.images = gSpriteImages_BattlerOpponentLeft,
|
||||
.affineAnims = gSpriteAffineAnimTable_BattlerOpponent,
|
||||
.images = gBattlerPicTable_OpponentLeft,
|
||||
.affineAnims = gAffineAnims_BattleSpriteOpponentSide,
|
||||
.callback = SpriteCB_EnemyMon,
|
||||
},
|
||||
[B_POSITION_PLAYER_RIGHT] = {
|
||||
@@ -1491,8 +1491,8 @@ const struct SpriteTemplate gSpriteTemplates_Battlers[] =
|
||||
.paletteTag = 0,
|
||||
.oam = &gOamData_BattlerPlayer,
|
||||
.anims = NULL,
|
||||
.images = gSpriteImages_BattlerPlayerRight,
|
||||
.affineAnims = gSpriteAffineAnimTable_BattlerPlayer,
|
||||
.images = gBattlerPicTable_PlayerRight,
|
||||
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
|
||||
.callback = SpriteCB_AllyMon,
|
||||
},
|
||||
[B_POSITION_OPPONENT_RIGHT] = {
|
||||
@@ -1500,8 +1500,8 @@ const struct SpriteTemplate gSpriteTemplates_Battlers[] =
|
||||
.paletteTag = 0,
|
||||
.oam = &gOamData_BattlerOpponent,
|
||||
.anims = NULL,
|
||||
.images = gSpriteImages_BattlerOpponentRight,
|
||||
.affineAnims = gSpriteAffineAnimTable_BattlerOpponent,
|
||||
.images = gBattlerPicTable_OpponentRight,
|
||||
.affineAnims = gAffineAnims_BattleSpriteOpponentSide,
|
||||
.callback = SpriteCB_EnemyMon,
|
||||
},
|
||||
};
|
||||
@@ -1514,7 +1514,7 @@ const struct SpriteTemplate gSpriteTemplates_TrainerBackpics[] =
|
||||
.oam = &gOamData_BattlerPlayer,
|
||||
.anims = NULL,
|
||||
.images = gTrainerBackPicTable_Red,
|
||||
.affineAnims = gSpriteAffineAnimTable_BattlerPlayer,
|
||||
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
|
||||
.callback = SpriteCB_AllyMon,
|
||||
},
|
||||
{
|
||||
@@ -1523,7 +1523,7 @@ const struct SpriteTemplate gSpriteTemplates_TrainerBackpics[] =
|
||||
.oam = &gOamData_BattlerPlayer,
|
||||
.anims = NULL,
|
||||
.images = gTrainerBackPicTable_Leaf,
|
||||
.affineAnims = gSpriteAffineAnimTable_BattlerPlayer,
|
||||
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
|
||||
.callback = SpriteCB_AllyMon,
|
||||
},
|
||||
{
|
||||
@@ -1532,7 +1532,7 @@ const struct SpriteTemplate gSpriteTemplates_TrainerBackpics[] =
|
||||
.oam = &gOamData_BattlerPlayer,
|
||||
.anims = NULL,
|
||||
.images = gTrainerBackPicTable_RSBrendan,
|
||||
.affineAnims = gSpriteAffineAnimTable_BattlerPlayer,
|
||||
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
|
||||
.callback = SpriteCB_AllyMon,
|
||||
},
|
||||
{
|
||||
@@ -1541,7 +1541,7 @@ const struct SpriteTemplate gSpriteTemplates_TrainerBackpics[] =
|
||||
.oam = &gOamData_BattlerPlayer,
|
||||
.anims = NULL,
|
||||
.images = gTrainerBackPicTable_RSMay,
|
||||
.affineAnims = gSpriteAffineAnimTable_BattlerPlayer,
|
||||
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
|
||||
.callback = SpriteCB_AllyMon,
|
||||
},
|
||||
{
|
||||
@@ -1550,7 +1550,7 @@ const struct SpriteTemplate gSpriteTemplates_TrainerBackpics[] =
|
||||
.oam = &gOamData_BattlerPlayer,
|
||||
.anims = NULL,
|
||||
.images = gTrainerBackPicTable_Pokedude,
|
||||
.affineAnims = gSpriteAffineAnimTable_BattlerPlayer,
|
||||
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
|
||||
.callback = SpriteCB_AllyMon,
|
||||
},
|
||||
{
|
||||
@@ -1559,7 +1559,7 @@ const struct SpriteTemplate gSpriteTemplates_TrainerBackpics[] =
|
||||
.oam = &gOamData_BattlerPlayer,
|
||||
.anims = NULL,
|
||||
.images = gTrainerBackPicTable_OldMan,
|
||||
.affineAnims = gSpriteAffineAnimTable_BattlerPlayer,
|
||||
.affineAnims = gAffineAnims_BattleSpritePlayerSide,
|
||||
.callback = SpriteCB_AllyMon,
|
||||
},
|
||||
};
|
||||
@@ -1856,7 +1856,7 @@ void CreateMonWithGenderNatureLetter(struct Pokemon *mon, u16 species, u8 level,
|
||||
{
|
||||
u32 personality;
|
||||
|
||||
if ((u8)(unownLetter - 1) < 28)
|
||||
if ((u8)(unownLetter - 1) < NUM_UNOWN_FORMS)
|
||||
{
|
||||
u16 actualLetter;
|
||||
|
||||
@@ -2747,7 +2747,7 @@ void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition)
|
||||
}
|
||||
}
|
||||
gMultiuseSpriteTemplate.paletteTag = speciesTag;
|
||||
gMultiuseSpriteTemplate.anims = gSpriteAnimTable_82349BC;
|
||||
gMultiuseSpriteTemplate.anims = gAnims_MonPic;
|
||||
}
|
||||
|
||||
void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosition)
|
||||
@@ -3919,7 +3919,7 @@ static void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex)
|
||||
*hpSwitchout = gBattleMons[battlerId].hp;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
gBattleMons[battlerId].statStages[i] = 6;
|
||||
gBattleMons[battlerId].statStages[i] = DEFAULT_STAT_STAGE;
|
||||
|
||||
gBattleMons[battlerId].status2 = 0;
|
||||
UpdateSentPokesToOpponentValue(battlerId);
|
||||
@@ -6125,7 +6125,7 @@ static void OakSpeechNidoranFSetupTemplateDummy(struct OakSpeechNidoranFStruct *
|
||||
for (j = 0; j < structPtr->frameCount; ++j)
|
||||
structPtr->frameImages[i * structPtr->spriteCount + j].data = &structPtr->bufferPtrs[i][j * 0x800];
|
||||
structPtr->templates[i].images = &structPtr->frameImages[i * structPtr->spriteCount]; // should be frameCount logically
|
||||
structPtr->templates[i].anims = gSpriteAnimTable_82349BC;
|
||||
structPtr->templates[i].anims = gAnims_MonPic;
|
||||
structPtr->templates[i].paletteTag = i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -626,14 +626,14 @@ static const u32 sBgTilemap_MovesPage[] = INCBIN_U32( "graphics/interface/pokesu
|
||||
|
||||
#include "data/text/nature_names.h"
|
||||
|
||||
static const u8 * const sEggHatchTimeTexts[] = {
|
||||
static const u8 *const sEggHatchTimeTexts[] = {
|
||||
gText_PokeSum_EggHatch_LongTime,
|
||||
gText_PokeSum_EggHatch_SomeTime,
|
||||
gText_PokeSum_EggHatch_Soon,
|
||||
gText_PokeSum_EggHatch_AlmostReady
|
||||
};
|
||||
|
||||
static const u8 * const sEggOriginTexts[] = {
|
||||
static const u8 *const sEggOriginTexts[] = {
|
||||
gText_PokeSum_EggOrigin_DayCare,
|
||||
gText_PokeSum_EggOrigin_Trade,
|
||||
gText_PokeSum_EggOrigin_TravelingMan,
|
||||
|
||||
@@ -439,7 +439,7 @@ void CreateGroupMemberObjectsInvisible(u8 * sprite_ids, s32 group)
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
s32 obj_id = 5 * group + i;
|
||||
sprite_ids[obj_id] = sprite_new(OBJ_EVENT_GFX_MAN, obj_id - 0x38, sUnionPartnerCoords[group][0] + sFacingDirectionOffsets[i][0], sUnionPartnerCoords[group][1] + sFacingDirectionOffsets[i][1], 3, 1);
|
||||
sprite_ids[obj_id] = CreateVirtualObject(OBJ_EVENT_GFX_MAN, obj_id - 0x38, sUnionPartnerCoords[group][0] + sFacingDirectionOffsets[i][0], sUnionPartnerCoords[group][1] + sFacingDirectionOffsets[i][1], 3, 1);
|
||||
RfuUnionObjectToggleInvisibility(obj_id - 0x38, TRUE);
|
||||
}
|
||||
}
|
||||
@@ -653,7 +653,7 @@ bool32 RfuUnionTool_GetGroupAndMemberInFrontOfPlayer(struct UnkStruct_Main0 *mai
|
||||
|
||||
static void UnionPartnerObjectSetFacing(s32 member, s32 group, u8 direction)
|
||||
{
|
||||
TurnObjectEvent(5 * group - 0x38 + member, direction);
|
||||
TurnVirtualObject(5 * group - 0x38 + member, direction);
|
||||
}
|
||||
|
||||
void UpdateUnionGroupMemberFacing(u32 member, u32 group, struct UnkStruct_Main0 *main0_p)
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ struct GFRomHeader
|
||||
const struct CompressedSpriteSheet * monBackPics;
|
||||
const struct CompressedSpritePalette * monNormalPalettes;
|
||||
const struct CompressedSpritePalette * monShinyPalettes;
|
||||
const u8 * const * monIcons;
|
||||
const u8 *const * monIcons;
|
||||
const u8 * monIconPaletteIds;
|
||||
const struct SpritePalette * monIconPalettes;
|
||||
const u8 (* monSpeciesNames)[];
|
||||
@@ -63,7 +63,7 @@ struct GFRomHeader
|
||||
u32 unk18;
|
||||
const struct BaseStats * baseStats;
|
||||
const u8 (* abilityNames)[];
|
||||
const u8 * const * abilityDescriptions;
|
||||
const u8 *const * abilityDescriptions;
|
||||
const struct Item * items;
|
||||
const struct BattleMove * moves;
|
||||
const struct CompressedSpriteSheet * ballGfx;
|
||||
|
||||
+156
-165
@@ -9,6 +9,7 @@
|
||||
#include "field_screen_effect.h"
|
||||
#include "quest_log.h"
|
||||
#include "map_preview_screen.h"
|
||||
#include "fieldmap.h"
|
||||
#include "field_weather.h"
|
||||
#include "field_tasks.h"
|
||||
#include "field_fadetransition.h"
|
||||
@@ -34,6 +35,7 @@
|
||||
#include "fieldmap.h"
|
||||
#include "field_door.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/sound.h"
|
||||
|
||||
extern u16 (*const gSpecials[])(void);
|
||||
@@ -44,12 +46,12 @@ extern const u8 *const gStdScriptsEnd[];
|
||||
static bool8 ScriptContext_NextCommandEndsScript(struct ScriptContext * ctx);
|
||||
static u8 ScriptContext_GetQuestLogInput(struct ScriptContext * ctx);
|
||||
|
||||
static EWRAM_DATA ptrdiff_t gVScriptOffset = 0;
|
||||
static EWRAM_DATA ptrdiff_t sAddressOffset = 0; // For relative addressing in vgoto etc., used by saved scripts (e.g. Mystery Event)
|
||||
static EWRAM_DATA u8 sQuestLogWaitButtonPressTimer = 0;
|
||||
static EWRAM_DATA u16 sPauseCounter = 0;
|
||||
static EWRAM_DATA u16 sMovingNpcId = 0;
|
||||
static EWRAM_DATA u16 sMovingNpcMapBank = 0;
|
||||
static EWRAM_DATA u16 sMovingNpcMapId = 0;
|
||||
static EWRAM_DATA u16 sMovingNpcMapGroup = 0;
|
||||
static EWRAM_DATA u16 sMovingNpcMapNum = 0;
|
||||
static EWRAM_DATA u16 sFieldEffectScriptId = 0;
|
||||
|
||||
struct ScriptContext * sQuestLogScriptContextPtr;
|
||||
@@ -95,7 +97,7 @@ bool8 ScrCmd_gotonative(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_special(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 (*const *specialPtr)(void) = gSpecials + ScriptReadHalfword(ctx);
|
||||
u16 (*const *specialPtr)(void) = &gSpecials[ScriptReadHalfword(ctx)];
|
||||
if (specialPtr < gSpecialsEnd)
|
||||
(*specialPtr)();
|
||||
else
|
||||
@@ -106,7 +108,7 @@ bool8 ScrCmd_special(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_specialvar(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 * varPtr = GetVarPointer(ScriptReadHalfword(ctx));
|
||||
u16 (*const *specialPtr)(void) = gSpecials + ScriptReadHalfword(ctx);
|
||||
u16 (*const *specialPtr)(void) = &gSpecials[ScriptReadHalfword(ctx)];
|
||||
if (specialPtr < gSpecialsEnd)
|
||||
*varPtr = (*specialPtr)();
|
||||
else
|
||||
@@ -170,28 +172,28 @@ bool8 ScrCmd_setvaddress(struct ScriptContext * ctx)
|
||||
u32 addr1 = (u32)ctx->scriptPtr - 1;
|
||||
u32 addr2 = ScriptReadWord(ctx);
|
||||
|
||||
gVScriptOffset = addr2 - addr1;
|
||||
sAddressOffset = addr2 - addr1;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_vgoto(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 * scrptr = (const u8 *)ScriptReadWord(ctx);
|
||||
ScriptJump(ctx, scrptr - gVScriptOffset);
|
||||
ScriptJump(ctx, scrptr - sAddressOffset);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_vcall(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 * scrptr = (const u8 *)ScriptReadWord(ctx);
|
||||
ScriptCall(ctx, scrptr - gVScriptOffset);
|
||||
ScriptCall(ctx, scrptr - sAddressOffset);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_vgoto_if(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 condition = ScriptReadByte(ctx);
|
||||
const u8 * scrptr = (const u8 *)ScriptReadWord(ctx) - gVScriptOffset;
|
||||
const u8 * scrptr = (const u8 *)ScriptReadWord(ctx) - sAddressOffset;
|
||||
if (sScriptConditionTable[condition][ctx->comparisonResult] == 1)
|
||||
ScriptJump(ctx, scrptr);
|
||||
return FALSE;
|
||||
@@ -200,7 +202,7 @@ bool8 ScrCmd_vgoto_if(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_vcall_if(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 condition = ScriptReadByte(ctx);
|
||||
const u8 * scrptr = (const u8 *)ScriptReadWord(ctx) - gVScriptOffset;
|
||||
const u8 * scrptr = (const u8 *)ScriptReadWord(ctx) - sAddressOffset;
|
||||
if (sScriptConditionTable[condition][ctx->comparisonResult] == 1)
|
||||
ScriptCall(ctx, scrptr);
|
||||
return FALSE;
|
||||
@@ -209,7 +211,7 @@ bool8 ScrCmd_vcall_if(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_gotostd(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 stdIdx = ScriptReadByte(ctx);
|
||||
const u8 *const * script = gStdScripts + stdIdx;
|
||||
const u8 *const * script = &gStdScripts[stdIdx];
|
||||
if (script < gStdScriptsEnd)
|
||||
ScriptJump(ctx, *script);
|
||||
return FALSE;
|
||||
@@ -218,7 +220,7 @@ bool8 ScrCmd_gotostd(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_callstd(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 stdIdx = ScriptReadByte(ctx);
|
||||
const u8 *const * script = gStdScripts + stdIdx;
|
||||
const u8 *const * script = &gStdScripts[stdIdx];
|
||||
if (script < gStdScriptsEnd)
|
||||
ScriptCall(ctx, *script);
|
||||
return FALSE;
|
||||
@@ -250,13 +252,13 @@ bool8 ScrCmd_callstd_if(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_gotoram(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_returnram(struct ScriptContext * ctx)
|
||||
{
|
||||
ScriptJump(ctx, gRAMScriptPtr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_killscript(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_endram(struct ScriptContext * ctx)
|
||||
{
|
||||
ClearRamScript();
|
||||
StopScript(ctx);
|
||||
@@ -269,9 +271,9 @@ bool8 ScrCmd_setmysteryeventstatus(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_execram(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_trywondercardscript(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 * script = sub_8069E48();
|
||||
const u8 * script = GetSavedRamScriptIfValid();
|
||||
if (script != NULL)
|
||||
{
|
||||
gRAMScriptPtr = ctx->scriptPtr;
|
||||
@@ -282,19 +284,19 @@ bool8 ScrCmd_execram(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_loadword(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 which = ScriptReadByte(ctx);
|
||||
ctx->data[which] = ScriptReadWord(ctx);
|
||||
u8 index = ScriptReadByte(ctx);
|
||||
ctx->data[index] = ScriptReadWord(ctx);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_loadbytefromaddr(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_loadbytefromptr(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 which = ScriptReadByte(ctx);
|
||||
ctx->data[which] = *(const u8 *)ScriptReadWord(ctx);
|
||||
u8 index = ScriptReadByte(ctx);
|
||||
ctx->data[index] = *(const u8 *)ScriptReadWord(ctx);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_writebytetoaddr(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_setptr(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 value = ScriptReadByte(ctx);
|
||||
*(u8 *)ScriptReadWord(ctx) = value;
|
||||
@@ -303,23 +305,23 @@ bool8 ScrCmd_writebytetoaddr(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_loadbyte(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 which = ScriptReadByte(ctx);
|
||||
ctx->data[which] = ScriptReadByte(ctx);
|
||||
u8 index = ScriptReadByte(ctx);
|
||||
ctx->data[index] = ScriptReadByte(ctx);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_setptrbyte(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 which = ScriptReadByte(ctx);
|
||||
*(u8 *)ScriptReadWord(ctx) = ctx->data[which];
|
||||
u8 index = ScriptReadByte(ctx);
|
||||
*(u8 *)ScriptReadWord(ctx) = ctx->data[index];
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_copylocal(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 whichDst = ScriptReadByte(ctx);
|
||||
u8 whichSrc = ScriptReadByte(ctx);
|
||||
ctx->data[whichDst] = ctx->data[whichSrc];
|
||||
u8 destIndex = ScriptReadByte(ctx);
|
||||
u8 srcIndex = ScriptReadByte(ctx);
|
||||
ctx->data[destIndex] = ctx->data[srcIndex];
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -352,69 +354,67 @@ bool8 ScrCmd_setorcopyvar(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u8 compare_012(u16 left, u16 right)
|
||||
static u8 Compare(u16 a, u16 b)
|
||||
{
|
||||
if (left < right)
|
||||
if (a < b)
|
||||
return 0;
|
||||
else if (left == right)
|
||||
else if (a == b)
|
||||
return 1;
|
||||
else
|
||||
return 2;
|
||||
}
|
||||
|
||||
// comparelocaltolocal
|
||||
bool8 ScrCmd_compare_local_to_local(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 value1 = ctx->data[ScriptReadByte(ctx)];
|
||||
const u8 value2 = ctx->data[ScriptReadByte(ctx)];
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// comparelocaltoimm
|
||||
bool8 ScrCmd_compare_local_to_value(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 value1 = ctx->data[ScriptReadByte(ctx)];
|
||||
const u8 value2 = ScriptReadByte(ctx);
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_compare_local_to_addr(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_compare_local_to_ptr(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 value1 = ctx->data[ScriptReadByte(ctx)];
|
||||
const u8 value2 = *(const u8 *)ScriptReadWord(ctx);
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_compare_addr_to_local(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_compare_ptr_to_local(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 value1 = *(const u8 *)ScriptReadWord(ctx);
|
||||
const u8 value2 = ctx->data[ScriptReadByte(ctx)];
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_compare_addr_to_value(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_compare_ptr_to_value(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 value1 = *(const u8 *)ScriptReadWord(ctx);
|
||||
const u8 value2 = ScriptReadByte(ctx);
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_compare_addr_to_addr(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_compare_ptr_to_ptr(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 value1 = *(const u8 *)ScriptReadWord(ctx);
|
||||
const u8 value2 = *(const u8 *)ScriptReadWord(ctx);
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@ bool8 ScrCmd_compare_var_to_value(struct ScriptContext * ctx)
|
||||
const u16 value1 = *GetVarPointer(ScriptReadHalfword(ctx));
|
||||
const u16 value2 = ScriptReadHalfword(ctx);
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -432,10 +432,11 @@ bool8 ScrCmd_compare_var_to_var(struct ScriptContext * ctx)
|
||||
const u16 *ptr1 = GetVarPointer(ScriptReadHalfword(ctx));
|
||||
const u16 *ptr2 = GetVarPointer(ScriptReadHalfword(ctx));
|
||||
|
||||
ctx->comparisonResult = compare_012(*ptr1, *ptr2);
|
||||
ctx->comparisonResult = Compare(*ptr1, *ptr2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Note: addvar doesn't support adding from a variable in vanilla.
|
||||
bool8 ScrCmd_addvar(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 *ptr = GetVarPointer(ScriptReadHalfword(ctx));
|
||||
@@ -521,7 +522,7 @@ bool8 ScrCmd_checkpcitem(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_givedecoration(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_adddecoration(struct ScriptContext * ctx)
|
||||
{
|
||||
u32 decorId = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
@@ -529,7 +530,7 @@ bool8 ScrCmd_givedecoration(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_takedecoration(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_removedecoration(struct ScriptContext * ctx)
|
||||
{
|
||||
u32 decorId = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
@@ -577,7 +578,7 @@ bool8 ScrCmd_incrementgamestat(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_comparestattoword(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_comparestat(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 statIdx = ScriptReadByte(ctx);
|
||||
u32 value = ScriptReadWord(ctx);
|
||||
@@ -607,11 +608,9 @@ bool8 ScrCmd_animateflash(struct ScriptContext * ctx)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_setflashradius(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_setflashlevel(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 flashLevel = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
Overworld_SetFlashLevel(flashLevel);
|
||||
SetFlashLevel(VarGet(ScriptReadHalfword(ctx)));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -642,9 +641,7 @@ bool8 ScrCmd_fadescreenspeed(struct ScriptContext * ctx)
|
||||
|
||||
static bool8 RunPauseTimer(void)
|
||||
{
|
||||
sPauseCounter--;
|
||||
|
||||
if (sPauseCounter == 0)
|
||||
if (--sPauseCounter == 0)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
@@ -666,7 +663,7 @@ bool8 ScrCmd_initclock(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_dodailyevents(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_dotimebasedevents(struct ScriptContext * ctx)
|
||||
{
|
||||
// DoTimeBasedEvents();
|
||||
return FALSE;
|
||||
@@ -688,13 +685,13 @@ bool8 ScrCmd_setweather(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 weather = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
SetSav1Weather(weather);
|
||||
SetSavedWeather(weather);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_resetweather(struct ScriptContext * ctx)
|
||||
{
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
SetSavedWeatherFromCurrMapHeader();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -768,10 +765,10 @@ bool8 ScrCmd_warphole(struct ScriptContext * ctx)
|
||||
u16 y;
|
||||
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
if (mapGroup == 0xFF && mapNum == 0xFF)
|
||||
SetWarpDestinationToFixedHoleWarp(x - 7, y - 7);
|
||||
if (mapGroup == MAP_GROUP(UNDEFINED) && mapNum == MAP_NUM(UNDEFINED))
|
||||
SetWarpDestinationToFixedHoleWarp(x - MAP_OFFSET, y - MAP_OFFSET);
|
||||
else
|
||||
SetWarpDestination(mapGroup, mapNum, -1, x - 7, y - 7);
|
||||
SetWarpDestination(mapGroup, mapNum, WARP_ID_NONE, x - MAP_OFFSET, y - MAP_OFFSET);
|
||||
DoFallWarp();
|
||||
ResetInitialPlayerAvatarState();
|
||||
return TRUE;
|
||||
@@ -791,7 +788,7 @@ bool8 ScrCmd_warpteleport(struct ScriptContext * ctx)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_warpteleport2(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_warpspinenter(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
@@ -922,11 +919,11 @@ bool8 ScrCmd_waitfanfare(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_playbgm(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 songId = ScriptReadHalfword(ctx);
|
||||
bool8 val = ScriptReadByte(ctx);
|
||||
bool8 save = ScriptReadByte(ctx);
|
||||
|
||||
if (QL_IS_PLAYBACK_STATE)
|
||||
return FALSE;
|
||||
if (val == TRUE)
|
||||
if (save == TRUE)
|
||||
Overworld_SetSavedMusic(songId);
|
||||
PlayNewMapMusic(songId);
|
||||
return FALSE;
|
||||
@@ -992,7 +989,7 @@ bool8 ScrCmd_applymovement(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_applymovement_at(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_applymovementat(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
const void *movementScript = (const void *)ScriptReadWord(ctx);
|
||||
@@ -1006,7 +1003,7 @@ bool8 ScrCmd_applymovement_at(struct ScriptContext * ctx)
|
||||
|
||||
static bool8 WaitForMovementFinish(void)
|
||||
{
|
||||
return ScriptMovement_IsObjectMovementFinished(sMovingNpcId, sMovingNpcMapId, sMovingNpcMapBank);
|
||||
return ScriptMovement_IsObjectMovementFinished(sMovingNpcId, sMovingNpcMapNum, sMovingNpcMapGroup);
|
||||
}
|
||||
|
||||
bool8 ScrCmd_waitmovement(struct ScriptContext * ctx)
|
||||
@@ -1015,13 +1012,13 @@ bool8 ScrCmd_waitmovement(struct ScriptContext * ctx)
|
||||
|
||||
if (localId != 0)
|
||||
sMovingNpcId = localId;
|
||||
sMovingNpcMapBank = gSaveBlock1Ptr->location.mapGroup;
|
||||
sMovingNpcMapId = gSaveBlock1Ptr->location.mapNum;
|
||||
sMovingNpcMapGroup = gSaveBlock1Ptr->location.mapGroup;
|
||||
sMovingNpcMapNum = gSaveBlock1Ptr->location.mapNum;
|
||||
SetupNativeScript(ctx, WaitForMovementFinish);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_waitmovement_at(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_waitmovementat(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapBank;
|
||||
@@ -1031,8 +1028,8 @@ bool8 ScrCmd_waitmovement_at(struct ScriptContext * ctx)
|
||||
sMovingNpcId = localId;
|
||||
mapBank = ScriptReadByte(ctx);
|
||||
mapId = ScriptReadByte(ctx);
|
||||
sMovingNpcMapBank = mapBank;
|
||||
sMovingNpcMapId = mapId;
|
||||
sMovingNpcMapGroup = mapBank;
|
||||
sMovingNpcMapNum = mapId;
|
||||
SetupNativeScript(ctx, WaitForMovementFinish);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1045,7 +1042,7 @@ bool8 ScrCmd_removeobject(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_removeobject_at(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_removeobjectat(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 objectId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
@@ -1063,7 +1060,7 @@ bool8 ScrCmd_addobject(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_addobject_at(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_addobjectat(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 objectId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
@@ -1089,11 +1086,11 @@ bool8 ScrCmd_setobjectxyperm(struct ScriptContext * ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
Overworld_SetMapObjTemplateCoords(localId, x, y);
|
||||
SetObjEventTemplateCoords(localId, x, y);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_moveobjectoffscreen(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_copyobjectxytoperm(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
@@ -1101,44 +1098,44 @@ bool8 ScrCmd_moveobjectoffscreen(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_showobject_at(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_showobjectat(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
|
||||
ShowOrHideObjectByLocalIdAndMap(localId, mapNum, mapGroup, 0);
|
||||
SetObjectInvisibility(localId, mapNum, mapGroup, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_hideobject_at(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_hideobjectat(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
|
||||
ShowOrHideObjectByLocalIdAndMap(localId, mapNum, mapGroup, 1);
|
||||
SetObjectInvisibility(localId, mapNum, mapGroup, TRUE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_setobjectpriority(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_setobjectsubpriority(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
u8 priority = ScriptReadByte(ctx);
|
||||
|
||||
SetObjectPriorityByLocalIdAndMap(localId, mapNum, mapGroup, priority + 83);
|
||||
SetObjectSubpriority(localId, mapNum, mapGroup, priority + 83);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_resetobjectpriority(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_resetobjectsubpriority(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
|
||||
UnfixObjectPriorityByLocalIdAndMap(localId, mapNum, mapGroup);
|
||||
ResetObjectSubpriority(localId, mapNum, mapGroup);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1166,32 +1163,34 @@ bool8 ScrCmd_setobjectmovementtype(struct ScriptContext * ctx)
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 movementType = ScriptReadByte(ctx);
|
||||
|
||||
Overworld_SetObjEventTemplateMovementType(localId, movementType);
|
||||
SetObjEventTemplateMovementType(localId, movementType);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_createvobject(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 graphicsId = ScriptReadByte(ctx);
|
||||
u8 v2 = ScriptReadByte(ctx);
|
||||
u8 virtualObjId = ScriptReadByte(ctx);
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u32 y = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 elevation = ScriptReadByte(ctx);
|
||||
u8 direction = ScriptReadByte(ctx);
|
||||
|
||||
sprite_new(graphicsId, v2, x, y, elevation, direction);
|
||||
CreateVirtualObject(graphicsId, virtualObjId, x, y, elevation, direction);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_turnvobject(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 v1 = ScriptReadByte(ctx);
|
||||
u8 virtualObjId = ScriptReadByte(ctx);
|
||||
u8 direction = ScriptReadByte(ctx);
|
||||
|
||||
TurnObjectEvent(v1, direction);
|
||||
TurnVirtualObject(virtualObjId, direction);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// lockall freezes all object events except the player immediately.
|
||||
// The player is frozen after waiting for their current movement to finish.
|
||||
bool8 ScrCmd_lockall(struct ScriptContext * ctx)
|
||||
{
|
||||
if (IsUpdateLinkStateCBActive())
|
||||
@@ -1200,8 +1199,8 @@ bool8 ScrCmd_lockall(struct ScriptContext * ctx)
|
||||
}
|
||||
else
|
||||
{
|
||||
ScriptFreezeObjectEvents();
|
||||
SetupNativeScript(ctx, NativeScript_WaitPlayerStopMoving);
|
||||
FreezeObjects_WaitForPlayer();
|
||||
SetupNativeScript(ctx, IsFreezePlayerFinished);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1216,13 +1215,13 @@ bool8 ScrCmd_lock(struct ScriptContext * ctx)
|
||||
{
|
||||
if (gObjectEvents[gSelectedObjectEvent].active)
|
||||
{
|
||||
LockSelectedObjectEvent();
|
||||
SetupNativeScript(ctx, NativeScript_WaitPlayerAndTargetNPCStopMoving);
|
||||
FreezeObjects_WaitForPlayerAndSelected();
|
||||
SetupNativeScript(ctx, IsFreezeSelectedObjectAndPlayerFinished);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScriptFreezeObjectEvents();
|
||||
SetupNativeScript(ctx, NativeScript_WaitPlayerStopMoving);
|
||||
FreezeObjects_WaitForPlayer();
|
||||
SetupNativeScript(ctx, IsFreezePlayerFinished);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1429,7 +1428,7 @@ bool8 ScrCmd_multichoice(struct ScriptContext * ctx)
|
||||
u8 left = ScriptReadByte(ctx);
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 multichoiceId = ScriptReadByte(ctx);
|
||||
u8 ignoreBPress = ScriptReadByte(ctx);
|
||||
bool8 ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
if (ScriptMenu_Multichoice(left, top, multichoiceId, ignoreBPress) == TRUE)
|
||||
{
|
||||
@@ -1448,7 +1447,7 @@ bool8 ScrCmd_multichoicedefault(struct ScriptContext * ctx)
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 multichoiceId = ScriptReadByte(ctx);
|
||||
u8 defaultChoice = ScriptReadByte(ctx);
|
||||
u8 ignoreBPress = ScriptReadByte(ctx);
|
||||
bool8 ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
if (ScriptMenu_MultichoiceWithDefault(left, top, multichoiceId, ignoreBPress, defaultChoice) == TRUE)
|
||||
{
|
||||
@@ -1478,7 +1477,7 @@ bool8 ScrCmd_multichoicegrid(struct ScriptContext * ctx)
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 multichoiceId = ScriptReadByte(ctx);
|
||||
u8 numColumns = ScriptReadByte(ctx);
|
||||
u8 ignoreBPress = ScriptReadByte(ctx);
|
||||
bool8 ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
if (ScriptMenu_MultichoiceGrid(left, top, multichoiceId, ignoreBPress, numColumns) == TRUE)
|
||||
{
|
||||
@@ -1498,7 +1497,7 @@ bool8 ScrCmd_erasebox(struct ScriptContext * ctx)
|
||||
u8 right = ScriptReadByte(ctx);
|
||||
u8 bottom = ScriptReadByte(ctx);
|
||||
|
||||
// MenuZeroFillWindowRect(left, top, right, bottom);
|
||||
// Menu_EraseWindowRect(left, top, right, bottom);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1507,7 +1506,7 @@ bool8 ScrCmd_drawboxtext(struct ScriptContext * ctx)
|
||||
// u8 left = ScriptReadByte(ctx);
|
||||
// u8 top = ScriptReadByte(ctx);
|
||||
// u8 multichoiceId = ScriptReadByte(ctx);
|
||||
// u8 ignoreBPress = ScriptReadByte(ctx);
|
||||
// bool8 ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
/*if (Multichoice(left, top, multichoiceId, ignoreBPress) == TRUE)
|
||||
{
|
||||
@@ -1530,7 +1529,9 @@ bool8 ScrCmd_showmonpic(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_hidemonpic(struct ScriptContext * ctx)
|
||||
{
|
||||
bool8 (*func)(void) = ScriptMenu_GetPicboxWaitFunc();
|
||||
// The hide function returns a pointer to a function
|
||||
// that returns true once the pic is hidden
|
||||
bool8 (*func)(void) = ScriptMenu_HidePokemonPic();
|
||||
|
||||
if (func == NULL)
|
||||
return FALSE;
|
||||
@@ -1538,48 +1539,48 @@ bool8 ScrCmd_hidemonpic(struct ScriptContext * ctx)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_showcontestwinner(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_showcontestpainting(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 v1 = ScriptReadByte(ctx);
|
||||
|
||||
u8 contestWinnerId = ScriptReadByte(ctx);
|
||||
/*
|
||||
if (v1)
|
||||
sub_812FDA8(v1);
|
||||
ShowContestWinner();
|
||||
ScriptContext1_Stop();
|
||||
return TRUE;
|
||||
*/
|
||||
// Artist's painting is temporary and already has its data loaded
|
||||
if (contestWinnerId != CONTEST_WINNER_ARTIST)
|
||||
SetContestWinnerForPainting(contestWinnerId);
|
||||
|
||||
ShowContestPainting();
|
||||
ScriptContext1_Stop()
|
||||
return TRUE;
|
||||
*/
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_braillemessage(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 *ptr = (u8 *)ScriptReadWord(ctx);
|
||||
if (ptr == NULL)
|
||||
ptr = (u8 *)ctx->data[0];
|
||||
u8 *msg = (u8 *)ScriptReadWord(ctx);
|
||||
if (msg == NULL)
|
||||
msg = (u8 *)ctx->data[0];
|
||||
|
||||
LoadStdWindowFrameGfx();
|
||||
DrawDialogueFrame(0, 1);
|
||||
AddTextPrinterParameterized(0, FONT_6, ptr, 0, 1, 0, NULL);
|
||||
AddTextPrinterParameterized(0, FONT_BRAILLE, msg, 0, 1, 0, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_getbraillestringwidth(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 *ptr = (u8 *)ScriptReadWord(ctx);
|
||||
if (ptr == NULL)
|
||||
ptr = (u8 *)ctx->data[0];
|
||||
u8 *msg = (u8 *)ScriptReadWord(ctx);
|
||||
if (msg == NULL)
|
||||
msg = (u8 *)ctx->data[0];
|
||||
|
||||
gSpecialVar_0x8004 = GetStringWidth(FONT_6, ptr, -1);
|
||||
gSpecialVar_0x8004 = GetStringWidth(FONT_BRAILLE, msg, -1);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_vmessage(struct ScriptContext * ctx)
|
||||
{
|
||||
u32 v1 = ScriptReadWord(ctx);
|
||||
u32 msg = ScriptReadWord(ctx);
|
||||
|
||||
ShowFieldMessage((u8 *)(v1 - gVScriptOffset));
|
||||
ShowFieldMessage((u8 *)(msg - sAddressOffset));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1629,8 +1630,8 @@ bool8 ScrCmd_bufferitemname(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const u8 gUnknown_83A72A0[] = _("S");
|
||||
const u8 gUnknown_83A72A2[] = _("IES");
|
||||
static const u8 sText_S[] = _("S");
|
||||
static const u8 sText_IES[] = _("IES");
|
||||
|
||||
bool8 ScrCmd_bufferitemnameplural(struct ScriptContext * ctx)
|
||||
{
|
||||
@@ -1640,15 +1641,15 @@ bool8 ScrCmd_bufferitemnameplural(struct ScriptContext * ctx)
|
||||
|
||||
CopyItemName(itemId, sScriptStringVars[stringVarIndex]);
|
||||
if (itemId == ITEM_POKE_BALL && quantity >= 2)
|
||||
StringAppend(sScriptStringVars[stringVarIndex], gUnknown_83A72A0);
|
||||
else if (itemId >= ITEM_CHERI_BERRY && itemId < ITEM_ENIGMA_BERRY && quantity >= 2)
|
||||
StringAppend(sScriptStringVars[stringVarIndex], sText_S);
|
||||
else if (itemId >= FIRST_BERRY_INDEX && itemId < LAST_BERRY_INDEX && quantity >= 2)
|
||||
{
|
||||
u16 strlength = StringLength(sScriptStringVars[stringVarIndex]);
|
||||
if (strlength != 0)
|
||||
{
|
||||
u8 * endptr = sScriptStringVars[stringVarIndex] + strlength;
|
||||
endptr[-1] = EOS;
|
||||
StringAppend(sScriptStringVars[stringVarIndex], gUnknown_83A72A2);
|
||||
StringAppend(sScriptStringVars[stringVarIndex], sText_IES);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1676,10 +1677,10 @@ bool8 ScrCmd_buffermovename(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_buffernumberstring(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 stringVarIndex = ScriptReadByte(ctx);
|
||||
u16 v1 = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 v2 = CountDigits(v1);
|
||||
u16 num = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 numDigits = CountDigits(num);
|
||||
|
||||
ConvertIntToDecimalStringN(sScriptStringVars[stringVarIndex], v1, 0, v2);
|
||||
ConvertIntToDecimalStringN(sScriptStringVars[stringVarIndex], num, STR_CONV_MODE_LEFT_ALIGN, numDigits);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1692,17 +1693,6 @@ bool8 ScrCmd_bufferstdstring(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
bool8 ScrCmd_buffercontesttype(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 stringVarIndex = ScriptReadByte(ctx);
|
||||
u16 index = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
sub_818E868(sScriptStringVars[stringVarIndex], index);
|
||||
return FALSE;
|
||||
}
|
||||
*/
|
||||
|
||||
bool8 ScrCmd_bufferstring(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 stringVarIndex = ScriptReadByte(ctx);
|
||||
@@ -1712,9 +1702,9 @@ bool8 ScrCmd_bufferstring(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_vloadword(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_vbuffermessage(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 *ptr = (u8 *)(ScriptReadWord(ctx) - gVScriptOffset);
|
||||
const u8 *ptr = (u8 *)(ScriptReadWord(ctx) - sAddressOffset);
|
||||
|
||||
StringExpandPlaceholders(gStringVar4, ptr);
|
||||
return FALSE;
|
||||
@@ -1725,7 +1715,7 @@ bool8 ScrCmd_vbufferstring(struct ScriptContext * ctx)
|
||||
u8 stringVarIndex = ScriptReadByte(ctx);
|
||||
u32 addr = ScriptReadWord(ctx);
|
||||
|
||||
const u8 *src = (u8 *)(addr - gVScriptOffset);
|
||||
const u8 *src = (u8 *)(addr - sAddressOffset);
|
||||
u8 *dest = sScriptStringVars[stringVarIndex];
|
||||
StringCopy(dest, src);
|
||||
return FALSE;
|
||||
@@ -1964,6 +1954,7 @@ bool8 ScrCmd_pokemartdecoration(struct ScriptContext * ctx)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Changes clerk dialogue slightly from above. See MART_TYPE_DECOR2
|
||||
bool8 ScrCmd_pokemartdecoration2(struct ScriptContext * ctx)
|
||||
{
|
||||
const void *ptr = (void *)ScriptReadWord(ctx);
|
||||
@@ -1989,13 +1980,13 @@ bool8 ScrCmd_setberrytree(struct ScriptContext * ctx)
|
||||
// u8 growthStage = ScriptReadByte(ctx);
|
||||
//
|
||||
// if (berry == 0)
|
||||
// PlantBerryTree(treeId, 0, growthStage, FALSE);
|
||||
// PlantBerryTree(treeId, berry, growthStage, FALSE);
|
||||
// else
|
||||
// PlantBerryTree(treeId, berry, growthStage, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_getpricereduction(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_getpokenewsactive(struct ScriptContext * ctx)
|
||||
{
|
||||
// u16 value = VarGet(ScriptReadHalfword(ctx));
|
||||
//
|
||||
@@ -2005,7 +1996,7 @@ bool8 ScrCmd_getpricereduction(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_choosecontestmon(struct ScriptContext * ctx)
|
||||
{
|
||||
// sub_81B9404();
|
||||
// ChooseContestMon();
|
||||
ScriptContext1_Stop();
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2013,7 +2004,7 @@ bool8 ScrCmd_choosecontestmon(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_startcontest(struct ScriptContext * ctx)
|
||||
{
|
||||
// sub_80F840C();
|
||||
// StartContest();
|
||||
// ScriptContext1_Stop();
|
||||
// return TRUE;
|
||||
return FALSE;
|
||||
@@ -2021,7 +2012,7 @@ bool8 ScrCmd_startcontest(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_showcontestresults(struct ScriptContext * ctx)
|
||||
{
|
||||
// sub_80F8484();
|
||||
// ShowContestResults();
|
||||
// ScriptContext1_Stop();
|
||||
// return TRUE;
|
||||
return FALSE;
|
||||
@@ -2029,7 +2020,7 @@ bool8 ScrCmd_showcontestresults(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_contestlinktransfer(struct ScriptContext * ctx)
|
||||
{
|
||||
// sub_80F84C4(gSpecialVar_ContestCategory);
|
||||
// ContestLinkTransfer(gSpecialVar_ContestCategory);
|
||||
// ScriptContext1_Stop();
|
||||
// return TRUE;
|
||||
return FALSE;
|
||||
@@ -2044,7 +2035,7 @@ bool8 ScrCmd_dofieldeffect(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_setfieldeffectarg(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_setfieldeffectargument(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 argNum = ScriptReadByte(ctx);
|
||||
|
||||
@@ -2101,11 +2092,11 @@ bool8 ScrCmd_setmetatile(struct ScriptContext * ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 tileId = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 v8 = VarGet(ScriptReadHalfword(ctx));
|
||||
bool16 isImpassable = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
x += 7;
|
||||
y += 7;
|
||||
if (!v8)
|
||||
x += MAP_OFFSET;
|
||||
y += MAP_OFFSET;
|
||||
if (!isImpassable)
|
||||
MapGridSetMetatileIdAt(x, y, tileId);
|
||||
else
|
||||
MapGridSetMetatileIdAt(x, y, tileId | METATILE_COLLISION_MASK);
|
||||
@@ -2117,8 +2108,8 @@ bool8 ScrCmd_opendoor(struct ScriptContext * ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
x += 7;
|
||||
y += 7;
|
||||
x += MAP_OFFSET;
|
||||
y += MAP_OFFSET;
|
||||
PlaySE(GetDoorSoundEffect(x, y));
|
||||
FieldAnimateDoorOpen(x, y);
|
||||
return FALSE;
|
||||
@@ -2129,8 +2120,8 @@ bool8 ScrCmd_closedoor(struct ScriptContext * ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
x += 7;
|
||||
y += 7;
|
||||
x += MAP_OFFSET;
|
||||
y += MAP_OFFSET;
|
||||
FieldAnimateDoorClose(x, y);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2154,8 +2145,8 @@ bool8 ScrCmd_setdooropen(struct ScriptContext * ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
x += 7;
|
||||
y += 7;
|
||||
x += MAP_OFFSET;
|
||||
y += MAP_OFFSET;
|
||||
FieldSetDoorOpened(x, y);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2165,8 +2156,8 @@ bool8 ScrCmd_setdoorclosed(struct ScriptContext * ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
x += 7;
|
||||
y += 7;
|
||||
x += MAP_OFFSET;
|
||||
y += MAP_OFFSET;
|
||||
FieldSetDoorClosed(x, y);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2202,9 +2193,9 @@ bool8 ScrCmd_addcoins(struct ScriptContext * ctx)
|
||||
u16 coins = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
if (AddCoins(coins) == TRUE)
|
||||
gSpecialVar_Result = 0;
|
||||
gSpecialVar_Result = FALSE;
|
||||
else
|
||||
gSpecialVar_Result = 1;
|
||||
gSpecialVar_Result = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2213,9 +2204,9 @@ bool8 ScrCmd_removecoins(struct ScriptContext * ctx)
|
||||
u16 coins = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
if (RemoveCoins(coins) == TRUE)
|
||||
gSpecialVar_Result = 0;
|
||||
gSpecialVar_Result = FALSE;
|
||||
else
|
||||
gSpecialVar_Result = 1;
|
||||
gSpecialVar_Result = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -523,7 +523,7 @@ bool32 ValidateRamScript(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u8 *sub_8069E48(void)
|
||||
u8 *GetSavedRamScriptIfValid(void)
|
||||
{
|
||||
struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data;
|
||||
if (!ValidateReceivedWonderCard())
|
||||
|
||||
+1
-1
@@ -1048,7 +1048,7 @@ bool8 ScriptMenu_ShowPokemonPic(u16 species, u8 x, u8 y)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 (*ScriptMenu_GetPicboxWaitFunc(void))(void)
|
||||
bool8 (*ScriptMenu_HidePokemonPic(void))(void)
|
||||
{
|
||||
u8 taskId = FindTaskIdByFunc(Task_ScriptShowMonPic);
|
||||
if (taskId == 0xFF)
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ static u8 CreateShopMenu(u8 a0)
|
||||
{
|
||||
gShopData.martType = GetMartTypeFromItemList(a0);
|
||||
gShopData.selectedRow = 0;
|
||||
if (ContextNpcGetTextColor() == 0)
|
||||
if (ContextNpcGetTextColor() == NPC_TEXT_COLOR_MALE)
|
||||
gShopData.fontId = FONT_4;
|
||||
else
|
||||
gShopData.fontId = FONT_5;
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "decompress.h"
|
||||
|
||||
extern const struct CompressedSpriteSheet gMonFrontPicTable[];
|
||||
extern const struct CompressedSpriteSheet gMonBackPicTable[];
|
||||
extern const struct CompressedSpriteSheet gTrainerFrontPicTable[];
|
||||
extern const struct CompressedSpriteSheet gTrainerBackPicTable[];
|
||||
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
|
||||
extern const union AnimCmd *const gSpriteAnimTable_82349BC[];
|
||||
extern const union AnimCmd *const *const gTrainerFrontAnimsPtrTable[];
|
||||
|
||||
// Static type declarations
|
||||
#include "data.h"
|
||||
|
||||
struct PicData
|
||||
{
|
||||
@@ -131,7 +122,7 @@ void LoadPicPaletteBySlot(u16 species, u32 otId, u32 personality, u8 paletteSlot
|
||||
void AssignSpriteAnimsTable(bool8 isTrainer)
|
||||
{
|
||||
if (!isTrainer)
|
||||
sCreatingSpriteTemplate.anims = gSpriteAnimTable_82349BC;
|
||||
sCreatingSpriteTemplate.anims = gAnims_MonPic;
|
||||
else
|
||||
sCreatingSpriteTemplate.anims = gTrainerFrontAnimsPtrTable[0];
|
||||
}
|
||||
|
||||
+1
-1
@@ -4657,7 +4657,7 @@ static void HandleCancelTrade(bool32 unlockObjs)
|
||||
static void UR_EnableScriptContext2AndFreezeObjectEvents(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
ScriptFreezeObjectEvents();
|
||||
FreezeObjects_WaitForPlayer();
|
||||
}
|
||||
|
||||
static u8 GetSinglePartnerSpriteGenderParam(s32 linkPlayer)
|
||||
|
||||
+10
-8
@@ -575,7 +575,7 @@ static const u8 sMovementScript_TrainerNoRematch[] = {
|
||||
};
|
||||
|
||||
static const u8 sMovementScript_TrainerRematch[] = {
|
||||
MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_DOWN,
|
||||
MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_DOWN,
|
||||
MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK,
|
||||
MOVEMENT_ACTION_STEP_END
|
||||
};
|
||||
@@ -640,9 +640,9 @@ void VsSeekerResetObjectMovementAfterChargeComplete(void)
|
||||
{
|
||||
if ((templates[i].objUnion.normal.trainerType == TRAINER_TYPE_NORMAL
|
||||
|| templates[i].objUnion.normal.trainerType == TRAINER_TYPE_BURIED)
|
||||
&& (templates[i].objUnion.normal.movementType == MOVEMENT_TYPE_VS_SEEKER_4D
|
||||
|| templates[i].objUnion.normal.movementType == MOVEMENT_TYPE_VS_SEEKER_4E
|
||||
|| templates[i].objUnion.normal.movementType == MOVEMENT_TYPE_VS_SEEKER_4F))
|
||||
&& (templates[i].objUnion.normal.movementType == MOVEMENT_TYPE_RAISE_HAND_AND_STOP
|
||||
|| templates[i].objUnion.normal.movementType == MOVEMENT_TYPE_RAISE_HAND_AND_JUMP
|
||||
|| templates[i].objUnion.normal.movementType == MOVEMENT_TYPE_RAISE_HAND_AND_SWIM))
|
||||
{
|
||||
movementType = GetRandomFaceDirectionMovementType();
|
||||
TryGetObjectEventIdByLocalIdAndMap(templates[i].localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objEventId);
|
||||
@@ -700,7 +700,9 @@ static void ResetMovementOfRematchableTrainers(void)
|
||||
for (i = 0; i < OBJECT_EVENTS_COUNT; i++)
|
||||
{
|
||||
struct ObjectEvent * objectEvent = &gObjectEvents[i];
|
||||
if (objectEvent->movementType == MOVEMENT_TYPE_VS_SEEKER_4D || objectEvent->movementType == MOVEMENT_TYPE_VS_SEEKER_4E || objectEvent->movementType == MOVEMENT_TYPE_VS_SEEKER_4F)
|
||||
if (objectEvent->movementType == MOVEMENT_TYPE_RAISE_HAND_AND_STOP
|
||||
|| objectEvent->movementType == MOVEMENT_TYPE_RAISE_HAND_AND_JUMP
|
||||
|| objectEvent->movementType == MOVEMENT_TYPE_RAISE_HAND_AND_SWIM)
|
||||
{
|
||||
u8 movementType = GetRandomFaceDirectionMovementType();
|
||||
if (objectEvent->active && gSprites[objectEvent->spriteId].data[0] == i)
|
||||
@@ -1144,13 +1146,13 @@ static u8 GetRunningBehaviorFromGraphicsId(u8 graphicsId)
|
||||
case OBJ_EVENT_GFX_BLACKBELT:
|
||||
case OBJ_EVENT_GFX_HIKER:
|
||||
case OBJ_EVENT_GFX_SAILOR:
|
||||
return MOVEMENT_TYPE_VS_SEEKER_4E;
|
||||
return MOVEMENT_TYPE_RAISE_HAND_AND_JUMP;
|
||||
case OBJ_EVENT_GFX_TUBER_M_WATER:
|
||||
case OBJ_EVENT_GFX_SWIMMER_M_WATER:
|
||||
case OBJ_EVENT_GFX_SWIMMER_F_WATER:
|
||||
return MOVEMENT_TYPE_VS_SEEKER_4F;
|
||||
return MOVEMENT_TYPE_RAISE_HAND_AND_SWIM;
|
||||
default:
|
||||
return MOVEMENT_TYPE_VS_SEEKER_4D;
|
||||
return MOVEMENT_TYPE_RAISE_HAND_AND_STOP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user