remove tile_types.c

This commit is contained in:
DizzyEggg 2025-03-27 14:24:06 +01:00
parent 8b75821347
commit ad1bf82186
26 changed files with 258 additions and 294 deletions

View File

@ -24,4 +24,15 @@ void sub_804AA60(void);
void sub_804AAAC(void);
void sub_804AAD4(void);
#define DUNGEON_WATER_TYPE_NONE 0
#define DUNGEON_WATER_TYPE_LAVA 1
#define DUNGEON_WATER_TYPE_WATER 2
extern const u8 gDungeonWaterType[76];
bool8 sub_804AD34(DungeonPos *pos);
void sub_804AE84(DungeonPos *pos);
bool8 IsTileGround(Tile *tile);
bool8 IsWaterTileset(void);
#endif // GUARD_DUNGEON_MAP_ACCESS_H

View File

@ -1,17 +0,0 @@
#ifndef GUARD_TILE_TYPES_H
#define GUARD_TILE_TYPES_H
#include "structs/map.h"
#define DUNGEON_WATER_TYPE_NONE 0
#define DUNGEON_WATER_TYPE_LAVA 1
#define DUNGEON_WATER_TYPE_WATER 2
extern const u8 gDungeonWaterType[76];
bool8 sub_804AD34(DungeonPos *pos);
void sub_804AE84(DungeonPos *pos);
bool8 IsTileGround(Tile *tile);
bool8 IsWaterTileset();
#endif // GUARD_TILE_TYPES_H

View File

