Merge pull request #484 from GriffinRichards/clone-union

Separate connection clone objects from normal objects
This commit is contained in:
GriffinR
2022-10-17 21:29:52 -04:00
committed by GitHub
429 changed files with 3114 additions and 1484 deletions
+3
View File
@@ -192,4 +192,7 @@
#define OBJ_EVENT_ID_PLAYER 0xFF
#define OBJ_EVENT_ID_CAMERA 0x7F
#define OBJ_KIND_NORMAL 0
#define OBJ_KIND_CLONE 255
#endif // GUARD_CONSTANTS_EVENT_OBJECTS_H
+8 -1
View File
@@ -4,7 +4,10 @@
#include "constants/map_groups.h"
#include "constants/map_types.h"
#define MAP_NONE (0x7F | (0x7F << 8))
// Warps using this map will instead use the warp data stored in gSaveBlock1Ptr->dynamicWarp.
// Used for warps that need to change destinations, e.g. when stepping off an elevator.
#define MAP_DYNAMIC (0x7F | (0x7F << 8))
#define MAP_UNDEFINED (0xFF | (0xFF << 8))
#define MAP_GROUP(map) (MAP_##map >> 8)
@@ -12,6 +15,10 @@
#define MAP(map) MAP_GROUP(map), MAP_NUM(map)
// ID for dynamic warps. Used in the dest_warp_id field for warp events, but it's never
// read in practice. A dest_map of MAP_DYNAMIC is used to indicate that a dynamic warp
// should be used, at which point the warp id is ignored. It can be passed to SetDynamicWarp
// or SetDynamicWarpWithCoords as the first argument, but this argument is unused.
#define WARP_ID_DYNAMIC 0x7F
// Used to indicate an invalid warp id, for dummy warps or when a warp should
+22 -13
View File
@@ -96,19 +96,28 @@ struct BackupMapLayout
struct ObjectEventTemplate
{
/*0x00*/ u8 localId;
/*0x01*/ u8 graphicsId;
/*0x02*/ u8 inConnection;
/*0x04*/ s16 x;
/*0x06*/ s16 y;
/*0x08*/ u8 elevation;
/*0x09*/ u8 movementType;
/*0x0A*/ u16 movementRangeX:4;
u16 movementRangeY:4;
/*0x0C*/ u16 trainerType;
/*0x0E*/ u16 trainerRange_berryTreeId;
/*0x10*/ const u8 *script;
/*0x14*/ u16 flagId;
u8 localId;
u8 graphicsId;
u8 kind; // The "kind" field determines how to access objUnion union below.
s16 x, y;
union {
struct {
u8 elevation;
u8 movementType;
u16 movementRangeX:4;
u16 movementRangeY:4;
u16 trainerType;
u16 trainerRange_berryTreeId;
} normal;
struct {
u8 targetLocalId;
u8 padding[3];
u16 targetMapNum;
u16 targetMapGroup;
} clone;
} objUnion;
const u8 *script;
u16 flagId;
}; /*size = 0x18*/
struct WarpEvent