mirror of
https://github.com/pret/pmd-sky.git
synced 2026-04-26 08:35:04 -05:00
Decomped IsCurrentTilesetBackground
This commit is contained in:
parent
09f5f3e062
commit
75bf48c46b
|
|
@ -1,44 +1,4 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
.public Debug_Print0
|
|
||||||
.public DEFAULT_TILE
|
.public DEFAULT_TILE
|
||||||
.public DetermineMonsterShadow
|
|
||||||
.public DIRECTIONS_XY
|
|
||||||
.public DrawMinimapTile
|
|
||||||
.public DUNGEON_PTR
|
.public DUNGEON_PTR
|
||||||
.public EntityIsValid__02337CA8
|
|
||||||
.public GetBgRegionArea
|
|
||||||
.public GetLeader
|
|
||||||
.public GetTile
|
|
||||||
.public GetVisibilityRange
|
|
||||||
.public InitTilesetBuffer
|
|
||||||
.public IsBackgroundTileset
|
|
||||||
.public IsCurrentFixedRoomBossFight
|
|
||||||
.public IsGoldenChamber
|
|
||||||
.public IsSecretBazaar
|
|
||||||
.public ov10_022C2588
|
|
||||||
.public ov10_022C25EC
|
|
||||||
.public ov10_022C2638
|
|
||||||
.public ov10_022C2654
|
|
||||||
.public ov10_022C26A0
|
|
||||||
.public ov10_022C2720
|
|
||||||
.public ov29_022DE0EC
|
|
||||||
.public ov29_022E0378
|
|
||||||
.public ov29_022E2930
|
|
||||||
.public ov29_022E66C4
|
|
||||||
.public ov29_022E9F80
|
|
||||||
.public ov29_022FF958
|
|
||||||
.public ov29_02352B60
|
|
||||||
.public ov29_02352B74
|
|
||||||
.public ov29_02352B88
|
|
||||||
.public ov29_02352B9C
|
|
||||||
.public ov29_02352D58
|
|
||||||
.public ov29_02352F14
|
|
||||||
.public MOBILITY_TYPE_TO_DUNGEON_MOBILITY_TYPE
|
|
||||||
.public ov29_0237CAA0
|
|
||||||
.public ov29_0237CAAC
|
|
||||||
.public ov29_0237CAB8
|
.public ov29_0237CAB8
|
||||||
.public RandIntSafe
|
|
||||||
.public SECONDARY_TERRAIN_TYPES
|
|
||||||
.public sub_0204AED0
|
|
||||||
.public sub_02051D8C
|
|
||||||
.public sub_02051E60
|
|
||||||
|
|
|
||||||
43
asm/include/overlay_29_02336224.inc
Normal file
43
asm/include/overlay_29_02336224.inc
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
#pragma once
|
||||||
|
.public DEFAULT_TILE
|
||||||
|
.public DIRECTIONS_XY
|
||||||
|
.public DUNGEON_PTR
|
||||||
|
.public Debug_Print0
|
||||||
|
.public DetermineMonsterShadow
|
||||||
|
.public DrawMinimapTile
|
||||||
|
.public EntityIsValid__02337CA8
|
||||||
|
.public GetBgRegionArea
|
||||||
|
.public GetLeader
|
||||||
|
.public GetTile
|
||||||
|
.public GetTileSafe
|
||||||
|
.public GetVisibilityRange
|
||||||
|
.public InitTilesetBuffer
|
||||||
|
.public IsCurrentFixedRoomBossFight
|
||||||
|
.public IsGoldenChamber
|
||||||
|
.public IsSecretBazaar
|
||||||
|
.public MOBILITY_TYPE_TO_DUNGEON_MOBILITY_TYPE
|
||||||
|
.public RandIntSafe
|
||||||
|
.public SECONDARY_TERRAIN_TYPES
|
||||||
|
.public ov10_022C2588
|
||||||
|
.public ov10_022C25EC
|
||||||
|
.public ov10_022C2638
|
||||||
|
.public ov10_022C2654
|
||||||
|
.public ov10_022C26A0
|
||||||
|
.public ov10_022C2720
|
||||||
|
.public ov29_022DE0EC
|
||||||
|
.public ov29_022E0378
|
||||||
|
.public ov29_022E2930
|
||||||
|
.public ov29_022E66C4
|
||||||
|
.public ov29_022E9F80
|
||||||
|
.public ov29_022FF958
|
||||||
|
.public ov29_02352B60
|
||||||
|
.public ov29_02352B74
|
||||||
|
.public ov29_02352B88
|
||||||
|
.public ov29_02352B9C
|
||||||
|
.public ov29_02352D58
|
||||||
|
.public ov29_02352F14
|
||||||
|
.public ov29_0237CAA0
|
||||||
|
.public ov29_0237CAAC
|
||||||
|
.public sub_0204AED0
|
||||||
|
.public sub_02051D8C
|
||||||
|
.public sub_02051E60
|
||||||
File diff suppressed because it is too large
Load Diff
2042
asm/overlay_29_02336224.s
Normal file
2042
asm/overlay_29_02336224.s
Normal file
File diff suppressed because it is too large
Load Diff
10
include/run_dungeon.h
Normal file
10
include/run_dungeon.h
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#ifndef PMDSKY_RUN_DUNGEON_H
|
||||||
|
#define PMDSKY_RUN_DUNGEON_H
|
||||||
|
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
// Calls IsBackgroundTileset with the current tileset ID
|
||||||
|
// return: True if the current dungeon tileset is a background, false if it's a regular tileset.
|
||||||
|
bool8 IsCurrentTilesetBackground();
|
||||||
|
|
||||||
|
#endif //PMDSKY_RUN_DUNGEON_H
|
||||||
2
main.lsf
2
main.lsf
|
|
@ -447,6 +447,8 @@ Overlay OVY_29
|
||||||
Object asm/overlay_29_023350FC.o
|
Object asm/overlay_29_023350FC.o
|
||||||
Object src/dungeon_map_access.o
|
Object src/dungeon_map_access.o
|
||||||
Object asm/overlay_29_02336164.o
|
Object asm/overlay_29_02336164.o
|
||||||
|
Object src/run_dungeon.o
|
||||||
|
Object asm/overlay_29_02336224.o
|
||||||
Object src/overlay_29_02337CA8.o
|
Object src/overlay_29_02337CA8.o
|
||||||
Object asm/overlay_29_02337CCC.o
|
Object asm/overlay_29_02337CCC.o
|
||||||
Object src/overlay_29_02338390.o
|
Object src/overlay_29_02338390.o
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,10 @@
|
||||||
#include "dungeon_util.h"
|
#include "dungeon_util.h"
|
||||||
#include "dungeon_util_static.h"
|
#include "dungeon_util_static.h"
|
||||||
#include "overlay_29_022FF898.h"
|
#include "overlay_29_022FF898.h"
|
||||||
|
#include "run_dungeon.h"
|
||||||
|
|
||||||
static const u8 DIRECTIONAL_BIT_MASKS[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80};
|
static const u8 DIRECTIONAL_BIT_MASKS[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80};
|
||||||
|
|
||||||
extern bool8 IsCurrentTilesetBackground(void);
|
|
||||||
|
|
||||||
bool8 CanMonsterMoveInDirection(struct entity *monster, u16 direction)
|
bool8 CanMonsterMoveInDirection(struct entity *monster, u16 direction)
|
||||||
{
|
{
|
||||||
struct monster *monster_info = GetEntInfo(monster);
|
struct monster *monster_info = GetEntInfo(monster);
|
||||||
|
|
@ -31,6 +30,8 @@ bool8 CanMonsterMoveInDirection(struct entity *monster, u16 direction)
|
||||||
else if (ItemIsActive__022FF898(monster, ITEM_MOBILE_SCARF))
|
else if (ItemIsActive__022FF898(monster, ITEM_MOBILE_SCARF))
|
||||||
mobility = MOBILITY_INTANGIBLE;
|
mobility = MOBILITY_INTANGIBLE;
|
||||||
else if (IqSkillIsEnabled(monster, IQ_ALL_TERRAIN_HIKER))
|
else if (IqSkillIsEnabled(monster, IQ_ALL_TERRAIN_HIKER))
|
||||||
|
// BUG: If a Pokémon can normally move through walls, All-Terrain Hiker will block them from moving through walls.
|
||||||
|
// This bug is fixed in the NA/EU versions.
|
||||||
mobility = MOBILITY_HOVERING;
|
mobility = MOBILITY_HOVERING;
|
||||||
else if (IqSkillIsEnabled(monster, IQ_ABSOLUTE_MOVER)) {
|
else if (IqSkillIsEnabled(monster, IQ_ABSOLUTE_MOVER)) {
|
||||||
if (direction & 1)
|
if (direction & 1)
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ enum mobility_type GetMobilityTypeCheckSlip(s16 species, bool8 walk_on_water)
|
||||||
// Indices 4 and 5 in this array are assigned either MOBILITY_NORMAL or MOBILITY_WATER
|
// Indices 4 and 5 in this array are assigned either MOBILITY_NORMAL or MOBILITY_WATER
|
||||||
// depending on whether the dungeon's liquid is water or lava.
|
// depending on whether the dungeon's liquid is water or lava.
|
||||||
// For example, a lava dungeon would have these values:
|
// For example, a lava dungeon would have these values:
|
||||||
// WALKABLE_TILE_TO_MOBILITY_TYPE[MOBILITY_LAVA]: MOBILITY_WATER
|
// MOBILITY_TYPE_TO_DUNGEON_MOBILITY_TYPE[MOBILITY_LAVA]: MOBILITY_WATER
|
||||||
// WALKABLE_TILE_TO_MOBILITY_TYPE[MOBILITY_WATER]: MOBILITY_NORMAL
|
// MOBILITY_TYPE_TO_DUNGEON_MOBILITY_TYPE[MOBILITY_WATER]: MOBILITY_NORMAL
|
||||||
// This means a Fire-type can cross the dungeon's liquid, while a Water-type cannot.
|
// This means a Fire-type can cross the dungeon's liquid, while a Water-type cannot.
|
||||||
return MOBILITY_TYPE_TO_DUNGEON_MOBILITY_TYPE[mobility_type];
|
return MOBILITY_TYPE_TO_DUNGEON_MOBILITY_TYPE[mobility_type];
|
||||||
|
|
||||||
|
|
|
||||||
11
src/run_dungeon.c
Normal file
11
src/run_dungeon.c
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include "run_dungeon.h"
|
||||||
|
#include "dungeon.h"
|
||||||
|
|
||||||
|
extern struct dungeon *DUNGEON_PTR[];
|
||||||
|
|
||||||
|
extern bool8 IsBackgroundTileset(u32 tileset_id);
|
||||||
|
|
||||||
|
bool8 IsCurrentTilesetBackground()
|
||||||
|
{
|
||||||
|
return IsBackgroundTileset(DUNGEON_PTR[0]->gen_info.tileset_id);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user