sub_805D8C8 failed attempt

This commit is contained in:
DizzyEggg 2024-07-21 12:43:14 +02:00
parent eb4f78e6b5
commit 7672e9eb20
21 changed files with 2048 additions and 1487 deletions

File diff suppressed because it is too large Load Diff

View File

@ -66,7 +66,7 @@ typedef struct AITarget
} AITarget;
typedef struct Sleep
typedef struct Sleep
{
/* 0x0 */ u8 sleep;
/* 0x1 */ u8 sleepTurns;
@ -77,7 +77,7 @@ typedef struct NonVolatile
/* 0x0 */ u8 nonVolatileStatus;
/* 0x1 */ u8 nonVolatileStatusTurns;
/* 0x2 */ u8 nonVolatileStatusDamageCountdown;
/* 0x3 */ u8 unk4;
/* 0x3 */ u8 unk4;
} NonVolatile;
typedef struct Immobilize
@ -107,7 +107,7 @@ typedef struct Protection
/* 0x1 */ u8 protectionStatusTurns;
} Protection;
typedef struct Waiting
typedef struct Waiting
{
/* 0xC8 */ u8 waitingStatus;
/* 0xC9 */ bool8 enemyDecoy; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon).
@ -116,7 +116,7 @@ typedef struct Waiting
/* 0xCC */ u8 curseDamageCountdown;
} Waiting;
typedef struct Linked
typedef struct Linked
{
/* 0xD0 */ u8 linkedStatus;
/* 0xD4 */ u32 unkD4;
@ -126,7 +126,7 @@ typedef struct Linked
} Linked;
typedef struct MoveStatus
typedef struct MoveStatus
{
/* 0xDC */ u8 moveStatus;
/* 0xDD */ u8 moveStatusTurns;
@ -143,13 +143,13 @@ typedef struct TransformStatus
/* 0xE5 */ u8 transformStatusTurns;
} TransformStatus;
typedef struct EyesightStatus
typedef struct EyesightStatus
{
/* 0xE8 */ u8 eyesightStatus;
/* 0xE9 */ u8 eyesightStatusTurns;
} EyesightStatus;
typedef struct Muzzled
typedef struct Muzzled
{
/* 0xEC */ bool8 muzzled;
/* 0xED */ u8 muzzledTurns;

View File

@ -65,6 +65,42 @@ typedef struct DungeonMusicPlayer
/* 0xE */ u16 queuedSongIndex;
} DungeonMusicPlayer;
// Size unknown?
typedef struct unkDungeonGlobal_unk181E8_sub
{
/* 0x181E8 */ Position cameraPos;
/* 0x181EC */ Position cameraPosMirror;
/* 0x181F0 */ Position cameraPixelPos;
/* 0x181F4 */ Position cameraPixelPosMirror;
/* 0x181F8 */ Entity *cameraTarget;
u32 unk181FC;
u32 unk18200;
u32 unk18204;
u8 unk18208;
/* 0x18209 */ u8 visibilityRange; // Dungeon light level.
/* 0x1820A */ bool8 blinded; // Blacks out the screen when the player has the Blinker status.
u8 unk1820B;
u8 unk1820C;
u8 unk1820D;
u8 unk1820E;
u8 unk1820F;
/* 0x18210 */ bool8 hallucinating; // Displays Substitute and flower sprites when the player has the Cross-Eyed status.
u8 unk18211;
u8 unk18212;
u8 unk18213;
u8 unk18214;
u8 fill18215[2];
u8 unk18217;
u8 fill18218;
u8 fill18219;
u8 unk1821A;
u8 unk1821B;
u8 unk1821C;
u8 fill1821D;
u8 fill1821E;
u8 fill1821F;
} unkDungeonGlobal_unk181E8_sub;
// size: 0x1CEDC
typedef struct Dungeon
{
@ -93,7 +129,9 @@ typedef struct Dungeon
/* 0x179 */ bool8 pokemonExposed; // True if a Pokémon on the floor has the Exposed status.
u8 fill17A[0x17C - 0x17A];
Dungeon_sub unk17C[0x100];
/* 0x57C */ u8 fill57C[0x644 - 0x57c];
/* 0x57C */ u8 fill57C[0x5C0 - 0x57c];
/* 0x5C0 */ s32 unk5C0;
/* 0x5C4 */ u8 fill5C4[0x644 - 0x5C4];
/* 0x644 */ DungeonLocation dungeonLocation;
u8 fill646[0x654 - 0x648];
u8 unk654;
@ -131,16 +169,16 @@ typedef struct Dungeon
s32 unk690;
s32 unk694;
u8 fill698;
u8 unk699;
u8 unk699;
u8 fill69A[0x69C - 0x69A];
/* 0x69C */ EntityInfo unk69C[4];
u8 fillEBC[0x363C - 0xEBC];
u8 fillEBC[0x363C - 0xEBC];
/* 0x363C */ u8 expYieldRankings[NUM_MONSTERS];
u8 fill37D9[0x37F0 - 0x37D9];
/* 0x37F0 */ u32 unk37F0;
/* 0x37F4 */ s32 unk37F4;
/* 0x37F8 */ bool8 plusIsActive[2]; // Index 0: Enemy , Index 1: Team
/* 0x37FA */ bool8 minusIsActive[2]; // Index 0: Enemy , Index 1: Team
/* 0x37FA */ bool8 minusIsActive[2]; // Index 0: Enemy , Index 1: Team
/* 0x37FC */ bool8 decoyActive;
u8 fill37FD;
/* 0x37FE */ bool8 deoxysDefeat; // Flag set for deoxys in Meteor Cave
@ -220,31 +258,8 @@ typedef struct Dungeon
/* 0x17B3C */ u32 unk17B40;
/* 0x17B44 */ OpenedFile *sprites[MONSTER_MAX];
/* 0x181E4 */ OpenedFile *paletFile;
/* 0x181E8 */ Position cameraPos;
/* 0x181EC */ Position cameraPosMirror;
/* 0x181F0 */ Position cameraPixelPos;
/* 0x181F4 */ Position cameraPixelPosMirror;
/* 0x181F8 */ Entity *cameraTarget;
u32 unk181FC;
u32 unk18200;
u32 unk18204;
u8 unk18208;
/* 0x18209 */ u8 visibilityRange; // Dungeon light level.
/* 0x1820A */ bool8 blinded; // Blacks out the screen when the player has the Blinker status.
u8 unk1820B;
u8 unk1820C;
u8 unk1820D;
u8 unk1820E;
u8 unk1820F;
/* 0x18210 */ bool8 hallucinating; // Displays Substitute and flower sprites when the player has the Cross-Eyed status.
u8 unk18211;
u8 unk18212;
u8 unk18213;
u8 fill18214[3];
u8 unk18217;
u8 fill18218[0x1821A - 0x18218];
u8 unk1821A;
u8 fill1821B[0x1C578 - 0x1821B];
/* 0x181E8 */ unkDungeonGlobal_unk181E8_sub unk181e8;
u8 fill18220[0x1C578 - 0x18220];
u8 unk1C578;
u8 fill1C579[0x1C57E - 0x1C579];
u8 unk1C57E;

View File

@ -228,6 +228,7 @@ SECTIONS {
src/move_actions.o(.text);
src/status_actions.o(.text);
src/move_checks.o(.text);
src/code_805D8C8_1.o(.text);
asm/code_805D8C8.o(.text);
src/code_8066D04.o(.text);
asm/code_8066D04.o(.text);

View File

@ -31,7 +31,7 @@ void HandleLuminousOrbAction(Entity *pokemon)
int XCoord;
int YCoord;
gDungeon->unk1820B = 1;
gDungeon->unk181e8.unk1820B = 1;
for(YCoord = 0; YCoord < DUNGEON_MAX_SIZE_Y; YCoord++)
{
@ -49,7 +49,7 @@ void HandleLuminousOrbAction(Entity *pokemon)
void sub_8040094(u8 r0)
{
gDungeon->unk18217 = r0;
gDungeon->unk181e8.unk18217 = r0;
sub_803F7BC();
sub_80060EC();
IncrementPlayTime(gPlayTimeRef);
@ -63,15 +63,15 @@ void sub_8040094(u8 r0)
void sub_80400D4(void)
{
s32 temp;
temp = gDungeon->unk18200;
temp = gDungeon->unk181e8.unk18200;
if(temp == 0)
return;
if(temp > 0x1E)
temp = 0x1F;
gDungeon->unk181FC = gUnknown_80F6568[temp];
gDungeon->unk18200--;
if(gDungeon->unk18200 == 0)
gDungeon->unk18200 = gDungeon->unk18204;
gDungeon->unk181e8.unk181FC = gUnknown_80F6568[temp];
gDungeon->unk181e8.unk18200--;
if(gDungeon->unk181e8.unk18200 == 0)
gDungeon->unk181e8.unk18200 = gDungeon->unk181e8.unk18204;
}
void sub_8040124(void)

View File

@ -76,7 +76,7 @@ s32 sub_80416E0(Position32 *pos, u32 param_2, u8 param_3);
s32 sub_80416A4(Position *pos_1, u32 param_2, u8 param_3)
{
Position32 pos;
pos.x = pos_1->x * 0x1800 + 0xc00;
pos.y = pos_1->y * 0x1800 + 0x1000;
return sub_80416E0(&pos, param_2, param_3);
@ -95,7 +95,7 @@ s32 sub_80416E0(Position32 *pos, u32 param_2, u8 param_3)
auStack_10.x = pos->x / 256;
auStack_10.y = pos->y / 256;
auStack_10.unk14 = -1;
auStack_10.unk10 = 0;
auStack_10.unk12 = 0;
@ -126,9 +126,9 @@ void sub_804178C(u8 param_1)
{
u32 temp;
s32 counter;
counter = 0;
gDungeon->unk18204 = 0;
gDungeon->unk181e8.unk18204 = 0;
if (sub_800E9FC(param_1) != 0) {
while ((counter < 1000 && (sub_800E9FC(param_1) != 0))) {
sub_803E46C(0x4a);
@ -196,7 +196,7 @@ void EntityUpdateStatusSprites(Entity *entity)
EntityInfo *entityInfo;
u32 spriteStatus;
u8 temp;
if (EntityExists(entity)) {
entityInfo = entity->info;
spriteStatus = 0;
@ -204,7 +204,7 @@ void EntityUpdateStatusSprites(Entity *entity)
if (entityInfo->id == 0xb9) {
// NOTE: clean this up sometime
temp = entityInfo->sleep.sleepTurns;
temp = entityInfo->sleep.sleepTurns;
flag = 0x7f;
temp ^= flag;
flag = (temp) != 0;
@ -212,7 +212,7 @@ void EntityUpdateStatusSprites(Entity *entity)
if (flag) {
spriteStatus = gStatusSpriteMasks_SleepStatus[entityInfo->sleep.sleep];
}
spriteStatus = spriteStatus |
spriteStatus = spriteStatus |
gStatusSpriteMasks_NonVolatileStatus[entityInfo->nonVolatile.nonVolatileStatus] |
gStatusSpriteMasks_ImmobilizeStatus[entityInfo->immobilize.immobilizeStatus] |
gStatusSpriteMasks_VolatileStatus[entityInfo->volatileStatus.volatileStatus] |
@ -245,15 +245,15 @@ void EntityUpdateStatusSprites(Entity *entity)
if ((gDungeon->itemHoldersIdentified) && (entityInfo->heldItem.flags & ITEM_FLAG_EXISTS)) {
spriteStatus = spriteStatus | STATUS_SPRITE_LOWHP;
}
if ( (entityInfo->offensiveMultipliers[0] < DEFAULT_STAT_MULTIPLIER) ||
if ( (entityInfo->offensiveMultipliers[0] < DEFAULT_STAT_MULTIPLIER) ||
(entityInfo->offensiveMultipliers[1] < DEFAULT_STAT_MULTIPLIER) ||
(entityInfo->defensiveMultipliers[0] < DEFAULT_STAT_MULTIPLIER) ||
(entityInfo->defensiveMultipliers[1] < DEFAULT_STAT_MULTIPLIER) ||
(entityInfo->offensiveStages[0] < DEFAULT_STAT_STAGE) ||
(entityInfo->offensiveStages[1] < DEFAULT_STAT_STAGE) ||
(entityInfo->defensiveStages[0] < DEFAULT_STAT_STAGE) ||
(entityInfo->defensiveStages[0] < DEFAULT_STAT_STAGE) ||
(entityInfo->defensiveStages[1] < DEFAULT_STAT_STAGE) ||
(entityInfo->hitChanceStages[0]) < DEFAULT_STAT_STAGE ||
(entityInfo->hitChanceStages[0]) < DEFAULT_STAT_STAGE ||
(entityInfo->hitChanceStages[1] < DEFAULT_STAT_STAGE)) {
spriteStatus = spriteStatus | STATUS_SPRITE_STAT_DOWN;
}

View File

@ -158,7 +158,7 @@ void sub_8042A84(s16 param_1, Entity *entity, u32 param_3)
s32 param_1_s16;
param_1_s16 = param_1;
r6 = 0x200;
if (sub_8042768(entity) != 0) {
sub_804151C(entity,param_1_s16,0);
@ -173,7 +173,7 @@ void sub_8042A84(s16 param_1, Entity *entity, u32 param_3)
if (iVar3 < 0) {
iVar3 += 0xff;
}
} while (-8 <= (iVar3 >> 8) - gDungeon->cameraPixelPos.y);
} while (-8 <= (iVar3 >> 8) - gDungeon->unk181e8.cameraPixelPos.y);
entity->isVisible = 0;
sub_804178C(0);
}

1790
src/code_805D8C8_1.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -225,7 +225,7 @@ void sub_806A120(Entity * pokemon, Entity * target, Move* move)
}
void sub_806A1B0(Entity *pokemon)
{
{
if ((EntityExists(pokemon)) && (HasAbility(pokemon, ABILITY_TRUANT))) {
PausedStatusTarget(pokemon,pokemon,0,1,0);
}
@ -235,7 +235,7 @@ void sub_806A1E8(Entity *pokemon)
{
bool8 bVar3;
EntityInfo *entityInfo;
bVar3 = FALSE;
if (EntityExists(pokemon)) {
if (GetEntityType(pokemon) == ENTITY_MONSTER) {
@ -255,7 +255,7 @@ void sub_806A240(Entity *pokemon, Entity *target)
{
bool8 isNotTeamMember;
EntityInfo *entityInfo;
isNotTeamMember = FALSE;
if (EntityExists(pokemon)){
if (GetEntityType(pokemon) == ENTITY_MONSTER) {
@ -278,7 +278,7 @@ void sub_806A240(Entity *pokemon, Entity *target)
void sub_806A2BC(Entity *pokemon, u8 param_2)
{
if ((EntityExists(pokemon)) && (GetEntityType(pokemon) == ENTITY_MONSTER) && (gDungeon->cameraTarget != pokemon)) {
if ((EntityExists(pokemon)) && (GetEntityType(pokemon) == ENTITY_MONSTER) && (gDungeon->unk181e8.cameraTarget != pokemon)) {
if (param_2 != '\0') {
sub_804178C(1);
while (gDungeon->unk12 < 0x3c) {

View File

@ -58,9 +58,9 @@ void sub_806CCB4(Entity *entity, u8 a1)
EntityInfo *info;
info = entity->info;
flag = gDungeon->hallucinating;
flag = gDungeon->unk181e8.hallucinating;
if (entity == gDungeon->cameraTarget)
if (entity == gDungeon->unk181e8.cameraTarget)
flag = FALSE;
entity->unk6B = a1;
@ -177,7 +177,7 @@ void sub_806CF18(Entity *entity)
if (!EntityExists(entity))
return;
entityInfo = entity->info;
for (i = 0; i < 100; i++) {
sub_803E46C(33);

View File

@ -21,9 +21,9 @@ bool8 sub_8083568(s32 inX, s32 inY, u8 index) {
register s32 tmp asm("r2");
#endif
x = inX - gDungeon->cameraPixelPos.x;
y = inY - gDungeon->cameraPixelPos.y;
x = inX - gDungeon->unk181e8.cameraPixelPos.x;
y = inY - gDungeon->unk181e8.cameraPixelPos.y;
if (x >= -16 && y >= -16 && x <= 255 && y <= 175)
{
struct unkStruct_202ED28 *ptr = gUnknown_202ED28;
@ -50,7 +50,7 @@ bool8 sub_8083568(s32 inX, s32 inY, u8 index) {
tmp2 |= tmp;
sp->unk6 = tmp2;
AddSprite(sp, 0, NULL, NULL);
return TRUE;
}

View File

@ -419,10 +419,10 @@ void sub_8086854(void)
if (gUnknown_202F3D0.unk5 != 0)
gUnknown_202F3D0.unk5--;
gDungeon->unk181FC = gUnknown_8107314[gUnknown_202F3D0.unk5];
gDungeon->unk181e8.unk181FC = gUnknown_8107314[gUnknown_202F3D0.unk5];
}
else
gDungeon->unk181FC = 0;
gDungeon->unk181e8.unk181FC = 0;
}
void sub_80868F4(Entity *entity)
@ -544,4 +544,4 @@ void sub_80869E4(Entity *a0, s32 a1, u8 a2, s8 a3)
"\tpop {r0}\n"
"\tbx r0");
}
#endif // NONMATCHING
#endif // NONMATCHING

View File

@ -282,7 +282,7 @@ bool8 ChooseTargetPosition(Entity *pokemon)
// This item targeting code is never reached because the leader is never AI-controlled.
u8 room;
s32 minX, minY, maxX, maxY, x, y, maxY2;
if (gDungeon->visibilityRange) {
if (gDungeon->unk181e8.visibilityRange) {
// Dead code.
u8 a = -a;
}

View File

@ -21,7 +21,7 @@ void sub_804AA60(void) {
}
}
sub_80098F8(2);
gDungeon->unk1821A = 0;
gDungeon->unk181e8.unk1821A = 0;
}
void sub_804AAAC(void)
@ -121,8 +121,8 @@ void sub_804AC20(Position *pos)
tile2 = GetTile(pos->x,pos->y);
roomIndex = tile2->room;
visibilityRange = gDungeon->visibilityRange;
if (!gDungeon->blinded) {
visibilityRange = gDungeon->unk181e8.visibilityRange;
if (!gDungeon->unk181e8.blinded) {
if (visibilityRange == 0) {
visibilityRange = 2;
}

View File

@ -8,7 +8,7 @@
bool8 IsPositionActuallyInSight(Position *pos1, Position *pos2)
{
u8 pos1Room;
u8 visibility = gDungeon->visibilityRange;
u8 visibility = gDungeon->unk181e8.visibilityRange;
struct Tile *tile1;
if (visibility == 0)
{
@ -103,9 +103,9 @@ void sub_80833E8(Position *param_1, s32 *param_2)
struct RoomData *mapRoom;
u32 visibility;
u32 room;
tile = GetTile(param_1->x, param_1->y);
visibility = gDungeon->visibilityRange;
visibility = gDungeon->unk181e8.visibilityRange;
if (visibility == 0) {
visibility = 2;
}
@ -136,7 +136,7 @@ bool8 IsTargetTwoTilesAway(Position *pos1, Position *pos2)
s32 yDiff;
s32 x2;
s32 y2;
diff = pos1->x - pos2->x;
if (diff < 0)
{

View File

@ -77,40 +77,40 @@ Tile *GetTileAtEntitySafe(Entity *entity)
void sub_804513C(void)
{
s32 index;
for(index = 0; index < MAX_TEAM_MEMBERS; index++)
{
gDungeon->teamPokemon[index] = &gDungeon->teamPokemonEntities[index];
gDungeon->teamPokemon[index]->type = ENTITY_NOTHING;
}
for(index = 0; index < 6; index++)
{
gUnknown_202EE70[index] = 0;
}
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
{
gDungeon->wildPokemon[index] = &gDungeon->wildPokemonEntities[index];
gDungeon->wildPokemon[index]->type = ENTITY_NOTHING;
}
for(index = 0; index < 0x10; index++)
{
gUnknown_202EE76[index] = 0;
}
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
gDungeon->allPokemon[index] = NULL;
}
for (index = 0; index < DUNGEON_MAX_ITEMS; index++)
{
gDungeon->items[index] = &gDungeon->itemEntities[index];
gDungeon->items[index]->type = ENTITY_NOTHING;
}
for(index = 0; index < DUNGEON_MAX_TRAPS; index++)
{
gDungeon->traps[index] = &gDungeon->trapEntites[index];
@ -126,15 +126,15 @@ void sub_804522C(void) {
u32 statusSprites;
bool8 crossEyed;
crossEyed = gDungeon->hallucinating;
if (gDungeon->blinded)
crossEyed = gDungeon->unk181e8.hallucinating;
if (gDungeon->unk181e8.blinded)
{
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeon->allPokemon[index];
if(EntityExists(entity))
{
if(entity == gDungeon->cameraTarget)
if(entity == gDungeon->unk181e8.cameraTarget)
{
sub_806C51C(entity);
}
@ -165,12 +165,12 @@ void sub_804522C(void) {
sub_806C51C(entity2);
}
}
for(index = 0; index < gDungeon->unk3904; index++)
{
sub_80462AC(gDungeon->items[index], crossEyed, 1, 0xFF, 0);
}
if(crossEyed)
sub_807FA9C();
}

View File

@ -80,8 +80,8 @@ extern u8 *gUnknown_80FD2B4[];
extern u8 *gUnknown_80FAC74[];
extern u8 *gUnknown_80FAC54[];
extern u32 gUnknown_80F4F50;
extern s16 gUnknown_80F4DB8;
extern s16 gUnknown_80F4DBA;
extern s16 gUnknown_80F4DB8;
extern s16 gUnknown_80F4DBA;
extern s16 gUnknown_80F55BC[];
extern u8 *gUnknown_80FAE00[];
extern u8 *gUnknown_80FADD8[];
@ -370,7 +370,7 @@ bool8 sub_805768C(Entity *pokemon, Entity *target, Move *move, s32 param_4)
{
bool8 flag;
flag = FALSE;
flag = FALSE;
gUnknown_202F21C++;
if (sub_8055640(pokemon, target, move, gUnknown_8106A54[gUnknown_202F21C], param_4) == 0)
@ -557,7 +557,7 @@ bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4
Move struggleMove;
EntityInfo *entityInfo;
bool8 isTormented;
entityInfo = target->info;
isTormented = FALSE;
@ -663,7 +663,7 @@ bool32 sub_8057CD0(Entity * pokemon, Entity * target, Move * move, u32 param_4)
{
u32 weather;
s32 flag;
weather = GetApparentWeather(pokemon);
flag = sub_80556BC(pokemon,target,gUnknown_80F51E4[weather],move,
gUnknown_80F51EC[weather],param_4);
@ -792,7 +792,7 @@ bool8 sub_8057E6C(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
EntityInfo *entityInfo;
bool8 flag;
flag = FALSE;
entityInfo = pokemon->info;
SendThawedMessage(pokemon,target);
@ -808,7 +808,7 @@ bool8 sub_8057E6C(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8057ED0(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -823,7 +823,7 @@ bool8 sub_8057ED0(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8057F24(Entity *pokemon, Entity *target, Move *move, s32 param_4)
{
EntityInfo *entityInfo;
entityInfo = pokemon->info;
entityInfo->HP = 1;
ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C,0x40,TRUE);
@ -835,7 +835,7 @@ bool8 sub_8057F24(Entity *pokemon, Entity *target, Move *move, s32 param_4)
bool8 sub_8057F7C(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -857,7 +857,7 @@ bool8 sub_8057FCC(Entity *pokemon, Entity *target, Move *move, s32 param_4)
bool8 sub_8057FF4(Entity *pokemon, Entity *target, Move *move, s32 param_4)
{
u8 flashFireStatus;
flashFireStatus = GetFlashFireStatus(target);
if (flashFireStatus != FLASH_FIRE_STATUS_NONE) {
if (target->info->unk152 == 0) {
@ -887,7 +887,7 @@ bool8 sub_805805C(Entity * pokemon,Entity * target,Move * move,s32 param_4)
s32 IQ;
entityInfo = pokemon->info;
r6 = 1;
index = 0;
@ -911,7 +911,7 @@ bool8 GrudgeMoveAction(Entity *pokemon, Entity * target, Move *move, s32 param_4
{
EntityInfo *entityInfo;
bool8 hasGrudge;
hasGrudge = FALSE;
entityInfo = target->info;
SetMessageArgument(gUnknown_202DFE8,target,0);
@ -935,7 +935,7 @@ bool8 CounterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4
bool8 sub_805816C(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
SendThawedMessage(pokemon, target);
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
@ -951,7 +951,7 @@ bool8 sub_805816C(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_80581D0(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
SendThawedMessage(pokemon, target);
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
@ -1011,7 +1011,7 @@ bool8 sub_80582D4(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 RazorWindMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4)
{
bool8 flag;
if (MoveMatchesChargingStatus(pokemon,move)) {
flag = sub_8055640(pokemon,target,move,gUnknown_80F4F50,param_4) ? TRUE : FALSE;
sub_8079764(pokemon);
@ -1026,14 +1026,14 @@ bool8 RazorWindMoveAction(Entity * pokemon, Entity * target, Move * move, u32 pa
bool8 BideMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
SetChargeStatusTarget(pokemon, target, STATUS_BIDE, move, *gUnknown_80FAC74);
return TRUE;
return TRUE;
}
bool8 sub_805836C(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
s32 iVar2;
bool8 local_18;
local_18 = FALSE;
iVar2 = pokemon->info->unkA0 * 2;
if (999 < iVar2) {
@ -1048,7 +1048,7 @@ bool8 sub_805836C(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_80583D8(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -1063,7 +1063,7 @@ bool8 sub_80583D8(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8058430(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -1078,7 +1078,7 @@ bool8 sub_8058430(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8058478(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -1126,7 +1126,7 @@ bool8 sub_8058548(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -1141,7 +1141,7 @@ bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if ((target->info->protection.protectionStatus == STATUS_REFLECT) || (target->info->protection.protectionStatus == STATUS_LIGHT_SCREEN)) {
sub_80522F4(pokemon,target,*gUnknown_80FD104); // The barrier was shattered
@ -1156,7 +1156,7 @@ bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, u32 para
bool8 sub_8058638(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -1171,7 +1171,7 @@ bool8 sub_8058638(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 FocusPunchMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4)
{
bool8 flag;
if (MoveMatchesChargingStatus(pokemon,move)) {
flag = sub_8055640(pokemon,target,move,gUnknown_80F4F54,param_4) ? TRUE : FALSE;
sub_8079764(pokemon);
@ -1190,7 +1190,7 @@ bool8 sub_80586DC(Entity * pokemon, Entity * target, Move * move, u32 param_4)
s32 newHP;
bool8 flag;
EntityInfo *entityInfo;
hasLiquidOoze = HasAbility(target, ABILITY_LIQUID_OOZE);
uVar3 = sub_8055640(pokemon,target,move,0x100,param_4);
flag = uVar3 != 0 ? TRUE : FALSE;
@ -1228,7 +1228,7 @@ bool8 sub_8058770(Entity * pokemon, Entity * target, Move * move, u32 param_4)
#else
EntityInfo *entityInfo;
#endif
entityInfo = pokemon->info;
r2 = entityInfo->maxHPStat;
r0 = r2;
@ -1258,7 +1258,7 @@ bool8 sub_8058770(Entity * pokemon, Entity * target, Move * move, u32 param_4)
bool8 sub_80587E8(Entity * pokemon, Entity * target, Move * move, u32 param_4)
{
bool8 flag;
if (target->info->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) {
flag = sub_8055640(pokemon,target,move,0x80 << 2,param_4) ? TRUE : FALSE;
SendNonVolatileEndMessage(pokemon, target);
@ -1301,7 +1301,7 @@ bool8 sub_80588B8(Entity *pokemon, Entity *target, Move *move, u32 param_4)
if(sub_8055640(pokemon, target, move, 0x80 << 1, param_4) != 0)
{
flag = TRUE;
if(sub_8057308(pokemon, 0))
if(sub_8057308(pokemon, 0))
{
gUnknown_202F219 = 1;
}
@ -1313,7 +1313,7 @@ bool8 sub_80588F4(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
EntityInfo *entityInfo = target->info;
flag = sub_8055640(pokemon, target, move, GetWeight(entityInfo->apparentID), param_4) != 0 ? TRUE: FALSE;
return flag;
}
@ -1328,7 +1328,7 @@ bool8 sub_8058930(Entity *pokemon, Entity *target, Move *move, u32 param_4)
if(sub_8055640(pokemon, target, move, 0x80 << 1, param_4) != 0)
{
flag = TRUE;
if(sub_8057308(pokemon, gUnknown_80F4DD6))
if(sub_8057308(pokemon, gUnknown_80F4DD6))
{
entityInfo = pokemon->info;
RaiseMovementSpeedTarget(pokemon, pokemon, 0, TRUE);
@ -1365,7 +1365,7 @@ bool8 sub_8058A18(Entity *pokemon, Entity *target, Move *move, u32 param_4)
if(sub_8055640(pokemon, target, move, 0x80 << 1, param_4) != 0)
{
flag = TRUE;
if(sub_8057308(pokemon, 0))
if(sub_8057308(pokemon, 0))
{
gUnknown_202F21A = 1;
}
@ -1409,7 +1409,7 @@ bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param
bool8 sub_8058B3C(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -1425,7 +1425,7 @@ bool8 sub_8058B84(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
EntityInfo *entityInfo;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -1455,7 +1455,7 @@ bool8 sub_8058BF0(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8058C00(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -1471,7 +1471,7 @@ bool8 sub_8058C48(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
s32 rand;
bool8 flag;
rand = DungeonRandRange(128, 384); // 0x80 - 0x180
rand = (rand * pokemon->info->level) / 256;
if (rand < 0) {
@ -1487,7 +1487,7 @@ bool8 sub_8058C48(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8058C98(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 param_5)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_5) != 0) {
flag = TRUE;
@ -1505,7 +1505,7 @@ bool8 sub_8058CEC(Entity *pokemon, Entity *target, Move *move, u32 param_4)
if(sub_8055640(pokemon, target, move, 0x80 << 1, param_4) != 0)
{
flag = TRUE;
if(sub_8057308(pokemon, 0))
if(sub_8057308(pokemon, 0))
{
LowerAttackStageTarget(pokemon, pokemon, gUnknown_8106A50, 2, 0, FALSE);
}
@ -1533,7 +1533,7 @@ bool8 sub_8058D44(Entity * pokemon, Entity * target, Move * move, u32 param_4)
#else
EntityInfo *entityInfo;
#endif
entityInfo = pokemon->info;
r2 = entityInfo->maxHPStat;
r0 = r2;
@ -1566,7 +1566,7 @@ bool8 PsychUpMoveAction(Entity * pokemon, Entity * target, Move * move, u32 para
s32 index;
EntityInfo *iVar3;
EntityInfo *iVar4;
iVar4 = pokemon->info;
iVar3 = target->info;
nullsub_92(target);
@ -1592,7 +1592,7 @@ bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4)
int iVar2;
int iVar3;
bool8 flag;
flag = FALSE;
if ((sub_8055640(pokemon, target, move, 0x80 << 1, param_4) != 0) && (EntityExists(pokemon))) {
iVar2 = pokemon->info->maxHPStat;
@ -1622,11 +1622,11 @@ bool32 sub_8058F04(Entity *pokemon, Entity *target, Move *move, s32 param_4)
bool32 flag;
EntityInfo *entityInfo;
s32 iVar3;
entityInfo = target->info;
iVar3 = 1;
gDungeon->unk18200 = 0xc;
gDungeon->unk18204 = 0;
gDungeon->unk181e8.unk18200 = 0xc;
gDungeon->unk181e8.unk18204 = 0;
if (entityInfo->charging.chargingStatus == STATUS_DIGGING) {
iVar3 = 2;
}
@ -1642,7 +1642,7 @@ bool8 NaturePowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 par
bool8 flag;
s32 tileset;
Move natureMove;
tileset = gDungeon->tileset;
if (tileset < 0) {
tileset = 0;
@ -1658,7 +1658,7 @@ bool8 NaturePowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 par
bool8 sub_8058FBC(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -1691,7 +1691,7 @@ bool8 ChargeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8059080(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -1714,7 +1714,7 @@ bool8 sub_80590D4(Entity *pokemon, Entity *target, Move *move, s32 param_4)
u8 moveType;
bool8 uVar5;
bool8 flag;
flag = FALSE;
moveType = GetMoveType(move);
@ -1736,7 +1736,7 @@ bool8 sub_80590D4(Entity *pokemon, Entity *target, Move *move, s32 param_4)
bool8 sub_8059190(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -1761,7 +1761,7 @@ bool8 sub_80591E4(Entity *pokemon, Entity *target, Move *move, s32 param_4)
s32 iVar4;
bool8 flag;
EntityInfo *entityInfo;
flag = FALSE;
hasLiquidOoze = HasAbility(target, ABILITY_LIQUID_OOZE);
iVar3 = sub_8055640(pokemon,target,move,0x100,param_4);
@ -1798,7 +1798,7 @@ bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param
u8 *puVar6;
EntityInfo * targetEntityInfo;
EntityInfo * pokeEntityData;
pokeEntityData = pokemon->info;
targetEntityInfo = target->info;
if ((HasAbility(target, ABILITY_WONDER_GUARD)) || (HasAbility(pokemon, ABILITY_WONDER_GUARD))) {
@ -1827,7 +1827,7 @@ bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param
return flag;
}
// https://decomp.me/scratch/Ul8x5
// https://decomp.me/scratch/Ul8x5
#ifdef NONMATCHING
bool32 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4)
{
@ -1838,7 +1838,7 @@ bool32 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4
register bool32 flag asm("sl");
struct Move *move1;
s32 other_flag = 0;
flag = 0;
pokeInfo = pokemon->info;
targetInfo = target->info;
@ -1850,7 +1850,7 @@ bool32 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4
if ((((move1->moveFlags & MOVE_FLAG_EXISTS))) && ((targetInfo->moves[moveIndex].moveFlags & 0x10))) {
moveID = targetInfo->moves[moveIndex].id;
goto _moveIDcheck;
}
}
}
if(other_flag == 0)
@ -1866,7 +1866,7 @@ _moveIDcheck:
else {
InitPokemonMove(move, moveID);
sub_80928C0(gUnknown_202DE58, move, 0);
move->moveFlags2 |= MOVE_FLAG2_UNK4;
move->moveFlags2 |= MOVE_FLAG2_UNK4;
move->moveFlags2 |= MOVE_FLAG_REPLACE;
sub_80522F4(pokemon, target, *gUnknown_80FE38C);
if (pokeInfo->unkFB == 0) {
@ -2003,7 +2003,7 @@ bool32 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4
bool8 sub_8059424(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -2019,7 +2019,7 @@ bool8 sub_805946C(Entity * pokemon,Entity * target,Move * move,u32 param_4)
{
s32 HP;
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon, target, move, 0x100, param_4) != 0) {
flag = TRUE;
@ -2058,7 +2058,7 @@ bool8 sub_8059528(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8059540(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -2079,7 +2079,7 @@ bool8 sub_8059588(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_80595A0(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -2095,7 +2095,7 @@ bool8 sub_80595EC(Entity * pokemon,Entity * target,Move * move,u32 param_4)
{
u8 moveType;
u8 local_20;
local_20 = 0;
if (sub_806F4A4(target,GetMoveType(move)) == 0) {
sub_80522F4(pokemon,target,*gUnknown_80FEB8C);
@ -2113,11 +2113,11 @@ bool8 SolarBeamMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param
{
u8 weather; // weather and flag are reused in same variable
s32 movePower;
weather = GetApparentWeather(pokemon);
if ((weather == WEATHER_SUNNY) || (MoveMatchesChargingStatus(pokemon,move))) {
movePower = gSolarBeamMovePower;
if (((weather == WEATHER_SANDSTORM) || (weather == WEATHER_RAIN)) || weather == WEATHER_HAIL) {
movePower /= 2;
}
@ -2134,7 +2134,7 @@ bool8 SolarBeamMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param
bool8 sub_8059714(Entity * pokemon,Entity * target,Move * move,u32 param_4)
{
u8 local_20;
local_20 = 0;
sub_806F370(pokemon,target,gUnknown_80F4F7C,1,&local_20,GetMoveType(move),sub_8057600(move,param_4),0,1,0);
local_20 = local_20 == 0;
@ -2144,7 +2144,7 @@ bool8 sub_8059714(Entity * pokemon,Entity * target,Move * move,u32 param_4)
bool8 FlyMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (MoveMatchesChargingStatus(pokemon,move)) {
flag = sub_8055640(pokemon,target,move,gUnknown_80F4F5C,param_4) != 0 ? TRUE : FALSE;
@ -2166,7 +2166,7 @@ bool8 sub_80597F0(Entity * pokemon,Entity * target,Move * move,u32 param_4)
bool8 DiveMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (IsTileGround(GetTileAtEntitySafe(pokemon))) {
sub_80522F4(pokemon,target,*gUnknown_80FD128);
@ -2185,7 +2185,7 @@ bool8 DiveMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4
bool8 sub_80598CC(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -2207,7 +2207,7 @@ bool8 sub_8059928(Entity * pokemon,Entity * target,Move * move,u32 param_4)
{
bool8 flag;
s32 iVar2;
iVar2 = 1;
flag = FALSE;
if ((u8)(target->info->charging.chargingStatus - 7) <= 1){
@ -2218,7 +2218,7 @@ bool8 sub_8059928(Entity * pokemon,Entity * target,Move * move,u32 param_4)
flag = TRUE;
if(sub_805727C(pokemon,target,gUnknown_80F4DEC) != 0) {
CringeStatusTarget(pokemon,target,FALSE);
}
}
}
return flag;
}
@ -2226,7 +2226,7 @@ bool8 sub_8059928(Entity * pokemon,Entity * target,Move * move,u32 param_4)
bool8 sub_8059988(Entity * pokemon,Entity * target,Move * move,u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -2260,7 +2260,7 @@ bool8 sub_8059A2C(Entity * pokemon,Entity * target,Move * move,u32 param_4)
{
u8 local_20;
u32 level;
local_20 = 0;
level = pokemon->info->level;
sub_806F370(pokemon,target,level,1,&local_20,GetMoveType(move),sub_8057600(move,param_4),0,1,0);
@ -2289,7 +2289,7 @@ bool8 sub_8059AC4(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8059AF8(Entity * pokemon,Entity * target,Move * move,u32 param_4)
{
u8 local_20;
local_20 = 0;
if (sub_806F4A4(target,GetMoveType(move)) == 0) {
sub_80522F4(pokemon,target,*gUnknown_80FEB90);
@ -2317,7 +2317,7 @@ bool8 ConversionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 para
s32 counter;
s32 newIndex;
Move *moveStack [MAX_MON_MOVES];
counter = 0;
info = target->info;
if (HasAbility(target, ABILITY_FORECAST)) {
@ -2389,7 +2389,7 @@ bool8 sub_8059CF0(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8059D00(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -2410,7 +2410,7 @@ bool8 sub_8059D48(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8059D58(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -2443,7 +2443,7 @@ bool8 sub_8059DB4(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8059DC4(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -2458,7 +2458,7 @@ bool8 sub_8059DC4(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_8059E0C(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -2478,7 +2478,7 @@ bool8 sub_8059E54(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa
bool8 flag;
s32 local_30 [4];
u8 auStack_20;
flag = FALSE;
if (param_5 == 0) {
flag = sub_8055640(pokemon,target,move,0x100,param_4) != 0 ? TRUE : FALSE;
@ -2502,7 +2502,7 @@ bool8 sub_8059E54(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa
bool8 sub_8059F38(Entity * pokemon,Entity * target,Move * move,u32 param_4)
{
bool8 flag;
flag = FALSE;
if (MoveMatchesChargingStatus(pokemon, move)) {
if (sub_8055640(pokemon, target, move, gUnknown_80F4F60, param_4) != 0) {
@ -2528,7 +2528,7 @@ bool8 sub_8059FC8(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa
bool8 flag;
s32 local_30 [4];
u8 auStack_20;
flag = FALSE;
if (param_5 == 0) {
flag = sub_8055640(pokemon,target,move,0x200,param_4) != 0 ? TRUE : FALSE;
@ -2611,7 +2611,7 @@ bool8 sub_805A120(Entity * pokemon,Entity * target, Move *move, u32 param_4)
if (!(item1->flags & ITEM_FLAG_EXISTS))
flag = TRUE;
if(!(item2->flags & ITEM_FLAG_EXISTS))
if(!(item2->flags & ITEM_FLAG_EXISTS))
flag = TRUE;
if (flag)
@ -2661,7 +2661,7 @@ bool8 MudWaterSportMoveAction(Entity * pokemon, Entity * target, Move *move, u32
bool8 sub_805A258(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -2694,7 +2694,7 @@ bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
u32 uVar2;
flag = FALSE;
if (target->info->charging.chargingStatus == STATUS_DIVING) {
uVar2 = 0x200;
@ -2712,7 +2712,7 @@ bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_
{
EntityInfo * entityInfo;
EntityInfo * targetEntityInfo;
entityInfo = pokemon->info;
targetEntityInfo = target->info;
if (HasAbility(target, ABILITY_WONDER_GUARD)) {
@ -2757,7 +2757,7 @@ bool8 WishMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_805A408(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -2780,7 +2780,7 @@ bool8 sub_805A464(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool32 flag;
Item item;
Position pos;
flag = FALSE;
if (sub_8055640(pokemon, target, move, 0x100, param_4) != 0) {
flag = TRUE;
@ -2814,10 +2814,10 @@ bool8 sub_805A4FC(Entity *pokemon, Entity *target, Move *move, u32 param_4)
return TRUE;
}
bool8 SwallowMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 SwallowMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
u8 *stockpileStage;
stockpileStage = &target->info->stockpileStage;
if (*stockpileStage != 0) {
HealTargetHP(pokemon,target,gUnknown_80F51D4[*stockpileStage],0,TRUE);
@ -2843,11 +2843,11 @@ bool8 sub_805A568(Entity * pokemon, Entity * target, Move *move, u32 param_4)
return flag;
}
bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
u32 stat;
bool32 flag;
flag = FALSE;
if (sub_8055640(pokemon, target, move, 0x100, param_4) != 0) {
flag = TRUE;
@ -2860,11 +2860,11 @@ bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
return flag;
}
bool8 sub_805A5E8(Entity *pokemon, Entity *target, Move *move, u32 stat, u32 param_5)
bool8 sub_805A5E8(Entity *pokemon, Entity *target, Move *move, u32 stat, u32 param_5)
{
EntityInfo *entityInfo;
bool32 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_5) != 0) {
flag = TRUE;
@ -2879,10 +2879,10 @@ bool8 sub_805A5E8(Entity *pokemon, Entity *target, Move *move, u32 stat, u32 par
return flag;
}
bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
u8 *stockpileStage;
stockpileStage = &pokemon->info->stockpileStage;
if (*stockpileStage != 0) {
sub_8055640(pokemon,target,move,*stockpileStage << 8,param_4);
@ -2897,7 +2897,7 @@ bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4)
bool8 sub_805A688(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if (sub_8055640(pokemon,target,move,0x100,param_4) != 0) {
flag = TRUE;
@ -2925,12 +2925,12 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_
targetEntityInfo2 = targetEntityInfo1;
SetMessageArgument(gAvailablePokemonNames, pokemon, 0);
SetMessageArgument(gAvailablePokemonNames + 0x50, target, 0);
if (HasAbility(target, ABILITY_STICKY_HOLD))
if (HasAbility(target, ABILITY_STICKY_HOLD))
{
sub_80522F4(pokemon,target,*gUnknown_80FCCE8);
return FALSE;
}
else if (HasHeldItem(target, ITEM_ALERT_SPECS))
else if (HasHeldItem(target, ITEM_ALERT_SPECS))
{
sub_80522F4(pokemon,target,*gUnknown_80FD57C);
return FALSE;
@ -2941,7 +2941,7 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_
itemFlag = heldItem.flags;
flag = ITEM_FLAG_EXISTS;
flag &= itemFlag;
if (flag == 0)
if (flag == 0)
{
sub_80522F4(pokemon,target,*gUnknown_80FD18C);
return FALSE;
@ -2956,7 +2956,7 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_
pos.x = gAdjacentTileOffsets[entityInfo->action.direction].x;
pos.y = gAdjacentTileOffsets[entityInfo->action.direction].y;
sub_805A7D4(pokemon,target,&heldItem,&pos);
if (sub_80706A4(target, &target->pos) != 0)
if (sub_80706A4(target, &target->pos) != 0)
{
sub_807D148(pokemon, target, 0, NULL);
}
@ -2968,7 +2968,7 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_
void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, Position *pos)
{
Entity stackEntity;
stackEntity.type = ENTITY_ITEM;
stackEntity.unk24 = 0;
stackEntity.isVisible = TRUE;
@ -2998,7 +2998,7 @@ bool8 sub_805A85C(Entity * pokemon, Entity * target, Move *move, u32 param_4)
s32 temp2;
u8 check;
pos1 = target->pos;
sub_806CDD4(target,10,8);
@ -3126,7 +3126,7 @@ bool8 LightScreenMoveAction(Entity * pokemon, Entity * target, Move *move, u32 p
bool8 SecretPowerMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if ( sub_8055640(pokemon, target, move, 0x100, param_4) != 0) {
flag = TRUE;
@ -3169,7 +3169,7 @@ bool8 SecretPowerMoveAction(Entity * pokemon, Entity * target, Move *move, u32 p
bool8 sub_805AC90(Entity * pokemon, Entity * target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
if ( sub_8055640(pokemon, target, move, 0x100, param_4) != 0) {
flag = TRUE;
@ -3222,7 +3222,7 @@ bool8 sub_805AD54(Entity * pokemon, Entity * target, Move *move, u32 param_4)
#endif
Entity **possibleTargets;
bool8 flag;
flag = FALSE;
info = pokemon->info;
if (pokemon->info->isNotTeamMember) {
@ -3256,7 +3256,7 @@ bool8 sub_805AD54(Entity * pokemon, Entity * target, Move *move, u32 param_4)
bool8 sub_805AE3C(Entity *pokemon, Entity *target, Move *move, u32 param_4)
{
bool8 flag;
SendThawedMessage(pokemon, target);
flag = sub_8055640(pokemon,target,move,0x80 << 2,param_4) != 0 ? TRUE : FALSE;
return flag;
@ -3279,7 +3279,7 @@ bool8 sub_805AE74(Entity * pokemon, Entity * target, Move *move, u32 param_4)
bool8 sub_805AECC(Entity * pokemon, Entity * target, Move *move, u32 param_4)
{
bool8 flag;
flag = FALSE;
SendThawedMessage(pokemon, target);
if ( sub_8055640(pokemon, target, move, 0x100, param_4) != 0) {
@ -3297,7 +3297,7 @@ bool8 PresentMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param
s32 rand2;
s32 HP;
bool8 flag;
#ifndef NONMATCHING
#ifndef NONMATCHING
register Move *move_r6 asm("r6");
register u32 param_4_r4 asm("r4");
#else

View File

@ -171,7 +171,7 @@ bool8 sub_805AFA4(Entity * pokemon, Entity * target, Move *move, u32 param_4)
#else
EntityInfo *entityInfo;
#endif
SendThawedMessage(pokemon, target);
entityInfo = pokemon->info;
r2 = entityInfo->maxHPStat;
@ -200,13 +200,13 @@ bool8 sub_805AFA4(Entity * pokemon, Entity * target, Move *move, u32 param_4)
}
bool8 sub_805B028(Entity * pokemon,Entity * target,Move *move)
{
{
ParalyzeStatusTarget(pokemon,target, TRUE);
return TRUE;
}
bool8 TransformMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4)
{
{
if (IsBossFight()) {
sub_80522F4(pokemon,target,*gUnknown_80FEFF4);
return FALSE;
@ -219,7 +219,7 @@ bool8 TransformMoveAction(Entity * pokemon, Entity * target, Move *move, s32 par
}
bool8 sub_805B074(Entity * pokemon, Entity * target, Move *move, s32 param_4)
{
{
bool8 flag;
flag = FALSE;
@ -233,7 +233,7 @@ bool8 sub_805B074(Entity * pokemon, Entity * target, Move *move, s32 param_4)
}
bool8 sub_805B0BC(Entity * pokemon, Entity * target)
{
{
sub_807CD9C(pokemon, target, pokemon->info->action.direction);
return TRUE;
}
@ -294,13 +294,13 @@ bool8 sub_805B17C(Entity * pokemon, Entity * target, Move *move, s32 param_4)
}
bool8 PerishSongMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4)
{
{
PerishSongTarget(pokemon, target);
return TRUE;
}
bool8 WrapMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4)
{
{
WrapTarget(pokemon, target);
return TRUE;
}
@ -310,11 +310,11 @@ bool8 SpikesMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_
bool8 trapLaid;
u8 uVar2;
bool8 isNotTeamMember;
trapLaid = FALSE;
isNotTeamMember = pokemon->info->isNotTeamMember;
uVar2 = 1;
if (isNotTeamMember) {
uVar2 = 2;
}
@ -336,12 +336,12 @@ bool8 sub_805B264(Entity * pokemon, Entity * target, Move *move, s32 param_4)
s32 iVar5;
EntityInfo *entityInfo;
entityInfo = target->info;
entityInfo = target->info;
r3 = gUnknown_202F224;
r6 = FALSE;
gDungeon->unk18200 = gUnknown_8106A8C[r3];
gDungeon->unk18204 = 0;
gDungeon->unk181e8.unk18200 = gUnknown_8106A8C[r3];
gDungeon->unk181e8.unk18204 = 0;
iVar5 = gUnknown_80F4F94[r3];
if (entityInfo->charging.chargingStatus == STATUS_DIGGING) {
iVar5 *= 2;
@ -351,19 +351,19 @@ bool8 sub_805B264(Entity * pokemon, Entity * target, Move *move, s32 param_4)
}
bool8 MagicCoatMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4)
{
{
MagicCoatStatusTarget(pokemon, target);
return TRUE;
}
bool8 ProtectMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4)
{
{
ProtectStatusTarget(pokemon, target);
return TRUE;
}
bool8 sub_805B2FC(Entity * pokemon,Entity * target,Move *move, s32 param_4)
{
{
RaiseDefenseStageTarget(pokemon,target,gUnknown_8106A4C,1);
return TRUE;
}
@ -389,24 +389,24 @@ bool8 sub_805B324(Entity * pokemon,Entity * target,Move *move, s32 param_4)
}
bool8 DestinyBondMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4)
{
{
DestinyBondStatusTarget(pokemon, target);
return TRUE;
}
bool8 sub_805B388(Entity * pokemon,Entity * target,Move *move, s32 param_4)
{
{
return (sub_8055640(pokemon,target,move,0x100,param_4)) ? TRUE : FALSE;
}
bool8 MirrorCoatMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4)
{
{
MirrorCoatStatusTarget(pokemon, target);
return TRUE;
}
bool8 sub_805B3B4(Entity * pokemon,Entity * target,Move *move, s32 param_4)
{
{
u32 stat = gUnknown_8106A50;
RaiseAttackStageTarget(pokemon,target,stat,1);
RaiseDefenseStageTarget(pokemon,target,stat,1);
@ -414,7 +414,7 @@ bool8 sub_805B3B4(Entity * pokemon,Entity * target,Move *move, s32 param_4)
}
bool8 sub_805B3E0(Entity * pokemon,Entity * target,Move *move, s32 param_4)
{
{
sub_8055640(pokemon,target,move,0x100,param_4);
return TRUE;
}
@ -528,7 +528,7 @@ bool8 sub_805B618(Entity * pokemon, Entity * target, Move *move, s32 param_4)
u32 index;
index = gUnknown_202F228;
InitPokemonMove(&natureMove, gUnknown_80F59C8[index].moveID);
flag = gUnknown_80F59C8[index].move(pokemon, target, &natureMove, param_4);
return flag;
@ -540,7 +540,7 @@ bool8 sub_805B668(Entity * pokemon, Entity * target, Move *move, s32 param_4)
s32 iVar3;
s32 newHP;
bool8 flag;
flag = FALSE;
hasLiquidOoze = HasAbility(target, ABILITY_LIQUID_OOZE);
if (IsSleeping(target)) {
@ -584,7 +584,7 @@ bool8 RecycleMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param
s32 index;
EntityInfo *entityInfo;
bool8 isTMRecycled;
entityInfo = target->info;
isTMRecycled = FALSE;
if (!entityInfo->isNotTeamMember) {
@ -635,7 +635,7 @@ bool8 sub_805B808(Entity * pokemon, Entity * target, Move *move, s32 param_4)
}
bool8 sub_805B884( Entity * pokemon, Entity * target, Move *move, s32 param_4)
{
{
RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C, 1);
RaiseMovementSpeedTarget(pokemon, target, 0, TRUE);
return TRUE;
@ -1026,10 +1026,10 @@ bool8 TrapbustOrbAction(Entity * pokemon,Entity * target, Move *move, s32 param_
else
{
if (tile->room == CORRIDOR_ROOM) {
bottomRightCornerX = target->pos.x - gDungeon->visibilityRange;
bottomRightCornerY = target->pos.y - gDungeon->visibilityRange;
topLeftCornerX = bottomRightCornerX + gDungeon->visibilityRange;
topLeftCornerY = bottomRightCornerY + gDungeon->visibilityRange;
bottomRightCornerX = target->pos.x - gDungeon->unk181e8.visibilityRange;
bottomRightCornerY = target->pos.y - gDungeon->unk181e8.visibilityRange;
topLeftCornerX = bottomRightCornerX + gDungeon->unk181e8.visibilityRange;
topLeftCornerY = bottomRightCornerY + gDungeon->unk181e8.visibilityRange;
}
else {
room = &gDungeon->roomData[tile->room];
@ -1179,8 +1179,8 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4)
else
{
// Calculate the coordinates of the tile in front of the user
tileCoords.x = target->pos.x + gAdjacentTileOffsets[targetInfo->action.direction].x;
tileCoords.y = target->pos.y + gAdjacentTileOffsets[targetInfo->action.direction].y;
tileCoords.x = target->pos.x + gAdjacentTileOffsets[targetInfo->action.direction].x;
tileCoords.y = target->pos.y + gAdjacentTileOffsets[targetInfo->action.direction].y;
sub_8042A54(&tileCoords);
tileToFill = GetTileSafe(tileCoords.x,tileCoords.y);

View File

@ -57,8 +57,8 @@ s32 sub_8070828(Entity *pokemon, bool8 displayMessage)
void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum)
{
if (((gDungeon->blinded ||
gDungeon->hallucinating) ||
if (((gDungeon->unk181e8.blinded ||
gDungeon->unk181e8.hallucinating) ||
(param_2->transformStatus.transformStatus == STATUS_INVISIBLE)) &&
(param_2->isNotTeamMember))
{
@ -101,8 +101,8 @@ void sub_8070968(u8 *buffer, EntityInfo *entityInfo, s32 colorNum)
void sub_80709C8(u8 *buffer, EntityInfo *entityInfo)
{
if (((gDungeon->blinded ||
gDungeon->hallucinating) ||
if (((gDungeon->unk181e8.blinded ||
gDungeon->unk181e8.hallucinating) ||
(entityInfo->transformStatus.transformStatus == STATUS_INVISIBLE)) &&
(entityInfo->isNotTeamMember))
{

View File

@ -271,7 +271,7 @@ void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4)
if (HasHeldItem(target, ITEM_TRAP_SCARF)) {
text = *gUnknown_80FDB5C;
}
if ((flag == TRUE) || (gDungeon->unk1820F != 0)) {
if ((flag == TRUE) || (gDungeon->unk181e8.unk1820F != 0)) {
if (rand < 0) text = *gUnknown_80FDB7C;
}
else if (rand < 0xf) {
@ -291,7 +291,7 @@ void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4)
sub_80421C0(0,0x15c);
sub_8049ED4();
sub_804225C(pokemon,pos,trapData->id);
if (gDungeon->blinded) {
if (gDungeon->unk181e8.blinded) {
SendMessage(pokemon,*gUnknown_80FD7F4);
}
else {

View File

@ -483,7 +483,7 @@ void sub_8081454(unkStruct_8094924 *param_1)
for(iVar4 = 0; iVar4 < 8; iVar4++)
{
SavePosition(param_1,&gDungeon->unkE220[iVar4]);
}
}
sub_80830F8(param_1,&gDungeon->unkE240);
sub_80830F8(param_1,&gDungeon->unkE250);
sub_808312C(param_1,&gDungeon->unkE260);
@ -503,17 +503,17 @@ void sub_808165C(unkStruct_8094924 *param_1)
{
sub_808300C(param_1,gUnknown_81071E0);
sub_8083060(param_1, gDungeon->unk18208);
sub_8083060(param_1, gDungeon->visibilityRange);
sub_80830B4(param_1, gDungeon->blinded);
sub_80830B4(param_1, gDungeon->unk1820B);
sub_80830B4(param_1, gDungeon->unk1820C);
sub_80830B4(param_1, gDungeon->unk1820D);
sub_80830B4(param_1, gDungeon->unk1820E);
sub_80830B4(param_1, gDungeon->unk1820F);
sub_80830B4(param_1, gDungeon->hallucinating);
sub_80830B4(param_1, gDungeon->unk18211);
sub_80830B4(param_1, gDungeon->unk18213);
sub_8083060(param_1, gDungeon->unk181e8.unk18208);
sub_8083060(param_1, gDungeon->unk181e8.visibilityRange);
sub_80830B4(param_1, gDungeon->unk181e8.blinded);
sub_80830B4(param_1, gDungeon->unk181e8.unk1820B);
sub_80830B4(param_1, gDungeon->unk181e8.unk1820C);
sub_80830B4(param_1, gDungeon->unk181e8.unk1820D);
sub_80830B4(param_1, gDungeon->unk181e8.unk1820E);
sub_80830B4(param_1, gDungeon->unk181e8.unk1820F);
sub_80830B4(param_1, gDungeon->unk181e8.hallucinating);
sub_80830B4(param_1, gDungeon->unk181e8.unk18211);
sub_80830B4(param_1, gDungeon->unk181e8.unk18213);
}
// NOTE: forcing this s16 for now - Seth