Identify special move IDs, some move effect documentation, identify some unkStruct_80BDBC4 and unkStruct_80C183C fields

This commit is contained in:
Electro 2025-09-12 17:04:27 +01:00
parent 123d35fbbc
commit 462e83f8d2
14 changed files with 4918 additions and 4878 deletions

View File

@ -418,6 +418,28 @@
#define MOVE_MD1_2 0x19B // Unused
#define MOVE_PIERCE 0x19C
#define NUM_MOVE_IDS (MOVE_PIERCE + 1)
#define NUM_REGULAR_MOVE_IDS (MOVE_PIERCE + 1)
// special move effects derived from regular moves
// e.g. second turn of a multi-turn move
#define MOVE_UNK_19D 0x19D // Unused
#define MOVE_WEATHER_BALL_SUNNY 0x19E
#define MOVE_WEATHER_BALL_HAIL 0x19F
#define MOVE_WEATHER_BALL_RAIN 0x1A0
#define MOVE_WEATHER_BALL_SANDSTORM 0x1A1
#define MOVE_DIG_2ND_TURN 0x1A2
#define MOVE_RAZOR_WIND_2ND_TURN 0x1A3
#define MOVE_FOCUS_PUNCH_2ND_TURN 0x1A4
#define MOVE_SKY_ATTACK_2ND_TURN 0x1A5
#define MOVE_SOLARBEAM_2ND_TURN 0x1A6
#define MOVE_FLY_2ND_TURN 0x1A7
#define MOVE_DIVE_2ND_TURN 0x1A8
#define MOVE_BOUNCE_2ND_TURN 0x1A9
#define MOVE_SKULL_BASH_2ND_TURN 0x1AA
#define MOVE_CURSE_GHOST 0x1AB
#define MOVE_SNORE_ATTACK 0x1AC
#define MOVE_SLEEP_TALK_ATTACK 0x1AD
#define NUM_MOVE_IDS (MOVE_SLEEP_TALK_ATTACK + 1)
#endif

View File

@ -18,7 +18,7 @@ s32 CalcSpeedStage(Entity *pokemon);
s32 sub_8070828(Entity *pokemon, bool8 displayMessage);
void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum);
void sub_8070968(u8 *buffer, EntityInfo *entityInfo, s32 colorNum);
void sub_80709C8(u8 *buffer, EntityInfo *entityInfo);
void CopyEntityNameForDungeonExitSummary(u8 *buffer, EntityInfo *entityInfo);
bool8 HasNegativeStatus(Entity *pokemon);
bool8 IsSleeping(Entity *pokemon);
bool8 HasLowHealth(Entity *pokemon);

View File

@ -30,7 +30,7 @@ typedef struct unkStruct_80BDBC4
s32 unkC;
s32 unk10;
s32 unk14;
s32 unk18;
s32 soundEffectId;
s32 unk1C; // Amount of gUnknown_80C183C entries to scan
s32 unk20; // Index into gUnknown_80C183C
} unkStruct_80BDBC4;
@ -38,18 +38,18 @@ typedef struct unkStruct_80BDBC4
typedef struct unkStruct_80C183C
{
// size: 0xc
s16 unk0;
s16 species;
s16 unk2;
s32 unk4;
s32 unk8;
s32 soundEffectId;
} unkStruct_80C183C;
const unkStruct_80B9CC4 *sub_800ECA4(s32 param_1);
const unkStruct_80BDBC4 *sub_800ECB8(u16 param_1);
const unkStruct_80BDBC4 *sub_800ECB8(u16 moveId);
const unkStruct_80C183C *sub_800ECD0(s32 param_1);
s16 sub_800ECE4(u8 param_1);
s16 sub_800ECF8(u8 param_1);
s16 sub_800ED0C(u8 param_1);
s32 sub_800ED20(u16 param_1);
s32 sub_800ED20(u16 moveId);
#endif

View File