@ -218,7 +218,6 @@ SECTIONS {
src/code_8048480.o(.text);
src/dungeon_ai_item_weight.o(.text);
src/dungeon_map_access.o(.text);
src/tile_types.o(.text);
src/dungeon_generation.o(.text);
src/dungeon_message.o(.text);
src/dungeon_move.o(.text);
@ -583,7 +582,7 @@ SECTIONS {
src/code_8048480.o(.rodata);
src/friend_area.o(.rodata);
data/data_810AC60.o(.rodata);
src/tile_types.o(.rodata);
src/dungeon_map_access.o(.rodata);
src/exclusive_pokemon.o(.rodata);
src/rescue_team_info.o(.rodata);
src/strings.o(.rodata);

View File

@ -18,10 +18,8 @@ struct unkStruct_203B0D4
extern struct unkStruct_203B0D4 *gUnknown_203B0D4;
ALIGNED(4) static const u8 gUnknown_80CE77C[] = "efob%03d";
ALIGNED(4) static const u8 gUnknown_80CE788[] = "efbg%03d";
void sub_800F034(void) {
void sub_800F034(void)
{
s32 index;
if(gUnknown_203B0D4 == NULL)
{
@ -121,10 +119,10 @@ OpenedFile * sub_800F1C0(u32 animType, s32 effectID)
case 1:
case 2:
case 3:
sprintf(fileName,gUnknown_80CE77C,effectID); // efob
sprintf(fileName,"efob%03d",effectID);
break;
case 4:
sprintf(fileName,gUnknown_80CE788,effectID); // efbg
sprintf(fileName,"efbg%03d",effectID);
break;
}

View File

@ -18,8 +18,8 @@
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "sprite.h"
#include "tile_types.h"
#include "weather.h"
#include "dungeon_map_access.h"
struct UnkStruct_8040094
{

View File

@ -47,7 +47,6 @@
#include "sprite.h"
#include "text_1.h"
#include "text_3.h"
#include "tile_types.h"
#include "weather.h"
extern void sub_800F15C(s32);

View File

@ -5,7 +5,6 @@
#include "dungeon_map_access.h"
#include "dungeon_range.h"
#include "dungeon_util.h"
#include "tile_types.h"
#include "pokemon.h"
#include "code_805D8C8.h"

View File

@ -39,7 +39,6 @@
#include "random.h"
#include "sprite.h"
#include "status_checks_1.h"
#include "tile_types.h"
#include "weather.h"
extern void sub_8042900(Entity *r0);

View File

@ -33,7 +33,6 @@
#include "sprite.h"
#include "status.h"
#include "text_util.h"
#include "tile_types.h"
extern u8 gUnknown_202F221;

View File

@ -13,7 +13,6 @@
#include "dungeon_util.h"
#include "dungeon_visibility.h"
#include "structs/str_dungeon.h"
#include "tile_types.h"
#include "position_util.h"
#include "trap.h"

View File

@ -21,7 +21,6 @@
#include "moves.h"
#include "move_util.h"
#include "code_8041AD0.h"
#include "tile_types.h"
#include "code_803E668.h"
#include "weather.h"
#include "dungeon_config.h"

View File

@ -1,6 +1,5 @@
#include "global.h"
#include "tile_types.h"
#include "dungeon_map_access.h"
bool8 IsWaterDungeon(u32 r0)
{

View File

@ -34,7 +34,6 @@
#include "structs/map.h"
#include "structs/str_dungeon.h"
#include "dungeon_misc.h"
#include "tile_types.h"
extern char *gPtrCouldntBeUsedMessage;
extern char *gPtrItsaMonsterHouseMessage;

View File

@ -18,7 +18,6 @@
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "structs/map.h"
#include "tile_types.h"
extern void ShowVisualFlags(Entity *r0);

View File

@ -2,7 +2,6 @@
#include "def_filearchives.h"
#include "dungeon_generation.h"
#include "file_system.h"
#include "tile_types.h"
#include "dungeon_map_access.h"
#include "dungeon_message.h"
#include "dungeon_random.h"

View File

@ -56,7 +56,6 @@
#include "sprite.h"
#include "status_checks_1.h"
#include "string_format.h"
#include "tile_types.h"
#include "trap.h"
#include "weather.h"

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "dungeon_map_access.h"
#include "constants/walkable_tile.h"
#include "structs/str_dungeon.h"
#include "code_8042B34.h"
@ -9,14 +10,13 @@
#include "dungeon_engine.h"
#include "dungeon_leader.h"
#include "dungeon_map.h"
#include "dungeon_map_access.h"
#include "dungeon_movement.h"
#include "dungeon_util.h"
#include "dungeon_visibility.h"
#include "game_options.h"
#include "random.h"
#include "text_1.h"
#include "tile_types.h"
#include "code_806CD90.h"
extern const Tile gOtherOobTile;
extern const Tile gWaterOobTile;
@ -30,6 +30,8 @@ extern u8 gUnknown_8108EC0[];
extern const s16 gUnknown_80F6A4A[];
extern const s16 gUnknown_80F6C06[];
extern void sub_8042A14(DungeonPos *);
EWRAM_DATA OpenedFile *gDungeonPaletteFile = {0};
EWRAM_DATA unkStruct_202EE8C gUnknown_202EE8C[32] = {0};
EWRAM_DATA OpenedFile *gUnknown_202F18C = {0};
@ -37,6 +39,85 @@ EWRAM_DATA Tile gOutOfBoundsTileData = {0};
EWRAM_INIT const Tile *gCurTilesetOobTile = {NULL};
const u8 gDungeonWaterType[76] = {
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_WATER,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_WATER,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_LAVA,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_LAVA,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_LAVA,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_LAVA,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
};
const Tile *GetTile(s32 x, s32 y)
{
if (x >= 0 && y >= 0 && x < DUNGEON_MAX_SIZE_X && y < DUNGEON_MAX_SIZE_Y)
@ -1025,3 +1106,160 @@ void sub_804AC20(DungeonPos *pos)
}
}
}
bool8 PosHasItem(DungeonPos *pos)
{
const Tile *tile;
Entity *entity;
tile = GetTile(pos->x,pos->y);
entity = tile->object;
if ((entity != NULL) && (GetEntityType(entity) == ENTITY_ITEM)) {
return TRUE;
}
return FALSE;
}
Entity *GetMonsterAtPos(DungeonPos *pos)
{
const Tile *tile;
Entity *entity;
tile = GetTile(pos->x,pos->y);
entity = tile->monster;
if ((entity != NULL) && (entity->type == ENTITY_MONSTER)) {
return entity;
}
return NULL;
}
bool8 sub_804AD34(DungeonPos *pos)
{
Tile *tile;
s32 x;
Entity * entity;
s32 y;
bool8 iVar8;
s32 index;
iVar8 = 0;
tile = GetTileMut(pos->x,pos->y);
if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)))
if(!(tile->terrainType & (TERRAIN_TYPE_UNBREAKABLE | TERRAIN_TYPE_IMPASSABLE_WALL))){
iVar8 = 1;
tile->terrainType = (tile->terrainType & ~(TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL)) | TERRAIN_TYPE_NORMAL;
for(y = -1; y < 2; y++)
{
for(x = -1; x < 2; x++)
{
sub_80498A8(x + pos->x, y + pos->y);
sub_8049BB0(x + pos->x, y + pos->y);
ShowDungeonMapAtPos(x + pos->x, y + pos->y);
}
}
}
if (iVar8 != 0) {
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeon->activePokemon[index];
if (EntityIsValid(entity)) {
sub_806CF98(entity);
}
}
sub_8049ED4();
sub_8042A14(pos);
}
return iVar8;
}
bool8 sub_804AE08(DungeonPos *pos)
{
Tile *tile;
s32 x;
s32 y;
bool8 uVar6;
uVar6 = FALSE;
tile = GetTileMut(pos->x,pos->y);
if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)))
if(!(tile->terrainType & (TERRAIN_TYPE_UNBREAKABLE | TERRAIN_TYPE_IMPASSABLE_WALL))) {
uVar6 = TRUE;
tile->terrainType = (tile->terrainType & ~(TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL)) | TERRAIN_TYPE_NORMAL;
tile->spawnOrVisibilityFlags = tile->spawnOrVisibilityFlags | 0x10;
for(y = -1; y < 2; y++)
{
for(x = -1; x < 2; x++)
{
sub_8049BB0(x + pos->x, y + pos->y);
}
}
}
return uVar6;
}
void sub_804AE84(DungeonPos *pos)
{
Tile *tile;
s32 x;
Entity * entity;
s32 index;
s32 y;
tile = GetTileMut(pos->x,pos->y);
if ((tile->spawnOrVisibilityFlags & 0x10) != 0) {
tile->spawnOrVisibilityFlags &= 0xffef;
for(y = -1; y < 2; y++)
{
for(x = -1; x < 2; x++)
{
sub_80498A8(x + pos->x, y + pos->y);
ShowDungeonMapAtPos(x + pos->x, y + pos->y);
}
}
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeon->activePokemon[index];
if (EntityIsValid(entity)) {
sub_806CF98(entity);
}
}
sub_8049ED4();
sub_8042A14(pos);
}
}
bool8 IsTileGround(Tile *tile)
{
bool8 isGround = FALSE;
if (IsWaterTileset())
{
if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)))
{
isGround = TRUE;
}
}
else if ((tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != TERRAIN_TYPE_SECONDARY ||
gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA)
{
isGround = TRUE;
}
return isGround;
}
bool8 IsWaterTileset(void)
{
if (gDungeon->tileset == 0 ||
gDungeon->tileset == 0x31 ||
gDungeon->tileset == 0x20 ||
gDungeon->tileset == 0x21 ||
gDungeon->tileset == 0x36)
{
return TRUE;
}
return FALSE;
}

