mirror of
https://github.com/pret/pmd-red.git
synced 2026-09-29 23:04:31 -04:00
Decomped SetWalkAction()
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#include "global.h"
|
||||
#include "dungeon_action.h"
|
||||
|
||||
#include "constants/dungeon_action.h"
|
||||
#include "dungeon_entity.h"
|
||||
#include "pokemon.h"
|
||||
|
||||
void SetAction(struct DungeonActionContainer *actionPointer, u16 action)
|
||||
{
|
||||
@@ -8,3 +11,17 @@ void SetAction(struct DungeonActionContainer *actionPointer, u16 action)
|
||||
actionPointer->actionUseIndex = 0;
|
||||
actionPointer->unkC = 0;
|
||||
}
|
||||
|
||||
void SetWalkAction(struct DungeonActionContainer *actionPointer, s16 species)
|
||||
{
|
||||
if (GetIsMoving(species))
|
||||
{
|
||||
actionPointer->action = DUNGEON_ACTION_WALK;
|
||||
}
|
||||
else
|
||||
{
|
||||
actionPointer->action = DUNGEON_ACTION_WAIT;
|
||||
}
|
||||
actionPointer->actionUseIndex = 0;
|
||||
actionPointer->unkC = 0;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "constants/status.h"
|
||||
#include "constants/targeting.h"
|
||||
#include "code_80521D0.h"
|
||||
#include "dungeon_action.h"
|
||||
#include "dungeon_ai_items.h"
|
||||
#include "dungeon_capabilities_1.h"
|
||||
#include "dungeon_global_data.h"
|
||||
@@ -26,7 +27,6 @@ extern char *gPtrItsaMonsterHouseMessage;
|
||||
extern void SendImmobilizeEndMessage(struct DungeonEntity*, struct DungeonEntity*);
|
||||
extern void SetMessageArgument(char[], struct DungeonEntity*, u32);
|
||||
extern void ResetAction(u16*);
|
||||
extern void SetWalkAction(u16*, s16);
|
||||
extern void DecideAttack(struct DungeonEntity*);
|
||||
extern void MoveIfPossible(struct DungeonEntity*, bool8);
|
||||
extern u8 sub_8044B28(void);
|
||||
@@ -209,7 +209,7 @@ void DecideAction(struct DungeonEntity *pokemon)
|
||||
ResetAction(&pokemonData->action.action);
|
||||
if (pokemonData->clientType == CLIENT_TYPE_CLIENT)
|
||||
{
|
||||
SetWalkAction(&pokemonData->action.action, pokemonData->entityID);
|
||||
SetWalkAction(&pokemonData->action, pokemonData->entityID);
|
||||
pokemonData->action.facingDir = DungeonRandomCapped(NUM_DIRECTIONS);
|
||||
pokemonData->targetPosition.x = pokemon->posWorld.x;
|
||||
pokemonData->targetPosition.y = pokemon->posWorld.y - 1;
|
||||
@@ -228,7 +228,7 @@ void DecideAction(struct DungeonEntity *pokemon)
|
||||
}
|
||||
if (pokemonData->volatileStatus == VOLATILE_STATUS_CONFUSED)
|
||||
{
|
||||
SetWalkAction(&pokemonData->action.action, pokemonData->entityID);
|
||||
SetWalkAction(&pokemonData->action, pokemonData->entityID);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -243,7 +243,7 @@ void DecideAction(struct DungeonEntity *pokemon)
|
||||
{
|
||||
if (pokemonData->volatileStatus == VOLATILE_STATUS_CONFUSED)
|
||||
{
|
||||
SetWalkAction(&pokemonData->action.action, pokemonData->entityID);
|
||||
SetWalkAction(&pokemonData->action, pokemonData->entityID);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+1
-2
@@ -14,10 +14,9 @@ extern char *gPtrWrappedByMessage;
|
||||
extern char *gPtrBideMessage;
|
||||
extern char *gPtrPausedMessage;
|
||||
extern char *gPtrInfatuatedMessage;
|
||||
|
||||
extern char gAvailablePokemonNames[];
|
||||
|
||||
extern void SetMessageArgument(char[], struct DungeonEntity*, u32);
|
||||
extern void SetWalkAction(struct DungeonActionContainer*, s16);
|
||||
extern bool8 CanMoveForward2(struct DungeonEntity*, u8);
|
||||
extern void DecideAttack(struct DungeonEntity*);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user