Sync some function names with pmd-sky

This commit is contained in:
DizzyEggg 2025-07-16 13:18:24 +02:00
parent 354d61b5b5
commit 7bfe0991e9
109 changed files with 691 additions and 729 deletions

View File

@ -17,7 +17,7 @@ u8 sub_806CEBC(Entity *entity);
void sub_806CEFC(Entity *entity, u32 newDir);
void sub_806CF18(Entity *entity);
u8 sub_806CF54(Entity *entity);
void sub_806CF60(void);
u32 sub_806CF98(Entity *entity);
void DetermineAllMonsterShadow(void);
u32 DetermineMonsterShadow(Entity *entity);
#endif // GUARD_CODE_806CD90_H

View File

@ -6,5 +6,6 @@
extern const s16 gSpeedTurns[NUM_SPEED_COUNTERS][25];
void RunFractionalTurn(bool8 param_1);
bool8 IsFloorOver(void);
#endif

View File

@ -10,7 +10,9 @@ s32 GetDungeonFloorCount(u8 dungeon);
s32 GetDungeonStartingFloor(u8 dungeon);
const u8 *GetDungeonName1(u8 dungeon);
bool8 IsStairDirectionUp(u8 dungeon);
bool8 IsLevelResetDungeon(u8 dungeon);
u32 GetMaxItemsAllowed(u8 dungeon);
bool8 IsMoneyAllowed(u8 dungeon);
s8 GetRescuesAllowed(u8 dungeon);
bool8 HasCheckpoint(u8 dungeon);
s16 GetRandomMovementChance(u8 dungeon);

View File

@ -13,12 +13,12 @@ void sub_8045C18(u8 *buffer, Item *item);
#define FORCE_STICKY_NEVER 2
void CreateItemWithStickyChance(Item *item, u8 itemID, u32 forceSticky);
void CreateFloorItems(void);
void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg);
bool8 AddItemToDungeonAt(DungeonPos *pos, Item *item, bool8 a2);
bool8 RemoveItemFromDungeonAt(DungeonPos *pos, bool8 a2);
void TryLeaderItemPickUp(struct DungeonPos *pos, bool8 printMsg);
bool8 SpawnItem(DungeonPos *pos, Item *item, bool8 a2);
bool8 RemoveGroundItem(DungeonPos *pos, bool8 a2);
bool8 sub_80462AC(Entity * entity, u8 hallucinating, u8 a2, u8 a3, u8 a4);
const u8 *sub_80464AC(Item *item);
void sub_80464C8(Entity *entity, DungeonPos *pos, Item *item);
void SpawnDroppedItemWrapper(Entity *entity, DungeonPos *pos, Item *item);
void SpawnDroppedItem(Entity *entity1, Entity *entity2, Item *item, bool8 a3, DungeonPos *pos);
void sub_8046860(Entity *entity, DungeonPos *pos, Item *item, s32 a4);
void sub_804687C(Entity *entity, DungeonPos *pos1, DungeonPos *pos2, Item *item, s32 count);

View File

@ -12,7 +12,7 @@ struct UnkMenuBitsStruct {
void DungeonHandlePlayerInput(void);
void sub_805E804(void);
void sub_805EE30(void);
void CheckLeaderTile(void);
void sub_805EFB4(Entity *a0, bool8 a1);
void sub_805F02C(void);
ActionContainer *GetLeaderActionContainer(void);

View File

@ -12,7 +12,7 @@ void OpenDungeonMapFile(void);
void InitDungeonMap(bool8 a0);
void CloseDungeonMapFile(void);
void LoadDungeonMapPalette(void);
void ShowDungeonMapAtPos(s32 x, s32 y);
void DrawMinimapTile(s32 x, s32 y);
void CopyDungeonMapToVram(void);
void ShowPlayerDotOnMap(void);
void ResetMapPlayerDotFrames(void);

View File

@ -6,7 +6,7 @@
const Tile *GetTile(s32 x, s32 y);
Tile *GetTileMut(s32 x, s32 y);
void sub_8049ED4(void);
void UpdateTrapsVisibility(void);
void sub_804AC20(DungeonPos *pos);
void sub_80495E4(void);

View File

@ -35,7 +35,7 @@ void LogMessageByIdWithPopupCheckUser(Entity *pokemon, const u8 *str);
void TryDisplayDungeonLoggableMessage2(Entity *pokemon, const u8 *str);
void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u8 *str);
void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u8 *str);
void TryDisplayDungeonLoggableMessage5(Entity *pokemon, DungeonPos *pos, const u8 *str);
void LogMessageByIdWithPopupCheckUserUnknown(Entity *pokemon, DungeonPos *pos, const u8 *str);
// As opposed to the above - these always display the string and save it in the message log. False/True stand for an unknown argument. Not sure what the practical difference is between these.
void DisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str);
@ -51,7 +51,7 @@ bool32 DisplayDungeonYesNoMessage(struct MonDialogueSpriteInfo *monSpriteInfo, c
s32 DisplayDungeonMenuMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const u8 *str, const MenuItem *menuItems, u16 unkArg);
void sub_8052D44(s16 *ids, Entity *leader, Entity *partner);
void TryDisplayGeneralTutorialMessage(void);
void TryDisplayItemPickupTutorialMessage(u8 itemId);
void DisplayItemTip(u8 itemId);
void DisplayYouReachedDestFloorStr(void);
void sub_8052FB8(const u8 *str);
const u8 *GetCurrentDungeonName(void);

View File

@ -35,7 +35,7 @@ void sub_8068A84(Pokemon *pokemon);
void sub_8068BDC(bool8 a0);
void sub_8068F28(void);
void sub_8068F80(void);
void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3);
void HandleFaint(Entity *entity, s32 param_2, Entity *param_3);
void sub_80694C0(Entity *target,s32 x,s32 y,u8 param_4);
void sub_80695EC(Entity *param_1,int x,int y);
Entity * sub_8069660(Entity *target);

View File

@ -16,16 +16,17 @@ bool8 EntityIsValid(Entity *pokemon);
u32 GetEntityType(Entity *entity);
u8 GetEntityRoom(Entity *entity);
Tile *GetTileAtEntitySafe(Entity *entity);
void sub_804535C(Entity *entity, PixelPos *pos);
void UpdateEntityPixelPos(Entity *entity, PixelPos *pos);
void SetEntityPixelPos(Entity *entity, s32 x, s32 y);
void IncreaseEntityPixelPos(Entity *entity, s32 x, s32 y);
Item *GetItemData(Entity *entity);
Item *GetItemInfo(Entity *entity);
Item *GetItemData_1(Entity *entity);
Trap *GetTrapData(Entity *entity);
Trap *GetTrapInfo(Entity *entity);
Trap* GetTrapData_1(Entity *entity);
Entity *SpawnTrap(u8 trapID, DungeonPos *pos, u8 c);
Entity *sub_8045708(DungeonPos *pos);
Entity *SpawnItemEntity(DungeonPos *pos);
void sub_80457DC(Entity* ent);
bool8 ShouldDisplayEntity(Entity *ent);
bool8 CanSeeTarget(Entity *entity, Entity *targetEntity);
bool8 CanTargetEntity(Entity *entity, Entity *targetEntity);
bool8 sub_8045A70(Entity *entity, Entity *targetEntity);

View File

@ -45,22 +45,22 @@ void LoadItemParameters(void);
TeamInventory *GetMoneyItemsInfo(void);
void InitializeMoneyItems(void);
s32 GetNumberOfFilledInventorySlots(void);
bool8 IsThrowableItem(u8 id);
bool8 IsThrownItem(u8 id);
void ItemIdToItem(Item *item, u8 id, bool8 makeSticky);
void ItemIdToBulkItem(BulkItem *dst, u8 id);
void InitBulkItem(BulkItem *dst, u8 id);
void BulkItemToItem(Item *dst, BulkItem *src);
void ItemToBulkItem(BulkItem *dst, Item *src);
u8 GetItemCategory(u8 index);
s32 GetStackBuyValue(Item *param_1);
s32 GetStackSellValue(Item *param_1);
s32 GetStackBuyPrice(Item *param_1);
s32 GetStackSellPrice(Item *param_1);
s32 GetActualBuyPrice(Item *param_1);
s32 GetActualSellPrice(Item *param_1);
s32 GetItemBuyPrice(u8 id);
s32 GetItemSellPrice(u8 id);
s32 GetItemOrder(u8 id);
s32 GetItemPalette(u8 id);
u32 GetItemActionType(u8 id);
u32 GetSpawnAmountRange(u8 id, u32 r1);
u32 GetThrownItemQuantityLimit(u8 id, u32 r1);
u8 *GetItemDescription(u8 id);
bool8 TestItemAIFlag(u8 id, u32 aiFlag);
void BufferItemName(u8 *, u8 id, unkStruct_8090F58 *);
@ -70,7 +70,7 @@ void ConvertMoneyItemToMoney();
void AddToTeamMoney(s32 amount);
u32 GetMoneyValue(Item* slot);
u16 GetItemMoveID(u8 index);
bool8 CanSellItem(u32 id);
bool8 IsShoppableItem(u32 id);
bool8 IsGummiItem(u8);
void ShiftItemsDownFrom(s32 start);
void ClearItemSlotAt(u32 index);

View File

@ -109,7 +109,7 @@ s32 GetUnitSum_808D544(s32 *);
s32 sub_808D580(s32 *);
bool8 ComparePokemonNames(s16, s16);
void PrintPokeNameToBuffer(u8 *buffer, Pokemon *pokemon);
void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level);
void GetLvlUpEntry(LevelData* a1, s32 _id, s32 level);
const u8* DecompressMoveID(const u8* a1, u16* moveID);
bool8 sub_808DA44(s32, u32);
void ConvertStoryMonToPokemon(Pokemon *dst, const struct StoryMonData *src);

View File

@ -22,7 +22,7 @@ bool8 sub_8043CE4(s32 dungeonId);
u8 GetFloorType(void);
void sub_8043D50(s32 *a0, s32 *a1);
void sub_8043D60(void);
bool8 sub_8043ED0(bool8 a0);
bool8 TryForcedLoss(bool8 a0);
void EnforceMaxItemsAndMoney(void);
bool8 IsBossFight(void);
bool8 IsCurrentFixedRoomBossFight(void);

View File

@ -12,7 +12,7 @@ bool8 sub_807FD84(Entity *entity);
bool8 sub_807FE04(DungeonPos *pos, char param_2);
bool8 sub_807FE44(DungeonPos *pos, char param_2);
void GetTrapName(u8 *buffer, u8 trapIndex);
void HandleTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4);
void TryTriggerTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4);
void HandleMudTrap(Entity *pokemon, Entity *target);
void HandleStickyTrap(Entity *pokemon, Entity *target);
void HandleGrimyTrap(Entity *pokemon, Entity *target);

View File