View File

@ -24,7 +24,6 @@
#include "status_checks_1.h"
#include "dungeon_items.h"
#include "dungeon_leader.h"
#include "tile_types.h"
#include "menu_input.h"
#include "text_1.h"
#include "code_8044CC8.h"

View File

@ -29,7 +29,6 @@
#include "text_1.h"
#include "text_2.h"
#include "text_3.h"
#include "tile_types.h"
extern void PlayDungeonCancelSE(void);
extern void PlayDungeonConfirmationSE(void);

View File

@ -45,7 +45,6 @@
#include "status_checks_1.h"
#include "string_format.h"
#include "text_2.h"
#include "tile_types.h"
#include "weather.h"
extern bool8 sub_8048A68(Entity *param_1,Item *item);

View File

@ -38,7 +38,6 @@
#include "dungeon_config.h"
#include "game_options.h"
#include "weather.h"
#include "tile_types.h"
#include "dungeon_capabilities.h"
#include "text_util.h"
#include "dungeon_random.h"

View File

@ -30,7 +30,6 @@
#include "structs/dungeon_entity.h"
#include "structs/map.h"
#include "structs/str_dungeon.h"
#include "tile_types.h"
#include "weather.h"
#include "dungeon_config.h"
#include "dungeon_misc.h"

View File

@ -17,7 +17,6 @@
#include "status_actions.h"
#include "status_checks_1.h"
#include "text_util.h"
#include "tile_types.h"
#include "trap.h"
#include "weather.h"
#include "dungeon_config.h"

View File

@ -33,7 +33,6 @@
#include "structs/map.h"
#include "structs/str_dungeon.h"
#include "dungeon_misc.h"
#include "tile_types.h"
#include "dungeon_config.h"
extern u8 *gUnknown_80FB380[];

View File

@ -31,7 +31,6 @@
#include "structs/map.h"
#include "structs/str_dungeon.h"
#include "text_util.h"
#include "tile_types.h"
#include "trap.h"
#include "weather.h"
#include "dungeon_config.h"

