mirror of
https://github.com/pret/pmd-red.git
synced 2026-08-28 03:34:22 -05:00
rebase updates
This commit is contained in:
@@ -6,17 +6,14 @@ struct unkStruct_8069D4C
|
||||
s16 id;
|
||||
Position pos;
|
||||
s16 HP;
|
||||
u8 atk;
|
||||
u8 spAtk;
|
||||
u8 def;
|
||||
u8 spDef;
|
||||
/* 0x0 */ u8 att[2]; // Atk, SpAtk
|
||||
/* 0x2 */ u8 def[2]; // Def, SpDef
|
||||
u16 level;
|
||||
u32 exp;
|
||||
FixedPoint belly;
|
||||
FixedPoint maxBelly;
|
||||
Item heldItem;
|
||||
Move moves[MAX_MON_MOVES];
|
||||
u32 unk40; // strugglemoveFlags?
|
||||
Moves moves;
|
||||
HiddenPower hiddenPower;
|
||||
};
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ bool8 sub_8093318(s32, Move *moves);
|
||||
bool8 sub_809333C(s32, Move *moves);
|
||||
s32 sub_80935B8(Move *moves, s32 index);
|
||||
void sub_8094060(Move *srcMoves, Move *destMoves);
|
||||
void sub_8094184(struct unkStruct_8094924 *, struct unkStruct_8094184 *);
|
||||
void sub_80941FC(struct unkStruct_8094924 *, struct unkStruct_8094184 *);
|
||||
void sub_8094184(struct unkStruct_8094924 *, struct Moves *);
|
||||
void sub_80941FC(struct unkStruct_8094924 *, struct Moves *);
|
||||
|
||||
#endif // GUARD_MOVES_H
|
||||
#endif // GUARD_MOVES_H
|
||||
|
||||
@@ -168,6 +168,12 @@ typedef struct Unk_Entity_x184
|
||||
/* 0x19e - 0x1a */ u8 unk1A;
|
||||
} Unk_Entity_x184 ;
|
||||
|
||||
typedef struct Moves
|
||||
{
|
||||
/* 0x118 */ Move moves[MAX_MON_MOVES];
|
||||
/* 0x138 */ u8 struggleMoveFlags;
|
||||
} Moves;
|
||||
|
||||
// size: 0x208
|
||||
typedef struct EntityInfo
|
||||
{
|
||||
@@ -272,8 +278,7 @@ typedef struct EntityInfo
|
||||
// When non-zero, an AI Pokémon will move in a random direction every turn when it is a room.
|
||||
// There is a chance of this flag being set when a wild Pokémon spawns. The chance depends on the dungeon's randomMovementChance.
|
||||
/* 0x114 */ u32 moveRandomly;
|
||||
/* 0x118 */ Move moves[MAX_MON_MOVES];
|
||||
/* 0x138 */ u8 struggleMoveFlags;
|
||||
/* 0x118 */ Moves moves;
|
||||
/* 0x13C */ FixedPoint belly;
|
||||
/* 0x140 */ FixedPoint maxBelly;
|
||||
/* 0x144 */ bool8 aiNextToTarget; // True if an AI Pokémon is following another Pokémon and is already adjacent to them.
|
||||
|
||||
@@ -69,10 +69,10 @@ typedef struct PokemonStruct2
|
||||
u16 unk12; // pokeHP
|
||||
/* 0x14 */ Offense offense; // offense (other offset)
|
||||
/* 0x18 */ u32 currExp;
|
||||
/* 0x1C */ unkStruct_8094184 moves;
|
||||
/* 0x1C */ Moves moves;
|
||||
/* 0x40 */ Item itemSlot; // heldItem
|
||||
u32 belly; // some struct
|
||||
u32 maxBelly; // some struct (same type as 44)
|
||||
FixedPoint belly; // some struct
|
||||
FixedPoint maxBelly; // some struct (same type as 44)
|
||||
/* 0x4C */ u32 IQSkills; // unk20
|
||||
/* 0x50 */ u8 tacticIndex;
|
||||
/* 0x54 */ HiddenPower hiddenPower;
|
||||
|
||||
@@ -652,7 +652,7 @@ void GinsengItemAction(Entity *pokemon, Entity * target)
|
||||
if (DungeonRandInt(100) < gUnknown_80F4F46)
|
||||
moveBoost = 3;
|
||||
if (entityInfo->isTeamLeader) {
|
||||
for(moveIndex = 0, movePtr1 = &entityInfo->moves[0], movePtr2 = movePtr1; moveIndex < MAX_MON_MOVES; movePtr1++, movePtr2++, moveIndex++)
|
||||
for(moveIndex = 0, movePtr1 = &entityInfo->moves.moves[0], movePtr2 = movePtr1; moveIndex < MAX_MON_MOVES; movePtr1++, movePtr2++, moveIndex++)
|
||||
{
|
||||
if((movePtr1->moveFlags & MOVE_FLAG_EXISTS) && (movePtr1->moveFlags & MOVE_FLAG_SET))
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "pokemon_mid.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "structs/struct_8069D4C.h"
|
||||
#include "code_8069D4C.h"
|
||||
|
||||
u32 sub_8069D18(Position *pos,Entity *entity)
|
||||
{
|
||||
@@ -38,7 +38,7 @@ void sub_8069D4C(struct unkStruct_8069D4C *r0, Entity *target)
|
||||
r0->def[0] = info->def;
|
||||
r0->def[1] = info->spDef;
|
||||
r0->heldItem = info->heldItem;
|
||||
memcpy(r0->moves.moves, info->moves, sizeof(r0->moves));
|
||||
memcpy(r0->moves.moves, info->moves.moves, sizeof(r0->moves));
|
||||
r0->belly = info->belly;
|
||||
r0->maxBelly = info->maxBelly;
|
||||
r0->hiddenPower = info->hiddenPower;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "structs/str_pokemon.h"
|
||||
#include "structs/struct_8069D4C.h"
|
||||
#include "code_8069D4C.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_803E668.h"
|
||||
#include "code_8045A00.h"
|
||||
|
||||
@@ -476,7 +476,7 @@ void RestorePPTarget(Entity * pokemon,Entity * target, s32 param_3)
|
||||
|
||||
for(index = 0; index < MAX_MON_MOVES; index++)
|
||||
{
|
||||
movePtr = &entityInfo->moves[index];
|
||||
movePtr = &entityInfo->moves.moves[index];
|
||||
movePtr1 = movePtr;
|
||||
if ((movePtr->moveFlags & MOVE_FLAG_EXISTS)) {
|
||||
PP = movePtr->PP;
|
||||
@@ -689,7 +689,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move *
|
||||
|
||||
for(index = 0; index < MAX_MON_MOVES; index++)
|
||||
{
|
||||
movePtr = &entityInfo->moves[index];
|
||||
movePtr = &entityInfo->moves.moves[index];
|
||||
if(movePtr == move)
|
||||
{
|
||||
entityInfo->charging.chargingStatusMoveIndex = index;
|
||||
@@ -1118,7 +1118,7 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4)
|
||||
|
||||
for(index = 0; index < MAX_MON_MOVES; index++)
|
||||
{
|
||||
move = &entityInfo->moves[index];
|
||||
move = &entityInfo->moves.moves[index];
|
||||
if ((move->moveFlags & MOVE_FLAG_EXISTS) && (move->moveFlags2 & MOVE_FLAG_EXISTS)) {
|
||||
bVar8 = TRUE;
|
||||
moveUnsealed = TRUE;
|
||||
@@ -1155,7 +1155,7 @@ void sub_807A0CC(Entity * pokemon, Entity * target)
|
||||
|
||||
for(index = 0; index < MAX_MON_MOVES; index++)
|
||||
{
|
||||
move = &entityInfo->moves[index];
|
||||
move = &entityInfo->moves.moves[index];
|
||||
if ((move->moveFlags & MOVE_FLAG_EXISTS)) {
|
||||
move->moveFlags2 &= ~(MOVE_FLAG_EXISTS);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction)
|
||||
if (sp_0x28 != NULL) {
|
||||
InitPokemonMove(&move,0x163);
|
||||
if (!sub_80571F0(sp_0x28,&move)) {
|
||||
sub_807A96C(pokemon,sp_0x28);
|
||||
TrySendImmobilizeSleepEndMsg(pokemon,sp_0x28);
|
||||
sub_806F370(pokemon,sp_0x28,gUnknown_80F4F90,0,0,0,0x21a,0,0,0);
|
||||
}
|
||||
}
|
||||
@@ -248,7 +248,7 @@ void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos)
|
||||
}
|
||||
|
||||
sub_80522F4(pokemon,target,*gUnknown_80FC584); // $m0 warped!
|
||||
sub_807A96C(target,target);
|
||||
TrySendImmobilizeSleepEndMsg(target,target);
|
||||
sub_80421AC(pokemon,target);
|
||||
if (sub_8045888(target)) {
|
||||
direction = (info->action).direction;
|
||||
|
||||
@@ -95,18 +95,18 @@ void DecideAttack(Entity *pokemon)
|
||||
{
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
if (pokemonInfo->moves[i].moveFlags & MOVE_FLAG_EXISTS &&
|
||||
MoveMatchesChargingStatus(pokemon, &pokemonInfo->moves[i]) &&
|
||||
if (pokemonInfo->moves.moves[i].moveFlags & MOVE_FLAG_EXISTS &&
|
||||
MoveMatchesChargingStatus(pokemon, &pokemonInfo->moves.moves[i]) &&
|
||||
pokemonInfo->charging.chargingStatusMoveIndex == i)
|
||||
{
|
||||
s32 chosenMoveIndex;
|
||||
SetMonsterActionFields(&pokemonInfo->action, ACTION_USE_MOVE_AI);
|
||||
chosenMoveIndex = i;
|
||||
if (i > 0 && pokemonInfo->moves[i].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)
|
||||
if (i > 0 && pokemonInfo->moves.moves[i].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)
|
||||
{
|
||||
while (--chosenMoveIndex > 0)
|
||||
{
|
||||
if (!(pokemonInfo->moves[chosenMoveIndex].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))
|
||||
if (!(pokemonInfo->moves.moves[chosenMoveIndex].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -122,10 +122,10 @@ void DecideAttack(Entity *pokemon)
|
||||
numUsableMoves = 0;
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
Move *move = &pokemonInfo->moves[i];
|
||||
if (pokemonInfo->moves[i].moveFlags & MOVE_FLAG_EXISTS)
|
||||
Move *move = &pokemonInfo->moves.moves[i];
|
||||
if (pokemonInfo->moves.moves[i].moveFlags & MOVE_FLAG_EXISTS)
|
||||
{
|
||||
if (pokemonInfo->moves[i].moveFlags & MOVE_FLAG_ENABLED_FOR_AI)
|
||||
if (pokemonInfo->moves.moves[i].moveFlags & MOVE_FLAG_ENABLED_FOR_AI)
|
||||
{
|
||||
numUsableMoves++;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ void DecideAttack(Entity *pokemon)
|
||||
// This requires a separate check from the 0-PP check used for unlinked moves.
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
Move *move = &pokemonInfo->moves[i];
|
||||
Move *move = &pokemonInfo->moves.moves[i];
|
||||
if (!(move->moveFlags & MOVE_FLAG_EXISTS))
|
||||
{
|
||||
break;
|
||||
@@ -202,7 +202,7 @@ void DecideAttack(Entity *pokemon)
|
||||
{
|
||||
Move *move;
|
||||
aiPossibleMove[i].canBeUsed = FALSE;
|
||||
move = &pokemonInfo->moves[i];
|
||||
move = &pokemonInfo->moves.moves[i];
|
||||
if (move->moveFlags & MOVE_FLAG_EXISTS &&
|
||||
willNotUnlinkMove[i] &&
|
||||
CanAIUseMove(pokemon, i, hasPPChecker) &&
|
||||
@@ -319,17 +319,17 @@ void DecideAttack(Entity *pokemon)
|
||||
}
|
||||
else
|
||||
{
|
||||
AIConsiderMove(&aiPossibleMove[i], pokemon, &pokemonInfo->moves[i]);
|
||||
AIConsiderMove(&aiPossibleMove[i], pokemon, &pokemonInfo->moves.moves[i]);
|
||||
if (aiPossibleMove[i].canBeUsed)
|
||||
{
|
||||
s32 chosenMoveIndex;
|
||||
SetMonsterActionFields(&pokemonInfo->action, ACTION_USE_MOVE_AI);
|
||||
chosenMoveIndex = i;
|
||||
if (i > 0 && pokemonInfo->moves[i].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)
|
||||
if (i > 0 && pokemonInfo->moves.moves[i].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN)
|
||||
{
|
||||
while (--chosenMoveIndex > 0)
|
||||
{
|
||||
if (!(pokemonInfo->moves[chosenMoveIndex].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))
|
||||
if (!(pokemonInfo->moves.moves[chosenMoveIndex].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -1012,7 +1012,7 @@ void HandleUseOrbAction(Entity *pokemon)
|
||||
if (!entityInfo->isTeamLeader) {
|
||||
sp28.canBeUsed = r8;
|
||||
sp28.weight = 10;
|
||||
AIConsiderMove(&sp28, pokemon, entityInfo->moves);
|
||||
AIConsiderMove(&sp28, pokemon, entityInfo->moves.moves);
|
||||
|
||||
if (sp28.canBeUsed) {
|
||||
entityInfo->action.direction = sp28.direction & 7;
|
||||
|
||||
@@ -79,7 +79,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla
|
||||
break;
|
||||
case ITEM_MAX_ELIXIR:
|
||||
itemWeight = 0;
|
||||
move = pokemonInfo->moves;
|
||||
move = pokemonInfo->moves.moves;
|
||||
move2 = move;
|
||||
for (i = 0; i < MAX_MON_MOVES; move++, move2++, i++)
|
||||
{
|
||||
@@ -427,7 +427,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla
|
||||
itemWeight = 30;
|
||||
break;
|
||||
case ITEM_ROLLCALL_ORB:
|
||||
move = pokemonInfo->moves; // Fixes a regswap.
|
||||
move = pokemonInfo->moves.moves; // Fixes a regswap.
|
||||
if (targetOther)
|
||||
{
|
||||
itemWeight = 0;
|
||||
|
||||
@@ -139,7 +139,7 @@ bool8 sub_8072CF4(Entity *entity)
|
||||
|
||||
for(index = 0; index < MAX_MON_MOVES; index++)
|
||||
{
|
||||
move = &info->moves[index];
|
||||
move = &info->moves.moves[index];
|
||||
if ((move->moveFlags & MOVE_FLAG_EXISTS)) {
|
||||
move->moveFlags2 &= ~(MOVE_FLAG2_UNK4);
|
||||
}
|
||||
@@ -334,8 +334,8 @@ bool8 sub_8072CF4(Entity *entity)
|
||||
|
||||
for(index = 0; index < MAX_MON_MOVES; index++)
|
||||
{
|
||||
move = &info->moves[index];
|
||||
if ((info->moves[index].moveFlags & MOVE_FLAG_EXISTS) && (move->moveFlags & MOVE_FLAG_LAST_USED)) {
|
||||
move = &info->moves.moves[index];
|
||||
if ((info->moves.moves[index].moveFlags & MOVE_FLAG_EXISTS) && (move->moveFlags & MOVE_FLAG_LAST_USED)) {
|
||||
move->PP = 0;
|
||||
bVar4 = TRUE;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ bool8 sub_80717A4(Entity *pokemon, u16 moveID)
|
||||
|
||||
Move *pokeMove2; // some reason uses another pointer to same struct
|
||||
|
||||
for(index = 0, pokeMove = entityInfo->moves, pokeMove2 = pokeMove; index < MAX_MON_MOVES; pokeMove++, pokeMove2++, index++)
|
||||
for(index = 0, pokeMove = entityInfo->moves.moves, pokeMove2 = pokeMove; index < MAX_MON_MOVES; pokeMove++, pokeMove2++, index++)
|
||||
{
|
||||
if (((pokeMove->moveFlags & MOVE_FLAG_EXISTS)) && (entityInfo->isTeamLeader || ((pokeMove->moveFlags & MOVE_FLAG_ENABLED_FOR_AI))))
|
||||
if((sub_805744C(pokemon, pokeMove2, TRUE) != 0) && (pokeMove->PP != 0))
|
||||
|
||||
@@ -824,7 +824,7 @@ void sub_8032828(void)
|
||||
case 0x32:
|
||||
if (sub_8030894() == 0) {
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(NULL, TRUE, TRUE);
|
||||
xxx_call_save_unk_text_struct_800641C(NULL, TRUE, TRUE);
|
||||
sub_80306A8(WONDER_MAIL_TYPE_SOS, 0, NULL, 6);
|
||||
}
|
||||
break;
|
||||
@@ -921,7 +921,7 @@ void sub_8032828(void)
|
||||
case 0x1D:
|
||||
if (sub_8030894() == 0) {
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(NULL, TRUE, TRUE);
|
||||
xxx_call_save_unk_text_struct_800641C(NULL, TRUE, TRUE);
|
||||
sub_80306A8(WONDER_MAIL_TYPE_AOK, 0, NULL, 6);
|
||||
}
|
||||
break;
|
||||
@@ -1028,7 +1028,7 @@ void sub_8032828(void)
|
||||
if (sub_8030894() != 0)
|
||||
break;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(NULL, TRUE, TRUE);
|
||||
xxx_call_save_unk_text_struct_800641C(NULL, TRUE, TRUE);
|
||||
sub_80306A8(WONDER_MAIL_TYPE_SOS, 0, NULL, 6);
|
||||
break;
|
||||
case 0x15:
|
||||
|
||||
@@ -308,7 +308,7 @@ void sub_8057588(Entity * pokemon, u8 param_2)
|
||||
entityInfo = pokemon->info;
|
||||
for(index = 0; index < MAX_MON_MOVES; index++)
|
||||
{
|
||||
move = &entityInfo->moves[index];
|
||||
move = &entityInfo->moves.moves[index];
|
||||
if ((move->moveFlags & MOVE_FLAG_EXISTS)) {
|
||||
PPtoRemove = 1;
|
||||
if ((move->moveFlags2 & MOVE_FLAG_LAST_USED)) {
|
||||
@@ -556,7 +556,7 @@ bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4
|
||||
|
||||
for(iVar4 = 0; iVar4 < MAX_MON_MOVES; iVar4++)
|
||||
{
|
||||
movePtr = &entityInfo->moves[iVar4];
|
||||
movePtr = &entityInfo->moves.moves[iVar4];
|
||||
if ((movePtr->moveFlags & MOVE_FLAG_EXISTS) != 0) {
|
||||
if ((movePtr->moveFlags & MOVE_FLAG_DISABLED) == 0) {
|
||||
if ((movePtr->moveFlags & MOVE_FLAG_LAST_USED) != 0) {
|
||||
@@ -573,18 +573,18 @@ bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4
|
||||
}
|
||||
};
|
||||
|
||||
if ((entityInfo->struggleMoveFlags & MOVE_FLAG_DISABLED) == 0) {
|
||||
if ((entityInfo->struggleMoveFlags & MOVE_FLAG_LAST_USED) != 0) {
|
||||
if ((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_DISABLED) == 0) {
|
||||
if ((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) != 0) {
|
||||
InitPokemonMove(&struggleMove, MOVE_STRUGGLE);
|
||||
entityInfo->struggleMoveFlags |= MOVE_FLAG_DISABLED;
|
||||
entityInfo->moves.struggleMoveFlags |= MOVE_FLAG_DISABLED;
|
||||
isTormented = TRUE;
|
||||
sub_80928C0(gFormatItems,&struggleMove,0);
|
||||
// $i0 was tormented
|
||||
sub_80522F4(pokemon,target,*gUnknown_80FCFBC);
|
||||
}
|
||||
}
|
||||
else if ((entityInfo->struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) {
|
||||
entityInfo->struggleMoveFlags &= ~(MOVE_FLAG_DISABLED);
|
||||
else if ((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) {
|
||||
entityInfo->moves.struggleMoveFlags &= ~(MOVE_FLAG_DISABLED);
|
||||
}
|
||||
if (isTormented)
|
||||
{
|
||||
@@ -2321,7 +2321,7 @@ bool8 ConversionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 para
|
||||
{
|
||||
for(index = 0; index < MAX_MON_MOVES; index++)
|
||||
{
|
||||
movePtr = &info->moves[index];
|
||||
movePtr = &info->moves.moves[index];
|
||||
if (((movePtr->moveFlags & MOVE_FLAG_EXISTS)) && (GetMoveTypeForMonster(target,movePtr) != TYPE_NONE)) {
|
||||
moveStack[counter] = movePtr;
|
||||
counter++;
|
||||
|
||||
@@ -596,7 +596,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!HasLastUsedMove(targetData->moves))
|
||||
if (!HasLastUsedMove(targetData->moves.moves))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -614,7 +614,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move)
|
||||
}
|
||||
break;
|
||||
case MOVE_TORMENT:
|
||||
if (HasDisabledMove(targetData->moves) || !HasLastUsedMove(targetData->moves))
|
||||
if (HasDisabledMove(targetData->moves.moves) || !HasLastUsedMove(targetData->moves.moves))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -640,7 +640,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move)
|
||||
}
|
||||
break;
|
||||
case MOVE_SPITE:
|
||||
if (LastUsedMoveOutOfPP(targetData->moves))
|
||||
if (LastUsedMoveOutOfPP(targetData->moves.moves))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -850,7 +850,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move)
|
||||
break;
|
||||
case MOVE_MIMIC:
|
||||
case MOVE_SKETCH:
|
||||
if (!HasLastUsedMove(targetData->moves))
|
||||
if (!HasLastUsedMove(targetData->moves.moves))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ u32 sub_8057144(Entity * pokemon)
|
||||
{
|
||||
Entity *dungeonMon = gDungeon->allPokemon[i];
|
||||
if (EntityExists(dungeonMon)) {
|
||||
Move *moves = dungeonMon->info->moves;
|
||||
Move *moves = dungeonMon->info->moves.moves;
|
||||
for (j = 0; j < MAX_MON_MOVES; j++)
|
||||
{
|
||||
if (moves[j].moveFlags & MOVE_FLAG_EXISTS
|
||||
@@ -141,7 +141,7 @@ bool8 sub_8057308(Entity *pokemon, s32 chance)
|
||||
bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker)
|
||||
{
|
||||
EntityInfo *pokemonInfo = pokemon->info;
|
||||
Move *move = &pokemonInfo->moves[moveIndex];
|
||||
Move *move = &pokemonInfo->moves.moves[moveIndex];
|
||||
s32 i;
|
||||
if (!(move->moveFlags & MOVE_FLAG_EXISTS))
|
||||
{
|
||||
@@ -174,7 +174,7 @@ bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker)
|
||||
goto returnTrue;
|
||||
}
|
||||
move++;
|
||||
if ((u32) move >= (u32) &pokemonInfo->struggleMoveFlags || !(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))
|
||||
if ((u32) move >= (u32) &pokemonInfo->moves.struggleMoveFlags || !(move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -206,7 +206,7 @@ bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker)
|
||||
{
|
||||
if (move->id == MOVE_STRUGGLE)
|
||||
{
|
||||
if (!(pokemonInfo->struggleMoveFlags & MOVE_FLAG_LAST_USED))
|
||||
if (!(pokemonInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -233,7 +233,7 @@ bool8 sub_805744C(Entity * pokemon, Move *move, bool8 param_3)
|
||||
if ((entityInfo->volatileStatus.volatileStatus == STATUS_TAUNTED) && (!MoveIgnoresTaunted(move))) return FALSE;
|
||||
if (entityInfo->volatileStatus.volatileStatus == STATUS_ENCORE) {
|
||||
if (move->id == MOVE_STRUGGLE) {
|
||||
if((entityInfo->struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE;
|
||||
if((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE;
|
||||
}
|
||||
else {
|
||||
if((move->moveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE;
|
||||
|
||||
12
src/moves.c
12
src/moves.c
@@ -1595,14 +1595,14 @@ static void sub_8094148(struct unkStruct_8094924 *r0, Move *move)
|
||||
SaveIntegerBits(r0, &move->ginseng, 7);
|
||||
}
|
||||
|
||||
void sub_8094184(struct unkStruct_8094924 *r0, struct unkStruct_8094184 *r1)
|
||||
void sub_8094184(struct unkStruct_8094924 *r0, struct Moves *r1)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
sub_8094148(r0, &r1->moves[i]);
|
||||
|
||||
SaveIntegerBits(r0, &r1->unk20, 8);
|
||||
SaveIntegerBits(r0, &r1->struggleMoveFlags, 8);
|
||||
}
|
||||
|
||||
static void sub_80941B0(struct unkStruct_8094924 *r0, Move *move)
|
||||
@@ -1615,15 +1615,15 @@ static void sub_80941B0(struct unkStruct_8094924 *r0, Move *move)
|
||||
RestoreIntegerBits(r0, &move->ginseng, 7);
|
||||
}
|
||||
|
||||
void sub_80941FC(struct unkStruct_8094924 *r0, struct unkStruct_8094184 *r1)
|
||||
void sub_80941FC(struct unkStruct_8094924 *r0, struct Moves*r1)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
sub_80941B0(r0, &r1->moves[i]);
|
||||
|
||||
r1->unk20 = 0;
|
||||
RestoreIntegerBits(r0, &r1->unk20, 8);
|
||||
r1->struggleMoveFlags= 0;
|
||||
RestoreIntegerBits(r0, &r1->struggleMoveFlags, 8);
|
||||
}
|
||||
|
||||
bool8 DoesMoveCharge(u16 move)
|
||||
@@ -1639,4 +1639,4 @@ bool8 DoesMoveCharge(u16 move)
|
||||
if (move == MOVE_DIG) return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,10 +654,9 @@ void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 * a1, PokemonStruct1 *
|
||||
slot->quantity = 0;
|
||||
slot->flags = 0;
|
||||
}
|
||||
sub_80943A0(&somestruct_80943A0, 100);
|
||||
a1->belly = somestruct_80943A0;
|
||||
sub_80943A0(&somestruct2_80943A0, 100);
|
||||
a1->maxBelly = somestruct2_80943A0;
|
||||
|
||||
a1->belly = IntToFixedPoint(100);
|
||||
a1->maxBelly = IntToFixedPoint(100);
|
||||
}
|
||||
|
||||
void xxx_pokemon2_to_pokemonstruct_index_808DF2C(s32 a1, PokemonStruct2* a2)
|
||||
|
||||
@@ -1211,10 +1211,10 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target)
|
||||
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) {
|
||||
for(index = 0; index < MAX_MON_MOVES; index++)
|
||||
{
|
||||
movePtr = &EntityInfo->moves[index];
|
||||
if ((EntityInfo->moves[index].moveFlags & MOVE_FLAG_EXISTS) && (movePtr->moveFlags & MOVE_FLAG_LAST_USED)) break;
|
||||
movePtr = &EntityInfo->moves.moves[index];
|
||||
if ((EntityInfo->moves.moves[index].moveFlags & MOVE_FLAG_EXISTS) && (movePtr->moveFlags & MOVE_FLAG_LAST_USED)) break;
|
||||
}
|
||||
if ((index == MAX_MON_MOVES) && ((EntityInfo->struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0)) {
|
||||
if ((index == MAX_MON_MOVES) && ((EntityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0)) {
|
||||
SetMessageArgument(gAvailablePokemonNames,target,0);
|
||||
sub_80522F4(pokemon,target,*gUnknown_80FBBD4);
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ bool8 MimicMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4
|
||||
|
||||
for(moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++)
|
||||
{
|
||||
movePtr = &targetEntityInfo->moves[moveIndex];
|
||||
movePtr = &targetEntityInfo->moves.moves[moveIndex];
|
||||
if (((movePtr->moveFlags & MOVE_FLAG_EXISTS)) && !sub_805755C(pokemon,movePtr->id)) {
|
||||
if ((movePtr->id != MOVE_MIMIC) && (movePtr->id != MOVE_ASSIST) && (movePtr->id != MOVE_SKETCH) && (movePtr->id != MOVE_MIRROR_MOVE) &&
|
||||
(movePtr->id != MOVE_ENCORE) && ((movePtr->moveFlags & MOVE_FLAG_LAST_USED))) {
|
||||
|
||||
@@ -168,7 +168,7 @@ bool8 sub_80701A4(Entity *pokemon)
|
||||
SendMessage(pokemon,*gPtrMoveInterruptedMessage);
|
||||
}
|
||||
else {
|
||||
for(index = 0, move = pokemonInfo->moves; index < MAX_MON_MOVES; move++, index++) {
|
||||
for(index = 0, move = pokemonInfo->moves.moves; index < MAX_MON_MOVES; move++, index++) {
|
||||
if ((move->moveFlags & MOVE_FLAG_EXISTS) &&
|
||||
(MoveMatchesChargingStatus(pokemon,move)) &&
|
||||
(pokemonInfo->charging.chargingStatusMoveIndex == index)) {
|
||||
@@ -178,10 +178,10 @@ bool8 sub_80701A4(Entity *pokemon)
|
||||
if((index > 0) && (move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))
|
||||
{
|
||||
do {
|
||||
move2 = &pokemonInfo->moves[index_1 + 1];
|
||||
move2 = &pokemonInfo->moves.moves[index_1 + 1];
|
||||
move2--, index_1--;
|
||||
if(index_1 <= 0) break;
|
||||
if(!(pokemonInfo->moves[index_1].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))
|
||||
if(!(pokemonInfo->moves.moves[index_1].moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ bool8 HasNegativeStatus(Entity *pokemon)
|
||||
}
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
Move *moves = pokemonInfo->moves;
|
||||
Move *moves = pokemonInfo->moves.moves;
|
||||
if (moves[i].moveFlags & MOVE_FLAG_EXISTS && moves[i].moveFlags2 & MOVE_FLAG_SEALED)
|
||||
{
|
||||
return TRUE;
|
||||
|
||||
@@ -655,7 +655,7 @@ void HandlePPZeroTrap(Entity *param_1,Entity *param_2)
|
||||
counter = 0;
|
||||
for(i = 0; i < MAX_MON_MOVES; move++, i++)
|
||||
{
|
||||
move = &info->moves[i];
|
||||
move = &info->moves.moves[i];
|
||||
if (((move->moveFlags & MOVE_FLAG_EXISTS) != 0) && (move->PP != 0)) {
|
||||
moveStack[counter] = move;
|
||||
indexStack[counter] = i;
|
||||
@@ -697,7 +697,7 @@ void HandleSealTrap(Entity *param_1,Entity *param_2)
|
||||
counter = 0;
|
||||
for(i = 0; i < MAX_MON_MOVES;i++)
|
||||
{
|
||||
move = &info->moves[i];
|
||||
move = &info->moves.moves[i];
|
||||
if ((move->moveFlags & MOVE_FLAG_EXISTS) && !(move->moveFlags2 & MOVE_FLAG_SEALED)) {
|
||||
moveStack[counter] = move;
|
||||
counter++;
|
||||
@@ -706,7 +706,7 @@ void HandleSealTrap(Entity *param_1,Entity *param_2)
|
||||
if (counter != 0) {
|
||||
moveIndex = DungeonRandInt(counter);
|
||||
moveStack[moveIndex]->moveFlags2 |= MOVE_FLAG_SEALED;
|
||||
sub_80928C0(gUnknown_202DE58,moveStack[moveIndex], NULL);
|
||||
sub_80928C0(gFormatItems,moveStack[moveIndex], NULL);
|
||||
flag = TRUE;
|
||||
}
|
||||
if(flag)
|
||||
|
||||
10
src/trap_1.c
10
src/trap_1.c
@@ -44,7 +44,7 @@ void sub_8083048(unkStruct_8094924 *param_1, u32);
|
||||
void sub_80818C8(unkStruct_8094924 *param_1, JoinedAt *param_2);
|
||||
void SaveActionContainer(unkStruct_8094924 *param_1, ActionContainer *param_2);
|
||||
void sub_8081B34(unkStruct_8094924 *r0, s16 *r1);
|
||||
void SaveEntityMoves(unkStruct_8094924 *r0, Move *move);
|
||||
void SaveEntityMoves(unkStruct_8094924 *r0, Moves *move);
|
||||
void sub_8081824(unkStruct_8094924 *param_1, u32 param_2);
|
||||
void sub_80817B0(unkStruct_8094924 *param_1, u32 param_2);
|
||||
void SavePosition(void*, Position *);
|
||||
@@ -442,7 +442,7 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2)
|
||||
sub_8083060(param_1,info->stockpileStage);
|
||||
sub_8083060(param_1,info->unk113);
|
||||
sub_8083060(param_1,(u8)info->moveRandomly);
|
||||
SaveEntityMoves(param_1,info->moves);
|
||||
SaveEntityMoves(param_1,&info->moves);
|
||||
sub_8081B34(param_1,(s16 *)&info->belly);
|
||||
sub_8081B34(param_1,(s16 *)&info->maxBelly);
|
||||
sub_80830B4(param_1,info->aiNextToTarget);
|
||||
@@ -743,14 +743,14 @@ void SaveEntityMove(unkStruct_8094924 *r0, Move *r1)
|
||||
sub_8083060(r0, r1->ginseng);
|
||||
}
|
||||
|
||||
void SaveEntityMoves(unkStruct_8094924 *r0, Move *move)
|
||||
void SaveEntityMoves(unkStruct_8094924 *r0, Moves *move)
|
||||
{
|
||||
s32 index;
|
||||
for(index = 0; index < MAX_MON_MOVES; index++)
|
||||
{
|
||||
SaveEntityMove(r0, &move[index]);
|
||||
SaveEntityMove(r0, &move->moves[index]);
|
||||
}
|
||||
sub_8083060(r0, *(u8 *)(move + 0x4)); // Struggle Move flags?
|
||||
sub_8083060(r0, move->struggleMoveFlags); // Struggle Move flags?
|
||||
}
|
||||
|
||||
void sub_8081B34(unkStruct_8094924 *r0, s16 *r1)
|
||||
|
||||
@@ -1385,7 +1385,7 @@ void sub_80293F4(void)
|
||||
sub_8095274(mail.unk10.unk10);
|
||||
mail.mailType = 2;
|
||||
sub_80951BC(&mail);
|
||||
sub_80141B4(gWonderMailAOKMailReceivedText, 0, &sUnknown_203B2C0->faceFile, 0x101);
|
||||
xxx_info_box_80141B4(gWonderMailAOKMailReceivedText, 0, &sUnknown_203B2C0->faceFile, 0x101);
|
||||
SetFriendRescueCounterState(RECEIVED_FRIEND_SOS_MAIL);
|
||||
break;
|
||||
case 23:
|
||||
|
||||
@@ -65,7 +65,7 @@ bool8 sub_8030D40(u8 mailIndex, s32 windowID)
|
||||
sub_801317C(&gUnknown_203B324->unk0);
|
||||
gUnknown_203B324->windowID = windowID;
|
||||
gUnknown_203B324->unk14 = &gUnknown_203B324->unk18[windowID];
|
||||
sub_8006518(gUnknown_203B324->unk18);
|
||||
RestoreUnkTextStruct_8006518(gUnknown_203B324->unk18);
|
||||
gUnknown_203B324->unk18[gUnknown_203B324->windowID] = gUnknown_80E091C;
|
||||
sub_8030DD4();
|
||||
return TRUE;
|
||||
|
||||
Reference in New Issue
Block a user