mirror of
https://github.com/pret/pokefirered.git
synced 2026-04-25 23:40:13 -05:00
Document src/event_object_movement.c
This commit is contained in:
parent
dea9552563
commit
8998b19435
|
|
@ -260,6 +260,7 @@
|
|||
#define MOVEMENT_ACTION_JUMP_SPECIAL_WITH_EFFECT_RIGHT 0xA9
|
||||
|
||||
#define MOVEMENT_ACTION_STEP_END 0xFE
|
||||
#define MOVEMENT_ACTION_NONE 0xFF
|
||||
|
||||
#define ANIM_STD_FACE_SOUTH 0
|
||||
#define ANIM_STD_FACE_NORTH 1
|
||||
|
|
|
|||
|
|
@ -1,9 +1,27 @@
|
|||
#ifndef GUARD_EVENT_OBJECT_MOVEMENT_H
|
||||
#define GUARD_EVENT_OBJECT_MOVEMENT_H
|
||||
|
||||
#include "global.h"
|
||||
|
||||
// Exported struct declarations
|
||||
// Palette slots for overworld NPCs.
|
||||
// The same standard set of palettes for overworld objects are normally always loaded at the same
|
||||
// time while walking around the overworld. The only exceptions are the palettes for the player and
|
||||
// the "special" NPC, which can be swapped out. This also means that e.g. two "special" NPCs
|
||||
// with competing palettes cannot be properly loaded at the same time.
|
||||
enum {
|
||||
PALSLOT_PLAYER,
|
||||
PALSLOT_PLAYER_REFLECTION,
|
||||
PALSLOT_NPC_1,
|
||||
PALSLOT_NPC_2,
|
||||
PALSLOT_NPC_3,
|
||||
PALSLOT_NPC_4,
|
||||
PALSLOT_NPC_1_REFLECTION,
|
||||
PALSLOT_NPC_2_REFLECTION,
|
||||
PALSLOT_NPC_3_REFLECTION,
|
||||
PALSLOT_NPC_4_REFLECTION,
|
||||
PALSLOT_NPC_SPECIAL,
|
||||
PALSLOT_NPC_SPECIAL_REFLECTION,
|
||||
OBJ_PALSLOT_COUNT
|
||||
// the remaining sprite palette slots (12-15) are used by field effects, the interface, etc.
|
||||
};
|
||||
|
||||
enum SpinnerRunnerFollowPatterns
|
||||
{
|
||||
|
|
@ -69,15 +87,14 @@ void LoadPlayerObjectReflectionPalette(u16, u8);
|
|||
void LoadSpecialObjectReflectionPalette(u16, u8);
|
||||
void TryMoveObjectEventToMapCoords(u8, u8, u8, s16, s16);
|
||||
void PatchObjectPalette(u16, u8);
|
||||
void ReloadMapObjectsWithOffset(s16 x, s16 y);
|
||||
void SpawnObjectEventsOnReturnToField(s16 x, s16 y);
|
||||
void GetMapCoordsFromSpritePos(s16, s16, s16 *, s16 *);
|
||||
u8 GetFaceDirectionAnimNum(u8);
|
||||
void SetSpritePosToOffsetMapCoords(s16 *, s16 *, s16, s16);
|
||||
void ObjectEventClearHeldMovement(struct ObjectEvent *);
|
||||
void ObjectEventClearHeldMovementIfActive(struct ObjectEvent *);
|
||||
void SpawnObjectEventsInView(s16, s16);
|
||||
u8 CreateVirtualObject(u8, u8, s16, s16, u8, u8);
|
||||
u8 AddPseudoObjectEvent(u16, SpriteCallback, s16, s16, u8);
|
||||
u8 CreateVirtualObject(u8 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 elevation, u8 direction);
|
||||
u8 CreateObjectGraphicsSprite(u16 graphicsId, SpriteCallback callback, s16 x, s16 y, u8 subpriority);
|
||||
u8 TrySpawnObjectEvent(u8 localId, u8 mapNum, u8 mapGroup);
|
||||
int SpawnSpecialObjectEventParameterized(u8, u8, u8, s16, s16, u8);
|
||||
u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *);
|
||||
|
|
@ -109,7 +126,7 @@ void MoveCoords(u8, s16 *, s16 *);
|
|||
bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *);
|
||||
u8 ObjectEventClearHeldMovementIfFinished(struct ObjectEvent *);
|
||||
u8 GetObjectEventIdByPosition(u16 x, u16 y, u8 elevation);
|
||||
void sub_8063E28(struct ObjectEvent *, struct Sprite *);
|
||||
void UpdateQuestLogObjectEventCurrentMovement(struct ObjectEvent *, struct Sprite *);
|
||||
bool8 ObjectEventSetHeldMovement(struct ObjectEvent *, u8);
|
||||
void ShiftStillObjectEventCoords(struct ObjectEvent *);
|
||||
void OverrideMovementTypeForObjectEvent(const struct ObjectEvent *, u8);
|
||||
|
|
@ -117,7 +134,7 @@ void SetTrainerMovementType(struct ObjectEvent *, u8);
|
|||
u8 GetFishingDirectionAnimNum(u8 direction);
|
||||
u8 GetFishingNoCatchDirectionAnimNum(u8 a0);
|
||||
void ObjectEventSetGraphicsId(struct ObjectEvent *objectEvent, u8 a1);
|
||||
u8 sub_805EB44(u8, u8, s16, s16);
|
||||
u8 CreateFameCheckerObject(u8 graphicsId, u8 localId, s16 x, s16 y);
|
||||
void InitObjectEventPalettes(u8 mode);
|
||||
bool8 ObjectEventIsMovementOverridden(struct ObjectEvent *objectEvent);
|
||||
u8 ObjectEventCheckHeldMovementStatus(struct ObjectEvent *objectEvent);
|
||||
|
|
@ -138,7 +155,7 @@ bool8 UpdateWalkSlowerAnim(struct Sprite *sprite);
|
|||
void SetJumpSpriteData(struct Sprite *, u8, u8, u8);
|
||||
u8 DoJumpSpriteMovement(struct Sprite *);
|
||||
u8 DoJumpSpecialSpriteMovement(struct Sprite *);
|
||||
void TurnVirtualObject(u8, u8);
|
||||
void TurnVirtualObject(u8 virtualObjId, u8 direction);
|
||||
const u8 *GetObjectEventScriptPointerByObjectEventId(u8 objectEventId);
|
||||
u8 GetFirstInactiveObjectEventId(void);
|
||||
u8 GetCollisionFlagsAtCoords(struct ObjectEvent * objectEvent, s16 x, s16 y, u8 direction);
|
||||
|
|
@ -148,25 +165,25 @@ void FreezeObjectEvents(void);
|
|||
bool8 FreezeObjectEvent(struct ObjectEvent *);
|
||||
void UnfreezeObjectEvent(struct ObjectEvent *);
|
||||
void FreezeObjectEventsExceptOne(u8 objEventId);
|
||||
void RfuUnionObjectSetFacingDirection(u8 objectEventId, u8 direction);
|
||||
void RfuUnionObjectToggleInvisibility(u8 objectEventId, bool32 invisible);
|
||||
bool32 RfuUnionObjectIsInvisible(u8 objectEventId);
|
||||
void RfuUnionObjectStartWarp(u8 objectEventId, u8 animNo);
|
||||
bool32 RfuUnionObjectIsWarping(u8 objectEventId);
|
||||
void SetVirtualObjectGraphics(u8 virtualObjId, u8 direction);
|
||||
void SetVirtualObjectInvisibility(u8 virtualObjId, bool32 invisible);
|
||||
bool32 IsVirtualObjectInvisible(u8 virtualObjId);
|
||||
void SetVirtualObjectSpriteAnim(u8 virtualObjId, u8 animNo);
|
||||
bool32 IsVirtualObjectAnimating(u8 virtualObjId);
|
||||
u8 GetJumpSpecialMovementAction(u32 direction);
|
||||
void EnableObjectGroundEffectsByXY(s16 x, s16 y);
|
||||
void MoveObjectEventToMapCoords(struct ObjectEvent *objectEvent, s16 x, s16 y);
|
||||
u8 CreateCopySpriteAt(struct Sprite *sprite, s16 x, s16 y, u8 subpriority);
|
||||
u16 GetObjectPaletteTag(u8 paletteIndex);
|
||||
void SetSpritePosToMapCoords(s16 x, s16 y, s16 *x2, s16 *y2);
|
||||
void UpdateObjectEventSpriteVisibility(struct Sprite *sprite, bool8 invisible);
|
||||
void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible);
|
||||
u8 ElevationToPriority(u8 elevation);
|
||||
void ObjectEventUpdateElevation(struct ObjectEvent *pObject);
|
||||
void SetObjectSubpriorityByElevation(u8 elevation, struct Sprite *sprite, u8 offset);
|
||||
void MakeObjectTemplateFromObjectEventGraphicsInfo(u16 graphicsId, void (*callback)(struct Sprite *), struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables);
|
||||
void CopyObjectGraphicsInfoToSpriteTemplate(u16 graphicsId, void (*callback)(struct Sprite *), struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables);
|
||||
u8 AddCameraObject(u8 trackedSpriteId);
|
||||
void UpdateObjectEventsForCameraUpdate(s16 x, s16 y);
|
||||
void UpdateObjectEventSpriteSubpriorityAndVisibility(struct Sprite *);
|
||||
void SpriteCB_VirtualObject(struct Sprite *);
|
||||
void SetMovementDelay(struct Sprite *, s16);
|
||||
bool8 WaitForMovementDelay(struct Sprite *);
|
||||
void SetSpriteDataForNormalStep(struct Sprite *, u8, u8);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1104,7 +1104,7 @@ static bool8 CreateAllFlavorTextIcons(u8 who)
|
|||
{
|
||||
if ((gSaveBlock1Ptr->fameChecker[sFameCheckerData->unlockedPersons[who]].flavorTextFlags >> i) & 1)
|
||||
{
|
||||
sFameCheckerData->spriteIds[i] = sub_805EB44(
|
||||
sFameCheckerData->spriteIds[i] = CreateFameCheckerObject(
|
||||
sFameCheckerArrayNpcGraphicsIds[sFameCheckerData->unlockedPersons[who] * 6 + i],
|
||||
i,
|
||||
47 * (i % 3) + 0x72,
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ void UpdateTallGrassFieldEffect(struct Sprite *sprite)
|
|||
if (sprite->animCmdIndex == 0)
|
||||
metatileBehavior = 4;
|
||||
|
||||
UpdateObjectEventSpriteVisibility(sprite, FALSE);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||
UpdateGrassFieldEffectSubpriority(sprite, sprite->data[0], metatileBehavior);
|
||||
}
|
||||
}
|
||||
|
|
@ -434,7 +434,7 @@ void UpdateLongGrassFieldEffect(struct Sprite *sprite)
|
|||
{
|
||||
sprite->data[7] = TRUE;
|
||||
}
|
||||
UpdateObjectEventSpriteVisibility(sprite, FALSE);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||
UpdateGrassFieldEffectSubpriority(sprite, sprite->data[0], 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -513,7 +513,7 @@ void UpdateShortGrassFieldEffect(struct Sprite *sprite)
|
|||
sprite->y2 = (graphicsInfo->height >> 1) - 8;
|
||||
sprite->subpriority = linkedSprite->subpriority - 1;
|
||||
sprite->oam.priority = linkedSprite->oam.priority;
|
||||
UpdateObjectEventSpriteVisibility(sprite, linkedSprite->invisible);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, linkedSprite->invisible);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -587,14 +587,14 @@ static void FadeFootprintsTireTracks_Step0(struct Sprite *sprite)
|
|||
if (++sprite->data[1] > 40)
|
||||
sprite->data[0] = 1;
|
||||
|
||||
UpdateObjectEventSpriteVisibility(sprite, FALSE);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||
}
|
||||
|
||||
static void FadeFootprintsTireTracks_Step1(struct Sprite *sprite)
|
||||
{
|
||||
sprite->invisible ^= 1;
|
||||
sprite->data[1]++;
|
||||
UpdateObjectEventSpriteVisibility(sprite, sprite->invisible);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, sprite->invisible);
|
||||
if (sprite->data[1] > 56)
|
||||
{
|
||||
FieldEffectStop(sprite, sprite->data[7]);
|
||||
|
|
@ -641,7 +641,7 @@ void UpdateSplashFieldEffect(struct Sprite *sprite)
|
|||
{
|
||||
sprite->x = gSprites[gObjectEvents[objectEventId].spriteId].x;
|
||||
sprite->y = gSprites[gObjectEvents[objectEventId].spriteId].y;
|
||||
UpdateObjectEventSpriteVisibility(sprite, FALSE);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -727,7 +727,7 @@ static void UpdateFeetInFlowingWaterFieldEffect(struct Sprite *sprite)
|
|||
sprite->x = linkedSprite->x;
|
||||
sprite->y = linkedSprite->y;
|
||||
sprite->subpriority = linkedSprite->subpriority;
|
||||
UpdateObjectEventSpriteVisibility(sprite, FALSE);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||
if (objectEvent->currentCoords.x != sprite->data[3] || objectEvent->currentCoords.y != sprite->data[4])
|
||||
{
|
||||
sprite->data[3] = objectEvent->currentCoords.x;
|
||||
|
|
@ -797,7 +797,7 @@ void UpdateHotSpringsWaterFieldEffect(struct Sprite *sprite)
|
|||
sprite->x = linkedSprite->x;
|
||||
sprite->y = (graphicsInfo->height >> 1) + linkedSprite->y - 8;
|
||||
sprite->subpriority = linkedSprite->subpriority - 1;
|
||||
UpdateObjectEventSpriteVisibility(sprite, FALSE);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -935,7 +935,7 @@ static void UpdateAshFieldEffect_Step1(struct Sprite *sprite)
|
|||
|
||||
static void UpdateAshFieldEffect_Step2(struct Sprite *sprite)
|
||||
{
|
||||
UpdateObjectEventSpriteVisibility(sprite, FALSE);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||
if (sprite->animEnded)
|
||||
FieldEffectStop(sprite, FLDEFF_ASH);
|
||||
}
|
||||
|
|
@ -1187,7 +1187,7 @@ void UpdateSandPileFieldEffect(struct Sprite *sprite)
|
|||
sprite->x = x;
|
||||
sprite->y = y;
|
||||
sprite->subpriority = gSprites[gObjectEvents[objectEventId].spriteId].subpriority;
|
||||
UpdateObjectEventSpriteVisibility(sprite, FALSE);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1212,7 +1212,7 @@ void UpdateBubblesFieldEffect(struct Sprite *sprite)
|
|||
sprite->data[0] += 0x80;
|
||||
sprite->data[0] &= 0x100;
|
||||
sprite->y -= sprite->data[0] >> 8;
|
||||
UpdateObjectEventSpriteVisibility(sprite, FALSE);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||
if (sprite->invisible || sprite->animEnded)
|
||||
{
|
||||
FieldEffectStop(sprite, FLDEFF_BUBBLES);
|
||||
|
|
@ -1380,7 +1380,7 @@ void UpdateJumpImpactEffect(struct Sprite *sprite)
|
|||
}
|
||||
else
|
||||
{
|
||||
UpdateObjectEventSpriteVisibility(sprite, FALSE);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||
SetObjectSubpriorityByElevation(sprite->data[0], sprite, 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -1390,7 +1390,7 @@ void WaitFieldEffectSpriteAnim(struct Sprite *sprite)
|
|||
if (sprite->animEnded)
|
||||
FieldEffectStop(sprite, sprite->data[0]);
|
||||
else
|
||||
UpdateObjectEventSpriteVisibility(sprite, FALSE);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||
}
|
||||
|
||||
static void UpdateGrassFieldEffectSubpriority(struct Sprite *sprite, u8 z, u8 offset)
|
||||
|
|
|
|||
|
|
@ -1393,7 +1393,7 @@ static void NamingScreen_CreatePlayerIcon(void)
|
|||
u8 spriteId;
|
||||
|
||||
rivalGfxId = GetRivalAvatarGraphicsIdByStateIdAndGender(PLAYER_AVATAR_STATE_NORMAL, sNamingScreen->monSpecies);
|
||||
spriteId = AddPseudoObjectEvent(rivalGfxId, SpriteCallbackDummy, 56, 37, 0);
|
||||
spriteId = CreateObjectGraphicsSprite(rivalGfxId, SpriteCallbackDummy, 56, 37, 0);
|
||||
gSprites[spriteId].oam.priority = 3;
|
||||
StartSpriteAnim(&gSprites[spriteId], ANIM_STD_GO_SOUTH);
|
||||
}
|
||||
|
|
@ -1440,7 +1440,7 @@ static void NamingScreen_CreateRivalIcon(void)
|
|||
const struct SubspriteTable * tables_p;
|
||||
u8 spriteId;
|
||||
|
||||
MakeObjectTemplateFromObjectEventGraphicsInfo(OBJ_EVENT_GFX_RED_NORMAL, SpriteCallbackDummy, &template, &tables_p);
|
||||
CopyObjectGraphicsInfoToSpriteTemplate(OBJ_EVENT_GFX_RED_NORMAL, SpriteCallbackDummy, &template, &tables_p);
|
||||
|
||||
template.tileTag = sheet.tag;
|
||||
template.paletteTag = palette.tag;
|
||||
|
|
|
|||
|
|
@ -2138,7 +2138,7 @@ static void InitObjectEventsLocal(void)
|
|||
|
||||
static void ReloadObjectsAndRunReturnToFieldMapScript(void)
|
||||
{
|
||||
ReloadMapObjectsWithOffset(0, 0);
|
||||
SpawnObjectEventsOnReturnToField(0, 0);
|
||||
RunOnReturnToFieldMapScript();
|
||||
}
|
||||
|
||||
|
|
@ -3515,13 +3515,13 @@ static void CreateLinkPlayerSprite(u8 linkPlayerId, u8 gameVersion)
|
|||
{
|
||||
if (gameVersion == VERSION_FIRE_RED || gameVersion == VERSION_LEAF_GREEN)
|
||||
{
|
||||
objEvent->spriteId = AddPseudoObjectEvent(
|
||||
objEvent->spriteId = CreateObjectGraphicsSprite(
|
||||
GetRivalAvatarGraphicsIdByStateIdAndGender(PLAYER_AVATAR_STATE_NORMAL, linkGender(objEvent)),
|
||||
SpriteCB_LinkPlayer, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
objEvent->spriteId = AddPseudoObjectEvent(GetRSAvatarGraphicsIdByGender(linkGender(objEvent)), SpriteCB_LinkPlayer, 0, 0, 0);
|
||||
objEvent->spriteId = CreateObjectGraphicsSprite(GetRSAvatarGraphicsIdByGender(linkGender(objEvent)), SpriteCB_LinkPlayer, 0, 0, 0);
|
||||
}
|
||||
|
||||
sprite = &gSprites[objEvent->spriteId];
|
||||
|
|
@ -3545,7 +3545,7 @@ static void SpriteCB_LinkPlayer(struct Sprite *sprite)
|
|||
else
|
||||
StartSpriteAnimIfDifferent(sprite, GetMoveDirectionAnimNum(linkDirection(objEvent)));
|
||||
|
||||
UpdateObjectEventSpriteVisibility(sprite, 0);
|
||||
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
|
||||
if (objEvent->triggerGroundEffectsOnMove)
|
||||
{
|
||||
sprite->invisible = ((sprite->data[7] & 4) >> 2);
|
||||
|
|
|
|||
|
|
@ -1297,7 +1297,7 @@ void sub_811246C(struct Sprite *sprite)
|
|||
QuestLogUpdatePlayerSprite(sMovementScripts[0][1]);
|
||||
sMovementScripts[0][1] = 0xFF;
|
||||
}
|
||||
sub_8063E28(objectEvent, sprite);
|
||||
UpdateQuestLogObjectEventCurrentMovement(objectEvent, sprite);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1306,7 +1306,7 @@ void sub_811246C(struct Sprite *sprite)
|
|||
ObjectEventSetHeldMovement(objectEvent, sMovementScripts[objectEvent->localId][0]);
|
||||
sMovementScripts[objectEvent->localId][0] = 0xFF;
|
||||
}
|
||||
sub_8063E28(objectEvent, sprite);
|
||||
UpdateQuestLogObjectEventCurrentMovement(objectEvent, sprite);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -441,7 +441,7 @@ void CreateGroupMemberObjectsInvisible(u8 * sprite_ids, s32 group)
|
|||
{
|
||||
s32 obj_id = 5 * group + i;
|
||||
sprite_ids[obj_id] = CreateVirtualObject(OBJ_EVENT_GFX_MAN, obj_id - 0x38, sUnionPartnerCoords[group][0] + sFacingDirectionOffsets[i][0], sUnionPartnerCoords[group][1] + sFacingDirectionOffsets[i][1], 3, 1);
|
||||
RfuUnionObjectToggleInvisibility(obj_id - 0x38, TRUE);
|
||||
SetVirtualObjectInvisibility(obj_id - 0x38, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -485,7 +485,7 @@ static u8 UnionPartnerObjectGetFacing(u32 member, u32 group, struct GFtgtGname *
|
|||
|
||||
static u32 RfuUnionGroupMemberIsInvisible(u32 group, u32 member)
|
||||
{
|
||||
return RfuUnionObjectIsInvisible(5 * group + member - 0x38);
|
||||
return IsVirtualObjectInvisible(5 * group + member - 0x38);
|
||||
}
|
||||
|
||||
static void SpawnGroupMember(u32 groupNo, u32 memberNo, u8 direction, struct GFtgtGname * gname)
|
||||
|
|
@ -494,10 +494,10 @@ static void SpawnGroupMember(u32 groupNo, u32 memberNo, u8 direction, struct GFt
|
|||
s32 objId = 5 * groupNo + memberNo;
|
||||
if (RfuUnionGroupMemberIsInvisible(groupNo, memberNo) == TRUE)
|
||||
{
|
||||
RfuUnionObjectToggleInvisibility(objId - 0x38, FALSE);
|
||||
RfuUnionObjectStartWarp(objId - 0x38, UNION_ROOM_SPAWN_IN);
|
||||
SetVirtualObjectInvisibility(objId - 0x38, FALSE);
|
||||
SetVirtualObjectSpriteAnim(objId - 0x38, UNION_ROOM_SPAWN_IN);
|
||||
}
|
||||
RfuUnionObjectSetFacingDirection(objId - 0x38, direction);
|
||||
SetVirtualObjectGraphics(objId - 0x38, direction);
|
||||
UnionPartnerObjectSetFacing(memberNo, groupNo, UnionPartnerObjectGetFacing(memberNo, groupNo, gname));
|
||||
GetUnionRoomPlayerFacingCoords(groupNo, memberNo, &x, &y);
|
||||
MapGridSetMetatileImpassabilityAt(x, y, TRUE);
|
||||
|
|
@ -506,7 +506,7 @@ static void SpawnGroupMember(u32 groupNo, u32 memberNo, u8 direction, struct GFt
|
|||
static void DespawnGroupMember(u32 group, u32 member)
|
||||
{
|
||||
s32 x, y;
|
||||
RfuUnionObjectStartWarp(5 * group + member - 0x38, UNION_ROOM_SPAWN_OUT);
|
||||
SetVirtualObjectSpriteAnim(5 * group + member - 0x38, UNION_ROOM_SPAWN_OUT);
|
||||
GetUnionRoomPlayerFacingCoords(group, member, &x, &y);
|
||||
MapGridSetMetatileImpassabilityAt(x, y, FALSE);
|
||||
}
|
||||
|
|
@ -518,7 +518,7 @@ static void AssembleGroup(u32 group, struct GFtgtGname * gname)
|
|||
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
player_get_pos_including_state_based_drift(&x2, &y2);
|
||||
if (RfuUnionObjectIsInvisible(5 * group - 0x38) == TRUE)
|
||||
if (IsVirtualObjectInvisible(5 * group - 0x38) == TRUE)
|
||||
{
|
||||
if (IsUnionRoomPlayerFacingTileAt(group, 0, x, y) == TRUE || IsUnionRoomPlayerFacingTileAt(group, 0, x2, y2) == TRUE)
|
||||
{
|
||||
|
|
@ -631,11 +631,11 @@ bool32 RfuUnionTool_GetGroupAndMemberInFrontOfPlayer(struct UnkStruct_Main0 *mai
|
|||
{
|
||||
continue;
|
||||
}
|
||||
if (RfuUnionObjectIsInvisible(objId - 0x38) != 0)
|
||||
if (IsVirtualObjectInvisible(objId - 0x38) != FALSE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (RfuUnionObjectIsWarping(objId - 0x38) != 0)
|
||||
if (IsVirtualObjectAnimating(objId - 0x38) != FALSE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -844,7 +844,7 @@ static void BuyMenuDrawObjectEvents(void)
|
|||
continue;
|
||||
|
||||
graphicsInfo = GetObjectEventGraphicsInfo(gObjectEvents[sViewportObjectEvents[i][OBJECT_EVENT_ID]].graphicsId);
|
||||
spriteId = AddPseudoObjectEvent(
|
||||
spriteId = CreateObjectGraphicsSprite(
|
||||
gObjectEvents[sViewportObjectEvents[i][OBJECT_EVENT_ID]].graphicsId,
|
||||
SpriteCallbackDummy,
|
||||
(u16)sViewportObjectEvents[i][X_COORD] * 16 - 8,
|
||||
|
|
|
|||
|
|
@ -602,7 +602,7 @@ static void TeachyTvInitIo(void)
|
|||
|
||||
static u8 TeachyTvSetupObjEventAndOam(void)
|
||||
{
|
||||
u8 objId = AddPseudoObjectEvent(90, SpriteCallbackDummy, 0, 0, 8);
|
||||
u8 objId = CreateObjectGraphicsSprite(90, SpriteCallbackDummy, 0, 0, 8);
|
||||
gSprites[objId].oam.priority = 2;
|
||||
gSprites[objId].invisible = 1;
|
||||
return objId;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user