Document src/event_object_movement.c
This commit is contained in:
+236
-272
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -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,
|
||||
|
||||
+13
-13
@@ -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)
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
+4
-4
@@ -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);
|
||||
|
||||
+2
-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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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,
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user