Move metatile behavior constants to include/constants and sync closer to pokeruby
This commit is contained in:
@@ -642,7 +642,7 @@ u8 BattleSetup_GetTerrainId(void)
|
||||
case MAP_TYPE_ROUTE:
|
||||
break;
|
||||
case MAP_TYPE_UNDERGROUND:
|
||||
if (MetatileBehavior_IsMB_0B(tileBehavior))
|
||||
if (MetatileBehavior_IsIndoorEncounter(tileBehavior))
|
||||
return BATTLE_TERRAIN_BUILDING;
|
||||
if (MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior))
|
||||
return BATTLE_TERRAIN_POND;
|
||||
|
||||
@@ -1171,7 +1171,7 @@ void sub_8127B90(u16 mapX, u16 mapY, u8 decWidth, u8 decHeight, u16 decor)
|
||||
{
|
||||
decLeft = mapX + j;
|
||||
behavior = GetBehaviorByMetatileId(0x200 + gDecorations[decor].tiles[i * decWidth + j]);
|
||||
if (MetatileBehavior_IsMB_B9(behavior) == TRUE || (gDecorations[decor].permission != DECORPERM_PASS_FLOOR && (behavior >> 12)))
|
||||
if (MetatileBehavior_IsSecretBaseImpassable(behavior) == TRUE || (gDecorations[decor].permission != DECORPERM_PASS_FLOOR && (behavior >> 12)))
|
||||
{
|
||||
flags = 0xc00;
|
||||
}
|
||||
@@ -1179,7 +1179,7 @@ void sub_8127B90(u16 mapX, u16 mapY, u8 decWidth, u8 decHeight, u16 decor)
|
||||
{
|
||||
flags = 0x000;
|
||||
}
|
||||
if (gDecorations[decor].permission != DECORPERM_NA_WALL && MetatileBehavior_IsMB_B7(MapGridGetMetatileBehaviorAt(decLeft, decBottom)) == TRUE)
|
||||
if (gDecorations[decor].permission != DECORPERM_NA_WALL && MetatileBehavior_IsSecretBaseNorthWall(MapGridGetMetatileBehaviorAt(decLeft, decBottom)) == TRUE)
|
||||
{
|
||||
v0 = 1;
|
||||
}
|
||||
@@ -1446,7 +1446,7 @@ void sub_8128414(u8 taskId)
|
||||
|
||||
bool8 sub_8128484(u8 behaviorAt, u16 behaviorBy)
|
||||
{
|
||||
if (MetatileBehavior_IsMB_B3(behaviorAt) != TRUE || behaviorBy != 0)
|
||||
if (MetatileBehavior_IsBlockDecoration(behaviorAt) != TRUE || behaviorBy != 0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1464,9 +1464,9 @@ bool8 sub_81284AC(u8 taskId, s16 x, s16 y, u16 decor)
|
||||
|
||||
bool8 sub_81284F4(u16 behaviorAt, const struct Decoration *decoration)
|
||||
{
|
||||
if (MetatileBehavior_IsMB_B3(behaviorAt) != TRUE)
|
||||
if (MetatileBehavior_IsBlockDecoration(behaviorAt) != TRUE)
|
||||
{
|
||||
if (decoration->id == DECOR_SOLID_BOARD && MetatileBehavior_IsMB_C2(behaviorAt) == TRUE)
|
||||
if (decoration->id == DECOR_SOLID_BOARD && MetatileBehavior_IsSecretBaseHole(behaviorAt) == TRUE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1548,7 +1548,7 @@ bool8 sub_812853C(u8 taskId, const struct Decoration *decoration)
|
||||
curX = gTasks[taskId].data[0] + j;
|
||||
behaviorAt = MapGridGetMetatileBehaviorAt(curX, curY);
|
||||
behaviorBy = GetBehaviorByMetatileId(0x200 + decoration->tiles[j]) & 0xf000;
|
||||
if (!MetatileBehavior_IsNormal(behaviorAt) && !MetatileBehavior_IsMB_B7(behaviorAt))
|
||||
if (!MetatileBehavior_IsNormal(behaviorAt) && !MetatileBehavior_IsSecretBaseNorthWall(behaviorAt))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1570,7 +1570,7 @@ bool8 sub_812853C(u8 taskId, const struct Decoration *decoration)
|
||||
for (j=0; j<mapX; j++)
|
||||
{
|
||||
curX = gTasks[taskId].data[0] + j;
|
||||
if (!MetatileBehavior_IsMB_B7(MapGridGetMetatileBehaviorAt(curX, curY)))
|
||||
if (!MetatileBehavior_IsSecretBaseNorthWall(MapGridGetMetatileBehaviorAt(curX, curY)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1589,14 +1589,14 @@ bool8 sub_812853C(u8 taskId, const struct Decoration *decoration)
|
||||
behaviorAt = MapGridGetMetatileBehaviorAt(curX, curY);
|
||||
if (decoration->shape == DECORSHAPE_1x2)
|
||||
{
|
||||
if (!MetatileBehavior_IsMB_C3(behaviorAt))
|
||||
if (!MetatileBehavior_IsLargeMatCenter(behaviorAt))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (!MetatileBehavior_IsMB_B5(behaviorAt))
|
||||
else if (!MetatileBehavior_IsSecretBaseLargeMatEdge(behaviorAt))
|
||||
{
|
||||
if (!MetatileBehavior_IsMB_C3(behaviorAt))
|
||||
if (!MetatileBehavior_IsLargeMatCenter(behaviorAt))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2385,7 +2385,7 @@ void sub_8129C74(u8 taskId)
|
||||
{
|
||||
data = gTasks[taskId].data;
|
||||
behavior = MapGridGetMetatileBehaviorAt(data[0], data[1]);
|
||||
if (MetatileBehavior_IsSecretBasePC(behavior) == TRUE || MetatileBehavior_IsMB_C5(behavior) == TRUE)
|
||||
if (MetatileBehavior_IsSecretBasePC(behavior) == TRUE || MetatileBehavior_IsPlayerRoomPCOn(behavior) == TRUE)
|
||||
{
|
||||
gSprites[sDecor_CameraSpriteObjectIdx1].invisible = FALSE;
|
||||
gSprites[sDecor_CameraSpriteObjectIdx1].callback = SpriteCallbackDummy;
|
||||
|
||||
@@ -7721,7 +7721,7 @@ static void GetGroundEffectFlags_Tracks(struct EventObject *eventObj, u32 *flags
|
||||
*flags |= GROUND_EFFECT_FLAG_DEEP_SAND;
|
||||
}
|
||||
else if (MetatileBehavior_IsSandOrDeepSand(eventObj->previousMetatileBehavior)
|
||||
|| MetatileBehavior_IsUnusedFootprintMetatile(eventObj->previousMetatileBehavior))
|
||||
|| MetatileBehavior_IsFootprints(eventObj->previousMetatileBehavior))
|
||||
{
|
||||
*flags |= GROUND_EFFECT_FLAG_SAND;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "fieldmap.h"
|
||||
#include "global.fieldmap.h"
|
||||
#include "metatile_behavior.h"
|
||||
#include "metatile_behaviors.h"
|
||||
#include "overworld.h"
|
||||
#include "rotating_gate.h"
|
||||
#include "sprite.h"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -548,7 +548,7 @@ void sub_80E933C(void)
|
||||
gSpecialVar_0x8006 = roomDecorPos[decorIdx] >> 4;
|
||||
gSpecialVar_0x8007 = roomDecorPos[decorIdx] & 0xF;
|
||||
metatile = MapGridGetMetatileBehaviorAt(gSpecialVar_0x8006 + 7, gSpecialVar_0x8007 + 7);
|
||||
if (MetatileBehavior_IsMB_B5(metatile) == TRUE || MetatileBehavior_IsMB_C3(metatile) == TRUE)
|
||||
if (MetatileBehavior_IsSecretBaseLargeMatEdge(metatile) == TRUE || MetatileBehavior_IsLargeMatCenter(metatile) == TRUE)
|
||||
{
|
||||
gSpecialVar_Result = gMapHeader.events->eventObjects[objIdx].graphicsId + VAR_0x3F20;
|
||||
VarSet(gSpecialVar_Result, gDecorations[roomDecor[decorIdx]].tiles[0]);
|
||||
@@ -1271,7 +1271,7 @@ void sub_80EA3E4(u8 taskId)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (MetatileBehavior_IsMB_BE(behavior) == TRUE)
|
||||
else if (MetatileBehavior_IsSecretBaseBreakableDoor(behavior) == TRUE)
|
||||
{
|
||||
if (gUnknown_0203A01D == TRUE)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user