Document secret base
This commit is contained in:
@@ -686,7 +686,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_PICHU_DOLL,
|
||||
_("PICHU DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -695,7 +695,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_PIKACHU_DOLL,
|
||||
_("PIKACHU DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -704,7 +704,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_MARILL_DOLL,
|
||||
_("MARILL DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -713,7 +713,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_TOGEPI_DOLL,
|
||||
_("TOGEPI DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -722,7 +722,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_CYNDAQUIL_DOLL,
|
||||
_("CYNDAQUIL DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -731,7 +731,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_CHIKORITA_DOLL,
|
||||
_("CHIKORITA DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -740,7 +740,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_TOTODILE_DOLL,
|
||||
_("TOTODILE DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -749,7 +749,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_JIGGLYPUFF_DOLL,
|
||||
_("JIGGLYPUFF DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -758,7 +758,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_MEOWTH_DOLL,
|
||||
_("MEOWTH DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -767,7 +767,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_CLEFAIRY_DOLL,
|
||||
_("CLEFAIRY DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -776,7 +776,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_DITTO_DOLL,
|
||||
_("DITTO DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -785,7 +785,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_SMOOCHUM_DOLL,
|
||||
_("SMOOCHUM DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -794,7 +794,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_TREECKO_DOLL,
|
||||
_("TREECKO DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -803,7 +803,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_TORCHIC_DOLL,
|
||||
_("TORCHIC DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -812,7 +812,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_MUDKIP_DOLL,
|
||||
_("MUDKIP DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -821,7 +821,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_DUSKULL_DOLL,
|
||||
_("DUSKULL DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -830,7 +830,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_WYNAUT_DOLL,
|
||||
_("WYNAUT DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -839,7 +839,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_BALTOY_DOLL,
|
||||
_("BALTOY DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -848,7 +848,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_KECLEON_DOLL,
|
||||
_("KECLEON DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -857,7 +857,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_AZURILL_DOLL,
|
||||
_("AZURILL DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -866,7 +866,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_SKITTY_DOLL,
|
||||
_("SKITTY DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -875,7 +875,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_SWABLU_DOLL,
|
||||
_("SWABLU DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -884,7 +884,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_GULPIN_DOLL,
|
||||
_("GULPIN DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -893,7 +893,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_LOTAD_DOLL,
|
||||
_("LOTAD DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -902,7 +902,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_SEEDOT_DOLL,
|
||||
_("SEEDOT DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_DOLL,
|
||||
3000,
|
||||
@@ -911,7 +911,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_PIKA_CUSHION,
|
||||
_("PIKA CUSHION"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_CUSHION,
|
||||
2000,
|
||||
@@ -920,7 +920,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_ROUND_CUSHION,
|
||||
_("ROUND CUSHION"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_CUSHION,
|
||||
2000,
|
||||
@@ -929,7 +929,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_KISS_CUSHION,
|
||||
_("KISS CUSHION"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_CUSHION,
|
||||
2000,
|
||||
@@ -938,7 +938,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_ZIGZAG_CUSHION,
|
||||
_("ZIGZAG CUSHION"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_CUSHION,
|
||||
2000,
|
||||
@@ -947,7 +947,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_SPIN_CUSHION,
|
||||
_("SPIN CUSHION"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_CUSHION,
|
||||
2000,
|
||||
@@ -956,7 +956,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_DIAMOND_CUSHION,
|
||||
_("DIAMOND CUSHION"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_CUSHION,
|
||||
2000,
|
||||
@@ -965,7 +965,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_BALL_CUSHION,
|
||||
_("BALL CUSHION"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_CUSHION,
|
||||
2000,
|
||||
@@ -974,7 +974,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_GRASS_CUSHION,
|
||||
_("GRASS CUSHION"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_CUSHION,
|
||||
2000,
|
||||
@@ -983,7 +983,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_FIRE_CUSHION,
|
||||
_("FIRE CUSHION"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_CUSHION,
|
||||
2000,
|
||||
@@ -992,7 +992,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_WATER_CUSHION,
|
||||
_("WATER CUSHION"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x1,
|
||||
DECORCAT_CUSHION,
|
||||
2000,
|
||||
@@ -1001,7 +1001,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_SNORLAX_DOLL,
|
||||
_("SNORLAX DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x2,
|
||||
DECORCAT_DOLL,
|
||||
10000,
|
||||
@@ -1010,7 +1010,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_RHYDON_DOLL,
|
||||
_("RHYDON DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x2,
|
||||
DECORCAT_DOLL,
|
||||
10000,
|
||||
@@ -1019,7 +1019,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_LAPRAS_DOLL,
|
||||
_("LAPRAS DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x2,
|
||||
DECORCAT_DOLL,
|
||||
10000,
|
||||
@@ -1028,7 +1028,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_VENUSAUR_DOLL,
|
||||
_("VENUSAUR DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x2,
|
||||
DECORCAT_DOLL,
|
||||
10000,
|
||||
@@ -1037,7 +1037,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_CHARIZARD_DOLL,
|
||||
_("CHARIZARD DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x2,
|
||||
DECORCAT_DOLL,
|
||||
10000,
|
||||
@@ -1046,7 +1046,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_BLASTOISE_DOLL,
|
||||
_("BLASTOISE DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x2,
|
||||
DECORCAT_DOLL,
|
||||
10000,
|
||||
@@ -1055,7 +1055,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_WAILMER_DOLL,
|
||||
_("WAILMER DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x2,
|
||||
DECORCAT_DOLL,
|
||||
10000,
|
||||
@@ -1064,7 +1064,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_REGIROCK_DOLL,
|
||||
_("REGIROCK DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x2,
|
||||
DECORCAT_DOLL,
|
||||
10000,
|
||||
@@ -1073,7 +1073,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_REGICE_DOLL,
|
||||
_("REGICE DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x2,
|
||||
DECORCAT_DOLL,
|
||||
10000,
|
||||
@@ -1082,7 +1082,7 @@ const struct Decoration gDecorations[] = {
|
||||
}, {
|
||||
DECOR_REGISTEEL_DOLL,
|
||||
_("REGISTEEL DOLL"),
|
||||
DECORPERM_SOLID_MAT,
|
||||
DECORPERM_SPRITE,
|
||||
DECORSHAPE_1x2,
|
||||
DECORCAT_DOLL,
|
||||
10000,
|
||||
|
||||
@@ -444,7 +444,7 @@ void sub_8126968(void)
|
||||
if (gUnknown_0203A17C.isPlayerRoom == FALSE)
|
||||
{
|
||||
gUnknown_0203A17C.items = gSaveBlock1Ptr->secretBases[0].decorations;
|
||||
gUnknown_0203A17C.pos = gSaveBlock1Ptr->secretBases[0].decorationPos;
|
||||
gUnknown_0203A17C.pos = gSaveBlock1Ptr->secretBases[0].decorationPositions;
|
||||
}
|
||||
if (gUnknown_0203A17C.isPlayerRoom == TRUE)
|
||||
{
|
||||
@@ -507,7 +507,7 @@ void sub_8126AD8(u8 taskId)
|
||||
{
|
||||
sub_8126ABC();
|
||||
gUnknown_0203A17C.items = gSaveBlock1Ptr->secretBases[0].decorations;
|
||||
gUnknown_0203A17C.pos = gSaveBlock1Ptr->secretBases[0].decorationPos;
|
||||
gUnknown_0203A17C.pos = gSaveBlock1Ptr->secretBases[0].decorationPositions;
|
||||
gUnknown_0203A17C.size = sizeof(gSaveBlock1Ptr->secretBases[0].decorations);
|
||||
gUnknown_0203A17C.isPlayerRoom = FALSE;
|
||||
gTasks[taskId].func = sub_8126B80;
|
||||
@@ -1165,52 +1165,40 @@ u16 sub_8127B54(u8 decor, u8 a1)
|
||||
|
||||
void sub_8127B90(u16 mapX, u16 mapY, u8 decWidth, u8 decHeight, u16 decor)
|
||||
{
|
||||
u16 i;
|
||||
u16 j;
|
||||
u16 i, j;
|
||||
s16 x, y;
|
||||
u16 behavior;
|
||||
u16 impassableFlag;
|
||||
u16 v0;
|
||||
u16 v1;
|
||||
s16 decLeft;
|
||||
s16 decBottom;
|
||||
u16 posterSide;
|
||||
u16 elevation;
|
||||
|
||||
for (i = 0; i < decHeight; i ++)
|
||||
for (j = 0; j < decHeight; j++)
|
||||
{
|
||||
decBottom = mapY - decHeight + 1 + i;
|
||||
for (j = 0; j < decWidth; j ++)
|
||||
y = mapY - decHeight + 1 + j;
|
||||
for (i = 0; i < decWidth; i++)
|
||||
{
|
||||
decLeft = mapX + j;
|
||||
behavior = GetBehaviorByMetatileId(0x200 + gDecorations[decor].tiles[i * decWidth + j]);
|
||||
x = mapX + i;
|
||||
behavior = GetBehaviorByMetatileId(0x200 + gDecorations[decor].tiles[j * decWidth + i]);
|
||||
if (MetatileBehavior_IsSecretBaseImpassable(behavior) == TRUE || (gDecorations[decor].permission != DECORPERM_PASS_FLOOR && (behavior >> 12)))
|
||||
{
|
||||
impassableFlag = METATILE_COLLISION_MASK;
|
||||
}
|
||||
else
|
||||
{
|
||||
impassableFlag = 0x000;
|
||||
}
|
||||
if (gDecorations[decor].permission != DECORPERM_NA_WALL && MetatileBehavior_IsSecretBaseNorthWall(MapGridGetMetatileBehaviorAt(decLeft, decBottom)) == TRUE)
|
||||
{
|
||||
v0 = 1;
|
||||
}
|
||||
impassableFlag = 0;
|
||||
|
||||
if (gDecorations[decor].permission != DECORPERM_NA_WALL && MetatileBehavior_IsSecretBaseNorthWall(MapGridGetMetatileBehaviorAt(x, y)) == TRUE)
|
||||
posterSide = 1;
|
||||
else
|
||||
{
|
||||
v0 = 0;
|
||||
}
|
||||
v1 = sub_8127B54(gDecorations[decor].id, i * decWidth + j);
|
||||
if (v1 != 0xFFFF)
|
||||
{
|
||||
MapGridSetMetatileEntryAt(decLeft, decBottom, (gDecorations[decor].tiles[i * decWidth + j] + (0x200 | v0)) | impassableFlag | v1);
|
||||
}
|
||||
posterSide = 0;
|
||||
|
||||
elevation = sub_8127B54(gDecorations[decor].id, j * decWidth + i);
|
||||
if (elevation != 0xFFFF)
|
||||
MapGridSetMetatileEntryAt(x, y, (gDecorations[decor].tiles[j * decWidth + i] + (0x200 | posterSide)) | impassableFlag | elevation);
|
||||
else
|
||||
{
|
||||
MapGridSetMetatileIdAt(decLeft, decBottom, (gDecorations[decor].tiles[i * decWidth + j] + (0x200 | v0)) | impassableFlag);
|
||||
}
|
||||
MapGridSetMetatileIdAt(x, y, (gDecorations[decor].tiles[j * decWidth + i] + (0x200 | posterSide)) | impassableFlag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8127D38(u16 mapX, u16 mapY, u16 decor)
|
||||
void ShowDecorationOnMap(u16 mapX, u16 mapY, u16 decor)
|
||||
{
|
||||
switch (gDecorations[decor].shape)
|
||||
{
|
||||
@@ -1264,13 +1252,15 @@ void sub_8127E18(void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
VarSet(UNKNOWN_VAR_OFFSET_3F20 + gMapHeader.events->eventObjects[j].graphicsId, sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0]);
|
||||
VarSet(
|
||||
VAR_OBJ_GFX_ID_0 + (gMapHeader.events->eventObjects[j].graphicsId - EVENT_OBJ_GFX_VAR_0),
|
||||
sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0]);
|
||||
gSpecialVar_0x8005 = gMapHeader.events->eventObjects[j].localId;
|
||||
gSpecialVar_0x8006 = sCurDecorMapX;
|
||||
gSpecialVar_0x8007 = sCurDecorMapY;
|
||||
show_sprite(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
sub_808EBA8(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gSpecialVar_0x8006, gSpecialVar_0x8007);
|
||||
sub_808F254(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
TrySpawnEventObject(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
TryMoveEventObjectToMapCoords(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gSpecialVar_0x8006, gSpecialVar_0x8007);
|
||||
TryOverrideEventObjectTemplateCoords(gSpecialVar_0x8005, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1591,7 +1581,7 @@ bool8 sub_812853C(u8 taskId, const struct Decoration *decoration)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DECORPERM_SOLID_MAT:
|
||||
case DECORPERM_SPRITE:
|
||||
curY = gTasks[taskId].data[1];
|
||||
for (j=0; j<mapX; j++)
|
||||
{
|
||||
@@ -1599,14 +1589,14 @@ bool8 sub_812853C(u8 taskId, const struct Decoration *decoration)
|
||||
behaviorAt = MapGridGetMetatileBehaviorAt(curX, curY);
|
||||
if (decoration->shape == DECORSHAPE_1x2)
|
||||
{
|
||||
if (!MetatileBehavior_IsLargeMatCenter(behaviorAt))
|
||||
if (!MetatileBehavior_HoldsLargeDecoration(behaviorAt))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (!MetatileBehavior_IsSecretBaseLargeMatEdge(behaviorAt))
|
||||
else if (!MetatileBehavior_HoldsSmallDecoration(behaviorAt))
|
||||
{
|
||||
if (!MetatileBehavior_IsLargeMatCenter(behaviorAt))
|
||||
if (!MetatileBehavior_HoldsLargeDecoration(behaviorAt))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1646,9 +1636,9 @@ void sub_81289F0(u8 taskId)
|
||||
{
|
||||
ClearDialogWindowAndFrame(0, 0);
|
||||
sub_8128AAC(taskId);
|
||||
if (gDecorations[gCurDecorInventoryItems[gCurDecorationIndex]].permission != DECORPERM_SOLID_MAT)
|
||||
if (gDecorations[gCurDecorInventoryItems[gCurDecorationIndex]].permission != DECORPERM_SPRITE)
|
||||
{
|
||||
sub_8127D38(gTasks[taskId].data[0], gTasks[taskId].data[1], gCurDecorInventoryItems[gCurDecorationIndex]);
|
||||
ShowDecorationOnMap(gTasks[taskId].data[0], gTasks[taskId].data[1], gCurDecorInventoryItems[gCurDecorationIndex]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1750,7 +1740,7 @@ void sub_8128C64(u8 taskId)
|
||||
switch (data[2])
|
||||
{
|
||||
case 0:
|
||||
sub_80E9578();
|
||||
HideSecretBaseDecorationSprites();
|
||||
data[2] ++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -2043,7 +2033,7 @@ u8 gpu_pal_decompress_alloc_tag_and_upload(struct PlaceDecorationGraphicsDataBuf
|
||||
{
|
||||
sub_8129048(data);
|
||||
data->decoration = &gDecorations[decor];
|
||||
if (data->decoration->permission == DECORPERM_SOLID_MAT)
|
||||
if (data->decoration->permission == DECORPERM_SPRITE)
|
||||
{
|
||||
return AddPseudoEventObject(data->decoration->tiles[0], SpriteCallbackDummy, 0, 0, 1);
|
||||
}
|
||||
@@ -2104,7 +2094,7 @@ u8 AddDecorationIconObjectFromEventObject(u16 tilesTag, u16 paletteTag, u8 decor
|
||||
|
||||
sub_8129048(&sPlaceDecorationGraphicsDataBuffer);
|
||||
sPlaceDecorationGraphicsDataBuffer.decoration = &gDecorations[decor];
|
||||
if (sPlaceDecorationGraphicsDataBuffer.decoration->permission != DECORPERM_SOLID_MAT)
|
||||
if (sPlaceDecorationGraphicsDataBuffer.decoration->permission != DECORPERM_SPRITE)
|
||||
{
|
||||
sub_81291E8(&sPlaceDecorationGraphicsDataBuffer);
|
||||
SetDecorSelectionBoxOamAttributes(sPlaceDecorationGraphicsDataBuffer.decoration->shape);
|
||||
@@ -2192,7 +2182,7 @@ void sub_8129708(void)
|
||||
{
|
||||
gSpecialVar_Result = 1;
|
||||
}
|
||||
else if (gDecorations[gUnknown_0203A17C.items[sDecorRearrangementDataBuffer[gSpecialVar_0x8004].idx]].permission == DECORPERM_SOLID_MAT)
|
||||
else if (gDecorations[gUnknown_0203A17C.items[sDecorRearrangementDataBuffer[gSpecialVar_0x8004].idx]].permission == DECORPERM_SPRITE)
|
||||
{
|
||||
gSpecialVar_0x8005 = sDecorRearrangementDataBuffer[gSpecialVar_0x8004].flagId;
|
||||
sub_81296EC(sDecorRearrangementDataBuffer[gSpecialVar_0x8004].idx);
|
||||
@@ -2235,7 +2225,7 @@ void sub_81297F8(void)
|
||||
perm = gDecorations[gUnknown_0203A17C.items[sDecorRearrangementDataBuffer[i].idx]].permission;
|
||||
posX = gUnknown_0203A17C.pos[sDecorRearrangementDataBuffer[i].idx] >> 4;
|
||||
posY = gUnknown_0203A17C.pos[sDecorRearrangementDataBuffer[i].idx] & 0x0F;
|
||||
if (perm != DECORPERM_SOLID_MAT)
|
||||
if (perm != DECORPERM_SPRITE)
|
||||
{
|
||||
for (y = 0; y < sDecorRearrangementDataBuffer[i].height; y ++)
|
||||
{
|
||||
@@ -2522,7 +2512,7 @@ bool8 sub_8129FC8(u8 taskId)
|
||||
{
|
||||
if (gUnknown_0203A17C.items[i] != 0)
|
||||
{
|
||||
if (gDecorations[gUnknown_0203A17C.items[i]].permission == DECORPERM_SOLID_MAT)
|
||||
if (gDecorations[gUnknown_0203A17C.items[i]].permission == DECORPERM_SPRITE)
|
||||
{
|
||||
sub_8129D8C(gUnknown_0203A17C.items[i], sDecorRearrangementDataBuffer);
|
||||
if (sub_8129E74(taskId, i, sDecorRearrangementDataBuffer) == TRUE)
|
||||
@@ -2550,7 +2540,7 @@ void sub_812A040(u8 left, u8 top, u8 right, u8 bottom)
|
||||
decorIdx = gUnknown_0203A17C.items[i];
|
||||
xOff = gUnknown_0203A17C.pos[i] >> 4;
|
||||
yOff = gUnknown_0203A17C.pos[i] & 0x0F;
|
||||
if (decorIdx != 0 && gDecorations[decorIdx].permission == DECORPERM_SOLID_MAT && left <= xOff && top <= yOff && right >= xOff && bottom >= yOff)
|
||||
if (decorIdx != 0 && gDecorations[decorIdx].permission == DECORPERM_SPRITE && left <= xOff && top <= yOff && right >= xOff && bottom >= yOff)
|
||||
{
|
||||
sDecorRearrangementDataBuffer[sCurDecorSelectedInRearrangement].idx = i;
|
||||
sub_8129F20();
|
||||
@@ -2656,7 +2646,7 @@ void sub_812A2C4(u8 taskId)
|
||||
switch (data[2])
|
||||
{
|
||||
case 0:
|
||||
sub_80E9578();
|
||||
HideSecretBaseDecorationSprites();
|
||||
data[2] ++;
|
||||
break;
|
||||
case 1:
|
||||
|
||||
@@ -1534,10 +1534,10 @@ static u8 TrySetupEventObjectSprite(struct EventObjectTemplate *eventObjectTempl
|
||||
paletteSlot -= 16;
|
||||
sub_808EAB0(graphicsInfo->paletteTag1, paletteSlot);
|
||||
}
|
||||
|
||||
if (eventObject->movementType == MOVEMENT_TYPE_INVISIBLE)
|
||||
{
|
||||
eventObject->invisible = TRUE;
|
||||
}
|
||||
|
||||
*(u16 *)&spriteTemplate->paletteTag = 0xFFFF;
|
||||
spriteId = CreateSprite(spriteTemplate, 0, 0, 0);
|
||||
if (spriteId == MAX_SPRITES)
|
||||
@@ -1545,6 +1545,7 @@ static u8 TrySetupEventObjectSprite(struct EventObjectTemplate *eventObjectTempl
|
||||
gEventObjects[eventObjectId].active = FALSE;
|
||||
return EVENT_OBJECTS_COUNT;
|
||||
}
|
||||
|
||||
sprite = &gSprites[spriteId];
|
||||
sub_8092FF0(eventObject->currentCoords.x + cameraX, eventObject->currentCoords.y + cameraY, &sprite->pos1.x, &sprite->pos1.y);
|
||||
sprite->centerToCornerVecX = -(graphicsInfo->width >> 1);
|
||||
@@ -1557,15 +1558,14 @@ static u8 TrySetupEventObjectSprite(struct EventObjectTemplate *eventObjectTempl
|
||||
eventObject->spriteId = spriteId;
|
||||
eventObject->inanimate = graphicsInfo->inanimate;
|
||||
if (!eventObject->inanimate)
|
||||
{
|
||||
StartSpriteAnim(sprite, GetFaceDirectionAnimNum(eventObject->facingDirection));
|
||||
}
|
||||
|
||||
SetObjectSubpriorityByZCoord(eventObject->previousElevation, sprite, 1);
|
||||
UpdateEventObjectVisibility(eventObject, sprite);
|
||||
return eventObjectId;
|
||||
}
|
||||
|
||||
static u8 TrySpawnEventObject(struct EventObjectTemplate *eventObjectTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY)
|
||||
static u8 TrySpawnEventObjectTemplate(struct EventObjectTemplate *eventObjectTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY)
|
||||
{
|
||||
u8 eventObjectId;
|
||||
struct SpriteTemplate spriteTemplate;
|
||||
@@ -1579,14 +1579,12 @@ static u8 TrySpawnEventObject(struct EventObjectTemplate *eventObjectTemplate, u
|
||||
spriteTemplate.images = &spriteFrameImage;
|
||||
eventObjectId = TrySetupEventObjectSprite(eventObjectTemplate, &spriteTemplate, mapNum, mapGroup, cameraX, cameraY);
|
||||
if (eventObjectId == EVENT_OBJECTS_COUNT)
|
||||
{
|
||||
return EVENT_OBJECTS_COUNT;
|
||||
}
|
||||
|
||||
gSprites[gEventObjects[eventObjectId].spriteId].images = graphicsInfo->images;
|
||||
if (subspriteTables != NULL)
|
||||
{
|
||||
if (subspriteTables)
|
||||
SetSubspriteTables(&gSprites[gEventObjects[eventObjectId].spriteId], subspriteTables);
|
||||
}
|
||||
|
||||
return eventObjectId;
|
||||
}
|
||||
|
||||
@@ -1596,7 +1594,7 @@ u8 SpawnSpecialEventObject(struct EventObjectTemplate *eventObjectTemplate)
|
||||
s16 cameraY;
|
||||
|
||||
GetEventObjectMovingCameraOffset(&cameraX, &cameraY);
|
||||
return TrySpawnEventObject(eventObjectTemplate, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY);
|
||||
return TrySpawnEventObjectTemplate(eventObjectTemplate, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY);
|
||||
}
|
||||
|
||||
u8 SpawnSpecialEventObjectParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 z)
|
||||
@@ -1619,19 +1617,17 @@ u8 SpawnSpecialEventObjectParameterized(u8 graphicsId, u8 movementBehavior, u8 l
|
||||
return SpawnSpecialEventObject(&eventObjectTemplate);
|
||||
}
|
||||
|
||||
u8 show_sprite(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
u8 TrySpawnEventObject(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
{
|
||||
struct EventObjectTemplate *eventObjectTemplate;
|
||||
s16 cameraX;
|
||||
s16 cameraY;
|
||||
s16 cameraX, cameraY;
|
||||
|
||||
eventObjectTemplate = GetEventObjectTemplateByLocalIdAndMap(localId, mapNum, mapGroup);
|
||||
if (eventObjectTemplate == NULL)
|
||||
{
|
||||
if (!eventObjectTemplate)
|
||||
return EVENT_OBJECTS_COUNT;
|
||||
}
|
||||
|
||||
GetEventObjectMovingCameraOffset(&cameraX, &cameraY);
|
||||
return TrySpawnEventObject(eventObjectTemplate, mapNum, mapGroup, cameraX, cameraY);
|
||||
return TrySpawnEventObjectTemplate(eventObjectTemplate, mapNum, mapGroup, cameraX, cameraY);
|
||||
}
|
||||
|
||||
static void MakeObjectTemplateFromEventObjectGraphicsInfo(u16 graphicsId, void (*callback)(struct Sprite *), struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables)
|
||||
@@ -1765,7 +1761,7 @@ void TrySpawnEventObjects(s16 cameraX, s16 cameraY)
|
||||
|
||||
if (top <= npcY && bottom >= npcY && left <= npcX && right >= npcX
|
||||
&& !FlagGet(template->flagId))
|
||||
TrySpawnEventObject(template, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY);
|
||||
TrySpawnEventObjectTemplate(template, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2245,7 +2241,7 @@ static void SetEventObjectCoords(struct EventObject *eventObject, s16 x, s16 y)
|
||||
eventObject->currentCoords.y = y;
|
||||
}
|
||||
|
||||
void sub_808EB08(struct EventObject *eventObject, s16 x, s16 y)
|
||||
void MoveEventObjectToMapCoords(struct EventObject *eventObject, s16 x, s16 y)
|
||||
{
|
||||
struct Sprite *sprite;
|
||||
const struct EventObjectGraphicsInfo *graphicsInfo;
|
||||
@@ -2260,20 +2256,17 @@ void sub_808EB08(struct EventObject *eventObject, s16 x, s16 y)
|
||||
sprite->pos1.y += 16 + sprite->centerToCornerVecY;
|
||||
sub_808E38C(eventObject);
|
||||
if (eventObject->trackedByCamera)
|
||||
{
|
||||
CameraObjectReset1();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_808EBA8(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y)
|
||||
void TryMoveEventObjectToMapCoords(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y)
|
||||
{
|
||||
u8 eventObjectId;
|
||||
|
||||
if (!TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &eventObjectId))
|
||||
{
|
||||
x += 7;
|
||||
y += 7;
|
||||
sub_808EB08(&gEventObjects[eventObjectId], x, y);
|
||||
MoveEventObjectToMapCoords(&gEventObjects[eventObjectId], x, y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2604,15 +2597,13 @@ void OverrideTemplateCoordsForEventObject(const struct EventObject *eventObject)
|
||||
}
|
||||
}
|
||||
|
||||
void OverrideMovementTypeForEventObject(const struct EventObject *eventObject, const u8 *script)
|
||||
static void OverrideEventObjectTemplateScript(const struct EventObject *eventObject, const u8 *script)
|
||||
{
|
||||
struct EventObjectTemplate *eventObjectTemplate;
|
||||
|
||||
eventObjectTemplate = GetBaseTemplateForEventObject(eventObject);
|
||||
if (eventObjectTemplate != NULL)
|
||||
{
|
||||
if (eventObjectTemplate)
|
||||
eventObjectTemplate->script = script;
|
||||
}
|
||||
}
|
||||
|
||||
void TryOverrideTemplateCoordsForEventObject(const struct EventObject *eventObject, u8 movementType)
|
||||
@@ -2626,30 +2617,26 @@ void TryOverrideTemplateCoordsForEventObject(const struct EventObject *eventObje
|
||||
}
|
||||
}
|
||||
|
||||
void sub_808F254(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
void TryOverrideEventObjectTemplateCoords(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
{
|
||||
u8 eventObjectId;
|
||||
|
||||
if (!TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &eventObjectId))
|
||||
{
|
||||
OverrideTemplateCoordsForEventObject(&gEventObjects[eventObjectId]);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat)
|
||||
void OverrideSecretBaseDecorationSpriteScript(u8 localId, u8 mapNum, u8 mapGroup, u8 decorationCategory)
|
||||
{
|
||||
u8 eventObjectId;
|
||||
|
||||
if (!TryGetEventObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &eventObjectId))
|
||||
{
|
||||
switch (decorCat)
|
||||
switch (decorationCategory)
|
||||
{
|
||||
case DECORCAT_DOLL:
|
||||
OverrideMovementTypeForEventObject(&gEventObjects[eventObjectId], EventScript_SecretPower1);
|
||||
break;
|
||||
case DECORCAT_CUSHION:
|
||||
OverrideMovementTypeForEventObject(&gEventObjects[eventObjectId], EventScript_SecretPower2);
|
||||
break;
|
||||
case DECORCAT_DOLL:
|
||||
OverrideEventObjectTemplateScript(&gEventObjects[eventObjectId], SecretBase_EventScript_DollInteract);
|
||||
break;
|
||||
case DECORCAT_CUSHION:
|
||||
OverrideEventObjectTemplateScript(&gEventObjects[eventObjectId], SecretBase_EventScript_CushionInteract);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "fldeff_misc.h"
|
||||
#include "item_menu.h"
|
||||
#include "link.h"
|
||||
#include "match_call.h"
|
||||
#include "metatile_behavior.h"
|
||||
#include "overworld.h"
|
||||
#include "pokemon.h"
|
||||
@@ -32,7 +33,6 @@
|
||||
#include "constants/map_types.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/songs.h"
|
||||
#include "match_call.h"
|
||||
|
||||
static EWRAM_DATA u8 sWildEncounterImmunitySteps = 0;
|
||||
static EWRAM_DATA u16 sPreviousPlayerMetatileBehavior = 0;
|
||||
@@ -227,8 +227,8 @@ static bool8 TryStartInteractionScript(struct MapPosition *position, u16 metatil
|
||||
&& script != EventScript_PlayerPCFemale
|
||||
&& script != EventScript_SecretBasePC
|
||||
&& script != EventScript_RecordMixingSecretBasePC
|
||||
&& script != EventScript_SecretPower1
|
||||
&& script != EventScript_SecretPower2
|
||||
&& script != SecretBase_EventScript_DollInteract
|
||||
&& script != SecretBase_EventScript_CushionInteract
|
||||
&& script != EventScript_PC)
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
@@ -354,7 +354,7 @@ static const u8 *GetInteractedBackgroundEventScript(struct MapPosition *position
|
||||
if (direction == DIR_NORTH)
|
||||
{
|
||||
gSpecialVar_0x8004 = bgEvent->bgUnion.secretBaseId;
|
||||
if (sub_80E9680())
|
||||
if (TrySetCurSecretBase())
|
||||
return EventScript_2759F1;
|
||||
}
|
||||
return NULL;
|
||||
@@ -421,23 +421,23 @@ static const u8 *GetInteractedMetatileScript(struct MapPosition *position, u8 me
|
||||
return EventScript_SecretBaseShieldOrToyTV;
|
||||
if (MetatileBehavior_IsMB_C6(metatileBehavior) == TRUE)
|
||||
{
|
||||
sub_80EB56C();
|
||||
SetSecretBaseSecretsTvFlags_MiscFurnature();
|
||||
return NULL;
|
||||
}
|
||||
if (MetatileBehavior_IsLargeMatCenter(metatileBehavior) == TRUE)
|
||||
if (MetatileBehavior_HoldsLargeDecoration(metatileBehavior) == TRUE)
|
||||
{
|
||||
sub_80EB9E0();
|
||||
SetSecretBaseSecretsTvFlags_LargeDecorationSpot();
|
||||
return NULL;
|
||||
}
|
||||
if (MetatileBehavior_IsSecretBaseLargeMatEdge(metatileBehavior) == TRUE)
|
||||
if (MetatileBehavior_HoldsSmallDecoration(metatileBehavior) == TRUE)
|
||||
{
|
||||
sub_80EBB28();
|
||||
SetSecretBaseSecretsTvFlags_SmallDecorationSpot();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else if (MetatileBehavior_IsSecretBasePoster(metatileBehavior) == TRUE)
|
||||
{
|
||||
sub_80EB498();
|
||||
SetSecretBaseSecretsTvFlags_Poster();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -3485,7 +3485,7 @@ static void sub_80B9978(struct Task *task)
|
||||
eventObject = &gEventObjects[gPlayerAvatar.eventObjectId];
|
||||
sprite = &gSprites[eventObject->spriteId];
|
||||
eventObject->inanimate = 0;
|
||||
sub_808EB08(eventObject, eventObject->currentCoords.x, eventObject->currentCoords.y);
|
||||
MoveEventObjectToMapCoords(eventObject, eventObject->currentCoords.x, eventObject->currentCoords.y);
|
||||
sprite->pos2.x = 0;
|
||||
sprite->pos2.y = 0;
|
||||
sprite->coordOffsetEnabled = 1;
|
||||
|
||||
@@ -1188,9 +1188,9 @@ u8 PlayerGetZCoord(void)
|
||||
return gEventObjects[gPlayerAvatar.eventObjectId].previousElevation;
|
||||
}
|
||||
|
||||
void sub_808BC90(s16 a, s16 b)
|
||||
void sub_808BC90(s16 x, s16 y)
|
||||
{
|
||||
sub_808EB08(&gEventObjects[gPlayerAvatar.eventObjectId], a, b);
|
||||
MoveEventObjectToMapCoords(&gEventObjects[gPlayerAvatar.eventObjectId], x, y);
|
||||
}
|
||||
|
||||
u8 TestPlayerAvatarFlags(u8 a)
|
||||
|
||||
@@ -52,15 +52,15 @@ struct MapHeader const *const mapconnection_get_mapheader(struct MapConnection *
|
||||
void InitMap(void)
|
||||
{
|
||||
InitMapLayoutData(&gMapHeader);
|
||||
sub_80E8EE0(gMapHeader.events);
|
||||
SetOccupiedSecretBaseEntranceMetatiles(gMapHeader.events);
|
||||
RunOnLoadMapScript();
|
||||
}
|
||||
|
||||
void InitMapFromSavedGame(void)
|
||||
{
|
||||
InitMapLayoutData(&gMapHeader);
|
||||
sub_80E9238(0);
|
||||
sub_80E8EE0(gMapHeader.events);
|
||||
InitSecretBaseAppearance(FALSE);
|
||||
SetOccupiedSecretBaseEntranceMetatiles(gMapHeader.events);
|
||||
LoadSavedMapView();
|
||||
RunOnLoadMapScript();
|
||||
UpdateTVScreensOnMap(gBackupMapLayout.width, gBackupMapLayout.height);
|
||||
|
||||
@@ -488,8 +488,8 @@ static void sub_80F9DFC(u8 taskId)
|
||||
|
||||
static void SetCurrentSecretBase(void)
|
||||
{
|
||||
sub_80E9608(&gPlayerFacingPosition, gMapHeader.events);
|
||||
sub_80E8B6C();
|
||||
SetCurSecretBaseIdFromPosition(&gPlayerFacingPosition, gMapHeader.events);
|
||||
TrySetCurSecretBaseIndex();
|
||||
}
|
||||
|
||||
static void AdjustSecretPowerSpritePixelOffsets(void)
|
||||
@@ -544,7 +544,7 @@ bool8 SetUpFieldMove_SecretPower(void)
|
||||
{
|
||||
u8 mb;
|
||||
|
||||
sub_80E8BC8();
|
||||
CheckPlayerHasSecretBase();
|
||||
|
||||
if (gSpecialVar_Result == 1 || GetPlayerFacingDirection() != DIR_NORTH)
|
||||
return FALSE;
|
||||
@@ -623,10 +623,8 @@ static void CaveEntranceSpriteCallback2(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[0] < 40)
|
||||
{
|
||||
sprite->data[0]++;
|
||||
|
||||
if (sprite->data[0] == 20)
|
||||
sub_80E8D4C();
|
||||
if (++sprite->data[0] == 20)
|
||||
ToggleSecretBaseEntranceMetatile();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -681,7 +679,7 @@ bool8 FldEff_SecretPowerTree(void)
|
||||
148);
|
||||
|
||||
if (gFieldEffectArguments[7] == 1 || gFieldEffectArguments[7] == 3)
|
||||
sub_80E8D4C();
|
||||
ToggleSecretBaseEntranceMetatile();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -702,7 +700,7 @@ static void TreeEntranceSpriteCallback2(struct Sprite *sprite)
|
||||
if (sprite->data[0] >= 40)
|
||||
{
|
||||
if (gFieldEffectArguments[7] == 0 || gFieldEffectArguments[7] == 2)
|
||||
sub_80E8D4C();
|
||||
ToggleSecretBaseEntranceMetatile();
|
||||
|
||||
sprite->data[0] = 0;
|
||||
sprite->callback = TreeEntranceSpriteCallbackEnd;
|
||||
@@ -764,7 +762,7 @@ static void ShrubEntranceSpriteCallback2(struct Sprite *sprite)
|
||||
sprite->data[0]++;
|
||||
|
||||
if (sprite->data[0] == 20)
|
||||
sub_80E8D4C();
|
||||
ToggleSecretBaseEntranceMetatile();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1168,7 +1166,7 @@ void GetShieldToyTVDecorationInfo(void)
|
||||
|
||||
bool8 sub_80FADE4(u16 metatileId, u8 arg1)
|
||||
{
|
||||
if (!CurrentMapIsSecretBase())
|
||||
if (!CurMapIsSecretBase())
|
||||
return FALSE;
|
||||
|
||||
if (!arg1)
|
||||
|
||||
@@ -537,7 +537,7 @@ bool8 RemoveBagItem(u16 itemId, u16 count)
|
||||
if (totalQuantity < count)
|
||||
return FALSE; // We don't have enough of the item
|
||||
|
||||
if (CurrentMapIsSecretBase() == TRUE)
|
||||
if (CurMapIsSecretBase() == TRUE)
|
||||
{
|
||||
VarSet(VAR_SECRET_BASE_LOW_TV_FLAGS, VarGet(VAR_SECRET_BASE_LOW_TV_FLAGS) | 0x200);
|
||||
VarSet(VAR_SECRET_BASE_LAST_ITEM_USED, itemId);
|
||||
|
||||
@@ -191,7 +191,7 @@ static const u8 sTileBitAttributes[] =
|
||||
[MB_SECRET_BASE_UNUSED] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
|
||||
[MB_BLOCK_DECORATION] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
|
||||
[MB_SECRET_BASE_DECORATION] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
|
||||
[MB_SECRET_BASE_LARGE_MAT_EDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
|
||||
[MB_HOLDS_SMALL_DECORATION] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
|
||||
[MB_UNUSED_B6] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
|
||||
[MB_SECRET_BASE_NORTH_WALL] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
|
||||
[MB_SECRET_BASE_BALLOON] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
|
||||
@@ -205,7 +205,7 @@ static const u8 sTileBitAttributes[] =
|
||||
[MB_IMPASSABLE_SOUTH_AND_NORTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
|
||||
[MB_IMPASSABLE_WEST_AND_EAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
|
||||
[MB_SECRET_BASE_HOLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
|
||||
[MB_LARGE_MAT_CENTER] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
|
||||
[MB_HOLDS_LARGE_DECORATION] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
|
||||
[MB_SECRET_BASE_TV_SHIELD] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
|
||||
[MB_PLAYER_ROOM_PC_ON] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
|
||||
[MB_C6] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
|
||||
@@ -751,17 +751,17 @@ bool8 Unref_MetatileBehavior_IsSecretBaseUnused_B2_2(u8 metatileBehavior)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsSecretBaseLargeMatEdge(u8 metatileBehavior)
|
||||
bool8 MetatileBehavior_HoldsSmallDecoration(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_SECRET_BASE_LARGE_MAT_EDGE)
|
||||
if (metatileBehavior == MB_HOLDS_SMALL_DECORATION)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 MetatileBehavior_IsLargeMatCenter(u8 metatileBehavior)
|
||||
bool8 MetatileBehavior_HoldsLargeDecoration(u8 metatileBehavior)
|
||||
{
|
||||
if (metatileBehavior == MB_LARGE_MAT_CENTER)
|
||||
if (metatileBehavior == MB_HOLDS_LARGE_DECORATION)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
@@ -170,7 +170,7 @@ void NewGameInitData(void)
|
||||
InitEventData();
|
||||
ClearTVShowData();
|
||||
ResetGabbyAndTy();
|
||||
ResetSecretBases();
|
||||
ClearSecretBases();
|
||||
ClearBerryTrees();
|
||||
SetMoney(&gSaveBlock1Ptr->money, 3000);
|
||||
SetCoins(0);
|
||||
|
||||
@@ -889,7 +889,7 @@ static void mli0_load_map(u32 a1)
|
||||
if (a1 != 1 && isIndoors)
|
||||
{
|
||||
UpdateTVScreensOnMap(gBackupMapLayout.width, gBackupMapLayout.height);
|
||||
sub_80E9238(1);
|
||||
InitSecretBaseAppearance(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1508,7 +1508,7 @@ void SetUnusedCallback(void *func)
|
||||
|
||||
static bool8 map_post_load_hook_exec(void)
|
||||
{
|
||||
if (gFieldCallback2 != NULL)
|
||||
if (gFieldCallback2)
|
||||
{
|
||||
if (!gFieldCallback2())
|
||||
{
|
||||
@@ -1522,7 +1522,7 @@ static bool8 map_post_load_hook_exec(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gFieldCallback != NULL)
|
||||
if (gFieldCallback)
|
||||
gFieldCallback();
|
||||
else
|
||||
mapldr_default();
|
||||
@@ -1701,7 +1701,7 @@ void sub_80861E8(void)
|
||||
|
||||
static void sub_8086204(void)
|
||||
{
|
||||
if ((gMapHeader.flags & 0xF8) == 8 && sub_80E909C() == TRUE)
|
||||
if ((gMapHeader.flags & 0xF8) == 8 && SecretBaseMapPopupEnabled() == TRUE)
|
||||
ShowMapNamePopup();
|
||||
sub_80AF3C8();
|
||||
}
|
||||
@@ -1947,7 +1947,7 @@ static bool32 load_map_stuff(u8 *state, u32 a2)
|
||||
(*state)++;
|
||||
break;
|
||||
case 11:
|
||||
if ((gMapHeader.flags & 0xF8) == 8 && sub_80E909C() == 1)
|
||||
if ((gMapHeader.flags & 0xF8) == 8 && SecretBaseMapPopupEnabled() == TRUE)
|
||||
ShowMapNamePopup();
|
||||
(*state)++;
|
||||
break;
|
||||
|
||||
@@ -4444,7 +4444,7 @@ u8 GetMonAbility(struct Pokemon *mon)
|
||||
return GetAbilityBySpecies(species, altAbility);
|
||||
}
|
||||
|
||||
void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord)
|
||||
void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord)
|
||||
{
|
||||
s32 i, j;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ struct RecordMixingHallRecords
|
||||
|
||||
struct PlayerRecordsRS
|
||||
{
|
||||
struct SecretBaseRecord secretBases[SECRET_BASES_COUNT];
|
||||
struct SecretBase secretBases[SECRET_BASES_COUNT];
|
||||
TVShow tvShows[TV_SHOWS_COUNT];
|
||||
PokeNews pokeNews[POKE_NEWS_COUNT];
|
||||
OldMan oldMan;
|
||||
@@ -60,7 +60,7 @@ struct PlayerRecordsRS
|
||||
|
||||
struct PlayerRecordsEmerald
|
||||
{
|
||||
/* 0x0000 */ struct SecretBaseRecord secretBases[SECRET_BASES_COUNT];
|
||||
/* 0x0000 */ struct SecretBase secretBases[SECRET_BASES_COUNT];
|
||||
/* 0x0c80 */ TVShow tvShows[TV_SHOWS_COUNT];
|
||||
/* 0x1004 */ PokeNews pokeNews[POKE_NEWS_COUNT];
|
||||
/* 0x1044 */ OldMan oldMan;
|
||||
@@ -83,7 +83,7 @@ union PlayerRecords
|
||||
// Static RAM declarations
|
||||
|
||||
static IWRAM_DATA bool8 gUnknown_03001130;
|
||||
static IWRAM_DATA struct SecretBaseRecord *sSecretBasesSave;
|
||||
static IWRAM_DATA struct SecretBase *sSecretBasesSave;
|
||||
static IWRAM_DATA TVShow *sTvShowsSave;
|
||||
static IWRAM_DATA PokeNews *sPokeNewsSave;
|
||||
static IWRAM_DATA OldMan *sOldManSave;
|
||||
@@ -208,7 +208,7 @@ static void PrepareUnknownExchangePacket(struct PlayerRecordsRS *dest)
|
||||
static void PrepareExchangePacketForRubySapphire(struct PlayerRecordsRS *dest)
|
||||
{
|
||||
memcpy(dest->secretBases, sSecretBasesSave, sizeof(dest->secretBases));
|
||||
sub_80EB18C(dest->secretBases);
|
||||
ClearJapaneseSecretBases(dest->secretBases);
|
||||
memcpy(dest->tvShows, sTvShowsSave, sizeof(dest->tvShows));
|
||||
sub_80F1208(dest->tvShows);
|
||||
memcpy(dest->pokeNews, sPokeNewsSave, sizeof(dest->pokeNews));
|
||||
@@ -226,7 +226,7 @@ static void PrepareExchangePacketForRubySapphire(struct PlayerRecordsRS *dest)
|
||||
|
||||
static void PrepareExchangePacket(void)
|
||||
{
|
||||
sub_80E9914();
|
||||
SetPlayerSecretBaseParty();
|
||||
sub_80F0BB8();
|
||||
SetSrcLookupPointers();
|
||||
|
||||
|
||||
@@ -1068,7 +1068,7 @@ bool8 ScrCmd_addobject(struct ScriptContext *ctx)
|
||||
{
|
||||
u16 objectId = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
show_sprite(objectId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
TrySpawnEventObject(objectId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1078,7 +1078,7 @@ bool8 ScrCmd_addobject_at(struct ScriptContext *ctx)
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
|
||||
show_sprite(objectId, mapNum, mapGroup);
|
||||
TrySpawnEventObject(objectId, mapNum, mapGroup);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1088,7 +1088,7 @@ bool8 ScrCmd_setobjectxy(struct ScriptContext *ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
sub_808EBA8(localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, x, y);
|
||||
TryMoveEventObjectToMapCoords(localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, x, y);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1106,7 +1106,7 @@ bool8 ScrCmd_moveobjectoffscreen(struct ScriptContext *ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
sub_808F254(localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
TryOverrideEventObjectTemplateCoords(localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
1806
src/secret_base.c
1806
src/secret_base.c
File diff suppressed because it is too large
Load Diff
@@ -529,7 +529,7 @@ const u8 gText_ApostropheSBase[] = _("'s BASE");
|
||||
const u8 gText_OkayToDeleteFromRegistry[] = _("Is it okay to delete {STR_VAR_1}\nfrom the REGISTRY?");
|
||||
const u8 gText_RegisteredDataDeleted[] = _("The registered data was deleted.{PAUSE_UNTIL_PRESS}");
|
||||
const u8 gText_NoRegistry[] = _("There is no REGISTRY.{PAUSE_UNTIL_PRESS}");
|
||||
const u8 gUnknown_085EA79D[] = _("DEL REGIST.");
|
||||
const u8 gText_DelRegist[] = _("DEL REGIST.");
|
||||
const u8 gUnknown_085EA7A9[] = _("{STR_VAR_3}{STR_VAR_1}/{STR_VAR_2}");
|
||||
const u8 gText_Decorate[] = _("DECORATE");
|
||||
const u8 gText_PutAway[] = _("PUT AWAY");
|
||||
|
||||
14
src/tv.c
14
src/tv.c
@@ -2567,7 +2567,7 @@ void sub_80EEA70(void)
|
||||
show->secretBaseSecrets.active = FALSE;
|
||||
StringCopy(show->secretBaseSecrets.playerName, gSaveBlock2Ptr->playerName);
|
||||
show->secretBaseSecrets.stepsInBase = VarGet(VAR_SECRET_BASE_STEP_COUNTER);
|
||||
sub_80E980C();
|
||||
CopyCurSecretBaseOwnerName_StrVar1();
|
||||
StringCopy(strbuf, gStringVar1);
|
||||
StripExtCtrlCodes(strbuf);
|
||||
StringCopy(show->secretBaseSecrets.baseOwnersName, strbuf);
|
||||
@@ -7366,7 +7366,7 @@ u8 TVShowGetFlagCount(TVShow *show)
|
||||
return tot;
|
||||
}
|
||||
|
||||
u8 TVShowGetStateForFlagNumber(TVShow *show, u8 a1)
|
||||
static u8 SecretBaseSecrets_GetStateForFlagNumber(TVShow *show, u8 a1)
|
||||
{
|
||||
u8 i;
|
||||
u8 tot;
|
||||
@@ -7409,7 +7409,7 @@ static void DoTVShowSecretBaseSecrets(void)
|
||||
{
|
||||
show->secretBaseSecrets.savedState = 1;
|
||||
sTVSecretBaseSecretsRandomValues[0] = Random() % bitCount;
|
||||
sTVShowState = TVShowGetStateForFlagNumber(show, sTVSecretBaseSecretsRandomValues[0]);
|
||||
sTVShowState = SecretBaseSecrets_GetStateForFlagNumber(show, sTVSecretBaseSecretsRandomValues[0]);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
@@ -7424,11 +7424,11 @@ static void DoTVShowSecretBaseSecrets(void)
|
||||
show->secretBaseSecrets.savedState = 2;
|
||||
if (sTVSecretBaseSecretsRandomValues[0] == 0)
|
||||
{
|
||||
sTVShowState = TVShowGetStateForFlagNumber(show, 1);
|
||||
sTVShowState = SecretBaseSecrets_GetStateForFlagNumber(show, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
sTVShowState = TVShowGetStateForFlagNumber(show, 0);
|
||||
sTVShowState = SecretBaseSecrets_GetStateForFlagNumber(show, 0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -7441,7 +7441,7 @@ static void DoTVShowSecretBaseSecrets(void)
|
||||
}
|
||||
}
|
||||
show->secretBaseSecrets.savedState = 2;
|
||||
sTVShowState = TVShowGetStateForFlagNumber(show, sTVSecretBaseSecretsRandomValues[1]);
|
||||
sTVShowState = SecretBaseSecrets_GetStateForFlagNumber(show, sTVSecretBaseSecretsRandomValues[1]);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -7463,7 +7463,7 @@ static void DoTVShowSecretBaseSecrets(void)
|
||||
}
|
||||
}
|
||||
show->secretBaseSecrets.savedState = 3;
|
||||
sTVShowState = TVShowGetStateForFlagNumber(show, sTVSecretBaseSecretsRandomValues[2]);
|
||||
sTVShowState = SecretBaseSecrets_GetStateForFlagNumber(show, sTVSecretBaseSecretsRandomValues[2]);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
|
||||
@@ -125,7 +125,7 @@ static void SetUnionRoomPlayerGfx(u32 playerIdx, u32 gfxId)
|
||||
|
||||
static void CreateUnionRoomPlayerEventObject(u32 playerIdx)
|
||||
{
|
||||
show_sprite(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
TrySpawnEventObject(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
}
|
||||
|
||||
static void RemoveUnionRoomPlayerEventObject(u32 playerIdx)
|
||||
|
||||
Reference in New Issue
Block a user