Decomped IsBossBattle()

This commit is contained in:
AnonymousRandomPerson 2022-02-20 22:12:40 -05:00
parent 60a19d681c
commit e54b3427db
4 changed files with 13 additions and 27 deletions

View File

@ -2828,29 +2828,4 @@ _080441B4: .4byte gTeamInventory_203B460
_080441B8: .4byte gRecruitedPokemonRef
thumb_func_end sub_8044124
thumb_func_start IsBossBattle
IsBossBattle:
push {lr}
ldr r0, _080441D8
ldr r0, [r0]
ldr r1, _080441DC
adds r0, r1
movs r1, 0
ldrsh r0, [r0, r1]
cmp r0, 0
beq _080441E0
cmp r0, 0x31
bgt _080441E0
movs r0, 0x1
b _080441E2
.align 2, 0
_080441D8: .4byte gDungeonGlobalData
_080441DC: .4byte 0x00003a14
_080441E0:
movs r0, 0
_080441E2:
pop {r1}
bx r1
thumb_func_end IsBossBattle
.align 2, 0

View File

@ -1,6 +1,8 @@
#ifndef GUARD_DUNGEON_ENGINE_H
#define GUARD_DUNGEON_ENGINE_H
// 0x441BC
bool8 IsBossBattle();
// 0x441E8
bool8 IsFixedDungeon();

View File

@ -3,6 +3,15 @@
#include "constants/dungeon.h"
#include "dungeon_global_data.h"
bool8 IsBossBattle()
{
if (gDungeonGlobalData->bossBattleIndex != 0 && gDungeonGlobalData->bossBattleIndex <= 0x31)
{
return TRUE;
}
return FALSE;
}
bool8 IsFixedDungeon()
{
if (gDungeonGlobalData->tileset > DUNGEON_OUT_ON_RESCUE)
@ -10,4 +19,4 @@ bool8 IsFixedDungeon()
return TRUE;
}
return FALSE;
}
}

View File

@ -5,6 +5,7 @@
#include "constants/status.h"
#include "constants/type.h"
#include "constants/weather.h"
#include "dungeon_engine.h"
#include "dungeon_global_data.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
@ -93,7 +94,6 @@ const u8 gDungeonCamouflageTypes[76] = {
TYPE_ROCK
};
extern bool8 IsBossBattle();
extern u8 GetWeather(struct DungeonEntity*);
extern bool8 HasQuarterHPOrLess(struct DungeonEntity*);
extern bool8 IsTileGround(struct MapTile*);