@ -45,7 +45,7 @@ s32 sub_800E49C(u8 a0, DungeonPos *pos, DungeonPos posArray[4], bool8 a3, s32 a4
s32 sub_800E52C(struct UnkStruct_8040094 *a0);
s32 sub_800E6D8(s32 a0);
s32 sub_800E700(s32 a0);
s32 sub_800E710(s32 a0_, s32 a1);
s32 sub_800E710(s32 species, s32 moveId);
s32 sub_800E790(s32 a0_, s32 a1);
bool8 sub_800E7D0(u16 *param_1);
bool8 sub_800E838(u16 *param_1, s32 param_2);
@ -61,7 +61,7 @@ s32 sub_800EA84(struct UnkStruct_8040094 *a0);
void sub_800EB24(s32 param_1, DungeonPos *param_2, DungeonPos *param_3, s32 r5, s32 r4);
s32 sub_800EBC8(struct UnkStruct_8040094 *a0);
u8 sub_800EC74(void);
u8 sub_800EC84(s32 param_1);
bool8 sub_800EC84(s32 moveId);
u8 sub_800EC94(s32 param_1);

View File

@ -33,7 +33,7 @@ struct UnkStruct_8040094
};
extern u8 sub_800EC94(s32 param_1);
extern s32 sub_800E710(s32 a0, u16 a1);
extern s32 sub_800E710(s32 species, u16 moveId);
extern void sub_800EEC8(u16 r0);
extern void sub_8042DD4(s32 a0, Entity *a1, s32 a2);
extern u8 sub_800EA44(s32 species, u16 a2);
@ -48,17 +48,17 @@ extern bool8 sub_803F428(DungeonPos *pos);
extern void sub_800EEE0(u16 a0);
extern s32 sub_800EBC8(struct UnkStruct_8040094 *a0);
extern bool8 sub_800E7D0(struct UnkStruct_8040094 *a0);
extern u8 sub_800EC84(s32 param_1);
extern bool8 sub_800EC84(s32 moveId);
extern bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move);
extern bool8 IsSleeping(Entity *pokemon);
extern void sub_80421C0(Entity *pokemon, u16);
extern const s32 gUnknown_8106A8C[];
u16 sub_80412E0(u16 moveId, u8 weather, bool32 a2);
static bool32 sub_804143C(Entity *entity, Move *move);
u16 getEffectiveMoveId(u16 moveId, u8 weather, bool32 hasSpecialEffect);
static bool32 moveHasSpecialEffect(Entity *entity, Move *move);
static bool8 sub_80414C0(Entity *entity, Move *move);
static bool8 sub_804141C(u16 moveId, u8 weather, bool32 a2);
static bool8 sub_804141C(u16 moveId, u8 weather, bool32 hasSpecialEffect);
static void sub_8040C4C(Entity *entity, Move *move, bool32 a2);
static void sub_8041038(struct UnkStruct_8040094 *a0, Entity *entity, Move *move, bool32 a2);
static void sub_8041108(struct UnkStruct_8040094 *a0, Entity *entity, Move *move, bool32 a2);
@ -66,9 +66,9 @@ static void sub_8041500(struct UnkStruct_8040094 *a0);
bool8 sub_8040BB0(Entity *entity, Move *move, bool8 a2)
{
bool32 r8 = sub_804143C(entity, move);
bool8 r9 = sub_804141C(move->id, GetApparentWeather(entity), r8);
s32 r4 = sub_800ECB8(sub_80412E0(move->id, GetApparentWeather(entity), r8))->unk0;
bool32 hasSpecialEffect = moveHasSpecialEffect(entity, move);
bool8 r9 = sub_804141C(move->id, GetApparentWeather(entity), hasSpecialEffect);
s32 r4 = sub_800ECB8(getEffectiveMoveId(move->id, GetApparentWeather(entity), hasSpecialEffect))->unk0;
if (!sub_8042768(entity))
return r9;
@ -78,21 +78,21 @@ bool8 sub_8040BB0(Entity *entity, Move *move, bool8 a2)
return r9;
if (r4 != 0) {
sub_8040C4C(entity, move, r8);
sub_8040C4C(entity, move, hasSpecialEffect);
}
return r9;
}
static void sub_8040C4C(Entity *entity, Move *move, bool32 a2)
static void sub_8040C4C(Entity *entity, Move *move, bool32 hasSpecialEffect)
{
u8 savedUnkVar;
s32 r4;
struct UnkStruct_8040094 sp;
u16 r9 = sub_80412E0(move->id, GetApparentWeather(entity), a2);
u16 r9 = getEffectiveMoveId(move->id, GetApparentWeather(entity), hasSpecialEffect);
EntityInfo *entInfo = GetEntInfo(entity);
bool8 r8 = sub_800EC94(move->id);
s32 apparentId = entInfo->apparentID;
s32 r2 = sub_800E710(apparentId, sub_80412E0(move->id, GetApparentWeather(entity), TRUE));
s32 r2 = sub_800E710(apparentId, getEffectiveMoveId(move->id, GetApparentWeather(entity), TRUE));
if (r2 != -1) {
sub_800569C(&sp.unk8, &entity->axObj.axdata, r2);
@ -144,12 +144,12 @@ void sub_8040DA0(Entity *entity, Move *move)
s32 soundEffectId;
Entity *anotherEntity;
struct UnkStruct_8040094 sp;
bool32 r9 = sub_804143C(entity, move);
bool32 hasSpecialEffect = moveHasSpecialEffect(entity, move);
bool8 var_28 = FALSE;
EntityInfo *entInfo = GetEntInfo(entity);
u8 var_24 = sub_800EA44(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), r9));
u8 var_24 = sub_800EA44(entInfo->apparentID, getEffectiveMoveId(move->id, GetApparentWeather(entity), hasSpecialEffect));
sub_8041038(&sp, entity, move, r9);
sub_8041038(&sp, entity, move, hasSpecialEffect);
if (sub_800E838(&sp, 1)) {
anotherEntity = gDungeon->unk181e8.cameraTarget;
}
@ -184,7 +184,7 @@ void sub_8040DA0(Entity *entity, Move *move)
sub_80421C0(anotherEntity, 0x1A4);
}
soundEffectId = sub_800E790(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), r9));
soundEffectId = sub_800E790(entInfo->apparentID, getEffectiveMoveId(move->id, GetApparentWeather(entity), hasSpecialEffect));
if (soundEffectId != 0x3E5) {
PlaySoundEffect((u16) soundEffectId);
}
@ -192,7 +192,7 @@ void sub_8040DA0(Entity *entity, Move *move)
if (var_24 == 99) {
if (sub_8042768(anotherEntity)) {
s32 direction = entInfo->action.direction;
sub_8041108(&sp, entity, move, r9);
sub_8041108(&sp, entity, move, hasSpecialEffect);
for (i = 0; i < NUM_DIRECTIONS; i++) {
direction--;
direction &= DIRECTION_MASK;
@ -204,7 +204,7 @@ void sub_8040DA0(Entity *entity, Move *move)
else if (var_24 == 98) {
if (sub_8042768(anotherEntity)) {
s32 direction = entInfo->action.direction;
sub_8041108(&sp, entity, move, r9);
sub_8041108(&sp, entity, move, hasSpecialEffect);
for (i = 0; i < NUM_DIRECTIONS + 1; i++) {
direction &= DIRECTION_MASK;
sub_806CDD4(entity, 0, direction);
@ -226,7 +226,7 @@ void sub_8040DA0(Entity *entity, Move *move)
}
if ((unk & 2) && !var_28) {
sub_8041108(&sp, entity, move, r9);
sub_8041108(&sp, entity, move, hasSpecialEffect);
var_28 = TRUE;
}
if (unk & 1)
@ -238,13 +238,13 @@ void sub_8040DA0(Entity *entity, Move *move)
}
}
static void sub_8041038(struct UnkStruct_8040094 *a0, Entity *entity, Move *move, bool32 a2)
static void sub_8041038(struct UnkStruct_8040094 *a0, Entity *entity, Move *move, bool32 hasSpecialEffect)
{
EntityInfo *entInfo = GetEntInfo(entity);
u16 var_24 = sub_80412E0(move->id, GetApparentWeather(entity), a2);
u16 effectiveMoveId = getEffectiveMoveId(move->id, GetApparentWeather(entity), hasSpecialEffect);
if (sub_800ECB8(var_24)->unk2 != 0) {
s32 r2 = sub_800E710(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), a2));
if (sub_800ECB8(effectiveMoveId)->unk2 != 0) {
s32 r2 = sub_800E710(entInfo->apparentID, getEffectiveMoveId(move->id, GetApparentWeather(entity), hasSpecialEffect));
if (r2 != -1) {
sub_800569C(&a0->unk8, &entity->axObj.axdata, r2);
@ -253,7 +253,7 @@ static void sub_8041038(struct UnkStruct_8040094 *a0, Entity *entity, Move *move
a0->unk8 = (DungeonPos) {0};
}
a0->unk0 = var_24;
a0->unk0 = effectiveMoveId;
a0->unk2 = entInfo->apparentID;
a0->unk4.x = entity->pixelPos.x / 256;
a0->unk4.y = entity->pixelPos.y / 256;
@ -265,14 +265,14 @@ static void sub_8041038(struct UnkStruct_8040094 *a0, Entity *entity, Move *move
}
}
static void sub_8041108(struct UnkStruct_8040094 *a0, Entity *entity, Move *move, bool32 a2)
static void sub_8041108(struct UnkStruct_8040094 *a0, Entity *entity, Move *move, bool32 hasSpecialEffect)
{
u16 r4 = sub_80412E0(move->id, GetApparentWeather(entity), a2);
s32 var = sub_800ECB8(r4)->unk2;
u16 effectiveMoveId = getEffectiveMoveId(move->id, GetApparentWeather(entity), hasSpecialEffect);
s32 var = sub_800ECB8(effectiveMoveId)->unk2;
if (a0->unk0 != 0 && var != 0) {
sub_8041500(a0);
sub_800EEF8(r4);
sub_800EEF8(effectiveMoveId);
sub_800EF64();
DungeonRunFrameActions(0x5A);
sub_8042DD4(sub_800E52C(a0), entity, 1);
@ -284,9 +284,9 @@ void sub_8041168(Entity *entity, Entity *entity2, Move *move, DungeonPos *pos)
s32 var2;
s32 var3;
struct UnkStruct_8040094 sp;
bool32 r5 = (sub_804143C(entity, move) != 0);
u16 r10 = sub_80412E0(move->id, GetApparentWeather(entity), r5);
s32 var = sub_800ECB8(r10)->unk4;
bool32 hasSpecialEffect = (moveHasSpecialEffect(entity, move) != FALSE);
u16 effectiveMoveId = getEffectiveMoveId(move->id, GetApparentWeather(entity), hasSpecialEffect);
s32 var = sub_800ECB8(effectiveMoveId)->unk4;
EntityInfo *ent2Info = NULL;
if (EntityIsValid(entity2)) {
@ -317,7 +317,7 @@ void sub_8041168(Entity *entity, Entity *entity2, Move *move, DungeonPos *pos)
sp.unk8 = (DungeonPos) {0};
}
sp.unk0 = r10;
sp.unk0 = effectiveMoveId;
if (ent2Info != NULL) {
sp.unk2 = ent2Info->apparentID;
sp.unk4.x = entity2->pixelPos.x / 256;
@ -337,7 +337,7 @@ void sub_8041168(Entity *entity, Entity *entity2, Move *move, DungeonPos *pos)
sp.unk10 = 0;
sub_8041500(&sp);
sub_800EEE0(r10);
sub_800EEE0(effectiveMoveId);
sub_800EF64();
var3 = sub_800EBC8(&sp);
DungeonRunFrameActions(0x5B);
@ -349,7 +349,7 @@ void sub_8041168(Entity *entity, Entity *entity2, Move *move, DungeonPos *pos)
}
}
u16 sub_80412E0(u16 moveId, u8 weather, bool32 a2)
u16 getEffectiveMoveId(u16 moveId, u8 weather, bool32 hasSpecialEffect)
{
u16 ret = moveId;
@ -361,57 +361,57 @@ u16 sub_80412E0(u16 moveId, u8 weather, bool32 a2)
ret = moveId;
break;
case WEATHER_SUNNY:
ret = 0x19E;
ret = MOVE_WEATHER_BALL_SUNNY;
break;
case WEATHER_SANDSTORM:
ret = 0x1A1;
ret = MOVE_WEATHER_BALL_SANDSTORM;
break;
case WEATHER_RAIN:
ret = 0x1A0;
ret = MOVE_WEATHER_BALL_RAIN;
break;
case WEATHER_HAIL:
case WEATHER_SNOW:
ret = 0x19F;
ret = MOVE_WEATHER_BALL_HAIL;
break;
}
}
else if (a2) {
else if (hasSpecialEffect) {
switch (moveId) {
case MOVE_DIG:
ret = 0x1A2;
ret = MOVE_DIG_2ND_TURN;
break;
case MOVE_RAZOR_WIND:
ret = 0x1A3;
ret = MOVE_RAZOR_WIND_2ND_TURN;
break;
case MOVE_FOCUS_PUNCH:
ret = 0x1A4;
ret = MOVE_FOCUS_PUNCH_2ND_TURN;
break;
case MOVE_SKY_ATTACK:
ret = 0x1A5;
ret = MOVE_SKY_ATTACK_2ND_TURN;
break;
case MOVE_SOLARBEAM:
ret = 0x1A6;
ret = MOVE_SOLARBEAM_2ND_TURN;
break;
case MOVE_FLY:
ret = 0x1A7;
ret = MOVE_FLY_2ND_TURN;
break;
case MOVE_DIVE:
ret = 0x1A8;
ret = MOVE_DIVE_2ND_TURN;
break;
case MOVE_BOUNCE:
ret = 0x1A9;
ret = MOVE_BOUNCE_2ND_TURN;
break;
case MOVE_SKULL_BASH:
ret = 0x1AA;
ret = MOVE_SKULL_BASH_2ND_TURN;
break;
case MOVE_CURSE:
ret = 0x1AB;
ret = MOVE_CURSE_GHOST;
break;
case MOVE_SNORE:
ret = 0x1AC;
ret = MOVE_SNORE_ATTACK;
break;
case MOVE_SLEEP_TALK:
ret = 0x1AD;
ret = MOVE_SLEEP_TALK_ATTACK;
break;
default:
ret = moveId;
@ -422,17 +422,17 @@ u16 sub_80412E0(u16 moveId, u8 weather, bool32 a2)
return ret;
}
UNUSED static s32 sub_8041400(u16 moveId, u8 weather, bool32 a2)
UNUSED static s32 sub_8041400(u16 moveId, u8 weather, bool32 hasSpecialEffect)
{
return sub_800ED20(sub_80412E0(moveId, weather, a2));
return sub_800ED20(getEffectiveMoveId(moveId, weather, hasSpecialEffect));
}
static bool8 sub_804141C(u16 moveId, u8 weather, bool32 a2)
static bool8 sub_804141C(u16 moveId, u8 weather, bool32 hasSpecialEffect)
{
return sub_800EC84(sub_80412E0(moveId, weather, a2));
return sub_800EC84(getEffectiveMoveId(moveId, weather, hasSpecialEffect));
}
static bool32 sub_804143C(Entity *entity, Move *move)
static bool32 moveHasSpecialEffect(Entity *entity, Move *move)
{
if (move->id == MOVE_CURSE) {
if (EntityIsValid(entity) && GetEntityType(entity) == ENTITY_MONSTER) {

View File

@ -314,7 +314,7 @@ void UpdateAdventureAchievements(void)
SetAdventureAchievement(AA_ALL_POKEMON_LEADERS);
moveCount = 0;
for (i = 0; i < NUM_MOVE_IDS; i++) {
for (i = 0; i < NUM_REGULAR_MOVE_IDS; i++) {
if (i == MOVE_NOTHING || i == MOVE_REGULAR_ATTACK || i == MOVE_IS_WATCHING || i == MOVE_BIDE_2)
continue;

View File

@ -30,13 +30,13 @@ void sub_8083AB0(s16 dungeonExitReason_, Entity *target, Entity *entity)
}
entityInfo = GetEntInfo(entity);
if (targetEntityInfo != NULL) {
sub_80709C8(buffer, targetEntityInfo);
CopyEntityNameForDungeonExitSummary(buffer, targetEntityInfo);
CopyStringtoBuffer(exitSummary->buffer1, buffer);
}
else {
CopyStringtoBuffer(exitSummary->buffer1, gUnknown_80FE6F4); // Someone
}
sub_80709C8(buffer,entityInfo);
CopyEntityNameForDungeonExitSummary(buffer,entityInfo);
CopyStringtoBuffer(exitSummary->buffer2, buffer);
exitSummary->exitReason = dungeonExitReason;
exitSummary->heldItem = entityInfo->heldItem;

View File

@ -10,6 +10,7 @@
#include "dungeon_run_end.h"
#include "dungeon_music.h"
#include "game_options.h"
#include "constants/dungeon_exit.h"
void ShowDungeonClearedWindow(void)
{
@ -37,14 +38,14 @@ void ShowDungeonClearedWindow(void)
header.f3 = 0;
windows.id[0].pos.y = 20;
DungeonShowWindows(&windows, TRUE);
if (gDungeon->exitSummary.exitReason > 549) {
if (gDungeon->exitSummary.exitReason >= DUNGEON_EXIT_REASON_SUCCESS) {
PlayDungeonCompleteBGM();
}
else {
PlayDungeonFailBGM();
}
PrintOnDungeonFinishedWindow(0, gText_TheLastOuting,&gDungeon->exitSummary);
while(1) {
while(TRUE) {
sub_803E668(0x36);
UpdateDungeonMusic();
if (windows.id[0].pos.y >= 4){

View File

@ -439,27 +439,31 @@ void sub_8070968(u8 *buffer, EntityInfo *entityInfo, s32 colorNum)
}
}
void sub_80709C8(u8 *buffer, EntityInfo *entityInfo)
void CopyEntityNameForDungeonExitSummary(u8 *buffer, EntityInfo *entityInfo)
{
if (((gDungeon->unk181e8.blinded ||
gDungeon->unk181e8.hallucinating) ||
(entityInfo->invisibleClassStatus.status == STATUS_INVISIBLE)) &&
(entityInfo->isNotTeamMember))
{
// "Pokémon"
strcpy(buffer, gUnknown_80F8994);
}
else
{
if (entityInfo->curseClassStatus.status == STATUS_DECOY) {
// "Decoy"
strcpy(buffer, gUnknown_80F8974);
}
else
{
if (entityInfo->isNotTeamMember) {
// use apparent ID for entity name
CopyMonsterNameToBuffer(buffer, entityInfo->apparentID);
}
else
{
// copy team member's name
sub_808DA0C(buffer, &gRecruitedPokemonRef->dungeonTeam[entityInfo->teamIndex]);
}
}

View File

@ -53,7 +53,7 @@ extern void sub_804178C(u32);
extern void sub_80428A0(Entity *r0);
extern bool8 sub_8040BB0(Entity *entity, Move *move, bool8);
extern void sub_8040DA0(Entity *entity, Move *move);
extern u16 sub_80412E0(u16 moveId, u8 weather, u8 a2);
extern u16 getEffectiveMoveId(u16 moveId, u8 weather, u8 hasSpecialEffect);
extern void sub_800EF10(u16 r0);
extern void sub_800E3AC(s32 a0, DungeonPos *pos, s32 a2);
extern void sub_8041168(Entity *entity, Entity *entity2, Move *,DungeonPos *);

View File

@ -49,7 +49,7 @@ extern void sub_804178C(u32);
extern void sub_80428A0(Entity *r0);
extern bool8 sub_8040BB0(Entity *entity, Move *move, bool8);
extern void sub_8040DA0(Entity *entity, Move *move);
extern u16 sub_80412E0(u16 moveId, u8 weather, u8 a2);
extern u16 getEffectiveMoveId(u16 moveId, u8 weather, u8 hasSpecialEffect);
extern void sub_800EF10(u16 r0);
extern void sub_800E3AC(s32 a0, DungeonPos *pos, s32 a2);
extern void sub_8041168(Entity *entity, Entity *entity2, Move *,DungeonPos *);
@ -477,24 +477,24 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30,
return TRUE;
}
bool8 sub_8056468(Entity *entity, Move *move, const u8 *str, Entity **unkArray, bool32 itemId, bool8 arg_4, bool32 unused)
bool8 sub_8056468(Entity *entity, Move *move, const u8 *str, Entity **targetsArray, bool32 itemId, bool8 arg_4, bool32 unused)
{
s32 i;
bool8 ret = FALSE;
bool32 r7 = (ShouldDisplayEntity(entity) != FALSE);
bool32 entityIsDisplayed = (ShouldDisplayEntity(entity) != FALSE);
if (str != NULL) {
for (i = 0; i < 65; i++) {
if (unkArray[i] == NULL) {
if (targetsArray[i] == NULL) {
break;
}
if (ShouldDisplayEntity(unkArray[i])) {
r7 = TRUE;
if (ShouldDisplayEntity(targetsArray[i])) {
entityIsDisplayed = TRUE;
break;
}
}
if (r7) {
if (entityIsDisplayed) {
SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(entity), 0);
if (itemId == 0) {
BufferMoveName(gFormatBuffer_Items[0], move, NULL);
@ -512,7 +512,7 @@ bool8 sub_8056468(Entity *entity, Move *move, const u8 *str, Entity **unkArray,
}
}
if (r7) {
if (entityIsDisplayed) {
if (arg_4) {
ret = sub_8040BB0(entity, move, TRUE);
}
@ -535,7 +535,7 @@ s32 sub_8056564(Entity *entity, DungeonPos *pos, Move *move, s32 r4)
EntityInfo *entInfo = GetEntInfo(entity);
if (!gDungeon->unk181e8.blinded && (GetBodySize(entInfo->apparentID) < 4 || r4 != 1)) {
s32 unk6 = sub_800ECB8(sub_80412E0(move->id, GetApparentWeather(entity), 1))->unk6;
s32 unk6 = sub_800ECB8(getEffectiveMoveId(move->id, GetApparentWeather(entity), TRUE))->unk6;
s32 pixelPosX = X_POS_TO_PIXELPOS(pos->x);
s32 pixelPosY = Y_POS_TO_PIXELPOS(pos->y);
@ -545,17 +545,17 @@ s32 sub_8056564(Entity *entity, DungeonPos *pos, Move *move, s32 r4)
if (unk6 != 0) {
s32 someRetVal;
sub_800EF10(sub_80412E0(move->id, GetApparentWeather(entity), 1));
sub_800EF10(getEffectiveMoveId(move->id, GetApparentWeather(entity), TRUE));
sub_800EF64();
DungeonRunFrameActions(0x5E);
someRetVal = sub_800E710(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), 1));
someRetVal = sub_800E710(entInfo->apparentID, getEffectiveMoveId(move->id, GetApparentWeather(entity), TRUE));
if (someRetVal != -1) {
sub_800569C(&unkSp1.unk8, &entity->axObj.axdata, someRetVal);
}
else {
unkSp1.unk8 = (DungeonPos) {0};
}
unkSp1.unk0 = sub_80412E0(move->id, GetApparentWeather(entity), 1);
unkSp1.unk0 = getEffectiveMoveId(move->id, GetApparentWeather(entity), TRUE);
unkSp1.unk2 = entInfo->apparentID;
unkSp1.unk4.x = entity->pixelPos.x / 256;
unkSp1.unk4.y = entity->pixelPos.y / 256;

File diff suppressed because it is too large Load Diff

View File

@ -878,15 +878,15 @@ s32 sub_800E700(s32 a0)
return sub_800E900((s16) a0);
}
s32 sub_800E710(s32 a0_, s32 a1)
s32 sub_800E710(s32 species_, s32 moveId)
{
s32 i;
s32 a0 = (s16) (a0_);
const unkStruct_80BDBC4 *unkPtr1 = sub_800ECB8(a1);
s32 species = (s16) (species_);
const unkStruct_80BDBC4 *unkPtr1 = sub_800ECB8(moveId);
const unkStruct_80C183C *unkPtr2 = sub_800ECD0(unkPtr1->unk20);
for (i = 0; i < unkPtr1->unk1C; i++, unkPtr2++) {
if (unkPtr2->unk0 == a0) {
if (unkPtr2->species == species) {
return unkPtr2->unk4;
}
}
@ -894,15 +894,15 @@ s32 sub_800E710(s32 a0_, s32 a1)
}
// Literally the same as the func above.
static s32 sub_800E750(s32 a0_, s32 a1)
static s32 sub_800E750(s32 species_, s32 moveId)
{
s32 i;
s32 a0 = (s16) (a0_);
const unkStruct_80BDBC4 *unkPtr1 = sub_800ECB8(a1);
s32 species = (s16) (species_);
const unkStruct_80BDBC4 *unkPtr1 = sub_800ECB8(moveId);
const unkStruct_80C183C *unkPtr2 = sub_800ECD0(unkPtr1->unk20);
for (i = 0; i < unkPtr1->unk1C; i++, unkPtr2++) {
if (unkPtr2->unk0 == a0) {
if (unkPtr2->species == species) {
return unkPtr2->unk4;
}
}
@ -910,19 +910,19 @@ static s32 sub_800E750(s32 a0_, s32 a1)
}
// Almost the same as the two funcs above, but returns different fields.
s32 sub_800E790(s32 a0_, s32 a1)
s32 sub_800E790(s32 species_, s32 moveId)
{
s32 i;
s32 a0 = (s16) (a0_);
const unkStruct_80BDBC4 *unkPtr1 = sub_800ECB8(a1);
s32 species = (s16) (species_);
const unkStruct_80BDBC4 *unkPtr1 = sub_800ECB8(moveId);
const unkStruct_80C183C *unkPtr2 = sub_800ECD0(unkPtr1->unk20);
for (i = 0; i < unkPtr1->unk1C; i++, unkPtr2++) {
if (unkPtr2->unk0 == a0) {
return unkPtr2->unk8;
if (unkPtr2->species == species) {
return unkPtr2->soundEffectId;
}
}
return unkPtr1->unk18;
return unkPtr1->soundEffectId;
}
bool8 sub_800E7D0(u16 *param_1)
@ -1073,7 +1073,7 @@ u8 sub_800EA44(unkStruct_800EA44 param_1, s32 param_2)
const unkStruct_80C183C *unkStruct2 = sub_800ECD0(ret->unk20);
for (i = 0; i < ret->unk1C; i++, unkStruct2++) {
if (unkStruct2->unk0 == a) {
if (unkStruct2->species == a) {
return unkStruct2->unk2;
}
}
@ -1191,10 +1191,9 @@ u8 sub_800EC74(void)
return sub_800F19C(1);
}
u8 sub_800EC84(s32 param_1)
bool8 sub_800EC84(s32 moveId)
{
const unkStruct_80BDBC4 *ret = sub_800ECB8(param_1);
return ret->unk8;
return sub_800ECB8(moveId)->unk8;
}
u8 sub_800EC94(s32 param_1)

View File

@ -674,11 +674,11 @@ void sub_808D9DC(u8 *buffer, DungeonMon *param_2, s32 colorNum)
sprintfStatic(buffer,_("{color}%c%s{reset}"),colorNum,nameBuffer);
}
void sub_808DA0C(u8 *buffer, DungeonMon *param_2)
void sub_808DA0C(u8 *buffer, DungeonMon *mon)
{
u8 nameBuffer [20];
StrncpyCustom(nameBuffer, param_2->name, POKEMON_NAME_LENGTH);
StrncpyCustom(nameBuffer, mon->name, POKEMON_NAME_LENGTH);
sprintfStatic(buffer,"%s",nameBuffer);
}
@ -687,7 +687,20 @@ void PrintPokeNameToBuffer(u8 *buffer, Pokemon *pokemon)
StrncpyCustom(buffer, pokemon->name, POKEMON_NAME_LENGTH);
}
static const u8 gUnknown_8107645[12] = {0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const u8 gUnknown_8107645[12] = {
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE
};
bool8 sub_808DA44(s32 _species, u32 a2_)
{
@ -708,10 +721,10 @@ bool8 sub_808DA44(s32 _species, u32 a2_)
for (i = 0; i < 10 && data[i].species != MONSTER_NONE; i++) {
if (data[i].species == species && data[i].unk4 == a2) {
return 1;
return TRUE;
}
}
return 0;
return FALSE;
}
else {
return gUnknown_8107645[a2];