View File

@ -1,246 +0,0 @@
#include "global.h"
#include "tile_types.h"
#include "code_806CD90.h"
#include "structs/str_dungeon.h"
#include "dungeon_map.h"
#include "dungeon_map_access.h"
#include "dungeon_util.h"
const u8 gDungeonWaterType[76] = {
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_WATER,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_WATER,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_LAVA,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_LAVA,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_LAVA,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_LAVA,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
DUNGEON_WATER_TYPE_NONE,
};
extern void sub_8049BB0(s32, s32);
void sub_8042A14(DungeonPos *);
bool8 PosHasItem(DungeonPos *pos)
{
const Tile *tile;
Entity *entity;
tile = GetTile(pos->x,pos->y);
entity = tile->object;
if ((entity != NULL) && (GetEntityType(entity) == ENTITY_ITEM)) {
return TRUE;
}
return FALSE;
}
Entity *GetMonsterAtPos(DungeonPos *pos)
{
const Tile *tile;
Entity *entity;
tile = GetTile(pos->x,pos->y);
entity = tile->monster;
if ((entity != NULL) && (entity->type == ENTITY_MONSTER)) {
return entity;
}
return NULL;
}
bool8 sub_804AD34(DungeonPos *pos)
{
Tile *tile;
s32 x;
Entity * entity;
s32 y;
bool8 iVar8;
s32 index;
iVar8 = 0;
tile = GetTileMut(pos->x,pos->y);
if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)))
if(!(tile->terrainType & (TERRAIN_TYPE_UNBREAKABLE | TERRAIN_TYPE_IMPASSABLE_WALL))){
iVar8 = 1;
tile->terrainType = (tile->terrainType & ~(TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL)) | TERRAIN_TYPE_NORMAL;
for(y = -1; y < 2; y++)
{
for(x = -1; x < 2; x++)
{
sub_80498A8(x + pos->x, y + pos->y);
sub_8049BB0(x + pos->x, y + pos->y);
ShowDungeonMapAtPos(x + pos->x, y + pos->y);
}
}
}
if (iVar8 != 0) {
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeon->activePokemon[index];
if (EntityIsValid(entity)) {
sub_806CF98(entity);
}
}
sub_8049ED4();
sub_8042A14(pos);
}
return iVar8;
}
bool8 sub_804AE08(DungeonPos *pos)
{
Tile *tile;
s32 x;
s32 y;
bool8 uVar6;
uVar6 = FALSE;
tile = GetTileMut(pos->x,pos->y);
if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)))
if(!(tile->terrainType & (TERRAIN_TYPE_UNBREAKABLE | TERRAIN_TYPE_IMPASSABLE_WALL))) {
uVar6 = TRUE;
tile->terrainType = (tile->terrainType & ~(TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL)) | TERRAIN_TYPE_NORMAL;
tile->spawnOrVisibilityFlags = tile->spawnOrVisibilityFlags | 0x10;
for(y = -1; y < 2; y++)
{
for(x = -1; x < 2; x++)
{
sub_8049BB0(x + pos->x, y + pos->y);
}
}
}
return uVar6;
}
void sub_804AE84(DungeonPos *pos)
{
Tile *tile;
s32 x;
Entity * entity;
s32 index;
s32 y;
tile = GetTileMut(pos->x,pos->y);
if ((tile->spawnOrVisibilityFlags & 0x10) != 0) {
tile->spawnOrVisibilityFlags &= 0xffef;
for(y = -1; y < 2; y++)
{
for(x = -1; x < 2; x++)
{
sub_80498A8(x + pos->x, y + pos->y);
ShowDungeonMapAtPos(x + pos->x, y + pos->y);
}
}
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeon->activePokemon[index];
if (EntityIsValid(entity)) {
sub_806CF98(entity);
}
}
sub_8049ED4();
sub_8042A14(pos);
}
}
bool8 IsTileGround(Tile *tile)
{
bool8 isGround = FALSE;
if (IsWaterTileset())
{
if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)))
{
isGround = TRUE;
}
}
else if ((tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != TERRAIN_TYPE_SECONDARY ||
gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA)
{
isGround = TRUE;
}
return isGround;
}
bool8 IsWaterTileset()
{
if (gDungeon->tileset == 0 ||
gDungeon->tileset == 0x31 ||
gDungeon->tileset == 0x20 ||
gDungeon->tileset == 0x21 ||
gDungeon->tileset == 0x36)
{
return TRUE;
}
return FALSE;
}