mirror of
https://github.com/pret/pmd-red.git
synced 2026-09-29 04:17:52 -05:00
Decomped DecideAction() (#66)
* Decomped DecideAction() * Defined dungeon Pokémon array sizes
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
enum DungeonAction
|
||||
{
|
||||
DUNGEON_ACTION_NONE = 0x0,
|
||||
DUNGEON_ACTION_WAIT = 0x1,
|
||||
DUNGEON_ACTION_WALK = 0x2,
|
||||
// Switching between Pokémon in the moves menu.
|
||||
|
||||
@@ -117,6 +117,7 @@ enum VolatileStatus
|
||||
|
||||
enum TargetingDecoy
|
||||
{
|
||||
TARGETING_DECOY_NONE = 0,
|
||||
TARGETING_DECOY_TEAM = 1,
|
||||
TARGETING_DECOY_WILD = 2
|
||||
};
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#ifndef GUARD_DUNGEON_ENGINE_H
|
||||
#define GUARD_DUNGEON_ENGINE_H
|
||||
|
||||
#include "dungeon_entity.h"
|
||||
|
||||
// 0x8075990
|
||||
void decideAction(struct DungeonEntity *pokemon);
|
||||
|
||||
#endif
|
||||
@@ -10,9 +10,8 @@ struct DungeonEntityData
|
||||
// Pokemon: MovementFlag
|
||||
// Items: ItemFlag
|
||||
// Traps: TrapType
|
||||
/* 0x0 */ u8 flags;
|
||||
/* 0x1 */ bool8 moving;
|
||||
/* 0x2 */ u16 entityID; // Pokémon species or item ID.
|
||||
/* 0x0 */ u16 flags;
|
||||
/* 0x2 */ s16 entityID; // Pokémon species or item ID.
|
||||
// Everything from here on only applies to Pokémon.
|
||||
/* 0x4 */ u16 transformSpecies; // Shows a different Pokémon when using Transform.
|
||||
/* 0x6 */ bool8 isEnemy;
|
||||
@@ -97,7 +96,7 @@ struct DungeonEntityData
|
||||
/* 0x90 */ u8 IQSkillsEnabled[4];
|
||||
/* 0x94 */ u8 tactics;
|
||||
u8 fill95[0xA4 - 0x95];
|
||||
/* 0xA4 */ u8 clientFlags;
|
||||
/* 0xA4 */ u8 clientType;
|
||||
u8 fillA5[0xA8 - 0xA5];
|
||||
// Statuses are split into groups based on which ones can't overlap.
|
||||
// See status.h for which statuses are in each group.
|
||||
@@ -290,6 +289,7 @@ enum EntityType
|
||||
enum MovementFlag
|
||||
{
|
||||
MOVEMENT_FLAG_SWAPPED_PLACES = 1 << 5,
|
||||
MOVEMENT_FLAG_MOVING = 1 << 9,
|
||||
MOVEMENT_FLAG_SWAPPED_PLACES_PETRIFIED = 1 << 15 // Set if the Pokémon is petrified and the leader cures them by swapping places.
|
||||
};
|
||||
|
||||
@@ -312,10 +312,11 @@ enum MovementAction
|
||||
MOVEMENT_ACTION_TAKE_ITEM = 7
|
||||
};
|
||||
|
||||
enum ClientFlag
|
||||
enum ClientType
|
||||
{
|
||||
CLIENT_FLAGS_CLIENT = 1, // Used for mission clients that need rescuing.
|
||||
CLIENT_FLAGS_DONT_MOVE = 3 // Used for Diglett in the Skarmory boss fight.
|
||||
CLIENT_TYPE_NONE = 0,
|
||||
CLIENT_TYPE_CLIENT = 1, // Used for mission clients that need rescuing.
|
||||
CLIENT_TYPE_DONT_MOVE = 3 // Used for Diglett in the Skarmory boss fight.
|
||||
};
|
||||
|
||||
enum VisualFlag
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
#ifndef GUARD_DUNGEON_DATA_H
|
||||
#define GUARD_DUNGEON_DATA_H
|
||||
|
||||
#define DUNGEON_MAX_SIZE_X 55
|
||||
#define DUNGEON_MAX_SIZE_Y 31
|
||||
|
||||
#include "constants/species.h"
|
||||
#include "dungeon_entity.h"
|
||||
#include "global.h"
|
||||
#include "map.h"
|
||||
|
||||
#define DUNGEON_MAX_SIZE_X 55
|
||||
#define DUNGEON_MAX_SIZE_Y 31
|
||||
#define DUNGEON_MAX_WILD_POKEMON 16
|
||||
#define DUNGEON_MAX_POKEMON MAX_TEAM_MEMBERS + DUNGEON_MAX_WILD_POKEMON
|
||||
|
||||
struct DungeonGlobalData
|
||||
{
|
||||
u8 unk0;
|
||||
@@ -73,8 +76,8 @@ struct DungeonGlobalData
|
||||
u8 unk1356C;
|
||||
u8 fill1356D[0x1357C - 0x1356D];
|
||||
/* 0x1357C */ struct DungeonEntity *teamPokemon[MAX_TEAM_MEMBERS];
|
||||
/* 0x1358C */ struct DungeonEntity *wildPokemon[0x10];
|
||||
/* 0x135CC */ struct DungeonEntity *allPokemon[0x14]; // Contains both team and wild Pokémon
|
||||
/* 0x1358C */ struct DungeonEntity *wildPokemon[DUNGEON_MAX_WILD_POKEMON];
|
||||
/* 0x135CC */ struct DungeonEntity *allPokemon[DUNGEON_MAX_POKEMON]; // Contains both team and wild Pokémon
|
||||
/* 0x1361C */ struct DungeonEntity *clientPokemon[2]; // Not sure how large this array is.
|
||||
u8 fill13624[0x181F8 - 0x13624];
|
||||
/* 0x181F8 */ struct DungeonEntity *leader; // Pointer to the team leader.
|
||||
@@ -86,7 +89,7 @@ struct DungeonGlobalData
|
||||
/* 0x1820A */ bool8 displayBlinker; // Blacks out the screen when the player has the Blinker status.
|
||||
u8 unk1820B;
|
||||
u32 unk1820C;
|
||||
/* 0x18210 */ bool8 displayCrossEyed; // Displays Subsitute and flower sprites when the player has the Cross-Eyed status.
|
||||
/* 0x18210 */ bool8 displayCrossEyed; // Displays Substitute and flower sprites when the player has the Cross-Eyed status.
|
||||
u8 fill18211[0x18217 - 0x18211];
|
||||
u8 unk18217;
|
||||
};
|
||||
|
||||
9
include/dungeon_movement.h
Normal file
9
include/dungeon_movement.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef GUARD_DUNGEON_MOVEMENT_H
|
||||
#define GUARD_DUNGEON_MOVEMENT_H
|
||||
|
||||
#include "dungeon_entity.h"
|
||||
|
||||
// 0x75990
|
||||
void DecideAction(struct DungeonEntity *pokemon);
|
||||
|
||||
#endif
|
||||
9
include/dungeon_util.h
Normal file
9
include/dungeon_util.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef GUARD_DUNGEON_UTIL_H
|
||||
#define GUARD_DUNGEON_UTIL_H
|
||||
|
||||
#include "dungeon_entity.h"
|
||||
|
||||
// 0x450E0
|
||||
bool8 EntityExists(struct DungeonEntity *pokemon);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user