mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-14 07:33:44 +01:00
Z coord / height -> elevation
This commit is contained in:
parent
fb81d9ad4a
commit
3d0326106e
@ -98,7 +98,7 @@ void ObjectEventClearHeldMovementIfActive(struct ObjectEvent *);
|
|||||||
void TrySpawnObjectEvents(s16, s16);
|
void TrySpawnObjectEvents(s16, s16);
|
||||||
u8 CreateObjectGraphicsSprite(u16, void (*)(struct Sprite *), s16 x, s16 y, u8 subpriority);
|
u8 CreateObjectGraphicsSprite(u16, void (*)(struct Sprite *), s16 x, s16 y, u8 subpriority);
|
||||||
u8 TrySpawnObjectEvent(u8, u8, u8);
|
u8 TrySpawnObjectEvent(u8, u8, u8);
|
||||||
u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 z);
|
u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 elevation);
|
||||||
u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *);
|
u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *);
|
||||||
void SetSpritePosToMapCoords(s16, s16, s16 *, s16 *);
|
void SetSpritePosToMapCoords(s16, s16, s16 *, s16 *);
|
||||||
void CameraObjectReset1(void);
|
void CameraObjectReset1(void);
|
||||||
@ -128,7 +128,7 @@ u8 GetCollisionAtCoords(struct ObjectEvent *, s16, s16, u32);
|
|||||||
void MoveCoords(u8, s16 *, s16 *);
|
void MoveCoords(u8, s16 *, s16 *);
|
||||||
bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *);
|
bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *);
|
||||||
u8 ObjectEventClearHeldMovementIfFinished(struct ObjectEvent *);
|
u8 ObjectEventClearHeldMovementIfFinished(struct ObjectEvent *);
|
||||||
u8 GetObjectEventIdByXYZ(u16 x, u16 y, u8 z);
|
u8 GetObjectEventIdByPosition(u16 x, u16 y, u8 elevation);
|
||||||
void SetTrainerMovementType(struct ObjectEvent *objectEvent, u8 movementType);
|
void SetTrainerMovementType(struct ObjectEvent *objectEvent, u8 movementType);
|
||||||
u8 GetTrainerFacingDirectionMovementType(u8 direction);
|
u8 GetTrainerFacingDirectionMovementType(u8 direction);
|
||||||
const u8 *GetObjectEventScriptPointerByObjectEventId(u8 objectEventId);
|
const u8 *GetObjectEventScriptPointerByObjectEventId(u8 objectEventId);
|
||||||
@ -162,17 +162,15 @@ u8 ObjectEventCheckHeldMovementStatus(struct ObjectEvent *objectEvent);
|
|||||||
u8 ObjectEventGetHeldMovementActionId(struct ObjectEvent *objectEvent);
|
u8 ObjectEventGetHeldMovementActionId(struct ObjectEvent *objectEvent);
|
||||||
void TryOverrideTemplateCoordsForObjectEvent(const struct ObjectEvent *objectEvent, u8 movementType);
|
void TryOverrideTemplateCoordsForObjectEvent(const struct ObjectEvent *objectEvent, u8 movementType);
|
||||||
void OverrideTemplateCoordsForObjectEvent(const struct ObjectEvent *objectEvent);
|
void OverrideTemplateCoordsForObjectEvent(const struct ObjectEvent *objectEvent);
|
||||||
void ShiftStillObjectEventCoords(struct ObjectEvent *pObject);
|
void ShiftStillObjectEventCoords(struct ObjectEvent *objEvent);
|
||||||
void ObjectEventMoveDestCoords(struct ObjectEvent *pObject, u32 unk_19, s16 *pInt, s16 *pInt1);
|
void ObjectEventMoveDestCoords(struct ObjectEvent *objEvent, u32 direction, s16 *x, s16 *y);
|
||||||
u8 AddCameraObject(u8 linkedSpriteId);
|
u8 AddCameraObject(u8 linkedSpriteId);
|
||||||
void UpdateObjectEventsForCameraUpdate(s16 x, s16 y);
|
void UpdateObjectEventsForCameraUpdate(s16 x, s16 y);
|
||||||
u8 GetWalkSlowMovementAction(u32);
|
u8 GetWalkSlowMovementAction(u32);
|
||||||
u8 GetJumpMovementAction(u32);
|
u8 GetJumpMovementAction(u32);
|
||||||
bool8 AreZCoordsCompatible(u8, u8);
|
u8 ElevationToPriority(u8);
|
||||||
u8 ZCoordToPriority(u8);
|
void ObjectEventUpdateElevation(struct ObjectEvent *objEvent);
|
||||||
void ObjectEventUpdateZCoord(struct ObjectEvent *pObject);
|
void SetObjectSubpriorityByElevation(u8, struct Sprite *, u8);
|
||||||
void SetObjectSubpriorityByZCoord(u8, struct Sprite *, u8);
|
|
||||||
bool8 IsZCoordMismatchAt(u8, s16, s16);
|
|
||||||
void UnfreezeObjectEvent(struct ObjectEvent *);
|
void UnfreezeObjectEvent(struct ObjectEvent *);
|
||||||
u8 FindLockedObjectEventIndex(struct ObjectEvent *);
|
u8 FindLockedObjectEventIndex(struct ObjectEvent *);
|
||||||
void SetAndStartSpriteAnim(struct Sprite *, u8, u8);
|
void SetAndStartSpriteAnim(struct Sprite *, u8, u8);
|
||||||
@ -413,7 +411,7 @@ u8 MovementType_Invisible_Step0(struct ObjectEvent *, struct Sprite *);
|
|||||||
u8 MovementType_Invisible_Step1(struct ObjectEvent *, struct Sprite *);
|
u8 MovementType_Invisible_Step1(struct ObjectEvent *, struct Sprite *);
|
||||||
u8 MovementType_Invisible_Step2(struct ObjectEvent *, struct Sprite *);
|
u8 MovementType_Invisible_Step2(struct ObjectEvent *, struct Sprite *);
|
||||||
|
|
||||||
u8 CreateVirtualObject(u8 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 z, u8 direction);
|
u8 CreateVirtualObject(u8 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 elevation, u8 direction);
|
||||||
void TurnVirtualObject(u8 virtualObjId, u8 direction);
|
void TurnVirtualObject(u8 virtualObjId, u8 direction);
|
||||||
void SetVirtualObjectGraphics(u8 virtualObjId, u8 graphicsId);
|
void SetVirtualObjectGraphics(u8 virtualObjId, u8 graphicsId);
|
||||||
void SetVirtualObjectInvisibility(u8 virtualObjId, bool32 invisible);
|
void SetVirtualObjectInvisibility(u8 virtualObjId, bool32 invisible);
|
||||||
|
@ -30,7 +30,7 @@ void PlayerSetAnimId(u8 a, u8 b);
|
|||||||
bool8 IsPlayerCollidingWithFarawayIslandMew(u8 direction);
|
bool8 IsPlayerCollidingWithFarawayIslandMew(u8 direction);
|
||||||
void PlayerOnBikeCollideWithFarawayIslandMew(u8 direction);
|
void PlayerOnBikeCollideWithFarawayIslandMew(u8 direction);
|
||||||
u8 CheckForObjectEventCollision(struct ObjectEvent *a, s16 b, s16 c, u8 d, u8 e);
|
u8 CheckForObjectEventCollision(struct ObjectEvent *a, s16 b, s16 c, u8 d, u8 e);
|
||||||
u8 PlayerGetZCoord(void);
|
u8 PlayerGetElevation(void);
|
||||||
void SetPlayerAvatarTransitionFlags(u16 a);
|
void SetPlayerAvatarTransitionFlags(u16 a);
|
||||||
void CancelPlayerForcedMovement(void);
|
void CancelPlayerForcedMovement(void);
|
||||||
void InitPlayerAvatar(s16 a, s16 b, u8 c, u8 d);
|
void InitPlayerAvatar(s16 a, s16 b, u8 c, u8 d);
|
||||||
|
@ -32,7 +32,7 @@ bool32 CanCameraMoveInDirection(int direction);
|
|||||||
u16 GetMetatileAttributesById(u16 metatileId);
|
u16 GetMetatileAttributesById(u16 metatileId);
|
||||||
void GetCameraFocusCoords(u16 *x, u16 *y);
|
void GetCameraFocusCoords(u16 *x, u16 *y);
|
||||||
u8 MapGridGetMetatileLayerTypeAt(int x, int y);
|
u8 MapGridGetMetatileLayerTypeAt(int x, int y);
|
||||||
u8 MapGridGetZCoordAt(int x, int y);
|
u8 MapGridGetElevationAt(int x, int y);
|
||||||
bool8 CameraMove(int deltaX, int deltaY);
|
bool8 CameraMove(int deltaX, int deltaY);
|
||||||
void SaveMapView(void);
|
void SaveMapView(void);
|
||||||
void SetCameraFocusCoords(u16 x, u16 y);
|
void SetCameraFocusCoords(u16 x, u16 y);
|
||||||
|
@ -1022,7 +1022,7 @@ struct MapPosition
|
|||||||
{
|
{
|
||||||
s16 x;
|
s16 x;
|
||||||
s16 y;
|
s16 y;
|
||||||
s8 height;
|
s8 elevation;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GUARD_GLOBAL_H
|
#endif // GUARD_GLOBAL_H
|
||||||
|
@ -900,7 +900,7 @@ static bool8 IsRunningDisallowedByMetatile(u8 tile)
|
|||||||
{
|
{
|
||||||
if (MetatileBehavior_IsRunningDisallowed(tile))
|
if (MetatileBehavior_IsRunningDisallowed(tile))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (MetatileBehavior_IsFortreeBridge(tile) && (PlayerGetZCoord() & 1) == 0)
|
if (MetatileBehavior_IsFortreeBridge(tile) && (PlayerGetElevation() & 1) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1534,7 +1534,7 @@ static bool8 CanPlaceDecoration(u8 taskId, const struct Decoration *decoration)
|
|||||||
if (!IsntInitialPosition(taskId, curX, curY, layerType))
|
if (!IsntInitialPosition(taskId, curX, curY, layerType))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
behaviorAt = GetObjectEventIdByXYZ(curX, curY, 0);
|
behaviorAt = GetObjectEventIdByPosition(curX, curY, 0);
|
||||||
if (behaviorAt != 0 && behaviorAt != OBJECT_EVENTS_COUNT)
|
if (behaviorAt != 0 && behaviorAt != OBJECT_EVENTS_COUNT)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1555,7 +1555,7 @@ static bool8 CanPlaceDecoration(u8 taskId, const struct Decoration *decoration)
|
|||||||
if (!IsntInitialPosition(taskId, curX, curY, layerType))
|
if (!IsntInitialPosition(taskId, curX, curY, layerType))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (GetObjectEventIdByXYZ(curX, curY, 0) != OBJECT_EVENTS_COUNT)
|
if (GetObjectEventIdByPosition(curX, curY, 0) != OBJECT_EVENTS_COUNT)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1572,7 +1572,7 @@ static bool8 CanPlaceDecoration(u8 taskId, const struct Decoration *decoration)
|
|||||||
if (!IsntInitialPosition(taskId, curX, curY, layerType))
|
if (!IsntInitialPosition(taskId, curX, curY, layerType))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
behaviorAt = GetObjectEventIdByXYZ(curX, curY, 0);
|
behaviorAt = GetObjectEventIdByPosition(curX, curY, 0);
|
||||||
if (behaviorAt != 0 && behaviorAt != OBJECT_EVENTS_COUNT)
|
if (behaviorAt != 0 && behaviorAt != OBJECT_EVENTS_COUNT)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1609,7 +1609,7 @@ static bool8 CanPlaceDecoration(u8 taskId, const struct Decoration *decoration)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetObjectEventIdByXYZ(curX, curY, 0) != OBJECT_EVENTS_COUNT)
|
if (GetObjectEventIdByPosition(curX, curY, 0) != OBJECT_EVENTS_COUNT)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -110,7 +110,7 @@ static void GetGroundEffectFlags_Seaweed(struct ObjectEvent*, u32*);
|
|||||||
static void GetGroundEffectFlags_JumpLanding(struct ObjectEvent*, u32*);
|
static void GetGroundEffectFlags_JumpLanding(struct ObjectEvent*, u32*);
|
||||||
static u8 ObjectEventGetNearbyReflectionType(struct ObjectEvent*);
|
static u8 ObjectEventGetNearbyReflectionType(struct ObjectEvent*);
|
||||||
static u8 GetReflectionTypeByMetatileBehavior(u32);
|
static u8 GetReflectionTypeByMetatileBehavior(u32);
|
||||||
static void InitObjectPriorityByZCoord(struct Sprite *sprite, u8 z);
|
static void InitObjectPriorityByElevation(struct Sprite *, u8);
|
||||||
static void ObjectEventUpdateSubpriority(struct ObjectEvent*, struct Sprite*);
|
static void ObjectEventUpdateSubpriority(struct ObjectEvent*, struct Sprite*);
|
||||||
static void DoTracksGroundEffect_None(struct ObjectEvent*, struct Sprite*, u8);
|
static void DoTracksGroundEffect_None(struct ObjectEvent*, struct Sprite*, u8);
|
||||||
static void DoTracksGroundEffect_Footprints(struct ObjectEvent*, struct Sprite*, u8);
|
static void DoTracksGroundEffect_Footprints(struct ObjectEvent*, struct Sprite*, u8);
|
||||||
@ -142,27 +142,29 @@ static void ResetObjectEventFldEffData(struct ObjectEvent *);
|
|||||||
static u8 LoadSpritePaletteIfTagExists(const struct SpritePalette *);
|
static u8 LoadSpritePaletteIfTagExists(const struct SpritePalette *);
|
||||||
static u8 FindObjectEventPaletteIndexByTag(u16);
|
static u8 FindObjectEventPaletteIndexByTag(u16);
|
||||||
static void _PatchObjectPalette(u16, u8);
|
static void _PatchObjectPalette(u16, u8);
|
||||||
static bool8 ObjectEventDoesZCoordMatch(struct ObjectEvent *, u8);
|
static bool8 ObjectEventDoesElevationMatch(struct ObjectEvent *, u8);
|
||||||
static void SpriteCB_CameraObject(struct Sprite *);
|
static void SpriteCB_CameraObject(struct Sprite *);
|
||||||
static void CameraObject_0(struct Sprite *);
|
static void CameraObject_0(struct Sprite *);
|
||||||
static void CameraObject_1(struct Sprite *);
|
static void CameraObject_1(struct Sprite *);
|
||||||
static void CameraObject_2(struct Sprite *);
|
static void CameraObject_2(struct Sprite *);
|
||||||
static struct ObjectEventTemplate *FindObjectEventTemplateByLocalId(u8 localId, struct ObjectEventTemplate *templates, u8 count);
|
static struct ObjectEventTemplate *FindObjectEventTemplateByLocalId(u8, struct ObjectEventTemplate *, u8);
|
||||||
static void ClearObjectEventMovement(struct ObjectEvent *, struct Sprite *);
|
static void ClearObjectEventMovement(struct ObjectEvent *, struct Sprite *);
|
||||||
static void ObjectEventSetSingleMovement(struct ObjectEvent *, struct Sprite *, u8);
|
static void ObjectEventSetSingleMovement(struct ObjectEvent *, struct Sprite *, u8);
|
||||||
static void SetSpriteDataForNormalStep(struct Sprite *, u8, u8);
|
static void SetSpriteDataForNormalStep(struct Sprite *, u8, u8);
|
||||||
static void InitSpriteForFigure8Anim(struct Sprite *sprite);
|
static void InitSpriteForFigure8Anim(struct Sprite *);
|
||||||
static bool8 AnimateSpriteInFigure8(struct Sprite *sprite);
|
static bool8 AnimateSpriteInFigure8(struct Sprite *);
|
||||||
static void SpriteCB_VirtualObject(struct Sprite *);
|
static void SpriteCB_VirtualObject(struct Sprite *);
|
||||||
static void DoShadowFieldEffect(struct ObjectEvent *);
|
static void DoShadowFieldEffect(struct ObjectEvent *);
|
||||||
static void SetJumpSpriteData(struct Sprite *, u8, u8, u8);
|
static void SetJumpSpriteData(struct Sprite *, u8, u8, u8);
|
||||||
static void SetWalkSlowSpriteData(struct Sprite *sprite, u8 direction);
|
static void SetWalkSlowSpriteData(struct Sprite *, u8);
|
||||||
static bool8 UpdateWalkSlowAnim(struct Sprite *sprite);
|
static bool8 UpdateWalkSlowAnim(struct Sprite *);
|
||||||
static u8 DoJumpSpriteMovement(struct Sprite *sprite);
|
static u8 DoJumpSpriteMovement(struct Sprite *);
|
||||||
static u8 DoJumpSpecialSpriteMovement(struct Sprite *sprite);
|
static u8 DoJumpSpecialSpriteMovement(struct Sprite *);
|
||||||
static void CreateLevitateMovementTask(struct ObjectEvent *);
|
static void CreateLevitateMovementTask(struct ObjectEvent *);
|
||||||
static void DestroyLevitateMovementTask(u8);
|
static void DestroyLevitateMovementTask(u8);
|
||||||
static bool8 NpcTakeStep(struct Sprite *sprite);
|
static bool8 NpcTakeStep(struct Sprite *);
|
||||||
|
static bool8 IsElevationMismatchAt(u8, s16, s16);
|
||||||
|
static bool8 AreElevationsCompatible(u8 a, u8 b);
|
||||||
|
|
||||||
static const struct SpriteFrameImage sPicTable_PechaBerryTree[];
|
static const struct SpriteFrameImage sPicTable_PechaBerryTree[];
|
||||||
|
|
||||||
@ -1433,7 +1435,7 @@ static u8 TrySetupObjectEventSprite(struct ObjectEventTemplate *objectEventTempl
|
|||||||
if (!objectEvent->inanimate)
|
if (!objectEvent->inanimate)
|
||||||
StartSpriteAnim(sprite, GetFaceDirectionAnimNum(objectEvent->facingDirection));
|
StartSpriteAnim(sprite, GetFaceDirectionAnimNum(objectEvent->facingDirection));
|
||||||
|
|
||||||
SetObjectSubpriorityByZCoord(objectEvent->previousElevation, sprite, 1);
|
SetObjectSubpriorityByElevation(objectEvent->previousElevation, sprite, 1);
|
||||||
UpdateObjectEventVisibility(objectEvent, sprite);
|
UpdateObjectEventVisibility(objectEvent, sprite);
|
||||||
return objectEventId;
|
return objectEventId;
|
||||||
}
|
}
|
||||||
@ -1470,7 +1472,7 @@ u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *objectEventTemplate)
|
|||||||
return TrySpawnObjectEventTemplate(objectEventTemplate, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY);
|
return TrySpawnObjectEventTemplate(objectEventTemplate, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 z)
|
u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 elevation)
|
||||||
{
|
{
|
||||||
struct ObjectEventTemplate objectEventTemplate;
|
struct ObjectEventTemplate objectEventTemplate;
|
||||||
|
|
||||||
@ -1481,7 +1483,7 @@ u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 l
|
|||||||
objectEventTemplate.inConnection = 0;
|
objectEventTemplate.inConnection = 0;
|
||||||
objectEventTemplate.x = x;
|
objectEventTemplate.x = x;
|
||||||
objectEventTemplate.y = y;
|
objectEventTemplate.y = y;
|
||||||
objectEventTemplate.elevation = z;
|
objectEventTemplate.elevation = elevation;
|
||||||
objectEventTemplate.movementType = movementBehavior;
|
objectEventTemplate.movementType = movementBehavior;
|
||||||
objectEventTemplate.movementRangeX = 0;
|
objectEventTemplate.movementRangeX = 0;
|
||||||
objectEventTemplate.movementRangeY = 0;
|
objectEventTemplate.movementRangeY = 0;
|
||||||
@ -1560,7 +1562,7 @@ u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *),
|
|||||||
// A unique id is given as an argument and stored in the sprite data to allow referring back to the same virtual object.
|
// A unique id is given as an argument and stored in the sprite data to allow referring back to the same virtual object.
|
||||||
// They can be turned (and, in the case of the Union Room, animated teleporting in and out) but do not have movement types
|
// They can be turned (and, in the case of the Union Room, animated teleporting in and out) but do not have movement types
|
||||||
// or any of the other data normally associated with object events.
|
// or any of the other data normally associated with object events.
|
||||||
u8 CreateVirtualObject(u8 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 z, u8 direction)
|
u8 CreateVirtualObject(u8 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 elevation, u8 direction)
|
||||||
{
|
{
|
||||||
u8 spriteId;
|
u8 spriteId;
|
||||||
struct Sprite *sprite;
|
struct Sprite *sprite;
|
||||||
@ -1587,7 +1589,7 @@ u8 CreateVirtualObject(u8 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 z, u8 di
|
|||||||
|
|
||||||
sprite->coordOffsetEnabled = TRUE;
|
sprite->coordOffsetEnabled = TRUE;
|
||||||
sprite->sVirtualObjId = virtualObjId;
|
sprite->sVirtualObjId = virtualObjId;
|
||||||
sprite->sVirtualObjElev = z;
|
sprite->sVirtualObjElev = elevation;
|
||||||
if (graphicsInfo->paletteSlot == 10)
|
if (graphicsInfo->paletteSlot == 10)
|
||||||
LoadSpecialObjectReflectionPalette(graphicsInfo->paletteTag, graphicsInfo->paletteSlot);
|
LoadSpecialObjectReflectionPalette(graphicsInfo->paletteTag, graphicsInfo->paletteSlot);
|
||||||
else if (graphicsInfo->paletteSlot >= 16)
|
else if (graphicsInfo->paletteSlot >= 16)
|
||||||
@ -1598,8 +1600,8 @@ u8 CreateVirtualObject(u8 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 z, u8 di
|
|||||||
SetSubspriteTables(sprite, subspriteTables);
|
SetSubspriteTables(sprite, subspriteTables);
|
||||||
sprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY;
|
sprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY;
|
||||||
}
|
}
|
||||||
InitObjectPriorityByZCoord(sprite, z);
|
InitObjectPriorityByElevation(sprite, elevation);
|
||||||
SetObjectSubpriorityByZCoord(z, sprite, 1);
|
SetObjectSubpriorityByElevation(elevation, sprite, 1);
|
||||||
StartSpriteAnim(sprite, GetFaceDirectionAnimNum(direction));
|
StartSpriteAnim(sprite, GetFaceDirectionAnimNum(direction));
|
||||||
}
|
}
|
||||||
return spriteId;
|
return spriteId;
|
||||||
@ -1755,7 +1757,7 @@ static void SpawnObjectEventOnReturnToField(u8 objectEventId, s16 x, s16 y)
|
|||||||
StartSpriteAnim(sprite, GetFaceDirectionAnimNum(objectEvent->facingDirection));
|
StartSpriteAnim(sprite, GetFaceDirectionAnimNum(objectEvent->facingDirection));
|
||||||
|
|
||||||
ResetObjectEventFldEffData(objectEvent);
|
ResetObjectEventFldEffData(objectEvent);
|
||||||
SetObjectSubpriorityByZCoord(objectEvent->previousElevation, sprite, 1);
|
SetObjectSubpriorityByElevation(objectEvent->previousElevation, sprite, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2148,7 +2150,7 @@ void UpdateObjectEventCoordsForCameraUpdate(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 GetObjectEventIdByXYZ(u16 x, u16 y, u8 z)
|
u8 GetObjectEventIdByPosition(u16 x, u16 y, u8 elevation)
|
||||||
{
|
{
|
||||||
u8 i;
|
u8 i;
|
||||||
|
|
||||||
@ -2156,16 +2158,18 @@ u8 GetObjectEventIdByXYZ(u16 x, u16 y, u8 z)
|
|||||||
{
|
{
|
||||||
if (gObjectEvents[i].active)
|
if (gObjectEvents[i].active)
|
||||||
{
|
{
|
||||||
if (gObjectEvents[i].currentCoords.x == x && gObjectEvents[i].currentCoords.y == y && ObjectEventDoesZCoordMatch(&gObjectEvents[i], z))
|
if (gObjectEvents[i].currentCoords.x == x
|
||||||
|
&& gObjectEvents[i].currentCoords.y == y
|
||||||
|
&& ObjectEventDoesElevationMatch(&gObjectEvents[i], elevation))
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return OBJECT_EVENTS_COUNT;
|
return OBJECT_EVENTS_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool8 ObjectEventDoesZCoordMatch(struct ObjectEvent *objectEvent, u8 z)
|
static bool8 ObjectEventDoesElevationMatch(struct ObjectEvent *objectEvent, u8 elevation)
|
||||||
{
|
{
|
||||||
if (objectEvent->currentElevation != 0 && z != 0 && objectEvent->currentElevation != z)
|
if (objectEvent->currentElevation != 0 && elevation != 0 && objectEvent->currentElevation != elevation)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -4630,7 +4634,7 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir)
|
|||||||
return COLLISION_IMPASSABLE;
|
return COLLISION_IMPASSABLE;
|
||||||
else if (objectEvent->trackedByCamera && !CanCameraMoveInDirection(direction))
|
else if (objectEvent->trackedByCamera && !CanCameraMoveInDirection(direction))
|
||||||
return COLLISION_IMPASSABLE;
|
return COLLISION_IMPASSABLE;
|
||||||
else if (IsZCoordMismatchAt(objectEvent->currentElevation, x, y))
|
else if (IsElevationMismatchAt(objectEvent->currentElevation, x, y))
|
||||||
return COLLISION_ELEVATION_MISMATCH;
|
return COLLISION_ELEVATION_MISMATCH;
|
||||||
else if (DoesObjectCollideWithObjectAt(objectEvent, x, y))
|
else if (DoesObjectCollideWithObjectAt(objectEvent, x, y))
|
||||||
return COLLISION_OBJECT_EVENT;
|
return COLLISION_OBJECT_EVENT;
|
||||||
@ -4645,7 +4649,7 @@ u8 GetCollisionFlagsAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 d
|
|||||||
flags |= 1;
|
flags |= 1;
|
||||||
if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction) || (objectEvent->trackedByCamera && !CanCameraMoveInDirection(direction)))
|
if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction) || (objectEvent->trackedByCamera && !CanCameraMoveInDirection(direction)))
|
||||||
flags |= 2;
|
flags |= 2;
|
||||||
if (IsZCoordMismatchAt(objectEvent->currentElevation, x, y))
|
if (IsElevationMismatchAt(objectEvent->currentElevation, x, y))
|
||||||
flags |= 4;
|
flags |= 4;
|
||||||
if (DoesObjectCollideWithObjectAt(objectEvent, x, y))
|
if (DoesObjectCollideWithObjectAt(objectEvent, x, y))
|
||||||
flags |= 8;
|
flags |= 8;
|
||||||
@ -4699,7 +4703,7 @@ static bool8 DoesObjectCollideWithObjectAt(struct ObjectEvent *objectEvent, s16
|
|||||||
{
|
{
|
||||||
if ((curObject->currentCoords.x == x && curObject->currentCoords.y == y) || (curObject->previousCoords.x == x && curObject->previousCoords.y == y))
|
if ((curObject->currentCoords.x == x && curObject->currentCoords.y == y) || (curObject->previousCoords.x == x && curObject->previousCoords.y == y))
|
||||||
{
|
{
|
||||||
if (AreZCoordsCompatible(objectEvent->currentElevation, curObject->currentElevation))
|
if (AreElevationsCompatible(objectEvent->currentElevation, curObject->currentElevation))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7667,23 +7671,23 @@ static void SetObjectEventSpriteOamTableForLongGrass(struct ObjectEvent *objEven
|
|||||||
|
|
||||||
sprite->subspriteTableNum = 4;
|
sprite->subspriteTableNum = 4;
|
||||||
|
|
||||||
if (ZCoordToPriority(objEvent->previousElevation) == 1)
|
if (ElevationToPriority(objEvent->previousElevation) == 1)
|
||||||
sprite->subspriteTableNum = 5;
|
sprite->subspriteTableNum = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 IsZCoordMismatchAt(u8 z, s16 x, s16 y)
|
static bool8 IsElevationMismatchAt(u8 elevation, s16 x, s16 y)
|
||||||
{
|
{
|
||||||
u8 mapZ;
|
u8 mapElevation;
|
||||||
|
|
||||||
if (z == 0)
|
if (elevation == 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
mapZ = MapGridGetZCoordAt(x, y);
|
mapElevation = MapGridGetElevationAt(x, y);
|
||||||
|
|
||||||
if (mapZ == 0 || mapZ == 15)
|
if (mapElevation == 0 || mapElevation == 15)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (mapZ != z)
|
if (mapElevation != elevation)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -7701,43 +7705,43 @@ static const u8 sElevationToSubspriteTableNum[] = {
|
|||||||
1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 0, 0, 1,
|
1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 0, 0, 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
void UpdateObjectEventZCoordAndPriority(struct ObjectEvent *objEvent, struct Sprite *sprite)
|
static void UpdateObjectEventElevationAndPriority(struct ObjectEvent *objEvent, struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
if (objEvent->fixedPriority)
|
if (objEvent->fixedPriority)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ObjectEventUpdateZCoord(objEvent);
|
ObjectEventUpdateElevation(objEvent);
|
||||||
|
|
||||||
sprite->subspriteTableNum = sElevationToSubspriteTableNum[objEvent->previousElevation];
|
sprite->subspriteTableNum = sElevationToSubspriteTableNum[objEvent->previousElevation];
|
||||||
sprite->oam.priority = sElevationToPriority[objEvent->previousElevation];
|
sprite->oam.priority = sElevationToPriority[objEvent->previousElevation];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InitObjectPriorityByZCoord(struct Sprite *sprite, u8 z)
|
static void InitObjectPriorityByElevation(struct Sprite *sprite, u8 elevation)
|
||||||
{
|
{
|
||||||
sprite->subspriteTableNum = sElevationToSubspriteTableNum[z];
|
sprite->subspriteTableNum = sElevationToSubspriteTableNum[elevation];
|
||||||
sprite->oam.priority = sElevationToPriority[z];
|
sprite->oam.priority = sElevationToPriority[elevation];
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 ZCoordToPriority(u8 z)
|
u8 ElevationToPriority(u8 elevation)
|
||||||
{
|
{
|
||||||
return sElevationToPriority[z];
|
return sElevationToPriority[elevation];
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectEventUpdateZCoord(struct ObjectEvent *objEvent)
|
void ObjectEventUpdateElevation(struct ObjectEvent *objEvent)
|
||||||
{
|
{
|
||||||
u8 z = MapGridGetZCoordAt(objEvent->currentCoords.x, objEvent->currentCoords.y);
|
u8 curElevation = MapGridGetElevationAt(objEvent->currentCoords.x, objEvent->currentCoords.y);
|
||||||
u8 z2 = MapGridGetZCoordAt(objEvent->previousCoords.x, objEvent->previousCoords.y);
|
u8 prevElevation = MapGridGetElevationAt(objEvent->previousCoords.x, objEvent->previousCoords.y);
|
||||||
|
|
||||||
if (z == 0xF || z2 == 0xF)
|
if (curElevation == 15 || prevElevation == 15)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
objEvent->currentElevation = z;
|
objEvent->currentElevation = curElevation;
|
||||||
|
|
||||||
if (z != 0 && z != 0xF)
|
if (curElevation != 0 && curElevation != 15)
|
||||||
objEvent->previousElevation = z;
|
objEvent->previousElevation = curElevation;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetObjectSubpriorityByZCoord(u8 elevation, struct Sprite *sprite, u8 subpriority)
|
void SetObjectSubpriorityByElevation(u8 elevation, struct Sprite *sprite, u8 subpriority)
|
||||||
{
|
{
|
||||||
s32 tmp = sprite->centerToCornerVecY;
|
s32 tmp = sprite->centerToCornerVecY;
|
||||||
u32 tmpa = *(u16 *)&sprite->y;
|
u32 tmpa = *(u16 *)&sprite->y;
|
||||||
@ -7752,10 +7756,10 @@ static void ObjectEventUpdateSubpriority(struct ObjectEvent *objEvent, struct Sp
|
|||||||
if (objEvent->fixedPriority)
|
if (objEvent->fixedPriority)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SetObjectSubpriorityByZCoord(objEvent->previousElevation, sprite, 1);
|
SetObjectSubpriorityByElevation(objEvent->previousElevation, sprite, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 AreZCoordsCompatible(u8 a, u8 b)
|
static bool8 AreElevationsCompatible(u8 a, u8 b)
|
||||||
{
|
{
|
||||||
if (a == 0 || b == 0)
|
if (a == 0 || b == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -8051,7 +8055,7 @@ static void DoGroundEffects_OnSpawn(struct ObjectEvent *objEvent, struct Sprite
|
|||||||
if (objEvent->triggerGroundEffectsOnMove)
|
if (objEvent->triggerGroundEffectsOnMove)
|
||||||
{
|
{
|
||||||
flags = 0;
|
flags = 0;
|
||||||
UpdateObjectEventZCoordAndPriority(objEvent, sprite);
|
UpdateObjectEventElevationAndPriority(objEvent, sprite);
|
||||||
GetAllGroundEffectFlags_OnSpawn(objEvent, &flags);
|
GetAllGroundEffectFlags_OnSpawn(objEvent, &flags);
|
||||||
SetObjectEventSpriteOamTableForLongGrass(objEvent, sprite);
|
SetObjectEventSpriteOamTableForLongGrass(objEvent, sprite);
|
||||||
DoFlaggedGroundEffects(objEvent, sprite, flags);
|
DoFlaggedGroundEffects(objEvent, sprite, flags);
|
||||||
@ -8067,7 +8071,7 @@ static void DoGroundEffects_OnBeginStep(struct ObjectEvent *objEvent, struct Spr
|
|||||||
if (objEvent->triggerGroundEffectsOnMove)
|
if (objEvent->triggerGroundEffectsOnMove)
|
||||||
{
|
{
|
||||||
flags = 0;
|
flags = 0;
|
||||||
UpdateObjectEventZCoordAndPriority(objEvent, sprite);
|
UpdateObjectEventElevationAndPriority(objEvent, sprite);
|
||||||
GetAllGroundEffectFlags_OnBeginStep(objEvent, &flags);
|
GetAllGroundEffectFlags_OnBeginStep(objEvent, &flags);
|
||||||
SetObjectEventSpriteOamTableForLongGrass(objEvent, sprite);
|
SetObjectEventSpriteOamTableForLongGrass(objEvent, sprite);
|
||||||
filters_out_some_ground_effects(objEvent, &flags);
|
filters_out_some_ground_effects(objEvent, &flags);
|
||||||
@ -8084,7 +8088,7 @@ static void DoGroundEffects_OnFinishStep(struct ObjectEvent *objEvent, struct Sp
|
|||||||
if (objEvent->triggerGroundEffectsOnStop)
|
if (objEvent->triggerGroundEffectsOnStop)
|
||||||
{
|
{
|
||||||
flags = 0;
|
flags = 0;
|
||||||
UpdateObjectEventZCoordAndPriority(objEvent, sprite);
|
UpdateObjectEventElevationAndPriority(objEvent, sprite);
|
||||||
GetAllGroundEffectFlags_OnFinishStep(objEvent, &flags);
|
GetAllGroundEffectFlags_OnFinishStep(objEvent, &flags);
|
||||||
SetObjectEventSpriteOamTableForLongGrass(objEvent, sprite);
|
SetObjectEventSpriteOamTableForLongGrass(objEvent, sprite);
|
||||||
FilterOutStepOnPuddleGroundEffectIfJumping(objEvent, &flags);
|
FilterOutStepOnPuddleGroundEffectIfJumping(objEvent, &flags);
|
||||||
@ -8548,7 +8552,7 @@ void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible)
|
|||||||
static void SpriteCB_VirtualObject(struct Sprite *sprite)
|
static void SpriteCB_VirtualObject(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
VirtualObject_UpdateAnim(sprite);
|
VirtualObject_UpdateAnim(sprite);
|
||||||
SetObjectSubpriorityByZCoord(sprite->sVirtualObjElev, sprite, 1);
|
SetObjectSubpriorityByElevation(sprite->sVirtualObjElev, sprite, 1);
|
||||||
UpdateObjectEventSpriteInvisibility(sprite, sprite->sInvisible);
|
UpdateObjectEventSpriteInvisibility(sprite, sprite->sInvisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
|
|||||||
static void GetPlayerPosition(struct MapPosition *position)
|
static void GetPlayerPosition(struct MapPosition *position)
|
||||||
{
|
{
|
||||||
PlayerGetDestCoords(&position->x, &position->y);
|
PlayerGetDestCoords(&position->x, &position->y);
|
||||||
position->height = PlayerGetZCoord();
|
position->elevation = PlayerGetElevation();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void GetInFrontOfPlayerPosition(struct MapPosition *position)
|
static void GetInFrontOfPlayerPosition(struct MapPosition *position)
|
||||||
@ -203,10 +203,10 @@ static void GetInFrontOfPlayerPosition(struct MapPosition *position)
|
|||||||
|
|
||||||
GetXYCoordsOneStepInFrontOfPlayer(&position->x, &position->y);
|
GetXYCoordsOneStepInFrontOfPlayer(&position->x, &position->y);
|
||||||
PlayerGetDestCoords(&x, &y);
|
PlayerGetDestCoords(&x, &y);
|
||||||
if (MapGridGetZCoordAt(x, y) != 0)
|
if (MapGridGetElevationAt(x, y) != 0)
|
||||||
position->height = PlayerGetZCoord();
|
position->elevation = PlayerGetElevation();
|
||||||
else
|
else
|
||||||
position->height = 0;
|
position->elevation = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 GetPlayerCurMetatileBehavior(int runningState)
|
static u16 GetPlayerCurMetatileBehavior(int runningState)
|
||||||
@ -264,9 +264,9 @@ const u8 *GetInteractedLinkPlayerScript(struct MapPosition *position, u8 metatil
|
|||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (!MetatileBehavior_IsCounter(MapGridGetMetatileBehaviorAt(position->x, position->y)))
|
if (!MetatileBehavior_IsCounter(MapGridGetMetatileBehaviorAt(position->x, position->y)))
|
||||||
objectEventId = GetObjectEventIdByXYZ(position->x, position->y, position->height);
|
objectEventId = GetObjectEventIdByPosition(position->x, position->y, position->elevation);
|
||||||
else
|
else
|
||||||
objectEventId = GetObjectEventIdByXYZ(position->x + gDirectionToVectors[direction].x, position->y + gDirectionToVectors[direction].y, position->height);
|
objectEventId = GetObjectEventIdByPosition(position->x + gDirectionToVectors[direction].x, position->y + gDirectionToVectors[direction].y, position->elevation);
|
||||||
|
|
||||||
if (objectEventId == OBJECT_EVENTS_COUNT || gObjectEvents[objectEventId].localId == OBJ_EVENT_ID_PLAYER)
|
if (objectEventId == OBJECT_EVENTS_COUNT || gObjectEvents[objectEventId].localId == OBJ_EVENT_ID_PLAYER)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -288,14 +288,14 @@ static const u8 *GetInteractedObjectEventScript(struct MapPosition *position, u8
|
|||||||
u8 objectEventId;
|
u8 objectEventId;
|
||||||
const u8 *script;
|
const u8 *script;
|
||||||
|
|
||||||
objectEventId = GetObjectEventIdByXYZ(position->x, position->y, position->height);
|
objectEventId = GetObjectEventIdByPosition(position->x, position->y, position->elevation);
|
||||||
if (objectEventId == OBJECT_EVENTS_COUNT || gObjectEvents[objectEventId].localId == OBJ_EVENT_ID_PLAYER)
|
if (objectEventId == OBJECT_EVENTS_COUNT || gObjectEvents[objectEventId].localId == OBJ_EVENT_ID_PLAYER)
|
||||||
{
|
{
|
||||||
if (MetatileBehavior_IsCounter(metatileBehavior) != TRUE)
|
if (MetatileBehavior_IsCounter(metatileBehavior) != TRUE)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Look for an object event on the other side of the counter.
|
// Look for an object event on the other side of the counter.
|
||||||
objectEventId = GetObjectEventIdByXYZ(position->x + gDirectionToVectors[direction].x, position->y + gDirectionToVectors[direction].y, position->height);
|
objectEventId = GetObjectEventIdByPosition(position->x + gDirectionToVectors[direction].x, position->y + gDirectionToVectors[direction].y, position->elevation);
|
||||||
if (objectEventId == OBJECT_EVENTS_COUNT || gObjectEvents[objectEventId].localId == OBJ_EVENT_ID_PLAYER)
|
if (objectEventId == OBJECT_EVENTS_COUNT || gObjectEvents[objectEventId].localId == OBJ_EVENT_ID_PLAYER)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -315,7 +315,7 @@ static const u8 *GetInteractedObjectEventScript(struct MapPosition *position, u8
|
|||||||
|
|
||||||
static const u8 *GetInteractedBackgroundEventScript(struct MapPosition *position, u8 metatileBehavior, u8 direction)
|
static const u8 *GetInteractedBackgroundEventScript(struct MapPosition *position, u8 metatileBehavior, u8 direction)
|
||||||
{
|
{
|
||||||
struct BgEvent *bgEvent = GetBackgroundEventAtPosition(&gMapHeader, position->x - MAP_OFFSET, position->y - MAP_OFFSET, position->height);
|
struct BgEvent *bgEvent = GetBackgroundEventAtPosition(&gMapHeader, position->x - MAP_OFFSET, position->y - MAP_OFFSET, position->elevation);
|
||||||
|
|
||||||
if (bgEvent == NULL)
|
if (bgEvent == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -366,7 +366,7 @@ static const u8 *GetInteractedBackgroundEventScript(struct MapPosition *position
|
|||||||
|
|
||||||
static const u8 *GetInteractedMetatileScript(struct MapPosition *position, u8 metatileBehavior, u8 direction)
|
static const u8 *GetInteractedMetatileScript(struct MapPosition *position, u8 metatileBehavior, u8 direction)
|
||||||
{
|
{
|
||||||
s8 height;
|
s8 elevation;
|
||||||
|
|
||||||
if (MetatileBehavior_IsPlayerFacingTVScreen(metatileBehavior, direction) == TRUE)
|
if (MetatileBehavior_IsPlayerFacingTVScreen(metatileBehavior, direction) == TRUE)
|
||||||
return EventScript_TV;
|
return EventScript_TV;
|
||||||
@ -409,8 +409,8 @@ static const u8 *GetInteractedMetatileScript(struct MapPosition *position, u8 me
|
|||||||
if (MetatileBehavior_IsTrainerHillTimer(metatileBehavior) == TRUE)
|
if (MetatileBehavior_IsTrainerHillTimer(metatileBehavior) == TRUE)
|
||||||
return EventScript_TrainerHillTimer;
|
return EventScript_TrainerHillTimer;
|
||||||
|
|
||||||
height = position->height;
|
elevation = position->elevation;
|
||||||
if (height == MapGridGetZCoordAt(position->x, position->y))
|
if (elevation == MapGridGetElevationAt(position->x, position->y))
|
||||||
{
|
{
|
||||||
if (MetatileBehavior_IsSecretBasePC(metatileBehavior) == TRUE)
|
if (MetatileBehavior_IsSecretBasePC(metatileBehavior) == TRUE)
|
||||||
return SecretBase_EventScript_PC;
|
return SecretBase_EventScript_PC;
|
||||||
@ -497,7 +497,7 @@ static bool8 TryStartStepBasedScript(struct MapPosition *position, u16 metatileB
|
|||||||
|
|
||||||
static bool8 TryStartCoordEventScript(struct MapPosition *position)
|
static bool8 TryStartCoordEventScript(struct MapPosition *position)
|
||||||
{
|
{
|
||||||
u8 *script = GetCoordEventScriptAtPosition(&gMapHeader, position->x - MAP_OFFSET, position->y - MAP_OFFSET, position->height);
|
u8 *script = GetCoordEventScriptAtPosition(&gMapHeader, position->x - MAP_OFFSET, position->y - MAP_OFFSET, position->elevation);
|
||||||
|
|
||||||
if (script == NULL)
|
if (script == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -783,7 +783,7 @@ static bool8 IsArrowWarpMetatileBehavior(u16 metatileBehavior, u8 direction)
|
|||||||
|
|
||||||
static s8 GetWarpEventAtMapPosition(struct MapHeader *mapHeader, struct MapPosition *position)
|
static s8 GetWarpEventAtMapPosition(struct MapHeader *mapHeader, struct MapPosition *position)
|
||||||
{
|
{
|
||||||
return GetWarpEventAtPosition(mapHeader, position->x - MAP_OFFSET, position->y - MAP_OFFSET, position->height);
|
return GetWarpEventAtPosition(mapHeader, position->x - MAP_OFFSET, position->y - MAP_OFFSET, position->elevation);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetupWarp(struct MapHeader *unused, s8 warpEventId, struct MapPosition *position)
|
static void SetupWarp(struct MapHeader *unused, s8 warpEventId, struct MapPosition *position)
|
||||||
@ -918,7 +918,7 @@ static u8 *GetCoordEventScriptAtPosition(struct MapHeader *mapHeader, u16 x, u16
|
|||||||
|
|
||||||
u8 *GetCoordEventScriptAtMapPosition(struct MapPosition *position)
|
u8 *GetCoordEventScriptAtMapPosition(struct MapPosition *position)
|
||||||
{
|
{
|
||||||
return GetCoordEventScriptAtPosition(&gMapHeader, position->x - MAP_OFFSET, position->y - MAP_OFFSET, position->height);
|
return GetCoordEventScriptAtPosition(&gMapHeader, position->x - MAP_OFFSET, position->y - MAP_OFFSET, position->elevation);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct BgEvent *GetBackgroundEventAtPosition(struct MapHeader *mapHeader, u16 x, u16 y, u8 elevation)
|
static struct BgEvent *GetBackgroundEventAtPosition(struct MapHeader *mapHeader, u16 x, u16 y, u8 elevation)
|
||||||
|
@ -359,7 +359,7 @@ void UpdateTallGrassFieldEffect(struct Sprite *sprite)
|
|||||||
|| objectEvent->previousCoords.y != sprite->sY))
|
|| objectEvent->previousCoords.y != sprite->sY))
|
||||||
sprite->sObjectMoved = TRUE;
|
sprite->sObjectMoved = TRUE;
|
||||||
|
|
||||||
// Metatile behavior var re-used
|
// Metatile behavior var re-used as subpriority
|
||||||
metatileBehavior = 0;
|
metatileBehavior = 0;
|
||||||
if (sprite->animCmdIndex == 0)
|
if (sprite->animCmdIndex == 0)
|
||||||
metatileBehavior = 4;
|
metatileBehavior = 4;
|
||||||
@ -423,7 +423,7 @@ u32 FldEff_LongGrass(void)
|
|||||||
{
|
{
|
||||||
sprite = &gSprites[spriteId];
|
sprite = &gSprites[spriteId];
|
||||||
sprite->coordOffsetEnabled = TRUE;
|
sprite->coordOffsetEnabled = TRUE;
|
||||||
sprite->oam.priority = ZCoordToPriority(gFieldEffectArguments[2]);
|
sprite->oam.priority = ElevationToPriority(gFieldEffectArguments[2]);
|
||||||
sprite->sElevation = gFieldEffectArguments[2];
|
sprite->sElevation = gFieldEffectArguments[2];
|
||||||
sprite->sX = gFieldEffectArguments[0];
|
sprite->sX = gFieldEffectArguments[0];
|
||||||
sprite->sY = gFieldEffectArguments[1];
|
sprite->sY = gFieldEffectArguments[1];
|
||||||
@ -1108,7 +1108,7 @@ void SynchroniseSurfPosition(struct ObjectEvent *playerObj, struct Sprite *sprit
|
|||||||
for (i = DIR_SOUTH; i <= DIR_EAST; i++, x = sprite->data[6], y = sprite->data[7])
|
for (i = DIR_SOUTH; i <= DIR_EAST; i++, x = sprite->data[6], y = sprite->data[7])
|
||||||
{
|
{
|
||||||
MoveCoords(i, &x, &y);
|
MoveCoords(i, &x, &y);
|
||||||
if (MapGridGetZCoordAt(x, y) == 3)
|
if (MapGridGetElevationAt(x, y) == 3)
|
||||||
{
|
{
|
||||||
sprite->data[5]++;
|
sprite->data[5]++;
|
||||||
break;
|
break;
|
||||||
@ -1646,7 +1646,7 @@ void UpdateJumpImpactEffect(struct Sprite *sprite)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||||
SetObjectSubpriorityByZCoord(sprite->sElevation, sprite, 0);
|
SetObjectSubpriorityByElevation(sprite->sElevation, sprite, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1658,14 +1658,14 @@ void WaitFieldEffectSpriteAnim(struct Sprite *sprite)
|
|||||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void UpdateGrassFieldEffectSubpriority(struct Sprite *sprite, u8 z, u8 offset)
|
static void UpdateGrassFieldEffectSubpriority(struct Sprite *sprite, u8 elevation, u8 subpriority)
|
||||||
{
|
{
|
||||||
u8 i;
|
u8 i;
|
||||||
s16 var, xhi, lyhi, yhi, ylo;
|
s16 var, xhi, lyhi, yhi, ylo;
|
||||||
const struct ObjectEventGraphicsInfo *graphicsInfo; // Unused Variable
|
const struct ObjectEventGraphicsInfo *graphicsInfo; // Unused Variable
|
||||||
struct Sprite *linkedSprite;
|
struct Sprite *linkedSprite;
|
||||||
|
|
||||||
SetObjectSubpriorityByZCoord(z, sprite, offset);
|
SetObjectSubpriorityByElevation(elevation, sprite, subpriority);
|
||||||
for (i = 0; i < OBJECT_EVENTS_COUNT; i ++)
|
for (i = 0; i < OBJECT_EVENTS_COUNT; i ++)
|
||||||
{
|
{
|
||||||
struct ObjectEvent *objectEvent = &gObjectEvents[i];
|
struct ObjectEvent *objectEvent = &gObjectEvents[i];
|
||||||
|
@ -708,8 +708,8 @@ static u8 CheckForObjectEventStaticCollision(struct ObjectEvent *objectEvent, s1
|
|||||||
static bool8 CanStopSurfing(s16 x, s16 y, u8 direction)
|
static bool8 CanStopSurfing(s16 x, s16 y, u8 direction)
|
||||||
{
|
{
|
||||||
if ((gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING)
|
if ((gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING)
|
||||||
&& MapGridGetZCoordAt(x, y) == 3
|
&& MapGridGetElevationAt(x, y) == 3
|
||||||
&& GetObjectEventIdByXYZ(x, y, 3) == OBJECT_EVENTS_COUNT)
|
&& GetObjectEventIdByPosition(x, y, 3) == OBJECT_EVENTS_COUNT)
|
||||||
{
|
{
|
||||||
CreateStopSurfingTask(direction);
|
CreateStopSurfingTask(direction);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1168,7 +1168,7 @@ u8 GetPlayerMovementDirection(void)
|
|||||||
return gObjectEvents[gPlayerAvatar.objectEventId].movementDirection;
|
return gObjectEvents[gPlayerAvatar.objectEventId].movementDirection;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 PlayerGetZCoord(void)
|
u8 PlayerGetElevation(void)
|
||||||
{
|
{
|
||||||
return gObjectEvents[gPlayerAvatar.objectEventId].previousElevation;
|
return gObjectEvents[gPlayerAvatar.objectEventId].previousElevation;
|
||||||
}
|
}
|
||||||
@ -1306,7 +1306,7 @@ bool8 IsPlayerFacingSurfableFishableWater(void)
|
|||||||
|
|
||||||
MoveCoords(playerObjEvent->facingDirection, &x, &y);
|
MoveCoords(playerObjEvent->facingDirection, &x, &y);
|
||||||
if (GetCollisionAtCoords(playerObjEvent, x, y, playerObjEvent->facingDirection) == COLLISION_ELEVATION_MISMATCH
|
if (GetCollisionAtCoords(playerObjEvent, x, y, playerObjEvent->facingDirection) == COLLISION_ELEVATION_MISMATCH
|
||||||
&& PlayerGetZCoord() == 3
|
&& PlayerGetElevation() == 3
|
||||||
&& MetatileBehavior_IsSurfableFishableWater(MapGridGetMetatileBehaviorAt(x, y)))
|
&& MetatileBehavior_IsSurfableFishableWater(MapGridGetMetatileBehaviorAt(x, y)))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else
|
else
|
||||||
|
@ -445,8 +445,8 @@ static void PacifidlogBridgePerStepCallback(u8 taskId)
|
|||||||
|
|
||||||
static void TryLowerFortreeBridge(s16 x, s16 y)
|
static void TryLowerFortreeBridge(s16 x, s16 y)
|
||||||
{
|
{
|
||||||
u8 z = PlayerGetZCoord();
|
u8 elevation = PlayerGetElevation();
|
||||||
if (!(z & 1))
|
if (!(elevation & 1))
|
||||||
{
|
{
|
||||||
switch (MapGridGetMetatileIdAt(x, y))
|
switch (MapGridGetMetatileIdAt(x, y))
|
||||||
{
|
{
|
||||||
@ -462,8 +462,8 @@ static void TryLowerFortreeBridge(s16 x, s16 y)
|
|||||||
|
|
||||||
static void TryRaiseFortreeBridge(s16 x, s16 y)
|
static void TryRaiseFortreeBridge(s16 x, s16 y)
|
||||||
{
|
{
|
||||||
u8 z = PlayerGetZCoord();
|
u8 elevation = PlayerGetElevation();
|
||||||
if (!(z & 1))
|
if (!(elevation & 1))
|
||||||
{
|
{
|
||||||
switch (MapGridGetMetatileIdAt(x, y))
|
switch (MapGridGetMetatileIdAt(x, y))
|
||||||
{
|
{
|
||||||
@ -488,7 +488,7 @@ static void FortreeBridgePerStepCallback(u8 taskId)
|
|||||||
{
|
{
|
||||||
bool8 isFortreeBridgeCur;
|
bool8 isFortreeBridgeCur;
|
||||||
bool8 isFortreeBridgePrev;
|
bool8 isFortreeBridgePrev;
|
||||||
u8 z, onBridgeElevation;
|
u8 elevation, onBridgeElevation;
|
||||||
s16 x, y, prevX, prevY;
|
s16 x, y, prevX, prevY;
|
||||||
s16 *data = gTasks[taskId].data;
|
s16 *data = gTasks[taskId].data;
|
||||||
PlayerGetDestCoords(&x, &y);
|
PlayerGetDestCoords(&x, &y);
|
||||||
@ -520,9 +520,9 @@ static void FortreeBridgePerStepCallback(u8 taskId)
|
|||||||
isFortreeBridgePrev = MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(prevX, prevY));
|
isFortreeBridgePrev = MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(prevX, prevY));
|
||||||
|
|
||||||
// Make sure player isn't below bridge
|
// Make sure player isn't below bridge
|
||||||
z = PlayerGetZCoord();
|
elevation = PlayerGetElevation();
|
||||||
onBridgeElevation = FALSE;
|
onBridgeElevation = FALSE;
|
||||||
if ((u8)(z & 1) == 0)
|
if ((u8)(elevation & 1) == 0)
|
||||||
onBridgeElevation = TRUE;
|
onBridgeElevation = TRUE;
|
||||||
|
|
||||||
if (onBridgeElevation && (isFortreeBridgeCur == TRUE || isFortreeBridgePrev == TRUE))
|
if (onBridgeElevation && (isFortreeBridgeCur == TRUE || isFortreeBridgePrev == TRUE))
|
||||||
|
@ -342,7 +342,7 @@ static void FillEastConnection(struct MapHeader const *mapHeader, struct MapHead
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 MapGridGetZCoordAt(int x, int y)
|
u8 MapGridGetElevationAt(int x, int y)
|
||||||
{
|
{
|
||||||
u16 block = GetMapGridBlockAt(x, y);
|
u16 block = GetMapGridBlockAt(x, y);
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ bool8 SetUpFieldMove_Cut(void)
|
|||||||
for (j = 0; j < CUT_NORMAL_SIDE; j++)
|
for (j = 0; j < CUT_NORMAL_SIDE; j++)
|
||||||
{
|
{
|
||||||
x = j - 1 + gPlayerFacingPosition.x;
|
x = j - 1 + gPlayerFacingPosition.x;
|
||||||
if (MapGridGetZCoordAt(x, y) == gPlayerFacingPosition.height)
|
if (MapGridGetElevationAt(x, y) == gPlayerFacingPosition.elevation)
|
||||||
{
|
{
|
||||||
tileBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
tileBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
||||||
if (MetatileBehavior_IsPokeGrass(tileBehavior) == TRUE
|
if (MetatileBehavior_IsPokeGrass(tileBehavior) == TRUE
|
||||||
@ -238,7 +238,7 @@ bool8 SetUpFieldMove_Cut(void)
|
|||||||
|
|
||||||
if (tileCuttable == TRUE)
|
if (tileCuttable == TRUE)
|
||||||
{
|
{
|
||||||
if (MapGridGetZCoordAt(x, y) == gPlayerFacingPosition.height)
|
if (MapGridGetElevationAt(x, y) == gPlayerFacingPosition.elevation)
|
||||||
{
|
{
|
||||||
u8 tileArrayId = ((sHyperCutStruct[i].y * 5) + 12) + (sHyperCutStruct[i].x);
|
u8 tileArrayId = ((sHyperCutStruct[i].y * 5) + 12) + (sHyperCutStruct[i].x);
|
||||||
tileBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
tileBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include "constants/map_types.h"
|
#include "constants/map_types.h"
|
||||||
#include "constants/songs.h"
|
#include "constants/songs.h"
|
||||||
|
|
||||||
// static functions
|
|
||||||
static void Task_DoFieldMove_Init(u8 taskId);
|
static void Task_DoFieldMove_Init(u8 taskId);
|
||||||
static void Task_DoFieldMove_ShowMonAfterPose(u8 taskId);
|
static void Task_DoFieldMove_ShowMonAfterPose(u8 taskId);
|
||||||
static void Task_DoFieldMove_WaitForMon(u8 taskId);
|
static void Task_DoFieldMove_WaitForMon(u8 taskId);
|
||||||
@ -28,14 +27,13 @@ static void Task_DoFieldMove_RunFunc(u8 taskId);
|
|||||||
static void FieldCallback_RockSmash(void);
|
static void FieldCallback_RockSmash(void);
|
||||||
static void FieldMove_RockSmash(void);
|
static void FieldMove_RockSmash(void);
|
||||||
|
|
||||||
// text
|
|
||||||
bool8 CheckObjectGraphicsInFrontOfPlayer(u8 graphicsId)
|
bool8 CheckObjectGraphicsInFrontOfPlayer(u8 graphicsId)
|
||||||
{
|
{
|
||||||
u8 objEventId;
|
u8 objEventId;
|
||||||
|
|
||||||
GetXYCoordsOneStepInFrontOfPlayer(&gPlayerFacingPosition.x, &gPlayerFacingPosition.y);
|
GetXYCoordsOneStepInFrontOfPlayer(&gPlayerFacingPosition.x, &gPlayerFacingPosition.y);
|
||||||
gPlayerFacingPosition.height = PlayerGetZCoord();
|
gPlayerFacingPosition.elevation = PlayerGetElevation();
|
||||||
objEventId = GetObjectEventIdByXYZ(gPlayerFacingPosition.x, gPlayerFacingPosition.y, gPlayerFacingPosition.height);
|
objEventId = GetObjectEventIdByPosition(gPlayerFacingPosition.x, gPlayerFacingPosition.y, gPlayerFacingPosition.elevation);
|
||||||
if (gObjectEvents[objEventId].graphicsId != graphicsId)
|
if (gObjectEvents[objEventId].graphicsId != graphicsId)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -725,11 +725,11 @@ static void ItemUseOnFieldCB_WailmerPailBerry(u8 taskId)
|
|||||||
static bool8 TryToWaterSudowoodo(void)
|
static bool8 TryToWaterSudowoodo(void)
|
||||||
{
|
{
|
||||||
u16 x, y;
|
u16 x, y;
|
||||||
u8 z;
|
u8 elevation;
|
||||||
u8 objId;
|
u8 objId;
|
||||||
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
|
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
|
||||||
z = PlayerGetZCoord();
|
elevation = PlayerGetElevation();
|
||||||
objId = GetObjectEventIdByXYZ(x, y, z);
|
objId = GetObjectEventIdByPosition(x, y, elevation);
|
||||||
if (objId == OBJECT_EVENTS_COUNT || gObjectEvents[objId].graphicsId != OBJ_EVENT_GFX_SUDOWOODO)
|
if (objId == OBJECT_EVENTS_COUNT || gObjectEvents[objId].graphicsId != OBJ_EVENT_GFX_SUDOWOODO)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else
|
else
|
||||||
|
@ -2692,7 +2692,7 @@ static void LoadCableClubPlayer(s32 linkPlayerId, s32 myPlayerId, struct CableCl
|
|||||||
GetLinkPlayerCoords(linkPlayerId, &x, &y);
|
GetLinkPlayerCoords(linkPlayerId, &x, &y);
|
||||||
trainer->pos.x = x;
|
trainer->pos.x = x;
|
||||||
trainer->pos.y = y;
|
trainer->pos.y = y;
|
||||||
trainer->pos.height = GetLinkPlayerElevation(linkPlayerId);
|
trainer->pos.elevation = GetLinkPlayerElevation(linkPlayerId);
|
||||||
trainer->metatileBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
trainer->metatileBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2745,7 +2745,7 @@ static const u8 *TryInteractWithPlayer(struct CableClubPlayer *player)
|
|||||||
otherPlayerPos = player->pos;
|
otherPlayerPos = player->pos;
|
||||||
otherPlayerPos.x += gDirectionToVectors[player->facing].x;
|
otherPlayerPos.x += gDirectionToVectors[player->facing].x;
|
||||||
otherPlayerPos.y += gDirectionToVectors[player->facing].y;
|
otherPlayerPos.y += gDirectionToVectors[player->facing].y;
|
||||||
otherPlayerPos.height = 0;
|
otherPlayerPos.elevation = 0;
|
||||||
linkPlayerId = GetLinkPlayerIdAt(otherPlayerPos.x, otherPlayerPos.y);
|
linkPlayerId = GetLinkPlayerIdAt(otherPlayerPos.x, otherPlayerPos.y);
|
||||||
|
|
||||||
if (linkPlayerId != MAX_LINK_PLAYERS)
|
if (linkPlayerId != MAX_LINK_PLAYERS)
|
||||||
@ -2955,7 +2955,7 @@ static void InitLinkPlayerObjectEventPos(struct ObjectEvent *objEvent, s16 x, s1
|
|||||||
objEvent->previousCoords.y = y;
|
objEvent->previousCoords.y = y;
|
||||||
SetSpritePosToMapCoords(x, y, &objEvent->initialCoords.x, &objEvent->initialCoords.y);
|
SetSpritePosToMapCoords(x, y, &objEvent->initialCoords.x, &objEvent->initialCoords.y);
|
||||||
objEvent->initialCoords.x += 8;
|
objEvent->initialCoords.x += 8;
|
||||||
ObjectEventUpdateZCoord(objEvent);
|
ObjectEventUpdateElevation(objEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetLinkPlayerObjectRange(u8 linkPlayerId, u8 dir)
|
static void SetLinkPlayerObjectRange(u8 linkPlayerId, u8 dir)
|
||||||
@ -3095,7 +3095,7 @@ static bool8 FacingHandler_DpadMovement(struct LinkPlayerObjectEvent *linkPlayer
|
|||||||
{
|
{
|
||||||
objEvent->directionSequenceIndex = 16;
|
objEvent->directionSequenceIndex = 16;
|
||||||
ShiftObjectEventCoords(objEvent, x, y);
|
ShiftObjectEventCoords(objEvent, x, y);
|
||||||
ObjectEventUpdateZCoord(objEvent);
|
ObjectEventUpdateElevation(objEvent);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3201,8 +3201,8 @@ static void SpriteCB_LinkPlayer(struct Sprite *sprite)
|
|||||||
struct ObjectEvent *objEvent = &gObjectEvents[linkPlayerObjEvent->objEventId];
|
struct ObjectEvent *objEvent = &gObjectEvents[linkPlayerObjEvent->objEventId];
|
||||||
sprite->x = objEvent->initialCoords.x;
|
sprite->x = objEvent->initialCoords.x;
|
||||||
sprite->y = objEvent->initialCoords.y;
|
sprite->y = objEvent->initialCoords.y;
|
||||||
SetObjectSubpriorityByZCoord(objEvent->previousElevation, sprite, 1);
|
SetObjectSubpriorityByElevation(objEvent->previousElevation, sprite, 1);
|
||||||
sprite->oam.priority = ZCoordToPriority(objEvent->previousElevation);
|
sprite->oam.priority = ElevationToPriority(objEvent->previousElevation);
|
||||||
|
|
||||||
if (linkPlayerObjEvent->movementMode == MOVEMENT_MODE_FREE)
|
if (linkPlayerObjEvent->movementMode == MOVEMENT_MODE_FREE)
|
||||||
StartSpriteAnim(sprite, GetFaceDirectionAnimNum(linkDirection(objEvent)));
|
StartSpriteAnim(sprite, GetFaceDirectionAnimNum(linkDirection(objEvent)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user