@ -29,9 +29,8 @@
void sub_804EB30();
bool8 ExposeTrap(s32 x, s32 y);
u8 sub_8045888(Entity *);
void sub_807EC28(u32);
u8 sub_8044B28(void);
u8 IsFloorOver(void);
extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32);
void sub_80421AC(Entity * pokemon, Entity * target);
void sub_807BB78(Entity *pokemon);
@ -93,7 +92,7 @@ void BlowAwayTarget(Entity *pokemon, Entity *target, u32 direction)
for(iVar8 = 0; iVar8 < 6; iVar8++)
{
IncreaseEntityPixelPos(target,pos32.x,pos32.y);
if (sub_8045888(target) != 0) {
if (ShouldDisplayEntity(target) != 0) {
DungeonRunFrameActions(0x19);
}
}
@ -118,7 +117,7 @@ void BlowAwayTarget(Entity *pokemon, Entity *target, u32 direction)
sub_807D068(target,&target->pos);
sub_806F370(pokemon,target,gBlowAwayDmgValue,0,0,0,0x219,0,0,0);
}
if (sub_8044B28()) {
if (IsFloorOver()) {
return;
}
if (entity != NULL) {
@ -128,7 +127,7 @@ void BlowAwayTarget(Entity *pokemon, Entity *target, u32 direction)
sub_806F370(pokemon,entity,gBlowAwayDmgValue,0,0,0,0x21a,0,0,0);
}
}
if (sub_8044B28()) {
if (IsFloorOver()) {
return;
}
if (!EntityIsValid(target)) {
@ -187,8 +186,8 @@ void sub_807D068(Entity *pokemon, DungeonPos *pos)
local_34.x = pixelX;
local_34.y = pixelY;
pokemon->unk1C.raw = sin_4096(iVar8) * 0xc;
sub_804535C(pokemon, &local_34);
if (sub_8045888(pokemon)) {
UpdateEntityPixelPos(pokemon, &local_34);
if (ShouldDisplayEntity(pokemon)) {
DungeonRunFrameActions(0x1a);
}
iVar8 = iVar8 + 0xaa;
@ -197,6 +196,6 @@ void sub_807D068(Entity *pokemon, DungeonPos *pos)
local_34.x = posX;
local_34.y = posY;
pokemon->unk1C = IntToF248(0);
sub_804535C(pokemon,&local_34);
UpdateEntityPixelPos(pokemon,&local_34);
DungeonRunFrameActions(0x1a);
}

View File

@ -41,7 +41,7 @@ bool8 sub_801B60C(u32 r0, u8 id, u8 quantity)
sUnknown_203B234->unk0 = r0;
sUnknown_203B234->unk10.id = id;
if (IsThrowableItem(sUnknown_203B234->unk10.id)) {
if (IsThrownItem(sUnknown_203B234->unk10.id)) {
sUnknown_203B234->unk10.quantity = quantity;
sUnknown_203B234->unkC = quantity;
}

View File

@ -52,7 +52,6 @@ extern void sub_80429A0(Entity *);
void sub_8042B34(s32 a0, s32 a1, s32 a2);
extern bool8 sub_8042CC0(void);
extern void sub_8042D7C(void);
extern bool8 sub_8045888(Entity *);
extern void sub_800F15C(s32);
extern void sub_800EF40(u8 r0, u8 r1);
extern s32 sub_800E6D8(s32);
@ -1220,7 +1219,7 @@ s32 sub_8042520(Entity *a0)
unkStruct_80416E0 local_58;
PixelPos local_2c;
if (sub_8045888(a0)) {
if (ShouldDisplayEntity(a0)) {
dir = GetEntInfo(a0)->action.direction;
pos.x = a0->pixelPos.x / 0x100;
pos.y = a0->pixelPos.y / 0x100;
@ -1327,7 +1326,7 @@ bool8 sub_8042768(Entity* pokemon)
else
return FALSE;
}
return sub_8045888(pokemon);
return ShouldDisplayEntity(pokemon);
}
void sub_80427AC(void)

View File

@ -39,10 +39,10 @@
#include "trap.h"
#include "dungeon_pos_data.h"
#include "dungeon_projectile_throw.h"
#include "dungeon_engine.h"
extern void sub_8071DA4(Entity *);
extern void EnemyEvolution(Entity *);
extern void sub_8057588(Entity * pokemon, u8 param_2);
extern bool8 sub_8045888(Entity *);
extern Item *sub_8044D90(Entity *, s32, u32);
u8 sub_8048D50();
void sub_8042208(Entity *pokemon, u8 r1);
@ -51,7 +51,6 @@ void sub_80479B8();
extern void sub_807AB38(Entity *, u32);
extern Entity * sub_8044DA4(Entity *param_1,int param_2);
extern void sub_8044DF0(Entity *, u32, u32);
extern bool8 sub_8044B28(void);
Entity *sub_806773C(Entity *entity);
void sub_8067558(Entity *entity, Entity *targetEntity, s32 a2);
void sub_8067794(Entity *entity, Entity *targetEntity, s32 a2);
@ -62,7 +61,7 @@ extern void sub_8084448(Entity *entity);
void HandlePickUpPlayerAction(Entity *entity)
{
GetEntInfo(entity)->action.actionParameters[0].actionUseIndex = 1;
PickUpItemFromPos(&entity->pos,0);
TryLeaderItemPickUp(&entity->pos,0);
}
void HandleSetItemAction(Entity *param_1, bool8 param_2)
@ -171,7 +170,7 @@ void HandleGiveItemAction(Entity *param_1)
item2.flags &= ~(ITEM_FLAG_SET);
sub_8044DF0(param_1,0,100);
if (bVar3) {
AddItemToDungeonAt(&param_1->pos,&item1,1);
SpawnItem(&param_1->pos,&item1,1);
}
else {
AddItemToInventory(&item1);
@ -329,7 +328,7 @@ void HandlePlaceItemAction(Entity *entity)
else {
item->flags &= ~(ITEM_FLAG_SET);
sub_8045BF8(gFormatBuffer_Items[0],item);
if (AddItemToDungeonAt(&entity->pos,item,1) == 0) {
if (SpawnItem(&entity->pos,item,1) == 0) {
LogMessageByIdWithPopupCheckUser(entity,gUnknown_80F8E04);
}
else {
@ -375,9 +374,9 @@ void sub_8066E14(Entity *entity)
newItems[0].flags &= ~(ITEM_FLAG_SET);
newItems[1].flags &= ~(ITEM_FLAG_SET);
RemoveItemFromDungeonAt(&info->action.actionParameters[0].itemPos,1);
RemoveGroundItem(&info->action.actionParameters[0].itemPos,1);
ZeroOutItem(item[1]);
if (!AddItemToDungeonAt(&info->action.actionParameters[0].itemPos,&newItems[1],1)) {
if (!SpawnItem(&info->action.actionParameters[0].itemPos,&newItems[1],1)) {
LogMessageByIdWithPopupCheckUser(entity,gNothingCanBePutDownHere);
}
else {
@ -420,16 +419,16 @@ void sub_8066FA4(Entity *entity)
else {
Item newItems[2];
item[1] = GetItemData(tile->object);
item[1] = GetItemInfo(tile->object);
sub_8045BF8(gFormatBuffer_Items[1],item[1]);
newItems[0] = *item[0];
newItems[1] = *item[1];
newItems[0].flags &= ~(ITEM_FLAG_SET);
newItems[1].flags &= ~(ITEM_FLAG_SET);
RemoveItemFromDungeonAt(&entity->pos,1);
RemoveGroundItem(&entity->pos,1);
ZeroOutItem(item[0]);
if (!AddItemToDungeonAt(&entity->pos, &newItems[0],1)) {
if (!SpawnItem(&entity->pos, &newItems[0],1)) {
LogMessageByIdWithPopupCheckUser(entity,gNothingCanBePutDownHere);
}
else {
@ -498,7 +497,7 @@ void sub_80671A0(Entity *entity)
if (info->action.actionParameters[0].actionUseIndex == 0x80) {
item = NULL;
RemoveItemFromDungeonAt(&info->action.actionParameters[0].itemPos, 1);
RemoveGroundItem(&info->action.actionParameters[0].itemPos, 1);
}
r7 = TRUE;
@ -515,7 +514,7 @@ void sub_80671A0(Entity *entity)
else {
if (info->action.actionParameters[0].actionUseIndex == 0x80) {
newItem.quantity--;
AddItemToDungeonAt(&info->action.actionParameters[0].itemPos, &newItem, 1);
SpawnItem(&info->action.actionParameters[0].itemPos, &newItem, 1);
}
else {
item->quantity--;
@ -526,7 +525,7 @@ void sub_80671A0(Entity *entity)
info->action.direction = DungeonRandInt(NUM_DIRECTIONS);
}
if (sub_8045888(entity)) {
if (ShouldDisplayEntity(entity)) {
s32 i;
s32 dir = info->action.direction;
sub_80421C0(entity, 0x164);
@ -743,7 +742,7 @@ void sub_8067794(Entity *entity, Entity *targetEntity, s32 a2)
u8 tempText[64];
strncpy(tempText, gFormatBuffer_Monsters[0], sizeof(tempText));
sub_8068FE0(targetEntity, 0x21D, 0);
HandleFaint(targetEntity, 0x21D, 0);
strncpy(gFormatBuffer_Monsters[0], tempText, sizeof(tempText));
DisplayDungeonMessage(NULL, stringPtr2, TRUE);
}
@ -757,7 +756,7 @@ void HandleUseMovePlayerAction(Entity *entity)
EntityInfo *info = GetEntInfo(entity);
sub_8055A00(entity, info->action.actionParameters[1].actionUseIndex, 1, 0, 0);
if (sub_8044B28()) {
if (IsFloorOver()) {
break;
}
if (info->unk159 != 0) {
@ -767,7 +766,7 @@ void HandleUseMovePlayerAction(Entity *entity)
}
sub_8057588(entity, 1);
if (!sub_8044B28()) {
if (!IsFloorOver()) {
if (EntityIsValid(entity)) {
sub_806A9B4(entity, GetEntInfo(entity)->action.actionParameters[1].actionUseIndex);
}
@ -826,7 +825,7 @@ void sub_8067904(Entity *entity, u16 moveId)
pos.y = entity->pos.y + gAdjacentTileOffsets[info->action.direction].y;
sub_807FE44(&pos, 1);
}
sub_8071DA4(entity);
EnemyEvolution(entity);
}
}
}

View File

@ -39,7 +39,6 @@ extern void sub_8042900(Entity *r0);
extern void sub_8042968(Entity *r0);
extern void EndAbilityImmuneStatus(Entity *, Entity *);
void sub_8041BBC(Entity *r0);
extern bool8 sub_8045888(Entity *);
extern void sub_806A2BC(Entity *, u8);
extern void sub_804178C(u32);
extern void sub_803F508(Entity *);
@ -742,7 +741,7 @@ void sub_806BC68(bool8 a0, Entity *entity, struct unkStruct_806B7F8 *structPtr,
entity->pos.y = -2;
sub_80694C0(entity, structPtr->pos.x, structPtr->pos.y, 1);
sub_804535C(entity, NULL);
UpdateEntityPixelPos(entity, NULL);
if (!a0) {
if (structPtr->species == MONSTER_KECLEON
@ -1057,7 +1056,7 @@ s32 sub_806C444(s32 _species, s32 level)
s32 hpCount = GetBaseHP(species);
for (i = 2; i <= level; i++) {
GetPokemonLevelData(&levelData, species, i);
GetLvlUpEntry(&levelData, species, i);
hpCount += levelData.gainHP;
}
@ -1072,7 +1071,7 @@ s32 sub_806C488(s32 _species, s32 level, s32 categoryIndex)
s32 offensiveCount = GetBaseOffensiveStat(species, categoryIndex);
for (i = 2; i <= level; i++) {
GetPokemonLevelData(&levelData, species, i);
GetLvlUpEntry(&levelData, species, i);
offensiveCount += levelData.gainAtt[categoryIndex];
}
@ -1087,7 +1086,7 @@ s32 sub_806C4D4(s32 _species, s32 level, s32 categoryIndex)
s32 defensiveCount = GetBaseDefensiveStat(species, categoryIndex);
for (i = 2; i <= level; i++) {
GetPokemonLevelData(&levelData, species, i);
GetLvlUpEntry(&levelData, species, i);
defensiveCount += levelData.gainDef[categoryIndex];
}

View File

@ -486,7 +486,7 @@ u8 sub_806CF54(Entity *entity)
return GetEntInfo(entity)->unk204;
}
void sub_806CF60(void)
void DetermineAllMonsterShadow(void)
{
Entity *entity;
s32 i;
@ -495,11 +495,11 @@ void sub_806CF60(void)
entity = gDungeon->activePokemon[i];
if (EntityIsValid(entity))
sub_806CF98(entity);
DetermineMonsterShadow(entity);
}
}
u32 sub_806CF98(Entity *entity)
u32 DetermineMonsterShadow(Entity *entity)
{
const Tile *mapTile;
u32 shadowSize;

View File

@ -274,7 +274,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa
UnlockFriendArea(friendArea);
flag = TRUE;
}
sub_8068FE0(entity2,500,entity1);
HandleFaint(entity2,500,entity1);
pokeStruct2 = &gRecruitedPokemonRef->dungeonTeam[pokeIndex];
pokeStruct2->flags = 3;
pokeStruct2->isTeamLeader = FALSE;
@ -441,7 +441,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr)
flag = TRUE;
}
IncrementAdventureNumJoined();
sub_8068FE0(entity2,500,entity1);
HandleFaint(entity2,500,entity1);
if (sub_806B8CC(local_74.id,local_74.pos.x,local_74.pos.y,pokeStruct2,&local_2c,0,0) == 0) {
pokeStruct2->flags = 0;
}

View File

@ -37,8 +37,7 @@ void sub_8083D78(void);
void sub_8083D58(void);
void sub_8072778(Entity *, Entity *, u8, u8);
bool8 sub_80725A4(Entity *, Entity *);
void GetAvailTacticsforLvl_Bool(u8 *tacticsBuffer, s32 pokeLevel);
bool8 sub_80723D0(Entity *, Entity *, u8, u8);
void GetUnlockedTacticFlags(u8 *tacticsBuffer, s32 pokeLevel);
void sub_807218C(Entity *);
extern void sub_8072B78(Entity *pokemon, Entity *target, s16 id);
@ -53,6 +52,8 @@ static const u8 * const gUnknown_8107018[3] = {
_("\n"),
};
static bool8 LevelUp(Entity *, Entity *, u8, u8);
void sub_8071D4C(Entity *pokemon, Entity *target, s32 exp)
{
s32 newExp;
@ -75,7 +76,7 @@ void sub_8071D4C(Entity *pokemon, Entity *target, s32 exp)
}
}
void sub_8071DA4(Entity *entity)
void EnemyEvolution(Entity *entity)
{
int counter;
s16 *id;
@ -116,7 +117,7 @@ void sub_8071DA4(Entity *entity)
s32 expGained = info->expGainedInTurn;
if (expGained != 0) {
if (info->isTeamLeader) {
GetAvailTacticsforLvl_Bool(tacticsBuffer1, info->level);
GetUnlockedTacticFlags(tacticsBuffer1, info->level);
}
maxHP = info->maxHPStat;
atk[0] = info->atk[0];
@ -128,7 +129,7 @@ void sub_8071DA4(Entity *entity)
gFormatArgs[0] = expGained;
SetMessageArgument_2(gFormatBuffer_Monsters[0],info,0);
TryDisplayDungeonLoggableMessage3(entityPtr,target,gUnknown_80F9E64); // $m0 gained $d0 Exp Points
flag = sub_80723D0(entityPtr,target,1,1);
flag = LevelUp(entityPtr,target,1,1);
}
}
if (info->unk149 != 0) {
@ -161,7 +162,7 @@ void sub_8071DA4(Entity *entity)
if ((expGained != 0) && (info->isTeamLeader)) {
s32 tacticIndex;
GetAvailTacticsforLvl_Bool(tacticsBuffer2,info->level);
GetUnlockedTacticFlags(tacticsBuffer2,info->level);
for(tacticIndex = 0; tacticIndex < NUM_TACTICS; tacticIndex++)
{
if ((tacticsBuffer1[tacticIndex] == 0) && (tacticsBuffer2[tacticIndex] == 1)) {
@ -177,7 +178,6 @@ void sub_8071DA4(Entity *entity)
}
}
}
return;
}
void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 param_5)
@ -197,7 +197,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para
flag = 0;
info = GetEntInfo(target);
if (info->isTeamLeader) {
GetAvailTacticsforLvl_Bool(tacticsBuffer1,info->level);
GetUnlockedTacticFlags(tacticsBuffer1,info->level);
}
maxHP = info->maxHPStat;
atk[0] = info->atk[0];
@ -210,9 +210,9 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para
newLevel = 100;
}
if (newLevel != info->level) {
GetPokemonLevelData(&leveldata,info->id,newLevel);
GetLvlUpEntry(&leveldata,info->id,newLevel);
info->exp = leveldata.expRequired;
flag |= (sub_80723D0(pokemon,target,param_4,param_5));
flag |= (LevelUp(pokemon,target,param_4,param_5));
if ((flag != 0) && (!info->isNotTeamMember)) {
gFormatArgs[0] = info->maxHPStat - maxHP;
gFormatArgs[1] = info->atk[0] - atk[0];
@ -226,7 +226,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para
}
}
if (info->isTeamLeader) {
GetAvailTacticsforLvl_Bool(tacticsBuffer2,info->level);
GetUnlockedTacticFlags(tacticsBuffer2,info->level);
for(tacticIndex = 0; tacticIndex < NUM_TACTICS; tacticIndex++)
{
if ((tacticsBuffer1[tacticIndex] == 0) && (tacticsBuffer2[tacticIndex] == 1)) {
@ -344,7 +344,7 @@ void LevelDownTarget(Entity *pokemon, Entity *target, u32 level)
if(newLevel != info->level)
{
GetPokemonLevelData(&leveldata, info->id, newLevel);
GetLvlUpEntry(&leveldata, info->id, newLevel);
info->exp = leveldata.expRequired;
flag |= sub_80725A4(pokemon, target);
}
@ -360,7 +360,7 @@ void LevelDownTarget(Entity *pokemon, Entity *target, u32 level)
}
}
bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4)
static bool8 LevelUp(Entity *pokemon, Entity *target, u8 param_3, u8 param_4)
{
EntityInfo *info;
LevelData leveldata;
@ -380,7 +380,7 @@ bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4)
for(level = info->level + 1; level <= 100; level++)
{
GetPokemonLevelData(&leveldata, id, level);
GetLvlUpEntry(&leveldata, id, level);
if(leveldata.expRequired > exp) break;
info->level = level;
@ -476,7 +476,7 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target)
for(level = 1; level < info->level; level++)
{
GetPokemonLevelData(&leveldata, id, level);
GetLvlUpEntry(&leveldata, id, level);
if(leveldata.expRequired >= exp) break;
}
@ -486,7 +486,7 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target)
{
if(level < 100)
{
GetPokemonLevelData(&leveldata, id, level + 1);
GetLvlUpEntry(&leveldata, id, level + 1);
info->exp = leveldata.expRequired - 1;
}
else
@ -496,7 +496,7 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target)
if(oldLevel > level)
{
GetPokemonLevelData(&leveldata, id, level + 1);
GetLvlUpEntry(&leveldata, id, level + 1);
info->level = level;
@ -789,7 +789,7 @@ void sub_8072B78(Entity *pokemon, Entity *target, s16 id)
CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[1],id_s32);
file = GetSpriteData(id_s32);
fu(entityInfo, id_s32);
GetPokemonLevelData(&levelData,id_s32,entityInfo->level);
GetLvlUpEntry(&levelData,id_s32,entityInfo->level);
entityInfo->exp = levelData.expRequired;
target->axObj.spriteFile = file;
ResetMonEntityData(entityInfo,0);

View File

@ -30,8 +30,8 @@
#include "math.h"
#include "dungeon_config.h"
#include "dungeon_strings.h"
#include "dungeon_engine.h"
extern bool8 sub_8044B28(void);
extern void DealDamageToEntity(Entity *, s32, u32, u32);
extern void sub_805229C(void);
extern void sub_807E8F0(Entity *);
@ -42,19 +42,18 @@ extern void sub_8041C4C(Entity *pokemon, u32 r1);
extern void sub_805E804(void);
extern void sub_80838EC(u8 *a);
extern bool8 TryUseChosenMove(struct Entity *, u32, u32, u32, u32, struct Move *);
extern bool8 sub_8045888(Entity *);
extern void nullsub_97(Entity *entity);
extern void sub_805EE30(void);
extern void sub_8086AC0(void);
extern void sub_8085140(void);
extern void sub_8075708(Entity *entity);
extern void sub_8043ED0(u32);
extern void sub_8071DA4(Entity *);
extern void EnemyEvolution(Entity *);
extern void sub_8075900(Entity *pokemon, u8 r1);
extern void sub_806A5B8(Entity *);
extern void sub_807EC28(bool8);
bool8 UseAttack(Entity *a0);
bool8 DisplayActions(Entity *a0);
void sub_8074094(Entity *entity)
{
@ -63,7 +62,7 @@ void sub_8074094(Entity *entity)
if (entity == NULL)
return;
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
entityInfo = GetEntInfo(entity);
@ -76,8 +75,8 @@ void sub_8074094(Entity *entity)
if (DungeonRandInt(100) < gWarpScarfActivationChances[entityInfo->turnsSinceWarpScarfActivation]) {
entityInfo->turnsSinceWarpScarfActivation = 0;
sub_80444F4(entity);
UseAttack(NULL);
if (!EntityIsValid(entity) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || IsFloorOver())
return;
WarpTarget(entity, entity, 0, NULL);
if (entityInfo->isTeamLeader) {
@ -137,8 +136,8 @@ void sub_8074094(Entity *entity)
if (FixedPointToInt(entityInfo->belly) == 0) {
sub_805E804();
sub_80444F4(entity);
UseAttack(NULL);
if (!EntityIsValid(entity) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (gDungeon->unk644.unk35 < 10)
gDungeon->unk644.unk35++;
@ -167,7 +166,7 @@ void sub_8074094(Entity *entity)
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (gDungeon->weather.weatherDamageCounter == 0) {
if (GetApparentWeather(entity) == WEATHER_HAIL) {
@ -180,15 +179,15 @@ void sub_8074094(Entity *entity)
DealDamageToEntity(entity, gHailSandstormDmgValue, 0x12, 0x220);
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
}
// Abilities check
rand = DungeonRandInt(100);
if (AbilityIsActive(entity, ABILITY_SHED_SKIN) && rand < gShedSkinActivateChance && HasNegativeStatus(entity)) {
UseAttack(NULL);
if (!EntityIsValid(entity) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || IsFloorOver())
return;
sub_8079F20(entity, entity, 1, 0);
}
@ -202,35 +201,35 @@ void sub_8074094(Entity *entity)
// Statuses
if (entityInfo->sleepClassStatus.status == STATUS_YAWNING) {
UseAttack(NULL);
if (!EntityIsValid(entity) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || IsFloorOver())
return;
sub_80420B8(entity);
}
if (entityInfo->burnClassStatus.status == STATUS_BURN) {
if (entityInfo->burnClassStatus.damageCountdown == 0 || --entityInfo->burnClassStatus.damageCountdown == 0) {
UseAttack(NULL);
if (!EntityIsValid(entity) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || IsFloorOver())
return;
entityInfo->burnClassStatus.damageCountdown = gBurnDmgCountdown;
TrySendImmobilizeSleepEndMsg(entity, entity);
DealDamageToEntity(entity, gBurnDmgValue, 1, 0x208);
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
}
if (entityInfo->burnClassStatus.status == STATUS_POISONED) {
if (entityInfo->burnClassStatus.damageCountdown == 0 || --entityInfo->burnClassStatus.damageCountdown == 0) {
UseAttack(NULL);
if (!EntityIsValid(entity) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || IsFloorOver())
return;
entityInfo->burnClassStatus.damageCountdown = gPoisonDmgCountdown;
TrySendImmobilizeSleepEndMsg(entity, entity);
DealDamageToEntity(entity, gPoisonDmgValue, 3, 0x20A);
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
}
else if (entityInfo->burnClassStatus.status == STATUS_BADLY_POISONED) {
@ -242,46 +241,46 @@ void sub_8074094(Entity *entity)
if (turns >= BAD_POISON_DMG_TURN_VALUES_COUNT - 1)
turns = BAD_POISON_DMG_TURN_VALUES_COUNT - 1;
UseAttack(NULL);
if (!EntityIsValid(entity) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || IsFloorOver())
return;
TrySendImmobilizeSleepEndMsg(entity, entity);
DealDamageToEntity(entity, gBadPoisonDmgValuesByTurn[turns], 3, 0x20A);
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
}
if (entityInfo->frozenClassStatus.status == STATUS_CONSTRICTION) {
if (entityInfo->frozenClassStatus.damageCountdown == 0 || --entityInfo->frozenClassStatus.damageCountdown == 0) {
UseAttack(NULL);
if (!EntityIsValid(entity) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || IsFloorOver())
return;
entityInfo->frozenClassStatus.damageCountdown = gConstrictionDmgCountdown;
TrySendImmobilizeSleepEndMsg(entity, entity);
sub_8041C4C(entity, entityInfo->frozenClassStatus.unk4);
DealDamageToEntity(entity, gConstrictionDmgValue, 2, 0x209);
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
}
else if (entityInfo->frozenClassStatus.status == STATUS_WRAPPED) {
if (entityInfo->frozenClassStatus.damageCountdown == 0 || --entityInfo->frozenClassStatus.damageCountdown == 0) {
UseAttack(NULL);
if (!EntityIsValid(entity) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || IsFloorOver())
return;
entityInfo->frozenClassStatus.damageCountdown = gWrapDmgCountdown;
TrySendImmobilizeSleepEndMsg(entity, entity);
DealDamageToEntity(entity, gWrapDmgValue, 5, 0x20B);
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
}
else if (entityInfo->frozenClassStatus.status == STATUS_INGRAIN) {
if (entityInfo->frozenClassStatus.damageCountdown == 0 || --entityInfo->frozenClassStatus.damageCountdown == 0) {
UseAttack(NULL);
if (!EntityIsValid(entity) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || IsFloorOver())
return;
entityInfo->frozenClassStatus.damageCountdown = gIngrainHealCountdown;
HealTargetHP(entity, entity, gIngrainHealValue, 0, TRUE);
@ -294,14 +293,14 @@ void sub_8074094(Entity *entity)
if (dmg == 0)
dmg = 1;
entityInfo->curseClassStatus.damageCountdown = gCurseDmgCountdown;
UseAttack(NULL);
if (!EntityIsValid(entity) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || IsFloorOver())
return;
TrySendImmobilizeSleepEndMsg(entity, entity);
DealDamageToEntity(entity, dmg, 7, 0x20C);
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
}
@ -322,8 +321,8 @@ void sub_8074094(Entity *entity)
else {
bool8 dmgUser = AbilityIsActive(entity, ABILITY_LIQUID_OOZE);
sub_80444F4(entity);
UseAttack(NULL);
if (!EntityIsValid(entity) || !EntityIsValid(target) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || !EntityIsValid(target) || IsFloorOver())
return;
if (entityInfo->frozenClassStatus.status != STATUS_FROZEN) {
@ -340,15 +339,15 @@ void sub_8074094(Entity *entity)
}
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
}
if (entityInfo->perishSongTurns != 0) {
sub_80838EC(&entityInfo->perishSongTurns);
if (entityInfo->perishSongTurns == 0) {
UseAttack(NULL);
if (!EntityIsValid(entity) || sub_8044B28())
DisplayActions(NULL);
if (!EntityIsValid(entity) || IsFloorOver())
return;
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], entity, 0);
LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FEB30);
@ -359,7 +358,7 @@ void sub_8074094(Entity *entity)
else {
DealDamageToEntity(entity, 0x270F, 0xB, 0x20E);
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
}
}
@ -371,18 +370,18 @@ void sub_8074094(Entity *entity)
if (!CheckVariousStatuses2(entity, FALSE) && !CannotAttack(entity, FALSE) && !CheckVariousStatuses(entity)) {
Move bideMove;
UseAttack(NULL);
DisplayActions(NULL);
InitPokemonMove(&bideMove, MOVE_BIDE_2);
bideMove.moveFlags |= MOVE_FLAG_LAST_USED;
TryUseChosenMove(entity, 0, 0, 0, 0, &bideMove);
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
entityInfo->unkA0 = 0;
}
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (entityInfo->bideClassStatus.status == STATUS_ENRAGED) {
@ -395,7 +394,7 @@ void sub_8074094(Entity *entity)
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
}
@ -407,7 +406,7 @@ void TickStatusHeal(Entity *entity)
if (entity == NULL)
return;
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
sub_805229C();
@ -450,7 +449,7 @@ void TickStatusHeal(Entity *entity)
EndSleepClassStatus(entity, entity, TRUE, TRUE);
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (entityInfo->burnClassStatus.status != 0) {
@ -459,7 +458,7 @@ void TickStatusHeal(Entity *entity)
EndBurnClassStatus(entity, entity);
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (entityInfo->frozenClassStatus.status != 0) {
@ -468,7 +467,7 @@ void TickStatusHeal(Entity *entity)
EndFrozenClassStatus(entity, entity);
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (entityInfo->cringeClassStatus.status != 0) {
@ -477,7 +476,7 @@ void TickStatusHeal(Entity *entity)
EndCringeClassStatus(entity, entity);
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (entityInfo->reflectClassStatus.status != 0) {
@ -486,7 +485,7 @@ void TickStatusHeal(Entity *entity)
EndReflectClassStatus(entity, entity);
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (entityInfo->curseClassStatus.status != 0) {
@ -495,7 +494,7 @@ void TickStatusHeal(Entity *entity)
EndCurseClassStatus(entity, entity, 0);
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (entityInfo->leechSeedClassStatus.status != 0) {
@ -504,7 +503,7 @@ void TickStatusHeal(Entity *entity)
EndLeechSeedClassStatus(entity, entity);
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (entityInfo->sureShotClassStatus.status != 0) {
@ -513,7 +512,7 @@ void TickStatusHeal(Entity *entity)
SendMoveEndMessage(entity, entity);
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (entityInfo->invisibleClassStatus.status != 0) {
@ -522,7 +521,7 @@ void TickStatusHeal(Entity *entity)
SendTransformEndMessage(entity, entity);
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (entityInfo->blinkerClassStatus.status != 0) {
@ -531,7 +530,7 @@ void TickStatusHeal(Entity *entity)
SendEyesightEndMessage(entity, entity);
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (entityInfo->muzzled.muzzled != 0) {
@ -540,7 +539,7 @@ void TickStatusHeal(Entity *entity)
SendMuzzledEndMessage(entity, entity);
}
}
if (!EntityIsValid(entity) || sub_8044B28())
if (!EntityIsValid(entity) || IsFloorOver())
return;
if (entityInfo->terrifiedTurns != 0) {

View File

@ -40,9 +40,9 @@
#include "code_8077274_1.h"
#include "math.h"
#include "dungeon_config.h"
#include "dungeon_engine.h"
extern void sub_8073D14(Entity *);
extern bool8 sub_8044B28(void);
extern void sub_8075708(Entity *entity);
extern void DealDamageToEntity(Entity *, s32, u32, u32);
extern void sub_805229C(void);
@ -54,14 +54,13 @@ extern void sub_8041C4C(Entity *pokemon, u32 r1);
extern void sub_805E804(void);
extern void sub_80838EC(u8 *a);
extern bool8 TryUseChosenMove(struct Entity *, u32, u32, u32, u32, struct Move *);
extern bool8 sub_8045888(Entity *);
extern void nullsub_97(Entity *entity);
extern void sub_805EE30(void);
extern void CheckLeaderTile(void);
extern void sub_8086AC0(void);
extern void sub_8085140(void);
extern void sub_8075708(Entity *entity);
extern void sub_8043ED0(u32);
extern void sub_8071DA4(Entity *);
extern void TryForcedLoss(u32);
extern void EnemyEvolution(Entity *);
extern void sub_8075900(Entity *pokemon, u8 r1);
extern void sub_806A5B8(Entity *);
extern void sub_807EC28(bool8);
@ -157,7 +156,7 @@ void sub_8075050(EntityInfo *info, Unk_Entity_x184 *strPtr)
}
}
bool8 UseAttack(Entity *a0)
bool8 DisplayActions(Entity *a0)
{
s32 i, j, loop;
Entity *savedEntityPtr;
@ -193,11 +192,11 @@ bool8 UseAttack(Entity *a0)
monInfo->flags |= 0x2000;
pos.x = X_POS_TO_PIXELPOS(monInfo->unk184[0].previousTargetMovePosition2.x);
pos.y = Y_POS_TO_PIXELPOS(monInfo->unk184[0].previousTargetMovePosition2.y);
sub_804535C(mon, &pos);
UpdateEntityPixelPos(mon, &pos);
sub_806CDFC(mon, 0, monInfo->unk184[0].lastMoveDirection);
monInfo->notMoving = 0;
r7 = TRUE;
if (sub_8045888(mon))
if (ShouldDisplayEntity(mon))
r9 = TRUE;
}
}
@ -230,7 +229,7 @@ bool8 UseAttack(Entity *a0)
pos.x = X_POS_TO_PIXELPOS(monInfo->unk184[monInfo->notMoving].previousTargetMovePosition2.x);
pos.y = Y_POS_TO_PIXELPOS(monInfo->unk184[monInfo->notMoving].previousTargetMovePosition2.y);
sub_804535C(mon, &pos);
UpdateEntityPixelPos(mon, &pos);
sub_806CDFC(mon, 0, monInfo->unk184[monInfo->notMoving].lastMoveDirection);
}
}
@ -247,7 +246,7 @@ bool8 UseAttack(Entity *a0)
monInfo->numMoveTiles = 0;
nullsub_97(mon);
if (monInfo->flags & 0x2000) {
sub_804535C(mon, NULL);
UpdateEntityPixelPos(mon, NULL);
}
}
}
@ -261,7 +260,7 @@ bool8 UseAttack(Entity *a0)
if (!EntityIsValid(mon))
continue;
if (sub_8044B28())
if (IsFloorOver())
break;
monInfo = GetEntInfo(mon);
@ -278,30 +277,30 @@ bool8 UseAttack(Entity *a0)
if (monInfo->isTeamLeader) {
sub_804AC20(&mon->pos);
sub_807EC28(FALSE);
sub_805EE30();
CheckLeaderTile();
}
else {
sub_8075708(mon);
}
if (!EntityIsValid(mon))
continue;
if (sub_8044B28())
if (IsFloorOver())
break;
sub_8043ED0(0);
TryForcedLoss(0);
sub_8074094(mon);
if (!EntityIsValid(mon))
continue;
if (sub_8044B28())
if (IsFloorOver())
break;
sub_8071DA4(mon);
EnemyEvolution(mon);
sub_8046D20();
sub_8075900(mon, gDungeon->forceMonsterHouse);
}
if (!EntityIsValid(mon))
continue;
if (sub_8044B28())
if (IsFloorOver())
break;
if (monPosBefore.x != mon->pos.x || monPosBefore.y != mon->pos.y)
@ -315,7 +314,7 @@ bool8 UseAttack(Entity *a0)
}
sub_8086AC0();
if (!sub_8044B28()) {
if (!IsFloorOver()) {
sub_8085140();
gDungeon->unkB8 = savedEntityPtr;
}
@ -384,12 +383,12 @@ void sub_8075708(Entity *entity)
switch(GetEntityType(trap)) {
case ENTITY_TRAP:
trapData = GetTrapData(trap);
trapData = GetTrapInfo(trap);
bVar1 = FALSE;
bVar2 = FALSE;
if ((IQSkillIsEnabled(entity, IQ_TRAP_SEER)) && (!trap->isVisible)) {
trap->isVisible = TRUE;
sub_8049ED4();
UpdateTrapsVisibility();
bVar2 = TRUE;
}
@ -412,7 +411,7 @@ void sub_8075708(Entity *entity)
}
_ret:
if (!bVar2) {
HandleTrap(entity, &entity->pos, 0, 1);
TryTriggerTrap(entity, &entity->pos, 0, 1);
}
break;
case ENTITY_ITEM:
@ -453,7 +452,7 @@ u32 sub_8075818(Entity *entity)
case ENTITY_UNK_5:
break;
case ENTITY_TRAP:
trapData = GetTrapData(subEntity);
trapData = GetTrapInfo(subEntity);
r1 = 0;
if(trapData->unk1 == 0)
{
@ -490,7 +489,7 @@ flag_check:
break;
else
{
item = GetItemData(subEntity);
item = GetItemInfo(subEntity);
if(!(item->flags & ITEM_FLAG_IN_SHOP))
{
return 1;
@ -499,7 +498,7 @@ flag_check:
}
else
{
item = GetItemData(subEntity);
item = GetItemInfo(subEntity);
if(!(item->flags & ITEM_FLAG_IN_SHOP))
{
error:
@ -517,7 +516,6 @@ error:
extern char *gPtrItsaMonsterHouseMessage;
extern u8 sub_8044B28(void);
extern void sub_807AB38(Entity *, u32);
extern void sub_8041888(u32);
@ -527,7 +525,7 @@ void sub_8075900(Entity *pokemon, u8 r1)
{
if(!GetEntInfo(pokemon)->isNotTeamMember)
{
if(!sub_8044B28())
if(!IsFloorOver())
{
if(!gDungeon->unk644.monsterHouseTriggered)
{

View File

@ -35,6 +35,7 @@
#include "pokemon_3.h"
#include "dungeon_boss_dialogue.h"
#include "dungeon_pos_data.h"
#include "dungeon_engine.h"
struct RgbS16
{
@ -66,7 +67,6 @@ extern void sub_8085F44(s32);
extern void sub_8052FB8(const u8 *);
extern void BgColorCallNullsub4(void);
extern void PlaySoundEffect(u32);
extern u8 sub_8044B28(void);
extern void sub_8085EB0(void);
extern void sub_803E748(void);
extern s32 GetCameraXPos(void);
@ -934,7 +934,7 @@ Entity *GetEntityFromMonsterBehavior(u8 entityType)
void sub_80856C8(Entity * pokemon, s32 x, s32 y)
{
sub_80694C0(pokemon, x, y, 1);
sub_804535C(pokemon,NULL);
UpdateEntityPixelPos(pokemon,NULL);
}
void sub_80856E0(Entity * pokemon, s32 direction)
@ -973,7 +973,7 @@ void sub_8085764(void)
{
entity = gDungeon->wildPokemon[index];
if ((EntityIsValid(entity)) && (GetEntInfo(entity)->monsterBehavior == BEHAVIOR_ALLY)) {
sub_8068FE0(entity,0x207,&stackEntity);
HandleFaint(entity,0x207,&stackEntity);
}
}
}
@ -991,7 +991,7 @@ void sub_80857B8(void)
if (EntityIsValid(entity)) {
entityInfo = GetEntInfo(entity);
if ((gDungeon->unk4 == 0) && (gDungeon->unk2 == 0)) {
sub_804535C(entity, 0);
UpdateEntityPixelPos(entity, 0);
entityInfo->unk15C = 0;
entityInfo->unkFE = 99;
direction = &entityInfo->action.direction;
@ -1524,7 +1524,7 @@ static void sub_80862DC(Entity *entity)
pos.x = entity->pixelPos.x;
pos.y = entity->pixelPos.y + 0x3800;
sub_804535C(entity, &pos);
UpdateEntityPixelPos(entity, &pos);
sub_806CDD4(entity, 0, DIRECTION_NORTH);
sub_8086A54(entity);
}
@ -1535,7 +1535,7 @@ static void sub_8086310(Entity *entity)
pos.x = entity->pixelPos.x;
pos.y = entity->pixelPos.y + 0x9000;
sub_804535C(entity, &pos);
UpdateEntityPixelPos(entity, &pos);
sub_806CE68(entity, DIRECTION_SOUTH);
sub_8086A3C(entity);
entity->isVisible = 0;
@ -1547,7 +1547,7 @@ static void sub_8086348(Entity *entity)
pos.x = entity->pixelPos.x + 0x7800;
pos.y = entity->pixelPos.y - 0x2000;
sub_804535C(entity, &pos);
UpdateEntityPixelPos(entity, &pos);
sub_806CDD4(entity, 0, DIRECTION_WEST);
sub_8086A54(entity);
}
@ -1558,7 +1558,7 @@ static void sub_8086384(Entity *entity)
pos.x = entity->pixelPos.x + 0x7800;
pos.y = entity->pixelPos.y;
sub_804535C(entity, &pos);
UpdateEntityPixelPos(entity, &pos);
sub_806CDD4(entity, 0, DIRECTION_WEST);
sub_8086A54(entity);
}
@ -2000,7 +2000,7 @@ void SetupBossFightHP(Entity *pokemon, s32 newHP, u16 songIndex)
void sub_8086AC0(void)
{
if(!sub_8044B28())
if(!IsFloorOver())
if(gDungeon->unk2 == 0)
sub_8097FF8();
}

View File

@ -144,7 +144,7 @@ bool8 ValidateWonderMail(WonderMail *data)
if(IsInvalidItemReward(data->targetItem))
return FALSE;
if(IsThrowableItem(data->targetItem))
if(IsThrownItem(data->targetItem))
return FALSE;
if(!IsNotMoneyOrUsedTMItem(data->targetItem))
return FALSE;
@ -417,7 +417,7 @@ u8 sub_8095F28(u8 param_1)
{
if ((param_1 == 0x63) ||
(xxx_bit_lut_lookup_8091E50(param_1, itemID) != 0)) {
if ((!IsThrowableItem(itemID)) && (IsNotMoneyOrUsedTMItem(itemID))) {
if ((!IsThrownItem(itemID)) && (IsNotMoneyOrUsedTMItem(itemID))) {
itemStack[counter] = itemID;
counter++;
}

View File

@ -71,7 +71,7 @@ void HandleDroughtOrbAction(Entity *pokemon, Entity *target)
LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FD060);
}
gDungeon->unk644.unk2C = 1;
sub_806CF60();
DetermineAllMonsterShadow();
ShowWholeRevealedDungeonMap();
sub_8049ED4();
UpdateTrapsVisibility();
}

View File

@ -30,6 +30,7 @@
#include "dungeon_config.h"
#include "dungeon_misc.h"
#include "dungeon_pos_data.h"
#include "dungeon_engine.h"
extern u8 gUnknown_202F221;
extern u8 gUnknown_202F222;
@ -70,8 +71,7 @@ void HandleTakeItemAction(Entity *);
void HandleUseItemAction(Entity *);
void sub_8066FA4(Entity *);
void HandleUnsetItemAction(Entity *,bool8);
extern u8 sub_8044B28(void);
extern u8 UseAttack(Entity *);
extern u8 DisplayActions(Entity *);
void sub_806A1E8(Entity *pokemon);
bool8 sub_804AE08(DungeonPos *pos);
void HandlePickUpAIAction(Entity *pokemon);
@ -79,7 +79,7 @@ void HandleThrowItemAIAction(Entity *pokemon);
void HandleEatAIAction(Entity *pokemon);
bool8 sub_8044B84(void);
extern void sub_8074094(Entity *);
extern void sub_8071DA4(Entity *);
extern void EnemyEvolution(Entity *);
u32 sub_8075818(Entity *entity);
extern void MarkLastUsedMonMove(Entity *entity, Move *move);
bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, bool32 isLinkedMove, struct Move *move);
@ -125,8 +125,8 @@ bool8 sub_8072CF4(Entity *entity)
}
}
if (!IsNotAttacking(entity, FALSE)) {
if (UseAttack(entity)) {
if (sub_8044B28()) {
if (DisplayActions(entity)) {
if (IsFloorOver()) {
return FALSE;
}
if (!EntityIsValid(entity)) {
@ -280,7 +280,7 @@ bool8 sub_8072CF4(Entity *entity)
sub_8067904(entity, MOVE_REGULAR_ATTACK);
break;
case ACTION_STEPPED_ON_TRAP:
HandleTrap(entity,&entity->pos,0,0);
TryTriggerTrap(entity,&entity->pos,0,0);
break;
case ACTION_PICK_UP_AI:
HandlePickUpAIAction(entity);
@ -345,7 +345,7 @@ bool8 sub_8072CF4(Entity *entity)
WarpTarget(entity,entity,0,0);
}
sub_8074094(entity);
sub_8071DA4(entity);
EnemyEvolution(entity);
}
}
}

View File

@ -20,18 +20,15 @@
#include "dungeon_engine.h"
#include "run_dungeon.h"
extern bool8 sub_8044B28(void);
extern void sub_8086AC0(void);
extern void UseAttack(u32);
extern void DisplayActions(u32);
extern void TriggerWeatherAbilities(void);
extern void sub_8071DA4(Entity *);
extern void EnemyEvolution(Entity *);
extern void TickStatusHeal(Entity *);
EWRAM_DATA SubMenuAction gDungeonSubMenu[10] = {0};
EWRAM_DATA s32 gDungeonSubMenuItemsCount = 0;
extern bool8 sub_8045888(Entity *);
static const u16 gUnknown_80F6964[NUM_ITEM_CATEGORIES] = {
[CATEGORY_THROWN_LINE] = 0,
[CATEGORY_THROWN_ARC] = 0,
@ -127,7 +124,7 @@ Item * sub_8044CC8(Entity *param_1, ActionParameter *param_2, UNUSED s32 a3)
}
else if (param_2->actionUseIndex == 0x80) {
tile = GetTile((param_2->itemPos).x,(param_2->itemPos).y);
item = GetItemData(tile->object);
item = GetItemInfo(tile->object);
}
else {
if (param_2->actionUseIndex == 0x81) {
@ -163,7 +160,7 @@ bool8 sub_8044D40(ActionContainer *param_1,s32 index)
if (puVar1->actionUseIndex != 0x80) {
return FALSE;
}
RemoveItemFromDungeonAt(&puVar1->itemPos,1);
RemoveGroundItem(&puVar1->itemPos,1);
}
return TRUE;
}
@ -198,7 +195,7 @@ void sub_8044DF0(Entity *entity, s32 index, u32 unused)
info = GetEntInfo(entity);
item = sub_8044D90(entity,index,unused);
if ((info->action).actionParameters[0].actionUseIndex == 0x80) {
RemoveItemFromDungeonAt(&(info->action).actionParameters[0].itemPos,1);
RemoveGroundItem(&(info->action).actionParameters[0].itemPos,1);
}
else {
item->id = ITEM_NOTHING;
@ -222,10 +219,10 @@ void sub_8044E24(Entity *entity,int index,u32 unused)
if (info->action.actionParameters[index].actionUseIndex == 0x80) {
item = *itemPtr;
pos = &info->action.actionParameters[index].itemPos;
RemoveItemFromDungeonAt(pos,1);
RemoveGroundItem(pos,1);
item.quantity = itemPtr->id - 125;
item.id = ITEM_TM_USED_TM;
AddItemToDungeonAt(pos,&item,1);
SpawnItem(pos,&item,1);
}
else {
itemPtr->quantity = itemPtr->id - 125;
@ -315,7 +312,7 @@ bool8 IsNotAttacking(Entity *param_1, bool8 param_2)
info = GetEntInfo(param_1);
action = &(info->action).action;
if ((param_2 == 0) || (sub_8045888(param_1)))
if ((param_2 == 0) || (ShouldDisplayEntity(param_1)))
{
if(*action == ACTION_NOTHING)
return TRUE;

View File

@ -31,6 +31,7 @@
#include "dungeon_misc.h"
#include "type_effectiveness.h"
#include "dungeon_pos_data.h"
#include "dungeon_engine.h"
#define REGULAR_ATTACK_INDEX 4
@ -45,13 +46,12 @@ EWRAM_DATA u8 gPotentialAttackTargetDirections[NUM_DIRECTIONS] = {0};
EWRAM_DATA s32 gPotentialAttackTargetWeights[NUM_DIRECTIONS] = {0};
EWRAM_DATA Entity *gPotentialTargets[NUM_DIRECTIONS] = {0};
extern bool8 sub_8044B28(void);
extern void sub_806A1B0(Entity *);
extern Item *sub_8044D90(Entity *, s32, u32);
extern bool8 sub_8044D40(ActionContainer *, u32);
extern void sub_8045BF8(u8 *, struct Item *);
extern void sub_8044DF0(struct Entity *, u32, u32);
extern void sub_8071DA4(struct Entity *);
extern void EnemyEvolution(struct Entity *);
extern void sub_804AC20(DungeonPos *);
extern void sub_807EC28(bool8);
extern void sub_806A5B8(struct Entity *entity);
@ -936,7 +936,7 @@ void HandleUseMoveAIAction(Entity *target)
sub_8055A00(target, entityInfo->action.actionParameters[0].actionUseIndex, 1, 0, 0);
if (!EntityIsValid(target))
break;
if (sub_8044B28())
if (IsFloorOver())
break;
if (entityInfo->unk159)
break;
@ -1035,7 +1035,7 @@ void HandleUseOrbAction(Entity *pokemon)
if (r4)
sub_8044DF0(pokemon, 0, 122);
sub_8071DA4(pokemon);
EnemyEvolution(pokemon);
sub_806CE68(pokemon, 8);
if (entityInfo->isTeamLeader) {
@ -1049,7 +1049,7 @@ void HandleUseOrbAction(Entity *pokemon)
else if (r4)
sub_8044D40(&act, 0);
if (!sub_8044B28())
if (!IsFloorOver())
sub_806A1B0(pokemon);
}

View File

@ -24,11 +24,11 @@
#include "dungeon_music.h"
#include "dungeon_items.h"
#include "constants/dungeon.h"
#include "dungeon_engine.h"
extern void sub_8045BF8(u8 *, Item *);
extern void sub_8067110(Entity *);
extern void sub_80671A0(Entity *);
extern bool8 sub_8044B28(void);
#define NUM_POTENTIAL_ROCK_TARGETS 20
#define GROUND_ITEM_TOOLBOX_INDEX 0x80
@ -152,7 +152,7 @@ void AIDecideUseItem(Entity *pokemon)
u32 objectType = GetEntityType(object);
if (objectType == ENTITY_ITEM)
{
item = GetItemData(mapTile->object);
item = GetItemInfo(mapTile->object);
selectedToolboxIndex = GROUND_ITEM_TOOLBOX_INDEX;
}
else
@ -441,7 +441,7 @@ void sub_8073D14(Entity *entity)
Entity *tileObject = GetTileAtEntitySafe(entity)->object;
if (tileObject == NULL)
return;
if (sub_8044B28())
if (IsFloorOver())
return;
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0);
if (entityInfo->isTeamLeader)
@ -454,7 +454,7 @@ void sub_8073D14(Entity *entity)
return;
_entityInfo = GetEntInfo(entity); // Reloaded as a new variable for some reason.
groundItem = GetItemData(tileObject);
groundItem = GetItemInfo(tileObject);
if (groundItem->flags & ITEM_FLAG_IN_SHOP)
return;
@ -473,7 +473,7 @@ void sub_8073D14(Entity *entity)
}
AddToTeamMoney(GetMoneyValue(groundItem));
sub_8045BF8(gFormatBuffer_Items[0], groundItem);
RemoveItemFromDungeonAt(&entity->pos, 1);
RemoveGroundItem(&entity->pos, 1);
DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem);
}
else {
@ -535,7 +535,7 @@ void sub_8073D14(Entity *entity)
carriedItems[newInventoryId]->flags |= ITEM_FLAG_STICKY;
sub_8045BF8(gFormatBuffer_Items[0], groundItem);
RemoveItemFromDungeonAt(&entity->pos, 1);
RemoveGroundItem(&entity->pos, 1);
PlaySoundEffect(0x14A);
if (inventoryIds[newInventoryId] <= -1)
DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem2);
@ -566,7 +566,7 @@ void sub_8073D14(Entity *entity)
if (inventoryIds[i] <= -1) {
_entityInfo->heldItem = *groundItem;
sub_8045BF8(gFormatBuffer_Items[0], groundItem);
RemoveItemFromDungeonAt(&entity->pos, 1);
RemoveGroundItem(&entity->pos, 1);
DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem2);
}
else if (AddItemToInventory(groundItem)) {
@ -575,7 +575,7 @@ void sub_8073D14(Entity *entity)
}
else {
sub_8045BF8(gFormatBuffer_Items[0], groundItem);
RemoveItemFromDungeonAt(&entity->pos, 1);
RemoveGroundItem(&entity->pos, 1);
DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItemToolbox);
}
}

View File

@ -125,7 +125,7 @@ bool8 CanTakeItem(Entity *pokemon)
if (!pokemonInfo->isTeamLeader &&
!(pokemonInfo->heldItem.flags & ITEM_FLAG_EXISTS) &&
((mapTile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) || !pokemonInfo->isNotTeamMember) &&
!(GetItemData(object)->flags & ITEM_FLAG_IN_SHOP))
!(GetItemInfo(object)->flags & ITEM_FLAG_IN_SHOP))
{
return TRUE;
}

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -109,7 +109,7 @@ void sub_8087FF8(void)
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
if (sub_8086AE4(MONSTER_ARTICUNO)) {
sub_8068FE0(articunoEntity,0x21c,0);
HandleFaint(articunoEntity,0x21c,0);
}
else {
sub_8072008(articunoEntity,articunoEntity,gArticunoConfigLevel,0,0);

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -100,7 +100,7 @@ void CelebiJoinDialogue(void)
celebiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_CELEBI);
if ((HasRecruitedMon(MONSTER_CELEBI)) || (!sub_806FD18(celebiEntity)))
{
sub_8068FE0(celebiEntity,0x21c,0);
HandleFaint(celebiEntity,0x21c,0);
SpriteLookAroundEffect(leaderEntity);
sub_803E708(10,0x46);
// .........

View File

@ -51,7 +51,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -158,7 +158,7 @@ static void sub_808C550(void)
static void sub_808C590(Entity *r0)
{
sub_8068FE0(r0, 0x21C, 0);
HandleFaint(r0, 0x21C, 0);
}
static void SetupDeoxysFacingDirection(Entity *deoxysEntity)

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -89,7 +89,7 @@ void sub_8089C90(void)
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
if (HasRecruitedMon(MONSTER_ENTEI)) {
sub_8068FE0(EnteiEntity,0x21c,0);
HandleFaint(EnteiEntity,0x21c,0);
}
else {
SetFacingDirection(EnteiEntity, DIRECTION_SOUTH);

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -106,7 +106,7 @@ void sub_80886C4(void)
sub_8085374();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_8068FE0(alakazamEntity,0x21c,0);
HandleFaint(alakazamEntity,0x21c,0);
SetFacingDirection(groudonEntity, DIRECTION_SOUTH);
sub_8086A3C(groudonEntity);
sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y);
@ -130,9 +130,9 @@ void sub_808875C(void)
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
sub_8068FE0(alakazamEntity,0x21c,0);
HandleFaint(alakazamEntity,0x21c,0);
if (sub_8086AE4(MONSTER_GROUDON)) {
sub_8068FE0(groudonEntity,0x21c,0);
HandleFaint(groudonEntity,0x21c,0);
}
else {
sub_8072008(groudonEntity,groudonEntity,gGroudonConfigLevel,0,0);
@ -200,7 +200,7 @@ void GroudonPreFightDialogue(void)
sub_80861B8(alakazamEntity,6,DIRECTION_NORTH);
PlaySoundEffect(0x205);
sub_8086738();
sub_8068FE0(alakazamEntity,0x21c,0);
HandleFaint(alakazamEntity,0x21c,0);
DisplayDungeonDialogue(&GroudonPreFightDialogue_8);
sub_803E708(10,0x46);
DisplayDungeonDialogue(&GroudonPreFightDialogue_9);

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -95,7 +95,7 @@ void sub_808A668(void)
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
if (HasRecruitedMon(MONSTER_HO_OH)) {
sub_8068FE0(HoOhEntity,0x21c,0);
HandleFaint(HoOhEntity,0x21c,0);
}
else {
SetFacingDirection(HoOhEntity, DIRECTION_SOUTH);

View File

@ -51,7 +51,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -84,7 +84,7 @@ void sub_808B2F4(void)
jirachiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_JIRACHI);
DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST);
CreateJirachiWishWarpTile();
sub_8049ED4();
UpdateTrapsVisibility();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
@ -106,13 +106,13 @@ void sub_808B35C(void)
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
if (HasRecruitedMon(MONSTER_JIRACHI)) {
sub_8068FE0(jirachiEntity,0x21c,0);
HandleFaint(jirachiEntity,0x21c,0);
}
else {
SetFacingDirection(jirachiEntity, DIRECTION_SOUTH);
sub_8086A3C(jirachiEntity);
CreateJirachiWishWarpTile();
sub_8049ED4();
UpdateTrapsVisibility();
}
sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3);
@ -509,7 +509,7 @@ static void CreateJirachiWishWarpTile(void)
tile->terrainType &= ~TERRAIN_TYPE_STAIRS;
sub_8049884();
sub_8049B8C();
sub_8049ED4();
UpdateTrapsVisibility();
ShowWholeRevealedDungeonMap();
}
@ -525,7 +525,7 @@ static void EnableJirachiWishWarpTile(void)
tile->unk8 = 1;
sub_8049884();
sub_8049B8C();
sub_8049ED4();
UpdateTrapsVisibility();
ShowWholeRevealedDungeonMap();
}

View File

@ -51,7 +51,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -81,7 +81,7 @@ void sub_808C10C(void)
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
if (HasRecruitedMon(MONSTER_KYOGRE)) {
sub_8068FE0(kyogreEntity,0x21c,0);
HandleFaint(kyogreEntity,0x21c,0);
}
else {
gDungeon->unk7 = 1;

View File

@ -51,7 +51,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -108,7 +108,7 @@ void sub_808AA94(void)
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
sub_8068FE0(LatiosEntity,0x21c,0);
HandleFaint(LatiosEntity,0x21c,0);
sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3);
CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS);
}

View File

@ -51,7 +51,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -80,7 +80,7 @@ void sub_808BDEC(void)
sub_80855E4(sub_8086A3C);
if (HasRecruitedMon(MONSTER_LUGIA)) {
DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE);
sub_8068FE0(lugiaEntity,0x21c,0);
HandleFaint(lugiaEntity,0x21c,0);
}
else {
gDungeon->unk7 = 1;

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -102,8 +102,8 @@ void sub_8088E5C(void)
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
sub_8068FE0(groudonEntity,0x21c,0);
sub_8068FE0(alakazamEntity,0x21c,0);
HandleFaint(groudonEntity,0x21c,0);
HandleFaint(alakazamEntity,0x21c,0);
sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3);
CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON);
CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM);

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -173,7 +173,7 @@ void sub_80898E4(void)
static void sub_80898F8(Entity *r0)
{
sub_8068FE0(r0, 0x21C, 0);
HandleFaint(r0, 0x21C, 0);
}
static void sub_8089908(Entity *r0)

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -124,7 +124,7 @@ void MedichamRescueDialogue(void)
sub_806CE68(medichamEntity, DIRECTION_SOUTH);
sub_803E708(0x20, 0x46);
sub_8042B0C(medichamEntity);
sub_8068FE0(medichamEntity, 0x21C, 0);
HandleFaint(medichamEntity, 0x21C, 0);
gDungeon->unk4 = 1;
gDungeon->unk11 = 4;
}
@ -139,7 +139,7 @@ void sub_808CB5C(void)
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_8068FE0(medichamEntity, 0x21C, 0);
HandleFaint(medichamEntity, 0x21C, 0);
sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y);
CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_MEDICHAM);
}

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -95,7 +95,7 @@ void sub_8089978(void)
sub_80855E4(sub_8086A3C);
if(HasRecruitedMon(MONSTER_MEWTWO)){
DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE);
sub_8068FE0(MewtwoEntity,0x21c,0);
HandleFaint(MewtwoEntity,0x21c,0);
}
else {
gDungeon->unk7 = 1;

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -101,7 +101,7 @@ void sub_8087848(void)
sub_8085930(DIRECTION_WEST);
sub_80855E4(sub_8086A3C);
if (sub_8086AE4(MONSTER_MOLTRES)) {
sub_8068FE0(moltresEntity,0x21c,0);
HandleFaint(moltresEntity,0x21c,0);
}
else {
sub_8072008(moltresEntity,moltresEntity,gMoltresConfigLevel,0,0);

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -104,7 +104,7 @@ void sub_8089F8C(void)
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
if (HasRecruitedMon(MONSTER_RAIKOU)) {
sub_8068FE0(RaikouEntity,0x21c,0);
HandleFaint(RaikouEntity,0x21c,0);
}
else {
SetFacingDirection(RaikouEntity, DIRECTION_SOUTH);

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -94,7 +94,7 @@ void sub_8089328(void)
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
if (sub_8086AE4(MONSTER_RAYQUAZA)) {
sub_8068FE0(rayquazaEntity,0x21c,0);
HandleFaint(rayquazaEntity,0x21c,0);
}
else {
sub_8072008(rayquazaEntity,rayquazaEntity,gRayquazaConfigLevel,0,0);

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -73,7 +73,7 @@ void sub_808ACC0(void)
if (HasRecruitedMon(MONSTER_REGIROCK)) {
entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGIROCK);
sub_8068FE0(entity,0x21c,0);
HandleFaint(entity,0x21c,0);
sub_8097FA8(0x22);
sub_8097FA8(0x1d);
sub_808B1CC(ITEM_ROCK_PART);
@ -100,7 +100,7 @@ void sub_808AD48(void)
if (HasRecruitedMon(MONSTER_REGICE)) {
entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGICE);
sub_8068FE0(entity,0x21c,0);
HandleFaint(entity,0x21c,0);
sub_8097FA8(0x22);
sub_8097FA8(0x1d);
sub_808B1CC(ITEM_ICE_PART);
@ -128,7 +128,7 @@ void sub_808ADCC(void)
if (HasRecruitedMon(MONSTER_REGISTEEL)) {
entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGISTEEL);
sub_8068FE0(entity,0x21c,0);
HandleFaint(entity,0x21c,0);
sub_8097FA8(0x22);
sub_8097FA8(0x1d);
sub_808B1CC(ITEM_STEEL_PART);
@ -162,7 +162,7 @@ void sub_808AE54(u8 param_1,u8 param_2,DungeonPos *param_3)
sub_808B1CC(ITEM_NOTHING);
if (!sub_8098100(0x1d)) {
ItemIdToItem(&item,ITEM_ROCK_PART,0);
sub_80464C8(GetLeader(),param_3,&item);
SpawnDroppedItemWrapper(GetLeader(),param_3,&item);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
// Something fell from Regirock's body
// Regirock was apparently guarding this item
@ -184,7 +184,7 @@ void sub_808AEC8(u8 param_1,u8 param_2,DungeonPos *param_3)
sub_808B1CC(ITEM_NOTHING);
if (!sub_8098100(0x1d)) {
ItemIdToItem(&item,ITEM_ICE_PART,0);
sub_80464C8(GetLeader(),param_3,&item);
SpawnDroppedItemWrapper(GetLeader(),param_3,&item);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
// Something fell from Regice's body
// Regice was apparently guarding this item
@ -206,7 +206,7 @@ void sub_808AF3C(u8 param_1,u8 param_2,DungeonPos *param_3)
sub_808B1CC(ITEM_NOTHING);
if (!sub_8098100(0x1d)) {
ItemIdToItem(&item,ITEM_STEEL_PART,0);
sub_80464C8(GetLeader(),param_3, &item);
SpawnDroppedItemWrapper(GetLeader(),param_3, &item);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
// Something fell from Registeel's body
// Registeel was apparently guarding this item
@ -330,9 +330,9 @@ static void sub_808B1CC(u8 itemID)
(sub_80860A8(ITEM_MUSIC_BOX) == 0)) {
ItemIdToItem(&item,itemID,0);
pos.y--;
AddItemToDungeonAt(&pos,&item,1);
SpawnItem(&pos,&item,1);
}
sub_8049ED4();
UpdateTrapsVisibility();
ShowWholeRevealedDungeonMap();
}

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -94,8 +94,8 @@ void sub_8086B94(void)
diglettEntity = GetEntityFromMonsterBehavior(BEHAVIOR_DIGLETT);
skarmoryEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SKARMORY);
sub_8068FE0(skarmoryEntity,0x21c,0);
sub_8068FE0(diglettEntity,0x21c,0);
HandleFaint(skarmoryEntity,0x21c,0);
HandleFaint(diglettEntity,0x21c,0);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y);

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -130,7 +130,7 @@ void SmeargleRescueDialogue(void)
sub_806CE68(smeargleEntity, DIRECTION_SOUTH);
sub_803E708(0x20, 0x46);
sub_8042B0C(smeargleEntity);
sub_8068FE0(smeargleEntity, 0x21C, 0);
HandleFaint(smeargleEntity, 0x21C, 0);
gDungeon->unk4 = 1;
gDungeon->unk11 = 4;
}
@ -146,7 +146,7 @@ void sub_808CD44(void)
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
sub_8068FE0(smeargleEntity, 540, 0);
HandleFaint(smeargleEntity, 540, 0);
sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3);
CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SMEARGLE);
}

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -107,7 +107,7 @@ void sub_808A308(void)
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
if (HasRecruitedMon(MONSTER_SUICUNE)) {
sub_8068FE0(SuicuneEntity,0x21c,0);
HandleFaint(SuicuneEntity,0x21c,0);
}
else {
SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH);

View File

@ -49,7 +49,7 @@ extern void sub_8041888(u32);
extern u32 sub_80861F8(u32, Entity *, u32);
extern u8 sub_80860A8(u32);
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32);
extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32);
extern void sub_807EAA0(u32, u32);
@ -104,7 +104,7 @@ void sub_808729C(void)
sub_8085930(4);
sub_80855E4(sub_8086A3C);
if (sub_8086AE4(0x91) != 0) {
sub_8068FE0(zapdosEntity,0x21c,0);
HandleFaint(zapdosEntity,0x21c,0);
}
else {
sub_8072008(zapdosEntity,zapdosEntity,gZapdosConfigLevel,0,0);

View File

@ -55,11 +55,10 @@ extern void sub_8042A24(Entity *r0);
extern void sub_806A390(Entity *r0);
extern void sub_8078084(Entity * pokemon);
extern void sub_800DBBC(void);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern bool8 DoEnemiesEvolveWhenKOed(u8 dungeon);
extern bool8 sub_806FA5C(Entity *, Entity *, struct unkStruct_8069D4C *);
extern void EntityUpdateStatusSprites(Entity *);
extern bool8 sub_8045888(Entity *r0);
extern void sub_806F500(void);
extern void sub_803F508(Entity *);
extern bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, struct DamageStruct *dmgStruct);
@ -349,7 +348,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0);
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0);
if (dmgStruct->dmg == 0) {
if (sub_8045888(attacker) && sub_8045888(target)) {
if (ShouldDisplayEntity(attacker) && ShouldDisplayEntity(target)) {
if (targetData->unk152 == 0) {
TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9688);
}
@ -365,11 +364,11 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
return FALSE;
}
else if (dmgStruct->dmg == 9999) {
if (arg8 != 0 && sub_8045888(target)) {
if (arg8 != 0 && ShouldDisplayEntity(target)) {
unkTile = GetTileAtEntitySafe(target);
sub_803E708(0x14, 0x18);
unkTile->spawnOrVisibilityFlags |= 4;
sub_8049ED4();
UpdateTrapsVisibility();
}
if (targetData->unk152 == 0) {
TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F96A8);
@ -388,7 +387,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
if (targetData->unkA0 > 999)
targetData->unkA0 = 999;
if (sub_8045888(target)) {
if (ShouldDisplayEntity(target)) {
if (dmgStruct->residualDmgType != 14) {
sub_803ED30(-dmgStruct->dmg, target, 1, -1);
}
@ -403,7 +402,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
}
}
if ((dmgStruct->residualDmgType != 14 || targetData->HP <= 1) && unkTile == NULL && sub_8045888(target)) {
if ((dmgStruct->residualDmgType != 14 || targetData->HP <= 1) && unkTile == NULL && ShouldDisplayEntity(target)) {
if ((attacker->pos.x != target->pos.x || attacker->pos.y != target->pos.y) && GetEntityType(attacker) == ENTITY_MONSTER) {
bool32 unkBool = FALSE;
if (targetData->isTeamLeader) {
@ -466,7 +465,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
if (unkTile != NULL)
{
unkTile->spawnOrVisibilityFlags &= ~(0x4);
sub_8049ED4();
UpdateTrapsVisibility();
}
return FALSE;
}
@ -481,7 +480,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
target->unk22 = 2;
sub_803E708(0xA, 0x18);
unkTile->spawnOrVisibilityFlags &= ~(0x4);
sub_8049ED4();
UpdateTrapsVisibility();
}
else if (var_24) {
target->unk22 = 1;
@ -600,9 +599,9 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
sub_8042148(target);
monPos = teamMember->pos;
sub_8068FE0(teamMember, 0x221, target);
HandleFaint(teamMember, 0x221, target);
sub_80694C0(target, monPos.x, monPos.y, 1);
sub_804535C(target, NULL);
UpdateEntityPixelPos(target, NULL);
target->unk22 = 0;
targetData->HP = targetData->maxHPStat;
sub_8042A24(target);
@ -688,7 +687,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
}
if (!targetData->isTeamLeader && ItemExists(&targetData->heldItem)) {
sub_80464C8(target, &target->pos, &targetData->heldItem);
SpawnDroppedItemWrapper(target, &target->pos, &targetData->heldItem);
ZeroOutItem(&targetData->heldItem);
}
if (targetData->bossFlag) {
@ -751,18 +750,18 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
sub_8069D4C(&sp, target);
if (sub_806F660(attacker, target)) {
if (!sub_806FA5C(attacker, target, &sp)) {
sub_8068FE0(target, 0x1F5, attacker);
HandleFaint(target, 0x1F5, attacker);
}
else {
gUnknown_202F221 = 1;
}
}
else {
sub_8068FE0(target, arg4, attacker);
HandleFaint(target, arg4, attacker);
}
}
else {
sub_8068FE0(target, arg4, attacker);
HandleFaint(target, arg4, attacker);
}
return TRUE;

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "globaldata.h"
#include "dungeon_engine.h"
#include "run_dungeon.h"
#include "dungeon_vram.h"
#include "constants/dungeon.h"
@ -13,16 +14,15 @@
#include "dungeon_logic.h"
#include "menu_input.h"
extern bool8 sub_8044B28(void);
extern void TrySpawnMonsterAndActivatePlusMinus(void);
extern void sub_807E378(void);
extern void sub_8044574(void);
extern void sub_8044820(void);
extern void sub_8044AB4(void);
extern u8 UseAttack(u32);
extern u8 DisplayActions(u32);
extern void TickStatusHeal(Entity *);
extern void sub_8086AC0(void);
extern void sub_8071DA4(Entity *);
extern void EnemyEvolution(Entity *);
extern void TriggerWeatherAbilities(void);
extern void DungeonHandlePlayerInput(void);
extern void sub_805F02C(void);
@ -31,7 +31,7 @@ extern void sub_8071B48(void);
extern void sub_807EAA0(u32, u32);
static void sub_8044454(void);
static bool8 xxx_dungeon_80442D0(bool8);
static bool8 RunLeaderTurn(bool8);
EWRAM_DATA DungeonPos gUnknown_202EE0C = {0};
EWRAM_DATA MenuInputStruct gDungeonMenu = {0};
@ -46,115 +46,98 @@ const s16 gSpeedTurns[NUM_SPEED_COUNTERS][25] = {
void RunFractionalTurn(bool8 param_1)
{
bool8 cVar2;
bool8 cVar2;
if (!sub_8044B28()) {
if (IsFloorOver()) return;
TrySpawnMonsterAndActivatePlusMinus();
if (!sub_8044B28()) {
cVar2 = xxx_dungeon_80442D0(param_1);
if (!sub_8044B28()) {
if (cVar2 != 0) {
sub_807E378();
if (sub_8044B28()) {
return;
}
}
if (!sub_8044B28()) {
sub_8044574();
if (!sub_8044B28()) {
sub_8044820();
if (!sub_8044B28()) {
sub_8044AB4();
gDungeon->unk644.fractionalTurn++;
if (gDungeon->unk644.fractionalTurn == 24) {
gDungeon->unk644.fractionalTurn = 0;
}
}
}
}
}
if (IsFloorOver()) return;
cVar2 = RunLeaderTurn(param_1);
if (IsFloorOver()) return;
if (cVar2) {
sub_807E378();
if (IsFloorOver()) return;
}
if (IsFloorOver()) return;
sub_8044574();
if (IsFloorOver()) return;
sub_8044820();
if (IsFloorOver()) return;
sub_8044AB4();
if (++gDungeon->unk644.fractionalTurn == 24) {
gDungeon->unk644.fractionalTurn = 0;
}
}
}
static bool8 xxx_dungeon_80442D0(bool8 param_1)
static bool8 RunLeaderTurn(bool8 param_1)
{
EntityInfo *entityInfo;
Entity *entity;
s32 movSpeed;
EntityInfo *entityInfo;
s32 movSpeed;
Entity *entity = GetLeader();
if (entity == NULL)
return FALSE;
entity = GetLeader();
if (entity == NULL) {
return FALSE;
}
else
{
TriggerWeatherAbilities();
movSpeed = CalcSpeedStage(entity);
if (gSpeedTurns[movSpeed][gDungeon->unk644.fractionalTurn] == 0) {
if (gSpeedTurns[movSpeed][gDungeon->unk644.fractionalTurn] == 0)
return FALSE;
}
else
{
if (GetEntInfo(entity)->attacking) {
return FALSE;
}
else
{
while (1) {
if(entity = GetLeader(), entity == NULL)
{
return FALSE;
}
else
{
if ((UseAttack(0) == 0) &&
((gDungeon->unk644.unk28 != 0 ||
(gDungeon->unk644.unk2F != 0)))) {
DungeonRunFrameActions(0xc);
}
GetEntInfo(entity)->speedStageChanged = FALSE;
if (sub_8044B28()) return FALSE;
gDungeon->unkB8 = entity;
gDungeon->unkBC = 0;
if (param_1) {
param_1 = FALSE;
}
else {
TickStatusHeal(entity);
}
if (sub_8044B28()) return FALSE;
sub_8071DA4(entity);
gDungeon->noActionInProgress = TRUE;
DungeonHandlePlayerInput();
gDungeon->noActionInProgress = FALSE;
if (sub_8044B28()) break;
sub_8072CF4(entity);
sub_8086AC0();
sub_8043ED0(0);
if (sub_8044B28()) break;
entityInfo = GetEntInfo(entity);
if ((entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY)) {
GetEntInfo(entity)->flags = (entityInfo->flags & ~(MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY)) | MOVEMENT_FLAG_UNK_14;
}
if (sub_8044B28() ) break;
sub_8044454();
if (sub_8044B28()) break;
if (gDungeon->unkBC != 0) {
sub_805F02C();
gDungeon->unkBC = 0;
param_1 = TRUE;
}
else {
if (!GetEntInfo(entity)->speedStageChanged) break;
gDungeon->unk644.fractionalTurn = 0;
}
}
if (GetEntInfo(entity)->attacking)
return FALSE;
while (1) {
entity = GetLeader();
if (entity == NULL)
return FALSE;
if (DisplayActions(0) == 0 && (gDungeon->unk644.unk28 != 0 || (gDungeon->unk644.unk2F != 0))) {
DungeonRunFrameActions(0xc);
}
GetEntInfo(entity)->speedStageChanged = FALSE;
if (IsFloorOver())
return FALSE;
gDungeon->unkB8 = entity;
gDungeon->unkBC = 0;
if (param_1) {
param_1 = FALSE;
}
else {
TickStatusHeal(entity);
}
if (IsFloorOver())
return FALSE;
EnemyEvolution(entity);
gDungeon->noActionInProgress = TRUE;
DungeonHandlePlayerInput();
gDungeon->noActionInProgress = FALSE;
if (IsFloorOver())
break;
sub_8072CF4(entity);
sub_8086AC0();
TryForcedLoss(0);
if (IsFloorOver())
break;
entityInfo = GetEntInfo(entity);
if (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY) {
GetEntInfo(entity)->flags = (entityInfo->flags & ~(MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY)) | MOVEMENT_FLAG_UNK_14;
}
if (IsFloorOver())
break;
sub_8044454();
if (IsFloorOver())
break;
if (gDungeon->unkBC != 0) {
sub_805F02C();
gDungeon->unkBC = 0;
param_1 = TRUE;
}
else {
if (!GetEntInfo(entity)->speedStageChanged)
break;
gDungeon->unk644.fractionalTurn = 0;
}
}
}
}
return TRUE;
return TRUE;
}
static void sub_8044454(void)
@ -170,14 +153,14 @@ static void sub_8044454(void)
{
entity = gDungeon->activePokemon[index];
if ((EntityIsValid(entity)) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) {
if (sub_8044B28()) break;
if (IsFloorOver()) break;
TickStatusHeal(entity);
if (EntityIsValid(entity)) {
sub_8071DA4(entity);
EnemyEvolution(entity);
RunMonsterAI(entity, 0);
sub_8072CF4(entity);
sub_8086AC0();
sub_8043ED0(0);
TryForcedLoss(0);
entityInfo->flags = (entityInfo->flags & ~(MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY)) | MOVEMENT_FLAG_UNK_14;
}
}
@ -198,11 +181,11 @@ void sub_80444F4(Entity *pokemon)
{
entity = gDungeon->activePokemon[index];
if ((EntityIsValid(entity)) && (pokemon != entity) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) {
if (sub_8044B28()) break;
if (IsFloorOver()) break;
RunMonsterAI(entity, 0);
sub_8072CF4(entity);
sub_8086AC0();
sub_8043ED0(0);
TryForcedLoss(0);
}
}
}
@ -228,7 +211,7 @@ void sub_8044574(void)
if (!teamMonInfo->isTeamLeader) {
s32 spdStage;
if (sub_8044B28())
if (IsFloorOver())
break;
gDungeon->unkB8 = teamMon;
TriggerWeatherAbilities();
@ -248,14 +231,14 @@ void sub_8044574(void)
if (EntityIsValid(teamMon)) {
s32 j;
sub_8071DA4(teamMon);
EnemyEvolution(teamMon);
for (j = 0; j < 3; j++) {
RunMonsterAI(teamMon, 0);
if (sub_8044B28() || !sub_8072CF4(teamMon))
if (IsFloorOver() || !sub_8072CF4(teamMon))
break;
sub_8086AC0();
sub_8043ED0(0);
if (sub_8044B28())
TryForcedLoss(0);
if (IsFloorOver())
break;
}
}
@ -310,14 +293,14 @@ void sub_8044574(void)
RunMonsterAI(entity,1);
sub_8072CF4(entity);
sub_8086AC0();
sub_8043ED0(0);
TryForcedLoss(0);
EntityIsValid(entity); // Does nothing
}
ptr = ptr->next;
}
}
if (!sub_8044B28()) {
if (!IsFloorOver()) {
for (i = 0; i < MAX_TEAM_MEMBERS; i++) {
Entity *teamMon = gDungeon->teamPokemon[i];
if (EntityIsValid(teamMon)) {
@ -325,7 +308,7 @@ void sub_8044574(void)
if (teamMonInfo->aiAllySkip) {
sub_8074094(teamMon);
if (EntityIsValid(teamMon)) {
sub_8071DA4(teamMon);
EnemyEvolution(teamMon);
teamMonInfo->aiAllySkip = FALSE;
}
}
@ -346,7 +329,7 @@ void sub_8044820(void)
for (index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) {
entity = gDungeon->wildPokemon[index];
if (EntityIsValid(entity)) {
if (sub_8044B28()) break;
if (IsFloorOver()) break;
entityInfo = GetEntInfo(entity);
gDungeon->unkB8 = entity;
TriggerWeatherAbilities();
@ -364,13 +347,13 @@ void sub_8044820(void)
entityInfo->recalculateFollow = FALSE;
TickStatusHeal(entity);
if (EntityIsValid(entity)) {
sub_8071DA4(entity);
EnemyEvolution(entity);
RunMonsterAI(entity, 0);
if (sub_8044B28()) break;
if (IsFloorOver()) break;
sub_8072CF4(entity);
sub_8086AC0();
sub_8043ED0(0);
if (sub_8044B28()) break;
TryForcedLoss(0);
if (IsFloorOver()) break;
}
}
}
@ -378,7 +361,7 @@ void sub_8044820(void)
}
}
}
if (sub_8044B28() == 0) {
if (IsFloorOver() == 0) {
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
{
entity2 = gDungeon->wildPokemon[index];
@ -386,7 +369,7 @@ void sub_8044820(void)
{
sub_8074094(entity2);
if (EntityIsValid(entity2)) {
sub_8071DA4(entity2);
EnemyEvolution(entity2);
entityInfo2->aiAllySkip = FALSE;
}
}
@ -437,7 +420,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void)
}
}
}
sub_8043ED0(0);
TryForcedLoss(0);
}
}
@ -448,17 +431,17 @@ void sub_8044AB4(void)
if (gSpeedTurns[1][gDungeon->unk644.fractionalTurn + 1] != 0) {
for (index = 0; index < DUNGEON_MAX_POKEMON; index++) {
if (EntityIsValid(gDungeon->activePokemon[index])) {
UseAttack(0);
DisplayActions(0);
break;
}
}
sub_807EAA0(1,0);
sub_8086AC0();
sub_8043ED0(0);
TryForcedLoss(0);
}
}
bool8 sub_8044B28(void)
bool8 IsFloorOver(void)
{
if (gDungeon->unk4 == 0) {
if (GetLeader() == NULL) {
@ -484,6 +467,6 @@ bool8 sub_8044B84(void)
return TRUE;
}
else {
return sub_8044B28();
return IsFloorOver();
}
}

View File

@ -36,7 +36,7 @@ static void SpawnItemAtPos(u8 itemId, s32 x, s32 y, s32 quantity, u32 itemFlags)
item.quantity = quantity;
}
AddItemToDungeonAt(&pos, &item, 1);
SpawnItem(&pos, &item, 1);
}
// s16 species memes strike again. Will the fix ever be discovered?
@ -1049,7 +1049,7 @@ void sub_8051E7C(Entity *pokemon)
tile->terrainType &= ~(TERRAIN_TYPE_IMPASSABLE_WALL | TERRAIN_TYPE_UNK_x1000);
sub_80498A8(pokemon->pos.x, pokemon->pos.y - 1);
sub_8049B8C();
sub_8049ED4();
UpdateTrapsVisibility();
sub_80429FC(&pos);
LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FDDD0); // The closed corridor was opened!
sub_803E708(0x14, 0x3C);

View File

@ -2414,7 +2414,7 @@ u8 HasCheckpoint(u8 dungeon)
return gDungeons[dungeon].hasCheckpoint;
}
bool8 IsLevelResetTo1(u8 dungeon)
bool8 IsLevelResetDungeon(u8 dungeon)
{
return gDungeons[dungeon].levelResetTo1;
}
@ -2424,7 +2424,7 @@ u32 GetMaxItemsAllowed(u8 dungeon)
return gDungeons[dungeon].maxItemsAllowed;
}
bool8 IsKeepMoney(u8 dungeon)
bool8 IsMoneyAllowed(u8 dungeon)
{
return gDungeons[dungeon].keepMoney;
}

View File

@ -123,9 +123,9 @@ void BlinkerSeedItemAction(Entity *, Entity *);
void DoomSeedItemAction(Entity *, Entity *);
void sub_80482FC(Entity *, Entity *, u32, u8);
extern void sub_8071DA4(Entity *);
extern void EnemyEvolution(Entity *);
extern void SetShopkeeperAggression(Entity *, Entity *);
extern void sub_80464C8(Entity *, DungeonPos *, Item *);
extern void SpawnDroppedItemWrapper(Entity *, DungeonPos *, Item *);
extern void sub_806A6E8(Entity *);
extern void sub_8042390(Entity *, Item *);
@ -156,7 +156,7 @@ void sub_80479B8(char param_1, char param_2, u8 param_3, Entity *pokemon, Entity
}
if (flag && ((info->heldItem.flags & ITEM_FLAG_EXISTS) == 0)) {
if (info->shopkeeper == TRUE) {
sub_80464C8(pokemon,&target->pos,item);
SpawnDroppedItemWrapper(pokemon,&target->pos,item);
return;
}
PlaySoundEffect(0x14d);
@ -178,7 +178,7 @@ void sub_80479B8(char param_1, char param_2, u8 param_3, Entity *pokemon, Entity
TryDisplayDungeonLoggableMessage3(pokemon,target,*gItemStickyDoesntWorkText);
if (param_1 != '\0') {
sub_806F370(pokemon,target,gUnknown_80F4FAE,1,&uStack_24,0,0x217,0,0,0);
sub_8071DA4(pokemon);
EnemyEvolution(pokemon);
return;
}
else goto _jump;
@ -407,7 +407,7 @@ _jump:
break;
}
_080482B4:
sub_8071DA4(pokemon);
EnemyEvolution(pokemon);
}
UNUSED void nullsub_205(void) { }

View File

@ -39,7 +39,6 @@ extern void sub_80855E4(void *);
extern void PlaySoundEffect(u32);
extern void sub_804178C(u32);
extern void sub_804219C(PixelPos *pos);
extern bool8 sub_8045888(Entity *);
extern u32 GetRandomFloorItem(u32);
static void MusicBoxCreation(void);
@ -143,20 +142,20 @@ void CreateFloorItems(void)
}
}
itemID = GetRandomFloorItem(spawnType);
if (!CanSellItem(itemID)) {
if (!IsShoppableItem(itemID)) {
shopFlag = FALSE;
}
CreateItemWithStickyChance(&item,itemID,FORCE_STICKY_RANDOM);
if (shopFlag) {
item.flags |= flag;
}
AddItemToDungeonAt(&pos,&item,TRUE);
SpawnItem(&pos,&item,TRUE);
}
}
}
}
void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg)
void TryLeaderItemPickUp(struct DungeonPos *pos, bool8 printMsg)
{
Item *tileItem;
int inventoryIds[INVENTORY_SIZE + 1];
@ -171,7 +170,7 @@ void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg)
if (GetEntityType(tileObject) != ENTITY_ITEM) {
return;
}
tileItem = GetItemData(tileObject);
tileItem = GetItemInfo(tileObject);
if (leaderInfo->action.actionParameters[0].actionUseIndex == 0) {
if (!printMsg) {
return;
@ -192,9 +191,9 @@ void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg)
PlaySoundEffect(0x14c);
AddToTeamMoney(GetMoneyValue(tileItem));
sub_8045BF8(gFormatBuffer_Items[0],tileItem);
RemoveItemFromDungeonAt(pos,TRUE);
RemoveGroundItem(pos,TRUE);
LogMessageByIdWithPopupCheckUser(leader,gPickedUpItem);
TryDisplayItemPickupTutorialMessage(tileItem->id);
DisplayItemTip(tileItem->id);
}
else {
s32 i, maxItems;
@ -259,7 +258,7 @@ void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg)
inventoryItems[index]->flags |= ITEM_FLAG_STICKY;
}
sub_8045BF8(gFormatBuffer_Items[0],tileItem);
RemoveItemFromDungeonAt(pos,TRUE);
RemoveGroundItem(pos,TRUE);
PlaySoundEffect(0x14a);
if (inventoryIds[index] < 0) {
LogMessageByIdWithPopupCheckUser(leader,gPickedUpItem2);
@ -267,7 +266,7 @@ void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg)
else {
LogMessageByIdWithPopupCheckUser(leader,gPickedUpItemToolbox);
}
TryDisplayItemPickupTutorialMessage(tileItem->id);
DisplayItemTip(tileItem->id);
return;
}
}
@ -290,7 +289,7 @@ void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg)
if (inventoryIds[i] < 0) {
leaderInfo->heldItem = *tileItem;
sub_8045BF8(gFormatBuffer_Items[0],tileItem);
RemoveItemFromDungeonAt(pos,TRUE);
RemoveGroundItem(pos,TRUE);
LogMessageByIdWithPopupCheckUser(leader,gPickedUpItem2);
}
else if (AddItemToInventory(tileItem) != 0) {
@ -299,19 +298,19 @@ void PickUpItemFromPos(struct DungeonPos *pos, bool8 printMsg)
}
else {
sub_8045BF8(gFormatBuffer_Items[0],tileItem);
RemoveItemFromDungeonAt(pos,TRUE);
RemoveGroundItem(pos,TRUE);
LogMessageByIdWithPopupCheckUser(leader,gPickedUpItemToolbox);
}
TryDisplayItemPickupTutorialMessage(tileItem->id);
DisplayItemTip(tileItem->id);
}
}
}
bool8 AddItemToDungeonAt(DungeonPos *pos, Item *item, bool8 a2)
bool8 SpawnItem(DungeonPos *pos, Item *item, bool8 a2)
{
s32 i, count;
Tile *tile;
Entity *itemEntity = sub_8045708(pos);
Entity *itemEntity = SpawnItemEntity(pos);
if (itemEntity == NULL)
return FALSE;
@ -320,14 +319,14 @@ bool8 AddItemToDungeonAt(DungeonPos *pos, Item *item, bool8 a2)
itemEntity->isVisible = TRUE;
tile = GetTileMut(pos->x, pos->y);
tile->object = itemEntity;
if ((tile->terrainType & TERRAIN_TYPE_SHOP) && CanSellItem(item->id)) {
if ((tile->terrainType & TERRAIN_TYPE_SHOP) && IsShoppableItem(item->id)) {
if (item->flags & ITEM_FLAG_IN_SHOP) {
if (a2) {
gDungeon->unk644.unk48 += GetStackBuyPrice(item);
gDungeon->unk644.unk48 += GetActualBuyPrice(item);
}
}
else {
gDungeon->unk644.unk4C += GetStackSellPrice(item);
gDungeon->unk644.unk4C += GetActualSellPrice(item);
}
}
@ -341,7 +340,7 @@ bool8 AddItemToDungeonAt(DungeonPos *pos, Item *item, bool8 a2)
return TRUE;
}
bool8 RemoveItemFromDungeonAt(DungeonPos *pos, bool8 a2)
bool8 RemoveGroundItem(DungeonPos *pos, bool8 a2)
{
s32 i, count;
Item *item;
@ -350,15 +349,15 @@ bool8 RemoveItemFromDungeonAt(DungeonPos *pos, bool8 a2)
if (tileObject == NULL || GetEntityType(tileObject) != ENTITY_ITEM)
return FALSE;
item = GetItemData(tileObject);
if ((tile->terrainType & TERRAIN_TYPE_SHOP) && CanSellItem(item->id)) {
item = GetItemInfo(tileObject);
if ((tile->terrainType & TERRAIN_TYPE_SHOP) && IsShoppableItem(item->id)) {
if (item->flags & ITEM_FLAG_IN_SHOP) {
if (a2) {
gDungeon->unk644.unk48 -= GetStackBuyPrice(item);
gDungeon->unk644.unk48 -= GetActualBuyPrice(item);
}
}
else {
gDungeon->unk644.unk4C -= GetStackSellPrice(item);
gDungeon->unk644.unk4C -= GetActualSellPrice(item);
}
}
@ -397,7 +396,7 @@ bool8 sub_80462AC(Entity * entity, u8 hallucinating, u8 a2, u8 a3, u8 a4)
objMode = 1;
}
if (!sub_8045888(entity))
if (!ShouldDisplayEntity(entity))
return FALSE;
}
@ -443,7 +442,7 @@ const u8 *sub_80464AC(Item *item)
return gActions[GetItemActionType(item->id)].desc;
}
void sub_80464C8(Entity *entity, DungeonPos *pos, Item *item)
void SpawnDroppedItemWrapper(Entity *entity, DungeonPos *pos, Item *item)
{
s32 x, y;
Entity itemEntity;
@ -500,7 +499,7 @@ void SpawnDroppedItem(Entity *entity1, Entity *entity2, Item *item, bool8 a3, Du
if (GetTerrainType(tile) != TERRAIN_TYPE_WALL && !(tile->terrainType & TERRAIN_TYPE_STAIRS) && tile->object == NULL) {
sub_8046734(entity2, &localPos);
localPos2 = localPos;
if (GetTerrainType(tile) == (TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL) || (AddItemToDungeonAt(&localPos, item, TRUE))) {
if (GetTerrainType(tile) == (TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL) || (SpawnItem(&localPos, item, TRUE))) {
var_24 = TRUE;
}
break;
@ -510,19 +509,19 @@ void SpawnDroppedItem(Entity *entity1, Entity *entity2, Item *item, bool8 a3, Du
sub_8045BF8(gFormatBuffer_Items[0], item);
if (var_24) {
ShowDungeonMapAtPos(localPos.x, localPos.y);
DrawMinimapTile(localPos.x, localPos.y);
switch (GetTerrainType(GetTile(localPos.x, localPos.y))) {
case TERRAIN_TYPE_NORMAL:
TryDisplayDungeonLoggableMessage5(entity1, &localPos, gItemFellOnGround);
LogMessageByIdWithPopupCheckUserUnknown(entity1, &localPos, gItemFellOnGround);
break;
case TERRAIN_TYPE_SECONDARY:
TryDisplayDungeonLoggableMessage5(entity1, &localPos, gItemFellInWater);
LogMessageByIdWithPopupCheckUserUnknown(entity1, &localPos, gItemFellInWater);
break;
case TERRAIN_TYPE_WALL:
TryDisplayDungeonLoggableMessage5(entity1, &localPos, gItemBuried);
LogMessageByIdWithPopupCheckUserUnknown(entity1, &localPos, gItemBuried);
break;
case TERRAIN_TYPE_SECONDARY | TERRAIN_TYPE_NORMAL:
TryDisplayDungeonLoggableMessage5(entity1, &localPos, gItemFellOutOfSight);
LogMessageByIdWithPopupCheckUserUnknown(entity1, &localPos, gItemFellOutOfSight);
break;
}
}
@ -537,7 +536,7 @@ void SpawnDroppedItem(Entity *entity1, Entity *entity2, Item *item, bool8 a3, Du
}
sub_804219C(&pixelPos);
TryDisplayDungeonLoggableMessage5(entity1, &localPos, gItemLost);
LogMessageByIdWithPopupCheckUserUnknown(entity1, &localPos, gItemLost);
}
}
@ -564,7 +563,7 @@ static void sub_8046734(Entity *entity, DungeonPos *pos)
calcPixelPos.x += add.x;
calcPixelPos.y += add.y;
entity->unk1C.raw = sin_4096(sinVal) * 12;
sub_804535C(entity, &calcPixelPos);
UpdateEntityPixelPos(entity, &calcPixelPos);
sub_80462AC(entity, hallucinating, 0, unk, 0);
DungeonRunFrameActions(0x13);
sinVal += 85;
@ -697,7 +696,7 @@ void sub_804687C(Entity *entity, DungeonPos *pos1, DungeonPos *pos2, Item *item,
for (i = 0; i < count; i++) {
if (targetTilePos[i].x >= 0) {
AddItemToDungeonAt(&targetTilePos[i], &item[i], TRUE);
SpawnItem(&targetTilePos[i], &item[i], TRUE);
}
}
}

View File

@ -127,7 +127,7 @@ void sub_8084448(Entity *pokemon)
sub_80843BC(entInfo->id);
sub_8042A34(&pokemon->pos);
sub_8068FE0(pokemon,0x21c,0);
HandleFaint(pokemon,0x21c,0);
sub_804178C(1);
while(1) {
if (DisplayDungeonYesNoMessage(0,str,1) == 1) {
@ -186,8 +186,8 @@ void sub_80845E0(Entity *pokemon)
info2->joinedAt.id = gDungeon->unk644.dungeonLocation.id;
sub_8042A34(&pokemon->pos);
sub_8042A34(&entity->pos);
sub_8068FE0(pokemon,0x21c,0);
sub_8068FE0(entity,0x21c,0);
HandleFaint(pokemon,0x21c,0);
HandleFaint(entity,0x21c,0);
sub_804178C(1);
while(1) {
if (DisplayDungeonYesNoMessage(0,gUnknown_80FA4D8,1) == 1) {

View File

@ -30,8 +30,7 @@
#include "dungeon_misc.h"
#include "sprite.h"
#include "dungeon_strings.h"
extern bool8 sub_8044B28(void);
#include "dungeon_engine.h"
bool8 sub_807EF48(void);
void sub_807EFFC(bool8 arg0);
@ -45,7 +44,7 @@ void sub_807EC28(bool8 arg0)
bool32 prevTileWasShop;
bool32 isShopTile;
if (sub_8044B28())
if (IsFloorOver())
return;
leader = GetLeader();
@ -231,14 +230,14 @@ void sub_807EFFC(bool8 arg0)
pos.x = x;
tile = GetTile(x,y);
if (tile->terrainType & TERRAIN_TYPE_SHOP && tile->object != NULL && GetEntityType(tile->object) == ENTITY_ITEM) {
Item *itemPtr = GetItemData(tile->object);
Item *itemPtr = GetItemInfo(tile->object);
if (!ItemInShop(itemPtr)) {
Item item = *itemPtr;
RemoveItemFromDungeonAt(&pos, 1);
if (CanSellItem(item.id)) {
RemoveGroundItem(&pos, 1);
if (IsShoppableItem(item.id)) {
item.flags |= ITEM_FLAG_IN_SHOP;
}
AddItemToDungeonAt(&pos, &item, 1);
SpawnItem(&pos, &item, 1);
}
}
}
@ -278,8 +277,8 @@ s32 sub_807F19C(bool8 arg0)
for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) {
const Tile *tile = GetTile(x, y);
if (!(tile->terrainType & TERRAIN_TYPE_SHOP) && tile->object != NULL && GetEntityType(tile->object) == ENTITY_ITEM) {
Item *itemPtr = GetItemData(tile->object);
if (CanSellItem(itemPtr->id)) {
Item *itemPtr = GetItemInfo(tile->object);
if (IsShoppableItem(itemPtr->id)) {
itemPtr->flags &= ~(ITEM_FLAG_IN_SHOP);
}
}
@ -288,7 +287,7 @@ s32 sub_807F19C(bool8 arg0)
for (i = 0; i < INVENTORY_SIZE; i++) {
Item *item = &gTeamInventoryRef->teamItems[i];
if (ItemExists(item) && CanSellItem(item->id)) {
if (ItemExists(item) && IsShoppableItem(item->id)) {
item->flags &= ~(ITEM_FLAG_IN_SHOP);
}
}
@ -298,7 +297,7 @@ s32 sub_807F19C(bool8 arg0)
if (EntityIsValid(mon)) {
EntityInfo *monInfo = GetEntInfo(mon);
Item *item = &monInfo->heldItem;
if (ItemExists(item) && CanSellItem(item->id)) {
if (ItemExists(item) && IsShoppableItem(item->id)) {
item->flags &= ~(ITEM_FLAG_IN_SHOP);
}
}
@ -321,7 +320,7 @@ void sub_807F33C(void)
for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) {
const Tile *tile = GetTile(x,y);
if (tile->object != NULL && GetEntityType(tile->object) == ENTITY_ITEM) {
Item *item = GetItemData(tile->object);
Item *item = GetItemInfo(tile->object);
item->flags &= ~(ITEM_FLAG_IN_SHOP);
}
}

View File

@ -64,7 +64,7 @@ extern Item *sub_8044D90(Entity *, s32, u32);
extern void PlayDungeonCancelSE(void);
extern void PlayDungeonConfirmationSE(void);
extern void sub_806A6E8(Entity *);
extern void HandleTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4);
extern void TryTriggerTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4);
bool8 sub_807EF48(void);
void sub_806A2BC(Entity *a0, u8 a1);
bool8 sub_80701A4(Entity *a0);
@ -79,7 +79,7 @@ static void TryCreateModeArrows(Entity *leader);
bool8 sub_8094C48(void);
void sub_803E724(s32 a0);
void HandleTalkFieldAction(Entity *);
bool8 sub_8044B28(void);
bool8 IsFloorOver(void);
bool8 IsNotAttacking(Entity *param_1, bool8 param_2);
s32 GetTeamMemberEntityIndex(Entity *pokemon);
bool8 sub_8070F80(Entity * pokemon, s32 direction);
@ -558,7 +558,7 @@ void DungeonHandlePlayerInput(void)
if (leaderInfo->action.action == 0x2D || leaderInfo->action.action == 0x13) {
HandleTalkFieldAction(leader);
if (sub_8044B28())
if (IsFloorOver())
break;
sub_8044C50(ACTION_NOTHING);
}
@ -581,7 +581,7 @@ void DungeonHandlePlayerInput(void)
sInRotateMode = FALSE;
unkPtr->unk1821A = 0;
sub_804AA60();
if (sub_8044B28())
if (IsFloorOver())
break;
if (leaderInfo->action.action != 0) {
if (leaderInfo->action.action == 0x2B) {
@ -993,14 +993,14 @@ static bool8 sub_805EC4C(Entity *a0, u8 a1)
return TRUE;
}
void sub_805EE30(void)
void CheckLeaderTile(void)
{
Entity *tileObject;
Tile *tile;
Entity *leader = GetLeader();
if (leader == NULL)
return;
if (sub_8044B28())
if (IsFloorOver())
return;
tile = GetTileAtEntitySafe(leader);
@ -1015,12 +1015,12 @@ void sub_805EE30(void)
switch (GetEntityType(tileObject))
{
case ENTITY_TRAP: {
Trap *trap = GetTrapData(tileObject);
Trap *trap = GetTrapInfo(tileObject);
bool32 r8 = FALSE;
bool32 r7 = FALSE;
if (IQSkillIsEnabled(leader, IQ_TRAP_SEER) && !tileObject->isVisible) {
tileObject->isVisible = TRUE;
sub_8049ED4();
UpdateTrapsVisibility();
r7 = TRUE;
}
if (trap->unk1 != 0) {
@ -1032,14 +1032,14 @@ void sub_805EE30(void)
break;
}
if (!r7) {
HandleTrap(leader, &leader->pos, 0, 1);
TryTriggerTrap(leader, &leader->pos, 0, 1);
}
}
break;
case ENTITY_ITEM: {
Item *item = GetItemData(tileObject);
Item *item = GetItemInfo(tileObject);
if (!(item->flags & ITEM_FLAG_IN_SHOP)) {
PickUpItemFromPos(&leader->pos, 1);
TryLeaderItemPickUp(&leader->pos, 1);
}
else {
gDungeon->unk5C0 = 4;

View File

@ -163,7 +163,7 @@ void LoadDungeonMapPalette(void)
}
}
void ShowDungeonMapAtPos(s32 x, s32 y)
void DrawMinimapTile(s32 x, s32 y)
{
s32 yAdd = 0;
const Tile *tile;
@ -282,7 +282,7 @@ void ShowDungeonMapAtPos(s32 x, s32 y)
else {
if (entType == ENTITY_TRAP) {
if (entity->isVisible || showHiddenTraps) {
Trap *trap = GetTrapData(entity);
Trap *trap = GetTrapInfo(entity);
mapGfxType = sTrapToMapGfxId[trap->id];
lookForMapObject = FALSE;
}
@ -530,7 +530,7 @@ void ShowWholeRevealedDungeonMap(void)
for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) {
for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) {
ShowDungeonMapAtPos(x, y);
DrawMinimapTile(x, y);
}
}
}

View File

@ -475,7 +475,7 @@ static const s16 gUnknown_80F6C06[] = {
60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63
};
void sub_8049ED4(void)
void UpdateTrapsVisibility(void)
{
bool32 hallucinating, showInvisibleTrapsMonsters;
u16 *src;
@ -1058,7 +1058,7 @@ void sub_804AC20(DungeonPos *pos)
for (x = xMin; x <= xMax; x++) {
tile = GetTileMut(x,y);
tile->spawnOrVisibilityFlags |= 3;
ShowDungeonMapAtPos(x,y);
DrawMinimapTile(x,y);
}
}
}
@ -1112,7 +1112,7 @@ bool8 sub_804AD34(DungeonPos *pos)
{
sub_80498A8(x + pos->x, y + pos->y);
sub_8049BB0(x + pos->x, y + pos->y);
ShowDungeonMapAtPos(x + pos->x, y + pos->y);
DrawMinimapTile(x + pos->x, y + pos->y);
}
}
}
@ -1121,10 +1121,10 @@ bool8 sub_804AD34(DungeonPos *pos)
{
entity = gDungeon->activePokemon[index];
if (EntityIsValid(entity)) {
sub_806CF98(entity);
DetermineMonsterShadow(entity);
}
}
sub_8049ED4();
UpdateTrapsVisibility();
sub_8042A14(pos);
}
return iVar8;
@ -1174,7 +1174,7 @@ void sub_804AE84(DungeonPos *pos)
for(x = -1; x < 2; x++)
{
sub_80498A8(x + pos->x, y + pos->y);
ShowDungeonMapAtPos(x + pos->x, y + pos->y);
DrawMinimapTile(x + pos->x, y + pos->y);
}
}
@ -1182,10 +1182,10 @@ void sub_804AE84(DungeonPos *pos)
{
entity = gDungeon->activePokemon[index];
if (EntityIsValid(entity)) {
sub_806CF98(entity);
DetermineMonsterShadow(entity);
}
}
sub_8049ED4();
UpdateTrapsVisibility();
sub_8042A14(pos);
}
}

View File

@ -475,7 +475,7 @@ static void PrintOnDungeonItemsMenu(s32 a0, Entity *a1, bool8 showWhichWindow, b
break;
case 2: {
const Tile *tile = GetTile(a1->pos.x, a1->pos.y);
Item *item = GetItemData(tile->object);
Item *item = GetItemInfo(tile->object);
PrintFormattedStringOnWindow(x, 0, gFieldItemMenuGroundTextPtr, 0, 0);
if (item->flags & ITEM_FLAG_EXISTS) {
gDungeonMenu.currPageEntries++;

View File

@ -50,7 +50,7 @@ extern Item *sub_8044D90(Entity *, s32, u32);
extern void PlayDungeonCancelSE(void);
extern void PlayDungeonConfirmationSE(void);
extern void sub_806A6E8(Entity *);
extern void HandleTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4);
extern void TryTriggerTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4);
bool8 sub_807EF48(void);
void sub_806A2BC(Entity *a0, u8 a1);
bool8 sub_805E874(void);
@ -70,7 +70,7 @@ bool8 sub_8094C48(void);
bool8 sub_805EC4C(Entity *a0, u8 a1);
void sub_803E724(s32 a0);
void HandleTalkFieldAction(Entity *);
bool8 sub_8044B28(void);
bool8 IsFloorOver(void);
bool8 IsNotAttacking(Entity *param_1, bool8 param_2);
void ShowMainMenu(bool8 fromBPress, bool8 a1);
bool8 sub_805EF60(Entity *a0, EntityInfo *a1);

View File

@ -187,7 +187,7 @@ static void ShowTileDescription(DungeonPos *pos)
break;
DungeonShowWindows(&windows, FALSE);
trap = GetTrapData(object);
trap = GetTrapInfo(object);
GetTrapName(trapName, trap->id);
sub_80073B8(0);
PrintStringOnWindow(16, 0, trapName, 0, '\0');

View File

@ -32,7 +32,6 @@ void sub_80526D0(s32 r0);
static bool8 sub_8052DC0(Entity *);
static void DisplayMessageAddToLog(Entity *pokemon, const u8 *str, bool8 r2);
extern bool8 sub_8045888(Entity *pokemon);
extern void sub_805E804(void);
extern void sub_8083E28(void);
extern void PlayDungeonCancelSE(void);
@ -87,14 +86,14 @@ void sub_805229C(void)
void LogMessageByIdWithPopupCheckUser(Entity *pokemon, const u8 *str)
{
if (sub_8045888(pokemon)){
if (ShouldDisplayEntity(pokemon)){
DisplayMessageAddToLog(pokemon, str, TRUE);
}
}
UNUSED void TryDisplayDungeonLoggableMessage2(Entity *pokemon, const u8 *str)
{
if (sub_8045888(pokemon)){
if (ShouldDisplayEntity(pokemon)){
DisplayMessageAddToLog(pokemon, str, FALSE);
}
}
@ -107,7 +106,7 @@ void DisplayDungeonLoggableMessageFalse(Entity *pokemon, const u8 *str)
void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u8 *str)
{
u8 flag;
flag = sub_8045888(attacker) ? TRUE : FALSE;
flag = ShouldDisplayEntity(attacker) ? TRUE : FALSE;
if(sub_8052DC0(target) != 0)
{
flag = TRUE;
@ -121,7 +120,7 @@ void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u
void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u8 *str)
{
u8 flag;
flag = sub_8045888(attacker) ? TRUE : FALSE;
flag = ShouldDisplayEntity(attacker) ? TRUE : FALSE;
if(sub_8052DC0(target) != 0)
{
flag = TRUE;
@ -132,11 +131,11 @@ void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u
}
}
void TryDisplayDungeonLoggableMessage5(Entity *pokemon, DungeonPos *pos,
void LogMessageByIdWithPopupCheckUserUnknown(Entity *pokemon, DungeonPos *pos,
const u8 *str)
{
u8 flag;
flag = sub_8045888(pokemon) ? TRUE : FALSE;
flag = ShouldDisplayEntity(pokemon) ? TRUE : FALSE;
if(sub_803F428(pos))
{
flag = TRUE;
@ -604,7 +603,7 @@ void sub_8052D44(s16 *ids, Entity *leader, Entity *partner)
static bool8 sub_8052DC0(Entity *entity)
{
return sub_8045888(entity);
return ShouldDisplayEntity(entity);
}
static inline bool32 DislayTutorialMsg(Entity *leader, const struct TutorialFlagMsg *tutorial, bool32 unkFunctionCall)
@ -641,7 +640,7 @@ void TryDisplayGeneralTutorialMessage(void)
}
}
void TryDisplayItemPickupTutorialMessage(u8 itemId)
void DisplayItemTip(u8 itemId)
{
u32 itemCategory = GetItemCategory(itemId);

View File

@ -16,7 +16,6 @@
#define MESSAGE_LOG_ROW_COUNT 8 // How many log messages are shown
extern bool8 sub_8045888(Entity *pokemon);
extern void sub_805E804(void);
extern void sub_8083E28(void);
extern u32 GetTouchScreenArrowPress(s32 a0, const void *a1);

View File

@ -48,7 +48,7 @@
static void EnsureCastformLoaded(void);
static void EnsureDeoxysLoaded(void);
extern bool8 IsLevelResetTo1(u8 dungeon);
extern bool8 IsLevelResetDungeon(u8 dungeon);
extern void sub_806C264(s32 teamIndex, EntityInfo *entInfo);
extern bool8 sub_806A58C(s16 r0);
extern void sub_8084E00(Entity *entity, u8 param_2, u8 param_3);
@ -61,7 +61,6 @@ extern void sub_8042900(Entity *r0);
extern void sub_8042968(Entity *r0);
extern void EndAbilityImmuneStatus(Entity *, Entity *);
extern void sub_8041BBC(Entity *r0);
extern bool8 sub_8045888(Entity *);
extern void sub_806A2BC(Entity *, u8);
extern void sub_804178C(u32);
extern void sub_803F508(Entity *);
@ -234,7 +233,7 @@ void SetDungeonMonsFromTeam(void)
Pokemon *pokeStruct = &gRecruitedPokemonRef->pokemon[recruitedId];
if (PokemonExists(pokeStruct) && PokemonFlag2(pokeStruct)) {
RecruitedPokemonToDungeonMon(&gRecruitedPokemonRef->dungeonTeam[index],recruitedId);
if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id)) {
if (IsLevelResetDungeon(gDungeon->unk644.dungeonLocation.id)) {
struct DungeonLocation dungeonLoc = {.id = DUNGEON_TINY_WOODS, .floor = 1};
CreateLevel1Pokemon(&lvl1Mon,pokeStruct->speciesNum,0,0,&dungeonLoc,0);
gRecruitedPokemonRef->dungeonTeam[index].level = lvl1Mon.level;
@ -363,7 +362,7 @@ void sub_8068BDC(bool8 a0)
}
if (sub_806A58C(monPtr->recruitedPokemonId)) {
if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id)) {
if (IsLevelResetDungeon(gDungeon->unk644.dungeonLocation.id)) {
sub_808DFDC(monPtr->recruitedPokemonId, monPtr);
}
else {
@ -488,7 +487,7 @@ static inline void ClearMonItemId(Pokemon *mon)
mon->heldItem.id = ITEM_NOTHING;
}
void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3)
void HandleFaint(Entity *entity, s32 param_2, Entity *param_3)
{
u16 joinId;
Entity EStack_a4;
@ -504,7 +503,7 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3)
tile->monster = NULL;
}
ShowDungeonMapAtPos(entity->pos.x,entity->pos.y);
DrawMinimapTile(entity->pos.x,entity->pos.y);
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
Entity *mon = gDungeon->activePokemon[i];
@ -587,7 +586,7 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3)
DungeonMon *partnerStruct = &gRecruitedPokemonRef->dungeonTeam[partnerInfo->teamIndex];
sub_806C264(partnerInfo->teamIndex,partnerInfo);
if (sub_806A58C(partnerStruct->recruitedPokemonId) != 0) {
if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id) == 0) {
if (IsLevelResetDungeon(gDungeon->unk644.dungeonLocation.id) == 0) {
DungeonMonToRecruitedPokemon(partnerStruct->recruitedPokemonId, partnerStruct);
}
if (!IsMakuhitaTrainingMaze()) {
@ -625,7 +624,7 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3)
gDungeon->deoxysDefeat = 1;
DisplayDungeonLoggableMessageTrue(entity,gUnknown_80FA580);
sub_803E178();
sub_8049ED4();
UpdateTrapsVisibility();
}
}
@ -635,7 +634,7 @@ void sub_8068FE0(Entity *entity, s32 param_2, Entity *param_3)
if (sub_806A58C(mon2Ptr->recruitedPokemonId) != 0) {
bool8 uVar10;
if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id) == 0) {
if (IsLevelResetDungeon(gDungeon->unk644.dungeonLocation.id) == 0) {
DungeonMonToRecruitedPokemon(mon2Ptr->recruitedPokemonId, mon2Ptr);
}
if (!IsMakuhitaTrainingMaze()) {
@ -685,7 +684,7 @@ void sub_80694C0(Entity *target,s32 x,s32 y,u8 param_4)
if (tile2->monster == target) {
tile2->monster = NULL;
}
ShowDungeonMapAtPos((target->pos).x,(target->pos).y);
DrawMinimapTile((target->pos).x,(target->pos).y);
}
(target->prevPos).x = (target->pos).x;
(target->prevPos).y = (target->pos).y;
@ -701,7 +700,7 @@ void sub_80694C0(Entity *target,s32 x,s32 y,u8 param_4)
gUnknown_202EE0C.y = y;
gDungeon->unk1 = 0;
}
ShowDungeonMapAtPos(x,y);
DrawMinimapTile(x,y);
switch(param_4)
{
@ -721,7 +720,7 @@ void sub_80694C0(Entity *target,s32 x,s32 y,u8 param_4)
break;
}
target->room = tile->room;
sub_806CF98(target);
DetermineMonsterShadow(target);
}
return;
}
@ -1058,7 +1057,7 @@ void sub_8069D4C(struct unkStruct_8069D4C *r0, Entity *target)
r0->level = info->level;
GetPokemonLevelData(&leveldata, info->id, info->level);
GetLvlUpEntry(&leveldata, info->id, info->level);
r0->exp = leveldata.expRequired;
r0->att[0] = info->atk[0];
r0->att[1] = info->atk[1];
@ -1262,7 +1261,7 @@ void sub_806A1E8(Entity *pokemon)
if (gGameOptionsRef->FarOffPals == '\0') {
bVar3 = FALSE;
}
if (bVar3 && (!sub_8045888(pokemon))) {
if (bVar3 && (!ShouldDisplayEntity(pokemon))) {
sub_806A2BC(pokemon,1);
}
}
@ -1279,7 +1278,7 @@ void sub_806A240(Entity *pokemon, Entity *target)
entityInfo = GetEntInfo(pokemon);
isNotTeamMember = (!entityInfo->isNotTeamMember);
}
if (isNotTeamMember && (!sub_8045888(pokemon))) {
if (isNotTeamMember && (!ShouldDisplayEntity(pokemon))) {
sub_806A2BC(pokemon,1);
return;
}
@ -1287,7 +1286,7 @@ void sub_806A240(Entity *pokemon, Entity *target)
entityInfo = GetEntInfo(target);
isNotTeamMember = (!entityInfo->isNotTeamMember);
}
if (isNotTeamMember && (!sub_8045888(target))) {
if (isNotTeamMember && (!ShouldDisplayEntity(target))) {
sub_806A2BC(target,1);
}
}
@ -1312,7 +1311,7 @@ void sub_806A2BC(Entity *pokemon, u8 param_2)
void nullsub_95(void)
{}
void sub_806A338(void)
void ReevaluateSnatchMonster(void)
{
s32 i;

View File

@ -43,18 +43,17 @@
#include "targeting_flags.h"
#include "text_util.h"
#include "dungeon_pos_data.h"
#include "dungeon_engine.h"
extern void sub_80429C8(Entity *r0);
extern bool8 sub_8045888(Entity *r0);
extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC);
extern void CalcDamage(Entity *, Entity *, u8, u32, u32, struct DamageStruct *dmgStruct, s24_8, u16, u32);
extern s16 sub_8057600(Move *move, s32 itemID);
extern void sub_803ED30(s32, Entity *r0, u8, s32);
extern void sub_8042238(Entity *pokemon, Entity *target);
extern void sub_806A1E8(Entity *pokemon);
extern bool8 sub_8044B28(void);
extern void sub_804178C(u32);
extern void sub_8071DA4(Entity *);
extern void EnemyEvolution(Entity *);
extern void sub_80428A0(Entity *r0);
extern bool8 sub_8040BB0(Entity *entity, Move *move, bool8);
extern void sub_8040DA0(Entity *entity, Move *move);
@ -168,7 +167,7 @@ void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move,
direction2 &= DIRECTION_MASK;
tileEntity = GetTile(currTarget->pos.x + gAdjacentTileOffsets[direction2].x, currTarget->pos.y + gAdjacentTileOffsets[direction2].y)->monster;
if (EntityIsValid(tileEntity) && GetEntityType(tileEntity) == ENTITY_MONSTER) {
if (sub_8045888(currTarget)) {
if (ShouldDisplayEntity(currTarget)) {
s32 k;
for (k = 0; k < 24; k++) {
sub_806CE68(currTarget, direction1);
@ -290,7 +289,7 @@ void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move,
moveHits = FALSE;
}
if (sub_8045888(currTarget)) {
if (ShouldDisplayEntity(currTarget)) {
sub_803E708(4, 0x4A);
sub_8041168(attacker, currTarget, move, NULL);
}
@ -317,7 +316,7 @@ void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move,
TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80F9364); // is unaffected!
}
if (sub_8045888(currTarget)) {
if (ShouldDisplayEntity(currTarget)) {
sub_803ED30(9999, currTarget, 1, -1);
}
@ -330,7 +329,7 @@ void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move,
break;
}
if (sub_8044B28())
if (IsFloorOver())
break; // breaks out of the loop
}
else {
@ -1313,7 +1312,7 @@ void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move,
break;
}
if (sub_8044B28()) {
if (IsFloorOver()) {
break;
}
@ -1347,7 +1346,7 @@ void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move,
}
}
if (!sub_8044B28()) {
if (!IsFloorOver()) {
if (EntityIsValid(attacker) && GetEntInfo(attacker)->unk154 != 0) {
GetEntInfo(attacker)->unk154 = 0;
WarpTarget(attacker, attacker, 0, NULL);
@ -1405,7 +1404,7 @@ static s32 TryHitTarget(Entity *attacker, Entity *target, Move *move, struct Dam
}
else {
SetMessageArgument_2(gFormatBuffer_Monsters[1], GetEntInfo(target), 0);
if (sub_8045888(attacker) && sub_8045888(target)) {
if (ShouldDisplayEntity(attacker) && ShouldDisplayEntity(target)) {
sub_803ED30(9999, target, 1, -1);
TryDisplayDungeonLoggableMessage4(attacker, target, gUnknown_80F9688); // It took no damage!
sub_8042238(attacker, target);

View File

@ -41,15 +41,14 @@
#include "pokemon_types.h"
#include "dungeon_run_end.h"
#include "dungeon_pos_data.h"
#include "dungeon_engine.h"
extern void sub_80429C8(Entity *r0);
extern bool8 sub_8045888(Entity *r0);
extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC);
extern void CalcDamage(Entity *, Entity *, u8, u32, u32, struct DamageStruct *dmgStruct, s24_8, u16, u32);
extern void sub_806A1E8(Entity *pokemon);
extern bool8 sub_8044B28(void);
extern void sub_804178C(u32);
extern void sub_8071DA4(Entity *);
extern void EnemyEvolution(Entity *);
extern void sub_80428A0(Entity *r0);
extern bool8 sub_8040BB0(Entity *entity, Move *move, bool8);
extern void sub_8040DA0(Entity *entity, Move *move);
@ -113,7 +112,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3
while (1) {
Move *currMove = &attackerInfo->moves.moves[moveId];
if (!EntityIsValid(attacker) || sub_8044B28())
if (!EntityIsValid(attacker) || IsFloorOver())
break;
if (currMove->id == MOVE_SNORE || currMove->id == MOVE_SLEEP_TALK) {
@ -186,7 +185,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3
}
sub_804178C(1);
if (!EntityIsValid(attacker) || sub_8044B28())
if (!EntityIsValid(attacker) || IsFloorOver())
break;
if (++moveId >= MAX_MON_MOVES)
break;
@ -218,7 +217,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3
}
if (EntityIsValid(attacker)) {
sub_8071DA4(attacker);
EnemyEvolution(attacker);
if (EntityIsValid(attacker) && gUnknown_202F222 != 0) {
gUnknown_202F222 = 0;
if (EntityIsValid(attacker)) {
@ -412,7 +411,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30,
var_24 = 1;
if (gUnknown_202F220 != 0 || gUnknown_202F221 != 0)
break;
if (!EntityIsValid(attacker) || sub_8044B28())
if (!EntityIsValid(attacker) || IsFloorOver())
return TRUE;
entInfo = GetEntInfo(attacker);
@ -487,14 +486,14 @@ bool8 sub_8056468(Entity *entity, Move *move, const u8 *str, Entity **unkArray,
{
s32 i;
bool8 ret = FALSE;
bool32 r7 = (sub_8045888(entity) != FALSE);
bool32 r7 = (ShouldDisplayEntity(entity) != FALSE);
if (str != NULL) {
for (i = 0; i < 65; i++) {
if (unkArray[i] == NULL) {
break;
}
if (sub_8045888(unkArray[i])) {
if (ShouldDisplayEntity(unkArray[i])) {
r7 = TRUE;
break;
}
@ -1194,7 +1193,7 @@ bool8 sub_80571F0(Entity * pokemon, Move *move)
bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance)
{
bool8 uVar2;
if (sub_8044B28())
if (IsFloorOver())
return FALSE;
if (!EntityIsValid(pokemon) || !EntityIsValid(target))
return FALSE;

View File

@ -177,7 +177,7 @@ static void WriteDungeonItems(DataSerializer *seri)
notEmpty = FALSE;
if (entity != NULL && GetEntityType(entity) == ENTITY_ITEM) {
item = GetItemData(entity);
item = GetItemInfo(entity);
WriteItem(seri, item); // 3 bytes
WriteBytes(seri, &entity->pos.x, 1); // 1 byte
WriteBytes(seri, &entity->pos.y, 1); // 1 byte
@ -207,7 +207,7 @@ static void WriteDungeonTraps(DataSerializer *seri)
notEmpty = FALSE;
if (entity != NULL && GetEntityType(entity) == ENTITY_TRAP) {
trap = GetTrapData(entity);
trap = GetTrapInfo(entity);
WriteBytes(seri, &trap->id, 1);
WriteBytes(seri, &trap->unk1, 1);
WriteBytes(seri, &entity->isVisible, 1);
@ -873,7 +873,7 @@ static void ReadDungeonItems(DataSerializer *seri)
ReadTilePos(seri, &pos);
if (item.flags & ITEM_FLAG_EXISTS)
AddItemToDungeonAt(&pos, &item, 0);
SpawnItem(&pos, &item, 0);
}
}
@ -1101,7 +1101,7 @@ static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index)
}
LoadIQSkills(mon);
sub_804535C(mon, NULL);
UpdateEntityPixelPos(mon, NULL);
}
}
}

View File

@ -185,7 +185,7 @@ void sub_803F508(Entity *a0)
if (gDungeon->unk1356C == 0) {
sub_806CD90();
}
sub_8049ED4();
UpdateTrapsVisibility();
ShowWholeRevealedDungeonMap();
}
@ -265,14 +265,14 @@ void sub_803F580(u8 a0)
}
if (before != strPtr->showInvisibleTrapsMonsters) {
sub_8049ED4();
UpdateTrapsVisibility();
ShowWholeRevealedDungeonMap();
sub_8041888(0);
}
if (a0 && strPtr->unk18213 == 0) {
if (abs(strPtr->cameraPixelPosMirror.x - strPtr->cameraPixelPos.x) > 7 || abs(strPtr->cameraPixelPosMirror.y - strPtr->cameraPixelPos.y) > 7) {
sub_8049ED4();
UpdateTrapsVisibility();
strPtr->unk18213 = 1;
}
else {
@ -296,7 +296,7 @@ void sub_803F580(u8 a0)
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
Entity *mon = gDungeon->activePokemon[i];
if (EntityIsValid(mon)) {
ShowDungeonMapAtPos(mon->pos.x, mon->pos.y);
DrawMinimapTile(mon->pos.x, mon->pos.y);
}
}
}
@ -352,7 +352,7 @@ void sub_803F878(s32 a0, s32 a1)
}
if (abs(strPtr->cameraPixelPosMirror.x - strPtr->cameraPixelPos.x) > 7 || abs(strPtr->cameraPixelPosMirror.y - strPtr->cameraPixelPos.y) > 7) {
sub_8049ED4();
UpdateTrapsVisibility();
strPtr->unk18213 = 1;
}
else {
@ -717,7 +717,7 @@ void HandleLuminousOrbAction(Entity *pokemon)
}
}
sub_803F580(0);
sub_8049ED4();
UpdateTrapsVisibility();
ShowWholeRevealedDungeonMap();
LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FD040);
}

View File

@ -54,12 +54,12 @@ u8 GetEntityRoom(Entity *entity)
return entity->room;
}
Trap* GetTrapData(Entity *entity)
Trap* GetTrapInfo(Entity *entity)
{
return entity->axObj.info.trap;
}
Item* GetItemData(Entity *entity)
Item* GetItemInfo(Entity *entity)
{
return entity->axObj.info.item;
}
@ -187,16 +187,16 @@ void sub_804522C(void)
}
}
void sub_804535C(Entity *entity, PixelPos *pos)
void UpdateEntityPixelPos(Entity *entity, PixelPos *pos)
{
if (pos != NULL) {
entity->pixelPos.x = pos->x;
entity->pixelPos.y = pos->y;
}
else {
entity->pixelPos.x = X_POS_TO_PIXELPOS(entity->pos.x);
entity->pixelPos.y = Y_POS_TO_PIXELPOS(entity->pos.y);
}
if (pos != NULL) {
entity->pixelPos.x = pos->x;
entity->pixelPos.y = pos->y;
}
else {
entity->pixelPos.x = X_POS_TO_PIXELPOS(entity->pos.x);
entity->pixelPos.y = Y_POS_TO_PIXELPOS(entity->pos.y);
}
}
void SetEntityPixelPos(Entity *entity, s32 x, s32 y)
@ -360,7 +360,7 @@ Entity *SpawnTrap(u8 trapID, DungeonPos *pos, u8 c)
return NULL;
}
Entity *sub_8045708(DungeonPos *pos)
Entity *SpawnItemEntity(DungeonPos *pos)
{
s32 i;
Entity *ent;
@ -438,7 +438,7 @@ bool8 sub_8045804(Entity *ent)
}
}
bool8 sub_8045888(Entity *ent)
bool8 ShouldDisplayEntity(Entity *ent)
{
if (ent->isVisible) {
s32 x = (ent->pixelPos.x / 256) - gDungeon->unk181e8.cameraPixelPos.x;

View File

@ -15,11 +15,11 @@
#include "move_util.h"
#include "moves.h"
#include "structs/str_dungeon.h"
#include "dungeon_engine.h"
extern u8 UseAttack(Entity *);
extern u8 DisplayActions(Entity *);
extern void sub_805E804(void);
void sub_806A2BC(Entity *pokemon, u8 param_2);
extern u8 sub_8044B28(void);
extern void nullsub_93(DungeonPos *);
extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32);
extern void sub_807EC28(bool8);
@ -43,8 +43,8 @@ void sub_807E378(void)
if (gDungeon->unk644.windTurns < 0xfa) {
sub_805E804();
sub_806A2BC(leader,1);
UseAttack(leader);
if (sub_8044B28() == 0) {
DisplayActions(leader);
if (IsFloorOver() == 0) {
LogMessageByIdWithPopupCheckUser(leader,gUnknown_80F9C4C);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0);
gDungeon->unk644.unk36 = 1;
@ -55,8 +55,8 @@ void sub_807E378(void)
if (gDungeon->unk644.windTurns < 0x96) {
sub_805E804();
sub_806A2BC(leader,1);
UseAttack(leader);
if (sub_8044B28() == 0) {
DisplayActions(leader);
if (IsFloorOver() == 0) {
LogMessageByIdWithPopupCheckUser(leader,gUnknown_80F9C70);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1);
gDungeon->unk644.unk36 = 2;
@ -67,8 +67,8 @@ void sub_807E378(void)
if (gDungeon->unk644.windTurns < 0x32) {
sub_805E804();
sub_806A2BC(leader,1);
UseAttack(leader);
if (sub_8044B28() == 0) {
DisplayActions(leader);
if (IsFloorOver() == 0) {
LogMessageByIdWithPopupCheckUser(leader,gUnknown_80F9C8C);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2);
gDungeon->unk644.unk36 = 3;
@ -78,12 +78,12 @@ void sub_807E378(void)
else if (gDungeon->unk644.windTurns < 1) {
sub_805E804();
sub_806A2BC(leader,1);
UseAttack(leader);
if (sub_8044B28() == 0) {
DisplayActions(leader);
if (IsFloorOver() == 0) {
LogMessageByIdWithPopupCheckUser(leader,gUnknown_80F9CBC);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3);
gDungeon->unk644.unk36 = 4;
sub_8068FE0(leader,0x21e,leader);
HandleFaint(leader,0x21e,leader);
}
}
}

View File

@ -25,8 +25,8 @@
#include "dungeon_misc.h"
#include "dungeon_items.h"
#include "dungeon_strings.h"
#include "dungeon_engine.h"
extern u8 sub_8044B28(void);
extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32);
extern void sub_804216C(Entity *pokemon, Entity *target, u32 r2);
extern void sub_804218C(Entity *pokemon, Entity *target);
@ -139,18 +139,18 @@ void HandleExplosion(Entity *pokemon,Entity *target,DungeonPos *param_3,s32 para
}
entity2 = tile->object;
if (((entity2 != NULL) && (entity2 != target)) && (GetEntityType(entity2) == ENTITY_ITEM)) {
RemoveItemFromDungeonAt(&pos, 0);
RemoveGroundItem(&pos, 0);
}
entity2 = tile->monster;
if (((entity2 != NULL) && (entity2 != target)) && (GetEntityType(entity2) == ENTITY_MONSTER)) {
sub_807E1A0(pokemon,entity2,moveType,uStack_2c,gUnknown_203B444[param_4]);
if (sub_8044B28()) break;
if (IsFloorOver()) break;
}
}
posPtr++;
}
}
if (sub_8044B28()) {
if (IsFloorOver()) {
return;
}
if (GetEntityType(target) == ENTITY_MONSTER) {
@ -167,7 +167,7 @@ void HandleExplosion(Entity *pokemon,Entity *target,DungeonPos *param_3,s32 para
}
}
ShowWholeRevealedDungeonMap();
sub_8049ED4();
UpdateTrapsVisibility();
}
}

View File

@ -63,7 +63,7 @@ void sub_807D3CC(Entity *param_1)
if (flag) {
LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80FD2F8); // All traps were exposed
ShowWholeRevealedDungeonMap();
sub_8049ED4();
UpdateTrapsVisibility();
}
else {
LogMessageByIdWithPopupCheckUser(param_1,gUnknown_80FD320); // There appears to be no hidden traps.

View File

@ -757,7 +757,7 @@ bool8 sub_8027E4C(Pokemon *pokeStruct)
return FALSE;
else
{
if(IsThrowableItem(pokeStruct->heldItem.id))
if(IsThrownItem(pokeStruct->heldItem.id))
{
if(gTeamInventoryRef->teamStorage[pokeStruct->heldItem.id] + pokeStruct->heldItem.quantity > 0x3e7)
return FALSE;
@ -785,7 +785,7 @@ void sub_8027EB8(void)
break;
case 2:
PlaySound(0x14d);
if(IsThrowableItem(sUnknown_203B2BC->item2.id))
if(IsThrownItem(sUnknown_203B2BC->item2.id))
gTeamInventoryRef->teamStorage[sUnknown_203B2BC->item2.id] += sUnknown_203B2BC->item2.quantity;
else
gTeamInventoryRef->teamStorage[sUnknown_203B2BC->item2.id] += 1;

View File

@ -42,7 +42,6 @@
extern void sub_80833E8(DungeonPos *param_1, s32 *param_2);
extern void sub_806A5B8(Entity *);
extern bool8 sub_8045888(Entity *ent);
extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32);
extern void sub_807D068(Entity *, DungeonPos *);
extern void sub_807EC28(bool8 arg0);
@ -145,7 +144,7 @@ void sub_807F43C(Entity *target, Entity *attacker)
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0);
TryDisplayDungeonLoggableMessage3(target, attacker, gUnknown_80FE690); // m0 was sent flying!
if (sub_8045888(attacker)) {
if (ShouldDisplayEntity(attacker)) {
PlaySoundEffect(0x1A3);
}
@ -169,8 +168,8 @@ void sub_807F43C(Entity *target, Entity *attacker)
for (i = 0; i < r6; i++) {
var_54.x += var_30;
var_54.y += r10;
sub_804535C(attacker, &var_54);
if (sub_8045888(attacker)) {
UpdateEntityPixelPos(attacker, &var_54);
if (ShouldDisplayEntity(attacker)) {
attacker->unk1C.raw = sin_4096(var_2C) << 5;
DungeonRunFrameActions(0x3B);
if (!(i & 3)) {
@ -185,7 +184,7 @@ void sub_807F43C(Entity *target, Entity *attacker)
var_54.x = pixelPosX;
var_54.y = pixelPosY;
attacker->unk1C.raw = 0;
sub_804535C(attacker, &var_54);
UpdateEntityPixelPos(attacker, &var_54);
DungeonRunFrameActions(0x3B);
GetEntInfo(attacker)->action.direction = attackerDirection & DIRECTION_MASK;

View File

@ -149,7 +149,7 @@ s32 GetNumberOfFilledInventorySlots(void)
}
// arm9.bin::02060FB0
bool8 IsThrowableItem(u8 id)
bool8 IsThrownItem(u8 id)
{
if ((GetItemCategory(id) != CATEGORY_THROWN_LINE) && (GetItemCategory(id) != CATEGORY_THROWN_ARC))
return FALSE;
@ -163,9 +163,9 @@ void ItemIdToItem(Item *item, u8 id, bool8 makeSticky)
if (id != ITEM_NOTHING) {
item->flags = ITEM_FLAG_EXISTS;
item->id = id;
if (IsThrowableItem(id)) {
s32 min = GetSpawnAmountRange(id, MIN_SPAWN_AMOUNT);
s32 max = GetSpawnAmountRange(id, MAX_SPAWN_AMOUNT);
if (IsThrownItem(id)) {
s32 min = GetThrownItemQuantityLimit(id, MIN_SPAWN_AMOUNT);
s32 max = GetThrownItemQuantityLimit(id, MAX_SPAWN_AMOUNT);
item->quantity = RandRange(min, max);
}
else if (GetItemCategory(id) == CATEGORY_POKE) {
@ -187,13 +187,13 @@ void ItemIdToItem(Item *item, u8 id, bool8 makeSticky)
}
// arm9.bin::02060E80
void ItemIdToBulkItem(BulkItem *dst, u8 id)
void InitBulkItem(BulkItem *dst, u8 id)
{
if (id != ITEM_NOTHING) {
dst->id = id;
if (IsThrowableItem(id)) {
s32 min = GetSpawnAmountRange(id, MIN_SPAWN_AMOUNT);
s32 max = GetSpawnAmountRange(id, MAX_SPAWN_AMOUNT);
if (IsThrownItem(id)) {
s32 min = GetThrownItemQuantityLimit(id, MIN_SPAWN_AMOUNT);
s32 max = GetThrownItemQuantityLimit(id, MAX_SPAWN_AMOUNT);
dst->quantity = RandRange(min, max);
}
else if (GetItemCategory(id) == CATEGORY_POKE)
@ -215,7 +215,7 @@ void BulkItemToItem(Item *dst, BulkItem *src)
if (src->id != ITEM_NOTHING) {
dst->flags = ITEM_FLAG_EXISTS;
dst->id = src->id;
is_throwable = IsThrowableItem(dst->id);
is_throwable = IsThrownItem(dst->id);
if (is_throwable != 0 || GetItemCategory(dst->id) == CATEGORY_POKE)
dst->quantity = src->quantity;
else if (dst->id == ITEM_TM_USED_TM)
@ -251,7 +251,7 @@ s32 GetStackBuyValue(Item *param_1)
{
if (param_1->id == ITEM_POKE)
return GetMoneyValue(param_1);
else if (IsThrowableItem(param_1->id))
else if (IsThrownItem(param_1->id))
return gItemParametersData[param_1->id].buyPrice * param_1->quantity;
else
return gItemParametersData[param_1->id].buyPrice;
@ -262,29 +262,29 @@ s32 GetStackSellValue(Item *param_1)
{
if (param_1->id == ITEM_POKE)
return GetMoneyValue(param_1);
else if (IsThrowableItem(param_1->id))
else if (IsThrownItem(param_1->id))
return gItemParametersData[param_1->id].sellPrice * param_1->quantity;
else
return gItemParametersData[param_1->id].sellPrice;
}
// arm9.bin::02060C7C
s32 GetStackBuyPrice(Item *param_1)
s32 GetActualBuyPrice(Item *param_1)
{
if (!CanSellItem(param_1->id))
if (!IsShoppableItem(param_1->id))
return 0;
else if (IsThrowableItem(param_1->id))
else if (IsThrownItem(param_1->id))
return gItemParametersData[param_1->id].buyPrice * param_1->quantity;
else
return gItemParametersData[param_1->id].buyPrice;
}
// arm9.bin::02060C18
s32 GetStackSellPrice(Item *param_1)
s32 GetActualSellPrice(Item *param_1)
{
if (!CanSellItem(param_1->id))
if (!IsShoppableItem(param_1->id))
return 0;
else if (IsThrowableItem(param_1->id))
else if (IsThrownItem(param_1->id))
return gItemParametersData[param_1->id].sellPrice * param_1->quantity;
else
return gItemParametersData[param_1->id].sellPrice;
@ -321,7 +321,7 @@ u32 GetItemActionType(u8 id)
}
// arm9.bin::02060B84
u32 GetSpawnAmountRange(u8 id, u32 rangeIndex)
u32 GetThrownItemQuantityLimit(u8 id, u32 rangeIndex)
{
return gItemParametersData[id].spawnAmountRange[rangeIndex];
}
@ -757,7 +757,7 @@ u32 sub_80913E0(Item* slot, u32 windowId, STATUSTEXTS(statuses))
}
// arm9.bin::0205FF28
bool8 CanSellItem(u32 id)
bool8 IsShoppableItem(u32 id)
{
u8 id_;
id = (u8)id;
@ -975,7 +975,7 @@ bool8 HasGummiItem(void)
// arm9.bin::0205FB18
void MoveToStorage(Item* slot)
{
if (IsThrowableItem(slot->id))
if (IsThrownItem(slot->id))
gTeamInventoryRef->teamStorage[slot->id] += slot->quantity;
else
gTeamInventoryRef->teamStorage[slot->id]++;
@ -1092,7 +1092,7 @@ bool8 AddKecleonShopItem(u8 itemIndex)
BulkItem held;
s32 i;
ItemIdToBulkItem(&held, itemIndex); // initialize
InitBulkItem(&held, itemIndex); // initialize
for (i = 0; i < MAX_KECLEON_ITEM_SHOP_ITEMS; i++) {
if (!gTeamInventoryRef->kecleonShopItems[i].id) {
@ -1208,7 +1208,7 @@ static bool8 AddKecleonWareItem(u8 itemIndex)
BulkItem held;
s32 i;
ItemIdToBulkItem(&held, itemIndex); // initialize
InitBulkItem(&held, itemIndex); // initialize
for (i = 0; i < MAX_KECLEON_WARE_SHOP_ITEMS; i++) {
if (!gTeamInventoryRef->kecleonWareItems[i].id) {

View File

@ -611,7 +611,7 @@ static void sub_8017A1C(void)
for (itemID = 0; itemID < NUMBER_OF_ITEM_IDS; itemID++) {
if (sub_801CFE0(itemID)) {
item.id = itemID;
if (IsThrowableItem(item.id)) {
if (IsThrownItem(item.id)) {
if (gTeamInventoryRef->teamStorage[item.id] > 99)
item.quantity = 99;
else
@ -762,7 +762,7 @@ static void sub_8017D24(void)
sub_801CBB8();
UpdateKangaskhanStorageState(KANGASKHAN_STORAGE_TOO_MANY_ITEMS);
}
else if (IsThrowableItem(gKangaskhanStorageWork->storedItem.id))
else if (IsThrownItem(gKangaskhanStorageWork->storedItem.id))
UpdateKangaskhanStorageState(24);
else
UpdateKangaskhanStorageState(27);

View File

@ -422,7 +422,7 @@ static void sub_80186F8(void)
if (sub_801CFE0(itemID) != 0) {
item.id = itemID;
if (IsThrowableItem(item.id)) {
if (IsThrownItem(item.id)) {
if (gTeamInventoryRef->teamStorage[item.id] > 99)
item.quantity = 99;
else
@ -571,7 +571,7 @@ static void HandleKangaskhanStorage2TakeMenu(void)
case TAKE_ACTION:
if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
sub_8012EA4(&sUnknown_203B20C->unk70, 1);
else if (IsThrowableItem(sUnknown_203B20C->item.id))
else if (IsThrownItem(sUnknown_203B20C->item.id))
UpdateKangaskhanStorage2State(12);
else {
gTeamInventoryRef->teamStorage[sUnknown_203B20C->item.id] -= sUnknown_203B20C->item.quantity;

View File

@ -740,7 +740,7 @@ static void HandleKecleonBrosSellAllItemsMenu(void)
for (slotIndex = 0; slotIndex < INVENTORY_SIZE; slotIndex++) {
item = &gTeamInventoryRef->teamItems[slotIndex];
if ((item->flags & ITEM_FLAG_EXISTS) && CanSellItem(item->id))
if ((item->flags & ITEM_FLAG_EXISTS) && IsShoppableItem(item->id))
ClearItemSlotAt(slotIndex);
}
@ -781,7 +781,7 @@ static void sub_80199CC(void)
ItemIdToItem(&sKecleonBrosWork1->soldItem, item->id, 0);
sKecleonBrosWork1->soldItem.quantity = item->quantity;
sKecleonBrosWork1->itemSellPrice = GetStackBuyPrice(&sKecleonBrosWork1->soldItem);
sKecleonBrosWork1->itemSellPrice = GetActualBuyPrice(&sKecleonBrosWork1->soldItem);
SetKecleonBrosState(20);
break;
case 4:
@ -796,7 +796,7 @@ static void sub_80199CC(void)
ItemIdToItem(&sKecleonBrosWork1->soldItem, item->id, 0);
sKecleonBrosWork1->soldItem.quantity = item->quantity;
sKecleonBrosWork1->itemSellPrice = GetStackBuyPrice(&sKecleonBrosWork1->soldItem);
sKecleonBrosWork1->itemSellPrice = GetActualBuyPrice(&sKecleonBrosWork1->soldItem);
SetKecleonBrosState(KECLEON_STORE_BUY_ITEM_INFO);
break;
case 2:
@ -823,13 +823,13 @@ static void sub_8019B08(void)
case 3:
sKecleonBrosWork1->soldItemInventoryIndex = sub_801A8AC();
sKecleonBrosWork1->soldItem = gTeamInventoryRef->teamItems[sKecleonBrosWork1->soldItemInventoryIndex];
sKecleonBrosWork1->itemSellPrice = GetStackSellPrice(&sKecleonBrosWork1->soldItem);
sKecleonBrosWork1->itemSellPrice = GetActualSellPrice(&sKecleonBrosWork1->soldItem);
SetKecleonBrosState(28);
break;
case 4:
sKecleonBrosWork1->soldItemInventoryIndex = sub_801A8AC();
sKecleonBrosWork1->soldItem = gTeamInventoryRef->teamItems[sKecleonBrosWork1->soldItemInventoryIndex];
sKecleonBrosWork1->itemSellPrice = GetStackSellPrice(&sKecleonBrosWork1->soldItem);
sKecleonBrosWork1->itemSellPrice = GetActualSellPrice(&sKecleonBrosWork1->soldItem);
sub_8099690(0);
SetKecleonBrosState(KECLEON_STORE_SELL_ITEM_INFO);
break;
@ -892,7 +892,7 @@ static void HandleKecleonBrosSellItemMenu(void)
case SELL_ACTION:
sub_8099690(0);
if (!CanSellItem(sKecleonBrosWork1->soldItem.id))
if (!IsShoppableItem(sKecleonBrosWork1->soldItem.id))
SetKecleonBrosState(KECLEON_STORE_CANT_SELL_ITEM);
else if (sKecleonBrosWork1->itemSellPrice + gTeamInventoryRef->teamMoney > MAX_TEAM_MONEY)
SetKecleonBrosState(KECLEON_STORE_SELL_ITEM_TOO_MUCH_MONEY);
@ -969,8 +969,8 @@ static void KecleonCalcSellPriceForAllItems(void)
for (index = 0; index < INVENTORY_SIZE; index++) {
item = &gTeamInventoryRef->teamItems[index];
if ((item->flags & ITEM_FLAG_EXISTS) != 0 && CanSellItem(item->id)) {
sellPrice = GetStackSellPrice(item);
if ((item->flags & ITEM_FLAG_EXISTS) != 0 && IsShoppableItem(item->id)) {
sellPrice = GetActualSellPrice(item);
sKecleonBrosWork1->inventoryItemSellPrice += sellPrice;
sKecleonBrosWork1->numInventoryItemToSell++;
}

View File

@ -61,7 +61,7 @@ u32 sub_8019EDC(bool8 r0)
slot.id = item->id;
slot.quantity = item->quantity;
if (GetStackBuyPrice(&slot) > gTeamInventoryRef->teamMoney)
if (GetActualBuyPrice(&slot) > gTeamInventoryRef->teamMoney)
PlayMenuSoundEffect(2);
else
PlayMenuSoundEffect(0);
@ -149,7 +149,7 @@ void sub_801A0D8(void)
local_7c.unk6 = 88;
local_7c.unk8 = 1;
sub_8090E14(auStack204, &item, &local_7c);
buyPrice = GetStackBuyPrice(&item);
buyPrice = GetActualBuyPrice(&item);
if (buyPrice <= gTeamInventoryRef->teamMoney) {
y = GetMenuEntryYCoord(&gUnknown_203B214->m.input, index);

View File

@ -61,7 +61,7 @@ u32 sub_801A2A8(bool8 r0)
slot.id = item->id;
slot.quantity = item->quantity;
if (GetStackBuyPrice(&slot) > gTeamInventoryRef->teamMoney)
if (GetActualBuyPrice(&slot) > gTeamInventoryRef->teamMoney)
PlayMenuSoundEffect(2);
else
PlayMenuSoundEffect(0);
@ -149,7 +149,7 @@ void sub_801A4A4(void)
local_7c.unk6 = 88;
local_7c.unk8 = 1;
sub_8090E14(buffer1, &item, &local_7c);
buyPrice = GetStackBuyPrice(&item);
buyPrice = GetActualBuyPrice(&item);
if (buyPrice <= gTeamInventoryRef->teamMoney) {
y = GetMenuEntryYCoord(&gUnknown_203B21C->m.input, index);

View File

@ -103,7 +103,7 @@ u32 sub_801A6E8(bool8 param_1)
case 4:
item = gTeamInventoryRef->teamItems[sub_801A8AC()];
if (CanSellItem(item.id) && GetStackSellPrice(&item) + gTeamInventoryRef->teamMoney <= MAX_TEAM_MONEY)
if (IsShoppableItem(item.id) && GetActualSellPrice(&item) + gTeamInventoryRef->teamMoney <= MAX_TEAM_MONEY)
PlayMenuSoundEffect(0);
else
PlayMenuSoundEffect(2);
@ -260,7 +260,7 @@ void sub_801A9E0(void)
struct unkStruct_8090F58 thing; // sp6C
u8 buf2[80]; // sp78
if (CanSellItem(item.id)) {
if (IsShoppableItem(item.id)) {
thing.unk0 = 3;
thing.unk4 = 0;
thing.unk6 = 88;
@ -268,7 +268,7 @@ void sub_801A9E0(void)
item.flags = 3;
sub_8090E14(buf1, &item, &thing);
if (GetStackSellPrice(&item) + gTeamInventoryRef->teamMoney > MAX_TEAM_MONEY) {
if (GetActualSellPrice(&item) + gTeamInventoryRef->teamMoney > MAX_TEAM_MONEY) {
sprintfStatic(buf2, sFmtRed, buf1);
PrintStringOnWindow(8, GetMenuEntryYCoord(&gUnknown_203B224->unk54.m.input, r7), buf2, gUnknown_203B224->unk54.m.menuWinId, 0);
}
@ -336,7 +336,7 @@ bool8 sub_801ADA0(s32 param_1)
if (!IsNotMoneyOrUsedTMItem(item.id))
return FALSE;
if (IsThrowableItem(item.id)) {
if (IsThrownItem(item.id)) {
uVar3_32 = sub_801AE24(item.id);
sum1 = gTeamInventoryRef->teamStorage[item.id];
uVar3 = uVar3_32;
@ -368,7 +368,7 @@ static s32 sub_801AE24(u32 itemID)
item = gTeamInventoryRef->teamItems[invIndex];
if (item.id == itemID) {
if (IsThrowableItem(item.id))
if (IsThrownItem(item.id))
count += item.quantity;
else
count++;

View File

@ -269,7 +269,7 @@ void HandleMissionReward(void)
{
if (gUnknown_203B310->unk10->moneyReward == 0) {
item.id = itemID;
if (IsThrowableItem(item.id)) {
if (IsThrownItem(item.id)) {
item.quantity = gUnknown_203B310->unk10->quantity;
}
else {

View File

@ -35,7 +35,6 @@
extern void sub_806A5B8(Entity *entity);
void sub_8075900(Entity *pokemon, u8 r1);
extern u8 sub_8044B28(void);
extern void sub_807EC28(bool8);
extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32);
extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32);

View File

@ -34,7 +34,6 @@
#include "dungeon_misc.h"
#include "dungeon_strings.h"
extern u8 sub_8044B28(void);
extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32);
extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32);

View File

@ -40,8 +40,8 @@
#include "trap.h"
#include "weather.h"
#include "dungeon_pos_data.h"
#include "dungeon_engine.h"
extern u8 sub_8044B28(void);
extern void sub_807EC28(bool8);
extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32);
extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32);
@ -622,9 +622,9 @@ _0805A8C2:
if (sub_80571F0(entity,&stackMove) == 0) {
sub_806F370(pokemon,entity,gSplashDmgValue,0,0,TYPE_NONE,sub_8057600(move, param_4),0,1,0);
}
if ((sub_8044B28() == 0) && (EntityIsValid(pokemon))) {
if ((IsFloorOver() == 0) && (EntityIsValid(pokemon))) {
sub_806F370(pokemon,pokemon,gSplashDmgValue,0,0,0,0x1fe,0,0,0);
if ((sub_8044B28() == 0) && (EntityIsValid(pokemon))) goto _0805A9FE;
if ((IsFloorOver() == 0) && (EntityIsValid(pokemon))) goto _0805A9FE;
}
}
else {
@ -651,7 +651,7 @@ _0805AA5E:
#else
DungeonPos *pos;
#endif
sub_804535C(target, NULL);
UpdateEntityPixelPos(target, NULL);
pos = r9;
if (sub_80706A4(target, pos)) {
WarpTarget(pokemon,target,0,0);
@ -1031,7 +1031,7 @@ bool8 SpikesMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_
{
TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC5A8); // A trap can't be laid here!
}
sub_8049ED4();
UpdateTrapsVisibility();
return trapLaid;
}

View File

@ -690,7 +690,7 @@ bool8 TrapbustOrbAction(Entity * pokemon,Entity * target, Move *move, s32 param_
for (yCoord = bottomRightCornerY; yCoord <= topLeftCornerY; yCoord++) {
object = GetTileMut(xCoord, yCoord)->object;
if (((object != 0) && (GetEntityType(object) == ENTITY_TRAP)) &&
(trapData = GetTrapData(object), trapData->id != TRAP_WONDER_TILE)) {
(trapData = GetTrapInfo(object), trapData->id != TRAP_WONDER_TILE)) {
pos.y = yCoord;
pos.x = xCoord;
sub_807FE04(&pos, 0);
@ -701,7 +701,7 @@ bool8 TrapbustOrbAction(Entity * pokemon,Entity * target, Move *move, s32 param_
if (foundTrap) {
TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD1B0);
ShowWholeRevealedDungeonMap();
sub_8049ED4();
UpdateTrapsVisibility();
}
else {
TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD1CC);

View File

@ -51,7 +51,7 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4)
for(x = -1; x < 2; x++)
sub_80498A8(tileCoords.x + x, tileCoords.y + y);
filledInTile = TRUE;
sub_806CF60();
DetermineAllMonsterShadow();
}
for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++)
@ -66,7 +66,7 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4)
TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD0B8);
}
ShowWholeRevealedDungeonMap();
sub_8049ED4();
UpdateTrapsVisibility();
return filledInTile;
}
}
@ -93,8 +93,8 @@ bool8 ItemizeOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4)
{
target->isVisible = FALSE;
CreateItemWithStickyChance(&stack, GetRandomFloorItem(0), 0);
sub_80464C8(pokemon, &posStruct, &stack);
sub_8068FE0(target, 0x218, pokemon);
SpawnDroppedItemWrapper(pokemon, &posStruct, &stack);
HandleFaint(target, 0x218, pokemon);
return TRUE;
}
}

View File

@ -94,7 +94,6 @@ extern void sub_8041D9C(Entity *);
extern void sub_8041DB0(Entity *pokemon);
extern void sub_8041CA8(Entity *);
extern void sub_8041C94(Entity *);
extern bool8 sub_8045888(Entity *r0);
extern void sub_803ED30(s32, Entity *r0, u8, s32);
extern void sub_8041BF8(Entity *);
extern void sub_8041BE8(Entity *);
@ -217,13 +216,13 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo
{
r8 = 0;
if (maxHPStat != 0) {
if (sub_8045888(target)) {
if (ShouldDisplayEntity(target)) {
r8 = maxHPStat;
}
TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB240); // m0$'s max HP rose by {VALUE_1}
}
if (HP != 0) {
if (sub_8045888(target)) {
if (ShouldDisplayEntity(target)) {
r8 = HP;
}
if (param_3 != 0) {
@ -947,7 +946,7 @@ void TransformStatusTarget(Entity * pokemon, Entity * target)
target->axObj.spriteFile = sprite;
entityInfo->invisibleClassStatus.status = STATUS_TRANSFORMED;
entityInfo->invisibleClassStatus.turns = CalculateStatusTurns(target, gTransformedTurnRange, TRUE) + 1;
sub_806CF98(target);
DetermineMonsterShadow(target);
nullsub_87(target);
sub_806CCB4(target, sub_806CEBC(target));
CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[1], entityInfo->apparentID);
@ -1059,7 +1058,7 @@ void BlindTarget(Entity *pokemon, Entity *target)
sub_8041E0C(target);
TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB7F4);
DungeonRunFrameActions(0x31);
sub_8049ED4();
UpdateTrapsVisibility();
ShowWholeRevealedDungeonMap();
}
else
@ -1086,7 +1085,7 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target)
entityInfo->blinkerClassStatus.status = STATUS_CROSS_EYED;
entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gCrossEyedTurnRange, TRUE) + 1;
sub_803F580(0x1);
sub_8049ED4();
UpdateTrapsVisibility();
ShowWholeRevealedDungeonMap();
}
else
@ -1112,7 +1111,7 @@ void RestoreVisionTarget(Entity *pokemon, Entity *target)
sub_8041E3C(target);
TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB880);
DungeonRunFrameActions(0x31);
sub_8049ED4();
UpdateTrapsVisibility();
ShowWholeRevealedDungeonMap();
}
else

View File

@ -545,7 +545,7 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target)
EntityUpdateStatusSprites(target);
if (entityInfo->isTeamLeader) {
DungeonRunFrameActions(0x31);
sub_8049ED4();
UpdateTrapsVisibility();
ShowWholeRevealedDungeonMap();
}
}

View File

@ -127,9 +127,9 @@ void HandleOneRoomOrb(Entity *pokemon, Entity *target)
sub_804EB30();
sub_804AAD4();
sub_8049884();
sub_806CF60();
DetermineAllMonsterShadow();
ShowWholeRevealedDungeonMap();
sub_8049ED4();
UpdateTrapsVisibility();
LogMessageByIdWithPopupCheckUser(pokemon,gUnknown_80FD3A0);
sub_803E708(0x28,0x2b);
sub_8075900(pokemon,1);

View File

@ -839,7 +839,7 @@ bool8 CanTakePokemonHeldItem(Pokemon *r0)
{
if(IsNotMoneyOrUsedTMItem(r0->heldItem.id))
{
if(IsThrowableItem(r0->heldItem.id))
if(IsThrownItem(r0->heldItem.id))
{
if((gTeamInventoryRef->teamStorage[r0->heldItem.id] + r0->heldItem.quantity) > 999)
return FALSE;
@ -870,7 +870,7 @@ void sub_8026FA4(void)
break;
case 2:
PlaySound(0x14d);
if(IsThrowableItem(sUnknown_203B2B8->item2.id))
if(IsThrownItem(sUnknown_203B2B8->item2.id))
{
gTeamInventoryRef->teamStorage[sUnknown_203B2B8->item2.id] += sUnknown_203B2B8->item2.quantity;
}

View File

@ -151,7 +151,7 @@ void CreateLevel1Pokemon(Pokemon *pokemon, s16 _species, u8* name, u32 _itemID,
pokemon->offense.def[0] = GetBaseDefensiveStat(species, 0);
pokemon->offense.def[1] = GetBaseDefensiveStat(species, 1);
pokemon->speciesNum = species;
ItemIdToBulkItem(&pokemon->heldItem, itemID);
InitBulkItem(&pokemon->heldItem, itemID);
pokemon->currExp = 0;
pokemon->tacticIndex = TACTIC_LETS_GO_TOGETHER;
pokemon->IQ = 1;
@ -214,7 +214,7 @@ void ConvertStoryMonToPokemon(Pokemon *dst, const struct StoryMonData *src)
dst->offense.def[0] = src->offenseDef[0];
dst->offense.def[1] = src->offenseDef[1];
dst->speciesNum = src->speciesNum;
ItemIdToBulkItem(&dst->heldItem, src->itemID);
InitBulkItem(&dst->heldItem, src->itemID);
dst->currExp = src->currExp;
dst->tacticIndex = TACTIC_LETS_GO_TOGETHER;
dst->IQ = src->IQ;
@ -1007,7 +1007,7 @@ void sub_808DFDC(s32 a1, DungeonMon* a2)
}
}
void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level)
void GetLvlUpEntry(LevelData* a1, s32 _id, s32 level)
{
u8 buffer[12];
s32 id = SpeciesId(_id);

Some files were not shown because too many files have changed in this diff Show More