mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-27 22:03:53 +01:00
Update event object struct members
This commit is contained in:
parent
38a126df66
commit
4018acfae1
@ -77,7 +77,7 @@ void MoveCoords(u8, s16 *, s16 *);
|
|||||||
bool8 FieldObjectIsSpecialAnimActive(struct MapObject *);
|
bool8 FieldObjectIsSpecialAnimActive(struct MapObject *);
|
||||||
u8 FieldObjectClearAnimIfSpecialAnimFinished(struct MapObject *);
|
u8 FieldObjectClearAnimIfSpecialAnimFinished(struct MapObject *);
|
||||||
u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z);
|
u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z);
|
||||||
void npc_set_running_behaviour_etc(struct MapObject *mapObject, u8 animPattern);
|
void npc_set_running_behaviour_etc(struct MapObject *mapObject, u8 movementType);
|
||||||
u8 npc_running_behaviour_by_direction(u8 direction);
|
u8 npc_running_behaviour_by_direction(u8 direction);
|
||||||
const u8 *GetFieldObjectScriptPointerByFieldObjectId(u8 mapObjectId);
|
const u8 *GetFieldObjectScriptPointerByFieldObjectId(u8 mapObjectId);
|
||||||
u8 sub_8092C8C(struct MapObject *mapObject, s16 x, s16 y, u8 direction);
|
u8 sub_8092C8C(struct MapObject *mapObject, s16 x, s16 y, u8 direction);
|
||||||
|
@ -181,51 +181,47 @@ struct MapHeader
|
|||||||
struct MapObject
|
struct MapObject
|
||||||
{
|
{
|
||||||
/*0x00*/ u32 active:1;
|
/*0x00*/ u32 active:1;
|
||||||
u32 mapobj_bit_1:1;
|
u32 singleMovementActive:1;
|
||||||
u32 mapobj_bit_2:1;
|
u32 triggerGroundEffectsOnMove:1;
|
||||||
u32 mapobj_bit_3:1;
|
u32 triggerGroundEffectsOnStop:1;
|
||||||
u32 mapobj_bit_4:1;
|
u32 disableCoveringGroundEffects:1;
|
||||||
u32 mapobj_bit_5:1;
|
u32 landingJump:1;
|
||||||
u32 mapobj_bit_6:1;
|
u32 heldMovementActive:1;
|
||||||
u32 mapobj_bit_7:1;
|
u32 heldMovementFinished:1;
|
||||||
/*0x01*/ u32 mapobj_bit_8:1;
|
/*0x01*/ u32 frozen:1;
|
||||||
u32 mapobj_bit_9:1;
|
u32 facingDirectionLocked:1;
|
||||||
u32 mapobj_bit_10:1;
|
u32 disableAnim:1;
|
||||||
u32 mapobj_bit_11:1;
|
u32 enableAnim:1;
|
||||||
u32 mapobj_bit_12:1;
|
u32 inanimate:1;
|
||||||
u32 mapobj_bit_13:1;
|
u32 invisible:1;
|
||||||
u32 mapobj_bit_14:1;
|
u32 offScreen:1;
|
||||||
u32 mapobj_bit_15:1;
|
u32 trackedByCamera:1;
|
||||||
/*0x02*/ u32 mapobj_bit_16:1;
|
/*0x02*/ u32 isPlayer:1;
|
||||||
u32 mapobj_bit_17:1;
|
u32 hasReflection:1;
|
||||||
u32 mapobj_bit_18:1;
|
u32 inShortGrass:1;
|
||||||
u32 mapobj_bit_19:1;
|
u32 inShallowFlowingWater:1;
|
||||||
u32 mapobj_bit_20:1;
|
u32 inSandPile:1;
|
||||||
u32 mapobj_bit_21:1;
|
u32 inHotSprings:1;
|
||||||
u32 mapobj_bit_22:1;
|
u32 hasShadow:1;
|
||||||
u32 mapobj_bit_23:1;
|
u32 spriteAnimPausedBackup:1;
|
||||||
/*0x03*/ u32 mapobj_bit_24:1;
|
/*0x03*/ u32 spriteAffineAnimPausedBackup:1;
|
||||||
u32 mapobj_bit_25:1;
|
u32 disableJumpLandingGroundEffect:1;
|
||||||
u32 mapobj_bit_26:1;
|
u32 fixedPriority:1;
|
||||||
u32 mapobj_bit_27:1;
|
u32 unk3_3:1;
|
||||||
u32 mapobj_bit_28:1;
|
|
||||||
u32 mapobj_bit_29:1;
|
|
||||||
u32 mapobj_bit_30:1;
|
|
||||||
u32 mapobj_bit_31:1;
|
|
||||||
/*0x04*/ u8 spriteId;
|
/*0x04*/ u8 spriteId;
|
||||||
/*0x05*/ u8 graphicsId;
|
/*0x05*/ u8 graphicsId;
|
||||||
/*0x06*/ u8 animPattern;
|
/*0x06*/ u8 movementType;
|
||||||
/*0x07*/ u8 trainerType;
|
/*0x07*/ u8 trainerType;
|
||||||
/*0x08*/ u8 localId;
|
/*0x08*/ u8 localId;
|
||||||
/*0x09*/ u8 mapNum;
|
/*0x09*/ u8 mapNum;
|
||||||
/*0x0A*/ u8 mapGroup;
|
/*0x0A*/ u8 mapGroup;
|
||||||
/*0x0B*/ u8 mapobj_unk_0B_0:4;
|
/*0x0B*/ u8 currentElevation:4;
|
||||||
u8 elevation:4;
|
u8 previousElevation:4;
|
||||||
/*0x0C*/ struct Coords16 coords1;
|
/*0x0C*/ struct Coords16 initialCoords;
|
||||||
/*0x10*/ struct Coords16 coords2;
|
/*0x10*/ struct Coords16 currentCoords;
|
||||||
/*0x14*/ struct Coords16 coords3;
|
/*0x14*/ struct Coords16 previousCoords;
|
||||||
/*0x18*/ u8 mapobj_unk_18:4; // current direction?
|
/*0x18*/ u8 facingDirection:4; // current direction?
|
||||||
/*0x18*/ u8 placeholder18:4;
|
/*0x18*/ u8 movementDirection:4;
|
||||||
/*0x19*/ union __attribute__((packed)) {
|
/*0x19*/ union __attribute__((packed)) {
|
||||||
u8 as_byte;
|
u8 as_byte;
|
||||||
struct __attribute__((packed)) {
|
struct __attribute__((packed)) {
|
||||||
@ -233,15 +229,15 @@ struct MapObject
|
|||||||
u8 y:4;
|
u8 y:4;
|
||||||
} __attribute__((aligned (1))) as_nybbles;
|
} __attribute__((aligned (1))) as_nybbles;
|
||||||
} __attribute__((aligned (1))) range;
|
} __attribute__((aligned (1))) range;
|
||||||
/*0x1A*/ u8 mapobj_unk_1A;
|
/*0x1A*/ u8 fieldEffectSpriteId;
|
||||||
/*0x1B*/ u8 mapobj_unk_1B;
|
/*0x1B*/ u8 warpArrowSpriteId;
|
||||||
/*0x1C*/ u8 mapobj_unk_1C;
|
/*0x1C*/ u8 movementActionId;
|
||||||
/*0x1D*/ u8 trainerRange_berryTreeId;
|
/*0x1D*/ u8 trainerRange_berryTreeId;
|
||||||
/*0x1E*/ u8 mapobj_unk_1E;
|
/*0x1E*/ u8 currentMetatileBehavior;
|
||||||
/*0x1F*/ u8 mapobj_unk_1F;
|
/*0x1F*/ u8 previousMetatileBehavior;
|
||||||
/*0x20*/ u8 mapobj_unk_20;
|
/*0x20*/ u8 previousMovementDirection;
|
||||||
/*0x21*/ u8 mapobj_unk_21;
|
/*0x21*/ u8 directionSequenceIndex;
|
||||||
/*0x22*/ u8 animId;
|
/*0x22*/ u8 playerCopyableMovement;
|
||||||
/*size = 0x24*/
|
/*size = 0x24*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1204,7 +1204,7 @@ void sub_80B16D8(void)
|
|||||||
{
|
{
|
||||||
struct MapObject *mapObject = &gMapObjects[gSelectedMapObject];
|
struct MapObject *mapObject = &gMapObjects[gSelectedMapObject];
|
||||||
|
|
||||||
npc_set_running_behaviour_etc(mapObject, npc_running_behaviour_by_direction(mapObject->mapobj_unk_18));
|
npc_set_running_behaviour_etc(mapObject, npc_running_behaviour_by_direction(mapObject->facingDirection));
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 GetTrainerBattleMode(void)
|
u8 GetTrainerBattleMode(void)
|
||||||
|
@ -1238,10 +1238,10 @@ void ResetBerryTreeSparkleFlags(void)
|
|||||||
bottom = top + 8;
|
bottom = top + 8;
|
||||||
for (i = 0; i < MAP_OBJECTS_COUNT; i++)
|
for (i = 0; i < MAP_OBJECTS_COUNT; i++)
|
||||||
{
|
{
|
||||||
if (gMapObjects[i].active && gMapObjects[i].animPattern == 12)
|
if (gMapObjects[i].active && gMapObjects[i].movementType == 12)
|
||||||
{
|
{
|
||||||
cam_left = gMapObjects[i].coords2.x;
|
cam_left = gMapObjects[i].currentCoords.x;
|
||||||
cam_top = gMapObjects[i].coords2.y;
|
cam_top = gMapObjects[i].currentCoords.y;
|
||||||
if (left <= cam_left && cam_left <= right && top <= cam_top && cam_top <= bottom)
|
if (left <= cam_left && cam_left <= right && top <= cam_top && cam_top <= bottom)
|
||||||
ResetBerryTreeSparkleFlag(gMapObjects[i].trainerRange_berryTreeId);
|
ResetBerryTreeSparkleFlag(gMapObjects[i].trainerRange_berryTreeId);
|
||||||
}
|
}
|
||||||
|
72
src/bike.c
72
src/bike.c
@ -198,14 +198,14 @@ static void MachBikeTransition_TurnDirection(u8 direction)
|
|||||||
{
|
{
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E))
|
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior))
|
||||||
{
|
{
|
||||||
PlayerTurnInPlace(direction);
|
PlayerTurnInPlace(direction);
|
||||||
Bike_SetBikeStill();
|
Bike_SetBikeStill();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MachBikeTransition_FaceDirection(playerMapObj->mapobj_unk_18);
|
MachBikeTransition_FaceDirection(playerMapObj->facingDirection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,13 +214,13 @@ static void MachBikeTransition_TrySpeedUp(u8 direction)
|
|||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
u8 collision;
|
u8 collision;
|
||||||
|
|
||||||
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == FALSE)
|
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == FALSE)
|
||||||
{
|
{
|
||||||
// we cannot go forward, so either slow down or, if we are stopped, idle face direction.
|
// we cannot go forward, so either slow down or, if we are stopped, idle face direction.
|
||||||
if (gPlayerAvatar.bikeSpeed)
|
if (gPlayerAvatar.bikeSpeed)
|
||||||
MachBikeTransition_TrySlowDown(playerMapObj->placeholder18);
|
MachBikeTransition_TrySlowDown(playerMapObj->movementDirection);
|
||||||
else
|
else
|
||||||
MachBikeTransition_FaceDirection(playerMapObj->placeholder18);
|
MachBikeTransition_FaceDirection(playerMapObj->movementDirection);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -388,7 +388,7 @@ static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16
|
|||||||
{
|
{
|
||||||
// B button was released.
|
// B button was released.
|
||||||
gPlayerAvatar.bikeFrameCounter = 0;
|
gPlayerAvatar.bikeFrameCounter = 0;
|
||||||
if (!MetatileBehavior_IsBumpySlope(playerMapObj->mapobj_unk_1E))
|
if (!MetatileBehavior_IsBumpySlope(playerMapObj->currentMetatileBehavior))
|
||||||
{
|
{
|
||||||
// Go back to normal on flat ground
|
// Go back to normal on flat ground
|
||||||
*newDirection = direction;
|
*newDirection = direction;
|
||||||
@ -431,7 +431,7 @@ static u8 AcroBikeHandleInputBunnyHop(u8 *newDirection, u16 newKeys, u16 heldKey
|
|||||||
{
|
{
|
||||||
// B button was released
|
// B button was released
|
||||||
Bike_SetBikeStill();
|
Bike_SetBikeStill();
|
||||||
if (MetatileBehavior_IsBumpySlope(playerMapObj->mapobj_unk_1E))
|
if (MetatileBehavior_IsBumpySlope(playerMapObj->currentMetatileBehavior))
|
||||||
{
|
{
|
||||||
// even though B was released, dont undo the wheelie on the bumpy slope.
|
// even though B was released, dont undo the wheelie on the bumpy slope.
|
||||||
gPlayerAvatar.acroBikeState = ACRO_STATE_WHEELIE_STANDING;
|
gPlayerAvatar.acroBikeState = ACRO_STATE_WHEELIE_STANDING;
|
||||||
@ -478,7 +478,7 @@ static u8 AcroBikeHandleInputWheelieMoving(u8 *newDirection, u16 newKeys, u16 he
|
|||||||
{
|
{
|
||||||
// we were moving on a wheelie, but we let go while moving. reset bike still status
|
// we were moving on a wheelie, but we let go while moving. reset bike still status
|
||||||
Bike_SetBikeStill();
|
Bike_SetBikeStill();
|
||||||
if (!MetatileBehavior_IsBumpySlope(playerMapObj->mapobj_unk_1E))
|
if (!MetatileBehavior_IsBumpySlope(playerMapObj->currentMetatileBehavior))
|
||||||
{
|
{
|
||||||
// we let go of B and arent on a bumpy slope, set state to normal because now we need to handle this
|
// we let go of B and arent on a bumpy slope, set state to normal because now we need to handle this
|
||||||
gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL;
|
gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL;
|
||||||
@ -526,8 +526,8 @@ static u8 AcroBikeHandleInputSidewaysJump(u8 *ptr, u16 newKeys, u16 heldKeys)
|
|||||||
{
|
{
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
playerMapObj->mapobj_bit_9 = 0;
|
playerMapObj->facingDirectionLocked = 0;
|
||||||
FieldObjectSetDirection(playerMapObj, playerMapObj->mapobj_unk_18);
|
FieldObjectSetDirection(playerMapObj, playerMapObj->facingDirection);
|
||||||
gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL;
|
gPlayerAvatar.acroBikeState = ACRO_STATE_NORMAL;
|
||||||
return CheckMovementInputAcroBike(ptr, newKeys, heldKeys);
|
return CheckMovementInputAcroBike(ptr, newKeys, heldKeys);
|
||||||
}
|
}
|
||||||
@ -547,8 +547,8 @@ static void AcroBikeTransition_TurnDirection(u8 direction)
|
|||||||
{
|
{
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
|
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
|
||||||
direction = playerMapObj->placeholder18;
|
direction = playerMapObj->movementDirection;
|
||||||
PlayerFaceDirection(direction);
|
PlayerFaceDirection(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -557,9 +557,9 @@ static void AcroBikeTransition_Moving(u8 direction)
|
|||||||
u8 collision;
|
u8 collision;
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
|
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
|
||||||
{
|
{
|
||||||
AcroBikeTransition_FaceDirection(playerMapObj->placeholder18);
|
AcroBikeTransition_FaceDirection(playerMapObj->movementDirection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
collision = get_some_collision(direction);
|
collision = get_some_collision(direction);
|
||||||
@ -582,8 +582,8 @@ static void AcroBikeTransition_NormalToWheelie(u8 direction)
|
|||||||
{
|
{
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
|
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
|
||||||
direction = playerMapObj->placeholder18;
|
direction = playerMapObj->movementDirection;
|
||||||
PlayerStartWheelie(direction);
|
PlayerStartWheelie(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -591,8 +591,8 @@ static void AcroBikeTransition_WheelieToNormal(u8 direction)
|
|||||||
{
|
{
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
|
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
|
||||||
direction = playerMapObj->placeholder18;
|
direction = playerMapObj->movementDirection;
|
||||||
PlayerEndWheelie(direction);
|
PlayerEndWheelie(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -600,8 +600,8 @@ static void AcroBikeTransition_WheelieIdle(u8 direction)
|
|||||||
{
|
{
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
|
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
|
||||||
direction = playerMapObj->placeholder18;
|
direction = playerMapObj->movementDirection;
|
||||||
PlayerIdleWheelie(direction);
|
PlayerIdleWheelie(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -609,8 +609,8 @@ static void AcroBikeTransition_WheelieHoppingStanding(u8 direction)
|
|||||||
{
|
{
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
|
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
|
||||||
direction = playerMapObj->placeholder18;
|
direction = playerMapObj->movementDirection;
|
||||||
PlayerStandingHoppingWheelie(direction);
|
PlayerStandingHoppingWheelie(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -619,9 +619,9 @@ static void AcroBikeTransition_WheelieHoppingMoving(u8 direction)
|
|||||||
u8 collision;
|
u8 collision;
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
|
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
|
||||||
{
|
{
|
||||||
AcroBikeTransition_WheelieHoppingStanding(playerMapObj->placeholder18);
|
AcroBikeTransition_WheelieHoppingStanding(playerMapObj->movementDirection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
collision = get_some_collision(direction);
|
collision = get_some_collision(direction);
|
||||||
@ -671,7 +671,7 @@ static void AcroBikeTransition_SideJump(u8 direction)
|
|||||||
}
|
}
|
||||||
playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
PlaySE(SE_JITE_PYOKO);
|
PlaySE(SE_JITE_PYOKO);
|
||||||
playerMapObj->mapobj_bit_9 = 1;
|
playerMapObj->facingDirectionLocked = 1;
|
||||||
PlayerSetAnimId(sub_8093514(direction), 2);
|
PlayerSetAnimId(sub_8093514(direction), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -685,9 +685,9 @@ static void AcroBikeTransition_WheelieMoving(u8 direction)
|
|||||||
u8 collision;
|
u8 collision;
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
|
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
|
||||||
{
|
{
|
||||||
PlayerIdleWheelie(playerMapObj->placeholder18);
|
PlayerIdleWheelie(playerMapObj->movementDirection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
collision = get_some_collision(direction);
|
collision = get_some_collision(direction);
|
||||||
@ -703,7 +703,7 @@ static void AcroBikeTransition_WheelieMoving(u8 direction)
|
|||||||
}
|
}
|
||||||
else if (collision <= 4)
|
else if (collision <= 4)
|
||||||
{
|
{
|
||||||
if (MetatileBehavior_IsBumpySlope(playerMapObj->mapobj_unk_1E))
|
if (MetatileBehavior_IsBumpySlope(playerMapObj->currentMetatileBehavior))
|
||||||
PlayerIdleWheelie(direction);
|
PlayerIdleWheelie(direction);
|
||||||
else
|
else
|
||||||
sub_808B980(direction); //hit wall?
|
sub_808B980(direction); //hit wall?
|
||||||
@ -719,9 +719,9 @@ static void AcroBikeTransition_WheelieRisingMoving(u8 direction)
|
|||||||
u8 collision;
|
u8 collision;
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
|
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
|
||||||
{
|
{
|
||||||
PlayerStartWheelie(playerMapObj->placeholder18);
|
PlayerStartWheelie(playerMapObj->movementDirection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
collision = get_some_collision(direction);
|
collision = get_some_collision(direction);
|
||||||
@ -737,7 +737,7 @@ static void AcroBikeTransition_WheelieRisingMoving(u8 direction)
|
|||||||
}
|
}
|
||||||
else if (collision <= 4)
|
else if (collision <= 4)
|
||||||
{
|
{
|
||||||
if (MetatileBehavior_IsBumpySlope(playerMapObj->mapobj_unk_1E))
|
if (MetatileBehavior_IsBumpySlope(playerMapObj->currentMetatileBehavior))
|
||||||
PlayerIdleWheelie(direction);
|
PlayerIdleWheelie(direction);
|
||||||
else
|
else
|
||||||
sub_808B980(direction); //hit wall?
|
sub_808B980(direction); //hit wall?
|
||||||
@ -753,9 +753,9 @@ static void AcroBikeTransition_WheelieLoweringMoving(u8 direction)
|
|||||||
u8 collision;
|
u8 collision;
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->mapobj_unk_1E) == 0)
|
if (CanBikeFaceDirOnMetatile(direction, playerMapObj->currentMetatileBehavior) == 0)
|
||||||
{
|
{
|
||||||
PlayerEndWheelie(playerMapObj->placeholder18);
|
PlayerEndWheelie(playerMapObj->movementDirection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
collision = get_some_collision(direction);
|
collision = get_some_collision(direction);
|
||||||
@ -882,8 +882,8 @@ static u8 get_some_collision(u8 direction)
|
|||||||
u8 metatitleBehavior;
|
u8 metatitleBehavior;
|
||||||
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
|
|
||||||
x = playerMapObj->coords2.x;
|
x = playerMapObj->currentCoords.x;
|
||||||
y = playerMapObj->coords2.y;
|
y = playerMapObj->currentCoords.y;
|
||||||
MoveCoords(direction, &x, &y);
|
MoveCoords(direction, &x, &y);
|
||||||
metatitleBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
metatitleBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
||||||
return Bike_CheckCollisionTryAdvanceCollisionCount(playerMapObj, x, y, direction, metatitleBehavior);
|
return Bike_CheckCollisionTryAdvanceCollisionCount(playerMapObj, x, y, direction, metatitleBehavior);
|
||||||
@ -979,7 +979,7 @@ bool8 IsBikingDisallowedByPlayer(void)
|
|||||||
|
|
||||||
bool8 player_should_look_direction_be_enforced_upon_movement(void)
|
bool8 player_should_look_direction_be_enforced_upon_movement(void)
|
||||||
{
|
{
|
||||||
if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_ACRO_BIKE) != FALSE && MetatileBehavior_IsBumpySlope(gMapObjects[gPlayerAvatar.mapObjectId].mapobj_unk_1E) != FALSE)
|
if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_ACRO_BIKE) != FALSE && MetatileBehavior_IsBumpySlope(gMapObjects[gPlayerAvatar.mapObjectId].currentMetatileBehavior) != FALSE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else
|
else
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -25,15 +25,15 @@ void sub_8097FE4(u8);
|
|||||||
|
|
||||||
bool8 FreezeMapObject(struct MapObject *mapObject)
|
bool8 FreezeMapObject(struct MapObject *mapObject)
|
||||||
{
|
{
|
||||||
if (mapObject->mapobj_bit_6 || mapObject->mapobj_bit_8)
|
if (mapObject->heldMovementActive || mapObject->frozen)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mapObject->mapobj_bit_8 = 1;
|
mapObject->frozen = 1;
|
||||||
mapObject->mapobj_bit_23 = gSprites[mapObject->spriteId].animPaused;
|
mapObject->spriteAnimPausedBackup = gSprites[mapObject->spriteId].animPaused;
|
||||||
mapObject->mapobj_bit_24 = gSprites[mapObject->spriteId].affineAnimPaused;
|
mapObject->spriteAffineAnimPausedBackup = gSprites[mapObject->spriteId].affineAnimPaused;
|
||||||
gSprites[mapObject->spriteId].animPaused = 1;
|
gSprites[mapObject->spriteId].animPaused = 1;
|
||||||
gSprites[mapObject->spriteId].affineAnimPaused = 1;
|
gSprites[mapObject->spriteId].affineAnimPaused = 1;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -58,11 +58,11 @@ void FreezeMapObjectsExceptOne(u8 a1)
|
|||||||
|
|
||||||
void npc_sync_anim_pause_bits(struct MapObject *mapObject)
|
void npc_sync_anim_pause_bits(struct MapObject *mapObject)
|
||||||
{
|
{
|
||||||
if (mapObject->active && mapObject->mapobj_bit_8)
|
if (mapObject->active && mapObject->frozen)
|
||||||
{
|
{
|
||||||
mapObject->mapobj_bit_8 = 0;
|
mapObject->frozen = 0;
|
||||||
gSprites[mapObject->spriteId].animPaused = mapObject->mapobj_bit_23;
|
gSprites[mapObject->spriteId].animPaused = mapObject->spriteAnimPausedBackup;
|
||||||
gSprites[mapObject->spriteId].affineAnimPaused = mapObject->mapobj_bit_24;
|
gSprites[mapObject->spriteId].affineAnimPaused = mapObject->spriteAffineAnimPausedBackup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -512,9 +512,9 @@ u32 oe_exec_and_other_stuff(u8 fieldEffectId, struct MapObject *mapObject)
|
|||||||
|
|
||||||
void DoShadowFieldEffect(struct MapObject *mapObject)
|
void DoShadowFieldEffect(struct MapObject *mapObject)
|
||||||
{
|
{
|
||||||
if (!mapObject->mapobj_bit_22)
|
if (!mapObject->hasShadow)
|
||||||
{
|
{
|
||||||
mapObject->mapobj_bit_22 = 1;
|
mapObject->hasShadow = 1;
|
||||||
oe_exec_and_other_stuff(FLDEFF_SHADOW, mapObject);
|
oe_exec_and_other_stuff(FLDEFF_SHADOW, mapObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -568,8 +568,8 @@ bool32 sub_8097E50(struct MapObject *mapObject, struct Sprite *sprite)
|
|||||||
|
|
||||||
if (ableToStore == TRUE)
|
if (ableToStore == TRUE)
|
||||||
{
|
{
|
||||||
mapObject->mapobj_bit_12 = TRUE;
|
mapObject->inanimate = TRUE;
|
||||||
mapObject->mapobj_bit_9 = TRUE;
|
mapObject->facingDirectionLocked = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprite->data[2] = 1;
|
sprite->data[2] = 1;
|
||||||
@ -596,8 +596,8 @@ bool32 sub_8097EF0(struct MapObject *mapObject, struct Sprite *sprite)
|
|||||||
FREE_AND_SET_NULL(gUnknown_020375B8);
|
FREE_AND_SET_NULL(gUnknown_020375B8);
|
||||||
if (ableToStore == TRUE)
|
if (ableToStore == TRUE)
|
||||||
{
|
{
|
||||||
mapObject->mapobj_bit_12 = GetFieldObjectGraphicsInfo(mapObject->graphicsId)->inanimate;
|
mapObject->inanimate = GetFieldObjectGraphicsInfo(mapObject->graphicsId)->inanimate;
|
||||||
mapObject->mapobj_bit_9 = 0;
|
mapObject->facingDirectionLocked = 0;
|
||||||
sprite->animPaused = 0;
|
sprite->animPaused = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -623,7 +623,7 @@ void sub_8097FA4(struct MapObject *mapObject)
|
|||||||
struct Task *task = &gTasks[taskId];
|
struct Task *task = &gTasks[taskId];
|
||||||
|
|
||||||
StoreWordInTwoHalfwords(&task->data[0], (u32)mapObject);
|
StoreWordInTwoHalfwords(&task->data[0], (u32)mapObject);
|
||||||
mapObject->mapobj_unk_1B = taskId;
|
mapObject->warpArrowSpriteId = taskId;
|
||||||
task->data[3] = 0xFFFF;
|
task->data[3] = 0xFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1185,7 +1185,7 @@ void mapldr_08084390(void)
|
|||||||
Overworld_PlaySpecialMapMusic();
|
Overworld_PlaySpecialMapMusic();
|
||||||
pal_fill_black();
|
pal_fill_black();
|
||||||
CreateTask(c3_080843F8, 0);
|
CreateTask(c3_080843F8, 0);
|
||||||
gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 1;
|
gMapObjects[gPlayerAvatar.mapObjectId].invisible = 1;
|
||||||
if (gPlayerAvatar.flags & 0x08)
|
if (gPlayerAvatar.flags & 0x08)
|
||||||
{
|
{
|
||||||
FieldObjectTurn(&gMapObjects[gPlayerAvatar.mapObjectId], DIR_WEST);
|
FieldObjectTurn(&gMapObjects[gPlayerAvatar.mapObjectId], DIR_WEST);
|
||||||
@ -1245,11 +1245,11 @@ bool8 sub_80B6BCC(struct Task *task) // gUnknown_0855C3C8[0]
|
|||||||
playerObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
playerObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
playerSprite = &gSprites[gPlayerAvatar.spriteId];
|
playerSprite = &gSprites[gPlayerAvatar.spriteId];
|
||||||
CameraObjectReset2();
|
CameraObjectReset2();
|
||||||
gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 1;
|
gMapObjects[gPlayerAvatar.mapObjectId].invisible = 1;
|
||||||
gPlayerAvatar.preventStep = TRUE;
|
gPlayerAvatar.preventStep = TRUE;
|
||||||
FieldObjectSetSpecialAnim(playerObject, GetFaceDirectionAnimId(player_get_direction_lower_nybble()));
|
FieldObjectSetSpecialAnim(playerObject, GetFaceDirectionAnimId(player_get_direction_lower_nybble()));
|
||||||
task->data[4] = playerSprite->subspriteMode;
|
task->data[4] = playerSprite->subspriteMode;
|
||||||
playerObject->mapobj_bit_26 = 1;
|
playerObject->fixedPriority = 1;
|
||||||
playerSprite->oam.priority = 1;
|
playerSprite->oam.priority = 1;
|
||||||
playerSprite->subspriteMode = 2;
|
playerSprite->subspriteMode = 2;
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
@ -1274,7 +1274,7 @@ bool8 sub_80B6C90(struct Task *task) // gUnknown_0855C3C8[2]
|
|||||||
sprite->pos2.y = -(sprite->pos1.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY + centerToCornerVecY);
|
sprite->pos2.y = -(sprite->pos1.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY + centerToCornerVecY);
|
||||||
task->data[1] = 1;
|
task->data[1] = 1;
|
||||||
task->data[2] = 0;
|
task->data[2] = 0;
|
||||||
gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 0;
|
gMapObjects[gPlayerAvatar.mapObjectId].invisible = 0;
|
||||||
PlaySE(SE_RU_HYUU);
|
PlaySE(SE_RU_HYUU);
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1299,15 +1299,15 @@ bool8 sub_80B6D04(struct Task *task)
|
|||||||
if (task->data[3] == 0 && sprite->pos2.y >= -16)
|
if (task->data[3] == 0 && sprite->pos2.y >= -16)
|
||||||
{
|
{
|
||||||
task->data[3]++;
|
task->data[3]++;
|
||||||
mapObject->mapobj_bit_26 = 0;
|
mapObject->fixedPriority = 0;
|
||||||
sprite->subspriteMode = task->data[4];
|
sprite->subspriteMode = task->data[4];
|
||||||
mapObject->mapobj_bit_2 = 1;
|
mapObject->triggerGroundEffectsOnMove = 1;
|
||||||
}
|
}
|
||||||
if (sprite->pos2.y >= 0)
|
if (sprite->pos2.y >= 0)
|
||||||
{
|
{
|
||||||
PlaySE(SE_W070);
|
PlaySE(SE_W070);
|
||||||
mapObject->mapobj_bit_3 = 1;
|
mapObject->triggerGroundEffectsOnStop = 1;
|
||||||
mapObject->mapobj_bit_5 = 1;
|
mapObject->landingJump = 1;
|
||||||
sprite->pos2.y = 0;
|
sprite->pos2.y = 0;
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
}
|
}
|
||||||
@ -1677,7 +1677,7 @@ bool8 sub_80B7478(struct Task *task, struct MapObject *mapObject)
|
|||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (MetatileBehavior_IsWaterfall(mapObject->mapobj_unk_1E))
|
if (MetatileBehavior_IsWaterfall(mapObject->currentMetatileBehavior))
|
||||||
{
|
{
|
||||||
task->data[0] = 3;
|
task->data[0] = 3;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1729,7 +1729,7 @@ bool8 dive_3_unknown(struct Task *task)
|
|||||||
PlayerGetDestCoords(&mapPosition.x, &mapPosition.y);
|
PlayerGetDestCoords(&mapPosition.x, &mapPosition.y);
|
||||||
if (!FieldEffectActiveListContains(FLDEFF_FIELD_MOVE_SHOW_MON))
|
if (!FieldEffectActiveListContains(FLDEFF_FIELD_MOVE_SHOW_MON))
|
||||||
{
|
{
|
||||||
dive_warp(&mapPosition, gMapObjects[gPlayerAvatar.mapObjectId].mapobj_unk_1E);
|
dive_warp(&mapPosition, gMapObjects[gPlayerAvatar.mapObjectId].currentMetatileBehavior);
|
||||||
DestroyTask(FindTaskIdByFunc(Task_Dive));
|
DestroyTask(FindTaskIdByFunc(Task_Dive));
|
||||||
FieldEffectActiveListRemove(FLDEFF_USE_DIVE);
|
FieldEffectActiveListRemove(FLDEFF_USE_DIVE);
|
||||||
}
|
}
|
||||||
@ -1755,7 +1755,7 @@ bool8 sub_80B764C(struct Task *task, struct MapObject *mapObject, struct Sprite
|
|||||||
CameraObjectReset2();
|
CameraObjectReset2();
|
||||||
SetCameraPanningCallback(NULL);
|
SetCameraPanningCallback(NULL);
|
||||||
gPlayerAvatar.preventStep = TRUE;
|
gPlayerAvatar.preventStep = TRUE;
|
||||||
mapObject->mapobj_bit_26 = 1;
|
mapObject->fixedPriority = 1;
|
||||||
task->data[1] = 1;
|
task->data[1] = 1;
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1778,8 +1778,8 @@ bool8 sub_80B76B8(struct Task *task, struct MapObject *mapObject, struct Sprite
|
|||||||
{
|
{
|
||||||
sprite->pos2.y = 0;
|
sprite->pos2.y = 0;
|
||||||
task->data[3] = 1;
|
task->data[3] = 1;
|
||||||
gFieldEffectArguments[0] = mapObject->coords2.x;
|
gFieldEffectArguments[0] = mapObject->currentCoords.x;
|
||||||
gFieldEffectArguments[1] = mapObject->coords2.y;
|
gFieldEffectArguments[1] = mapObject->currentCoords.y;
|
||||||
gFieldEffectArguments[2] = sprite->subpriority - 1;
|
gFieldEffectArguments[2] = sprite->subpriority - 1;
|
||||||
gFieldEffectArguments[3] = sprite->oam.priority;
|
gFieldEffectArguments[3] = sprite->oam.priority;
|
||||||
FieldEffectStart(FLDEFF_LAVARIDGE_GYM_WARP);
|
FieldEffectStart(FLDEFF_LAVARIDGE_GYM_WARP);
|
||||||
@ -1820,7 +1820,7 @@ bool8 sub_80B7704(struct Task *task, struct MapObject *mapObject, struct Sprite
|
|||||||
if (task->data[5] == 0 && sprite->pos2.y < -0x10)
|
if (task->data[5] == 0 && sprite->pos2.y < -0x10)
|
||||||
{
|
{
|
||||||
task->data[5]++;
|
task->data[5]++;
|
||||||
mapObject->mapobj_bit_26 = 1;
|
mapObject->fixedPriority = 1;
|
||||||
sprite->oam.priority = 1;
|
sprite->oam.priority = 1;
|
||||||
sprite->subspriteMode = 2;
|
sprite->subspriteMode = 2;
|
||||||
}
|
}
|
||||||
@ -1872,7 +1872,7 @@ bool8 sub_80B78EC(struct Task *task, struct MapObject *mapObject, struct Sprite
|
|||||||
CameraObjectReset2();
|
CameraObjectReset2();
|
||||||
FreezeMapObjects();
|
FreezeMapObjects();
|
||||||
gPlayerAvatar.preventStep = TRUE;
|
gPlayerAvatar.preventStep = TRUE;
|
||||||
mapObject->mapobj_bit_13 = 1;
|
mapObject->invisible = 1;
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1881,8 +1881,8 @@ bool8 sub_80B791C(struct Task *task, struct MapObject *mapObject, struct Sprite
|
|||||||
{
|
{
|
||||||
if (IsWeatherNotFadingIn())
|
if (IsWeatherNotFadingIn())
|
||||||
{
|
{
|
||||||
gFieldEffectArguments[0] = mapObject->coords2.x;
|
gFieldEffectArguments[0] = mapObject->currentCoords.x;
|
||||||
gFieldEffectArguments[1] = mapObject->coords2.y;
|
gFieldEffectArguments[1] = mapObject->currentCoords.y;
|
||||||
gFieldEffectArguments[2] = sprite->subpriority - 1;
|
gFieldEffectArguments[2] = sprite->subpriority - 1;
|
||||||
gFieldEffectArguments[3] = sprite->oam.priority;
|
gFieldEffectArguments[3] = sprite->oam.priority;
|
||||||
task->data[1] = FieldEffectStart(FLDEFF_POP_OUT_OF_ASH);
|
task->data[1] = FieldEffectStart(FLDEFF_POP_OUT_OF_ASH);
|
||||||
@ -1897,7 +1897,7 @@ bool8 sub_80B7968(struct Task *task, struct MapObject *mapObject, struct Sprite
|
|||||||
if (sprite->animCmdIndex > 1)
|
if (sprite->animCmdIndex > 1)
|
||||||
{
|
{
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
mapObject->mapobj_bit_13 = 0;
|
mapObject->invisible = 0;
|
||||||
CameraObjectReset1();
|
CameraObjectReset1();
|
||||||
PlaySE(SE_W091);
|
PlaySE(SE_W091);
|
||||||
FieldObjectSetSpecialAnim(mapObject, sub_8093514(DIR_EAST));
|
FieldObjectSetSpecialAnim(mapObject, sub_8093514(DIR_EAST));
|
||||||
@ -1954,7 +1954,7 @@ bool8 sub_80B7AE8(struct Task *task, struct MapObject *mapObject, struct Sprite
|
|||||||
FreezeMapObjects();
|
FreezeMapObjects();
|
||||||
CameraObjectReset2();
|
CameraObjectReset2();
|
||||||
gPlayerAvatar.preventStep = TRUE;
|
gPlayerAvatar.preventStep = TRUE;
|
||||||
mapObject->mapobj_bit_26 = 1;
|
mapObject->fixedPriority = 1;
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1965,8 +1965,8 @@ bool8 sub_80B7B18(struct Task *task, struct MapObject *mapObject, struct Sprite
|
|||||||
{
|
{
|
||||||
if (task->data[1] > 3)
|
if (task->data[1] > 3)
|
||||||
{
|
{
|
||||||
gFieldEffectArguments[0] = mapObject->coords2.x;
|
gFieldEffectArguments[0] = mapObject->currentCoords.x;
|
||||||
gFieldEffectArguments[1] = mapObject->coords2.y;
|
gFieldEffectArguments[1] = mapObject->currentCoords.y;
|
||||||
gFieldEffectArguments[2] = sprite->subpriority - 1;
|
gFieldEffectArguments[2] = sprite->subpriority - 1;
|
||||||
gFieldEffectArguments[3] = sprite->oam.priority;
|
gFieldEffectArguments[3] = sprite->oam.priority;
|
||||||
task->data[1] = FieldEffectStart(FLDEFF_POP_OUT_OF_ASH);
|
task->data[1] = FieldEffectStart(FLDEFF_POP_OUT_OF_ASH);
|
||||||
@ -1974,7 +1974,7 @@ bool8 sub_80B7B18(struct Task *task, struct MapObject *mapObject, struct Sprite
|
|||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
task->data[1]++;
|
task->data[1]++;
|
||||||
FieldObjectSetSpecialAnim(mapObject, GetStepInPlaceDelay4AnimId(mapObject->mapobj_unk_18));
|
FieldObjectSetSpecialAnim(mapObject, GetStepInPlaceDelay4AnimId(mapObject->facingDirection));
|
||||||
PlaySE(SE_FU_ZUZUZU);
|
PlaySE(SE_FU_ZUZUZU);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1985,7 +1985,7 @@ bool8 sub_80B7B94(struct Task *task, struct MapObject *mapObject, struct Sprite
|
|||||||
{
|
{
|
||||||
if (gSprites[task->data[1]].animCmdIndex == 2)
|
if (gSprites[task->data[1]].animCmdIndex == 2)
|
||||||
{
|
{
|
||||||
mapObject->mapobj_bit_13 = 1;
|
mapObject->invisible = 1;
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -2076,7 +2076,7 @@ void sub_80B7D34(struct Task *task)
|
|||||||
DestroyTask(FindTaskIdByFunc(sub_80B7CE4));
|
DestroyTask(FindTaskIdByFunc(sub_80B7CE4));
|
||||||
} else if (task->data[1] == 0 || (--task->data[1]) == 0)
|
} else if (task->data[1] == 0 || (--task->data[1]) == 0)
|
||||||
{
|
{
|
||||||
FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(spinDirections[mapObject->mapobj_unk_18]));
|
FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(spinDirections[mapObject->facingDirection]));
|
||||||
if (task->data[2] < 12)
|
if (task->data[2] < 12)
|
||||||
{
|
{
|
||||||
task->data[2]++;
|
task->data[2]++;
|
||||||
@ -2100,7 +2100,7 @@ void mapldr_080859D4(void)
|
|||||||
ScriptContext2_Enable();
|
ScriptContext2_Enable();
|
||||||
FreezeMapObjects();
|
FreezeMapObjects();
|
||||||
gFieldCallback = NULL;
|
gFieldCallback = NULL;
|
||||||
gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 1;
|
gMapObjects[gPlayerAvatar.mapObjectId].invisible = 1;
|
||||||
CreateTask(sub_80B7E94, 0);
|
CreateTask(sub_80B7E94, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2130,20 +2130,20 @@ void sub_80B7EE8(struct Task *task)
|
|||||||
}
|
}
|
||||||
if (task->data[2] >= 32 && task->data[15] == player_get_direction_lower_nybble())
|
if (task->data[2] >= 32 && task->data[15] == player_get_direction_lower_nybble())
|
||||||
{
|
{
|
||||||
mapObject->mapobj_bit_13 = 0;
|
mapObject->invisible = 0;
|
||||||
ScriptContext2_Disable();
|
ScriptContext2_Disable();
|
||||||
UnfreezeMapObjects();
|
UnfreezeMapObjects();
|
||||||
DestroyTask(FindTaskIdByFunc(sub_80B7E94));
|
DestroyTask(FindTaskIdByFunc(sub_80B7E94));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(spinDirections[mapObject->mapobj_unk_18]));
|
FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(spinDirections[mapObject->facingDirection]));
|
||||||
if (task->data[2] < 32)
|
if (task->data[2] < 32)
|
||||||
{
|
{
|
||||||
task->data[2]++;
|
task->data[2]++;
|
||||||
}
|
}
|
||||||
task->data[1] = task->data[2] >> 2;
|
task->data[1] = task->data[2] >> 2;
|
||||||
}
|
}
|
||||||
mapObject->mapobj_bit_13 ^= 1;
|
mapObject->invisible ^= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ExecuteTeleportFieldEffectTask(u8);
|
static void ExecuteTeleportFieldEffectTask(u8);
|
||||||
@ -2185,11 +2185,11 @@ static void TeleportFieldEffectTask2(struct Task *task)
|
|||||||
struct MapObject *mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
if (task->data[1] == 0 || (--task->data[1]) == 0)
|
if (task->data[1] == 0 || (--task->data[1]) == 0)
|
||||||
{
|
{
|
||||||
FieldObjectTurn(mapObject, spinDirections[mapObject->mapobj_unk_18]);
|
FieldObjectTurn(mapObject, spinDirections[mapObject->facingDirection]);
|
||||||
task->data[1] = 8;
|
task->data[1] = 8;
|
||||||
task->data[2]++;
|
task->data[2]++;
|
||||||
}
|
}
|
||||||
if (task->data[2] > 7 && task->data[15] == mapObject->mapobj_unk_18)
|
if (task->data[2] > 7 && task->data[15] == mapObject->facingDirection)
|
||||||
{
|
{
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
task->data[1] = 4;
|
task->data[1] = 4;
|
||||||
@ -2207,7 +2207,7 @@ static void TeleportFieldEffectTask3(struct Task *task)
|
|||||||
if ((--task->data[1]) <= 0)
|
if ((--task->data[1]) <= 0)
|
||||||
{
|
{
|
||||||
task->data[1] = 4;
|
task->data[1] = 4;
|
||||||
FieldObjectTurn(mapObject, spinDirections[mapObject->mapobj_unk_18]);
|
FieldObjectTurn(mapObject, spinDirections[mapObject->facingDirection]);
|
||||||
}
|
}
|
||||||
sprite->pos1.y -= task->data[3];
|
sprite->pos1.y -= task->data[3];
|
||||||
task->data[4] += task->data[3];
|
task->data[4] += task->data[3];
|
||||||
@ -2257,7 +2257,7 @@ static void mapldr_08085D88(void)
|
|||||||
ScriptContext2_Enable();
|
ScriptContext2_Enable();
|
||||||
FreezeMapObjects();
|
FreezeMapObjects();
|
||||||
gFieldCallback = NULL;
|
gFieldCallback = NULL;
|
||||||
gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 1;
|
gMapObjects[gPlayerAvatar.mapObjectId].invisible = 1;
|
||||||
CameraObjectReset2();
|
CameraObjectReset2();
|
||||||
CreateTask(sub_80B8250, 0);
|
CreateTask(sub_80B8250, 0);
|
||||||
}
|
}
|
||||||
@ -2282,7 +2282,7 @@ void sub_80B8280(struct Task *task)
|
|||||||
sprite = &gSprites[gPlayerAvatar.spriteId];
|
sprite = &gSprites[gPlayerAvatar.spriteId];
|
||||||
centerToCornerVecY = -(sprite->centerToCornerVecY << 1);
|
centerToCornerVecY = -(sprite->centerToCornerVecY << 1);
|
||||||
sprite->pos2.y = -(sprite->pos1.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY + centerToCornerVecY);
|
sprite->pos2.y = -(sprite->pos1.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY + centerToCornerVecY);
|
||||||
gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 0;
|
gMapObjects[gPlayerAvatar.mapObjectId].invisible = 0;
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
task->data[1] = 8;
|
task->data[1] = 8;
|
||||||
task->data[2] = 1;
|
task->data[2] = 1;
|
||||||
@ -2302,7 +2302,7 @@ void sub_80B830C(struct Task *task)
|
|||||||
if (task->data[13] == 0)
|
if (task->data[13] == 0)
|
||||||
{
|
{
|
||||||
task->data[13]++;
|
task->data[13]++;
|
||||||
mapObject->mapobj_bit_2 = 1;
|
mapObject->triggerGroundEffectsOnMove = 1;
|
||||||
sprite->subspriteMode = task->data[14];
|
sprite->subspriteMode = task->data[14];
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -2320,7 +2320,7 @@ void sub_80B830C(struct Task *task)
|
|||||||
if ((--task->data[2]) == 0)
|
if ((--task->data[2]) == 0)
|
||||||
{
|
{
|
||||||
task->data[2] = 4;
|
task->data[2] = 4;
|
||||||
FieldObjectTurn(mapObject, spinDirections[mapObject->mapobj_unk_18]);
|
FieldObjectTurn(mapObject, spinDirections[mapObject->facingDirection]);
|
||||||
}
|
}
|
||||||
if (sprite->pos2.y >= 0)
|
if (sprite->pos2.y >= 0)
|
||||||
{
|
{
|
||||||
@ -2337,9 +2337,9 @@ void sub_80B8410(struct Task *task)
|
|||||||
struct MapObject *mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
if ((--task->data[1]) == 0)
|
if ((--task->data[1]) == 0)
|
||||||
{
|
{
|
||||||
FieldObjectTurn(mapObject, spinDirections[mapObject->mapobj_unk_18]);
|
FieldObjectTurn(mapObject, spinDirections[mapObject->facingDirection]);
|
||||||
task->data[1] = 8;
|
task->data[1] = 8;
|
||||||
if ((++task->data[2]) > 4 && task->data[14] == mapObject->mapobj_unk_18)
|
if ((++task->data[2]) > 4 && task->data[14] == mapObject->facingDirection)
|
||||||
{
|
{
|
||||||
ScriptContext2_Disable();
|
ScriptContext2_Disable();
|
||||||
CameraObjectReset1();
|
CameraObjectReset1();
|
||||||
@ -2897,7 +2897,7 @@ void sub_80B8DB4(struct Task *task)
|
|||||||
gPlayerAvatar.preventStep = TRUE;
|
gPlayerAvatar.preventStep = TRUE;
|
||||||
SetPlayerAvatarStateMask(8);
|
SetPlayerAvatarStateMask(8);
|
||||||
PlayerGetDestCoords(&task->data[1], &task->data[2]);
|
PlayerGetDestCoords(&task->data[1], &task->data[2]);
|
||||||
MoveCoords(gMapObjects[gPlayerAvatar.mapObjectId].placeholder18, &task->data[1], &task->data[2]);
|
MoveCoords(gMapObjects[gPlayerAvatar.mapObjectId].movementDirection, &task->data[1], &task->data[2]);
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2933,11 +2933,11 @@ void sub_80B8EA8(struct Task *task)
|
|||||||
mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
FieldObjectSetGraphicsId(mapObject, GetPlayerAvatarGraphicsIdByStateId(3));
|
FieldObjectSetGraphicsId(mapObject, GetPlayerAvatarGraphicsIdByStateId(3));
|
||||||
FieldObjectClearAnimIfSpecialAnimFinished(mapObject);
|
FieldObjectClearAnimIfSpecialAnimFinished(mapObject);
|
||||||
FieldObjectSetSpecialAnim(mapObject, sub_8093540(mapObject->placeholder18));
|
FieldObjectSetSpecialAnim(mapObject, sub_8093540(mapObject->movementDirection));
|
||||||
gFieldEffectArguments[0] = task->data[1];
|
gFieldEffectArguments[0] = task->data[1];
|
||||||
gFieldEffectArguments[1] = task->data[2];
|
gFieldEffectArguments[1] = task->data[2];
|
||||||
gFieldEffectArguments[2] = gPlayerAvatar.mapObjectId;
|
gFieldEffectArguments[2] = gPlayerAvatar.mapObjectId;
|
||||||
mapObject->mapobj_unk_1A = FieldEffectStart(FLDEFF_SURF_BLOB);
|
mapObject->fieldEffectSpriteId = FieldEffectStart(FLDEFF_SURF_BLOB);
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2950,8 +2950,8 @@ void sub_80B8F24(struct Task *task)
|
|||||||
{
|
{
|
||||||
gPlayerAvatar.preventStep = FALSE;
|
gPlayerAvatar.preventStep = FALSE;
|
||||||
gPlayerAvatar.flags &= 0xdf;
|
gPlayerAvatar.flags &= 0xdf;
|
||||||
FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(mapObject->placeholder18));
|
FieldObjectSetSpecialAnim(mapObject, GetFaceDirectionAnimId(mapObject->movementDirection));
|
||||||
sub_81555AC(mapObject->mapobj_unk_1A, 1);
|
sub_81555AC(mapObject->fieldEffectSpriteId, 1);
|
||||||
UnfreezeMapObjects();
|
UnfreezeMapObjects();
|
||||||
ScriptContext2_Disable();
|
ScriptContext2_Disable();
|
||||||
FieldEffectActiveListRemove(FLDEFF_USE_SURF);
|
FieldEffectActiveListRemove(FLDEFF_USE_SURF);
|
||||||
@ -3238,8 +3238,8 @@ void sub_80B92A0(struct Task *task)
|
|||||||
mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
if (task->data[15] & 0x08)
|
if (task->data[15] & 0x08)
|
||||||
{
|
{
|
||||||
sub_81555AC(mapObject->mapobj_unk_1A, 2);
|
sub_81555AC(mapObject->fieldEffectSpriteId, 2);
|
||||||
sub_81555D8(mapObject->mapobj_unk_1A, 0);
|
sub_81555D8(mapObject->fieldEffectSpriteId, 0);
|
||||||
}
|
}
|
||||||
task->data[1] = sub_80B94C4();
|
task->data[1] = sub_80B94C4();
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
@ -3277,11 +3277,11 @@ void sub_80B9390(struct Task *task)
|
|||||||
mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
FieldObjectSetGraphicsId(mapObject, GetPlayerAvatarGraphicsIdByStateId(0x03));
|
FieldObjectSetGraphicsId(mapObject, GetPlayerAvatarGraphicsIdByStateId(0x03));
|
||||||
StartSpriteAnim(&gSprites[mapObject->spriteId], 0x16);
|
StartSpriteAnim(&gSprites[mapObject->spriteId], 0x16);
|
||||||
mapObject->mapobj_bit_12 = 1;
|
mapObject->inanimate = 1;
|
||||||
FieldObjectSetSpecialAnim(mapObject, 0x48);
|
FieldObjectSetSpecialAnim(mapObject, 0x48);
|
||||||
if (task->data[15] & 0x08)
|
if (task->data[15] & 0x08)
|
||||||
{
|
{
|
||||||
DestroySprite(&gSprites[mapObject->mapobj_unk_1A]);
|
DestroySprite(&gSprites[mapObject->fieldEffectSpriteId]);
|
||||||
}
|
}
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
task->data[2] = 0;
|
task->data[2] = 0;
|
||||||
@ -3295,8 +3295,8 @@ void sub_80B9418(struct Task *task)
|
|||||||
{
|
{
|
||||||
mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
FieldObjectClearAnimIfSpecialAnimActive(mapObject);
|
FieldObjectClearAnimIfSpecialAnimActive(mapObject);
|
||||||
mapObject->mapobj_bit_12 = 0;
|
mapObject->inanimate = 0;
|
||||||
mapObject->mapobj_bit_22 = 0;
|
mapObject->hasShadow = 0;
|
||||||
sub_80B9560(task->data[1], mapObject->spriteId);
|
sub_80B9560(task->data[1], mapObject->spriteId);
|
||||||
CameraObjectReset2();
|
CameraObjectReset2();
|
||||||
task->data[0]++;
|
task->data[0]++;
|
||||||
@ -3513,13 +3513,13 @@ void sub_80B9804(struct Task *task)
|
|||||||
SetPlayerAvatarStateMask(0x01);
|
SetPlayerAvatarStateMask(0x01);
|
||||||
if (task->data[15] & 0x08)
|
if (task->data[15] & 0x08)
|
||||||
{
|
{
|
||||||
sub_81555AC(mapObject->mapobj_unk_1A, 0);
|
sub_81555AC(mapObject->fieldEffectSpriteId, 0);
|
||||||
}
|
}
|
||||||
FieldObjectSetGraphicsId(mapObject, GetPlayerAvatarGraphicsIdByStateId(0x3));
|
FieldObjectSetGraphicsId(mapObject, GetPlayerAvatarGraphicsIdByStateId(0x3));
|
||||||
CameraObjectReset2();
|
CameraObjectReset2();
|
||||||
FieldObjectTurn(mapObject, DIR_WEST);
|
FieldObjectTurn(mapObject, DIR_WEST);
|
||||||
StartSpriteAnim(&gSprites[mapObject->spriteId], 0x16);
|
StartSpriteAnim(&gSprites[mapObject->spriteId], 0x16);
|
||||||
mapObject->mapobj_bit_13 = 0;
|
mapObject->invisible = 0;
|
||||||
task->data[1] = sub_80B94C4();
|
task->data[1] = sub_80B94C4();
|
||||||
sub_80B9524(task->data[1]);
|
sub_80B9524(task->data[1]);
|
||||||
sub_80B9560(task->data[1], mapObject->spriteId);
|
sub_80B9560(task->data[1], mapObject->spriteId);
|
||||||
@ -3582,8 +3582,8 @@ void sub_80B9978(struct Task *task)
|
|||||||
{
|
{
|
||||||
mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
sprite = &gSprites[mapObject->spriteId];
|
sprite = &gSprites[mapObject->spriteId];
|
||||||
mapObject->mapobj_bit_12 = 0;
|
mapObject->inanimate = 0;
|
||||||
sub_808EB08(mapObject, mapObject->coords2.x, mapObject->coords2.y);
|
sub_808EB08(mapObject, mapObject->currentCoords.x, mapObject->currentCoords.y);
|
||||||
sprite->pos2.x = 0;
|
sprite->pos2.x = 0;
|
||||||
sprite->pos2.y = 0;
|
sprite->pos2.y = 0;
|
||||||
sprite->coordOffsetEnabled = 1;
|
sprite->coordOffsetEnabled = 1;
|
||||||
@ -3623,7 +3623,7 @@ void sub_80B9A60(struct Task *task)
|
|||||||
if (task->data[15] & 0x08)
|
if (task->data[15] & 0x08)
|
||||||
{
|
{
|
||||||
state = 3;
|
state = 3;
|
||||||
sub_81555AC(mapObject->mapobj_unk_1A, 1);
|
sub_81555AC(mapObject->fieldEffectSpriteId, 1);
|
||||||
}
|
}
|
||||||
FieldObjectSetGraphicsId(mapObject, GetPlayerAvatarGraphicsIdByStateId(state));
|
FieldObjectSetGraphicsId(mapObject, GetPlayerAvatarGraphicsIdByStateId(state));
|
||||||
FieldObjectTurn(mapObject, DIR_SOUTH);
|
FieldObjectTurn(mapObject, DIR_SOUTH);
|
||||||
@ -3723,7 +3723,7 @@ void sub_80B9C54(s16* data, u8 taskId)
|
|||||||
if (++data[3] > 0x78)
|
if (++data[3] > 0x78)
|
||||||
{
|
{
|
||||||
struct Sprite *sprite = &gSprites[gMapObjects[data[2]].spriteId];
|
struct Sprite *sprite = &gSprites[gMapObjects[data[2]].spriteId];
|
||||||
gMapObjects[data[2]].mapobj_bit_13 = TRUE;
|
gMapObjects[data[2]].invisible = TRUE;
|
||||||
BlendPalettes(0x0000FFFF, 0x10, RGB_WHITE);
|
BlendPalettes(0x0000FFFF, 0x10, RGB_WHITE);
|
||||||
BeginNormalPaletteFade(0x0000FFFF, 0, 0x10, 0, RGB_WHITE);
|
BeginNormalPaletteFade(0x0000FFFF, 0, 0x10, 0, RGB_WHITE);
|
||||||
sub_80B9D24(sprite);
|
sub_80B9D24(sprite);
|
||||||
@ -3845,8 +3845,8 @@ bool8 sub_80B9E28(struct Sprite* sprite)
|
|||||||
int xPos, yPos;
|
int xPos, yPos;
|
||||||
u8 taskId;
|
u8 taskId;
|
||||||
object = &gMapObjects[mapObjectIdBuffer];
|
object = &gMapObjects[mapObjectIdBuffer];
|
||||||
xPos = object->coords2.x - 7;
|
xPos = object->currentCoords.x - 7;
|
||||||
yPos = object->coords2.y - 7;
|
yPos = object->currentCoords.y - 7;
|
||||||
xPos = (gFieldEffectArguments[3] - xPos) * 16;
|
xPos = (gFieldEffectArguments[3] - xPos) * 16;
|
||||||
yPos = (gFieldEffectArguments[4] - yPos) * 16;
|
yPos = (gFieldEffectArguments[4] - yPos) * 16;
|
||||||
npc_coords_shift(object, gFieldEffectArguments[3] + 7, gFieldEffectArguments[4] + 7);
|
npc_coords_shift(object, gFieldEffectArguments[3] + 7, gFieldEffectArguments[4] + 7);
|
||||||
@ -3888,7 +3888,7 @@ void sub_80B9EDC(u8 taskId)
|
|||||||
sprite->pos1.x = data[2];
|
sprite->pos1.x = data[2];
|
||||||
sprite->pos1.y = data[3];
|
sprite->pos1.y = data[3];
|
||||||
npc_coords_shift_still(object);
|
npc_coords_shift_still(object);
|
||||||
object->mapobj_bit_3 = TRUE;
|
object->triggerGroundEffectsOnStop = TRUE;
|
||||||
FieldEffectActiveListRemove(0x42);
|
FieldEffectActiveListRemove(0x42);
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
}
|
}
|
||||||
|
@ -346,7 +346,7 @@ void sub_80FB6EC(void)
|
|||||||
void sub_80FB768(void)
|
void sub_80FB768(void)
|
||||||
{
|
{
|
||||||
sub_80FB6EC();
|
sub_80FB6EC();
|
||||||
gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = TRUE;
|
gMapObjects[gPlayerAvatar.mapObjectId].invisible = TRUE;
|
||||||
pal_fill_black();
|
pal_fill_black();
|
||||||
CreateTask(Task_HandlePorthole, 80);
|
CreateTask(Task_HandlePorthole, 80);
|
||||||
ScriptContext2_Enable();
|
ScriptContext2_Enable();
|
||||||
|
@ -54,7 +54,7 @@ static void sub_8098400(u8 taskId)
|
|||||||
sub_808B864();
|
sub_808B864();
|
||||||
task->data[0] = 1;
|
task->data[0] = 1;
|
||||||
}
|
}
|
||||||
if (!task->data[1] && !gMapObjects[gSelectedMapObject].mapobj_bit_1)
|
if (!task->data[1] && !gMapObjects[gSelectedMapObject].singleMovementActive)
|
||||||
{
|
{
|
||||||
FreezeMapObject(&gMapObjects[gSelectedMapObject]);
|
FreezeMapObject(&gMapObjects[gSelectedMapObject]);
|
||||||
task->data[1] = 1;
|
task->data[1] = 1;
|
||||||
@ -81,7 +81,7 @@ void LockSelectedMapObject(void)
|
|||||||
u8 taskId;
|
u8 taskId;
|
||||||
FreezeMapObjectsExceptOne(gSelectedMapObject);
|
FreezeMapObjectsExceptOne(gSelectedMapObject);
|
||||||
taskId = CreateTask(sub_8098400, 80);
|
taskId = CreateTask(sub_8098400, 80);
|
||||||
if (!gMapObjects[gSelectedMapObject].mapobj_bit_1)
|
if (!gMapObjects[gSelectedMapObject].singleMovementActive)
|
||||||
{
|
{
|
||||||
FreezeMapObject(&gMapObjects[gSelectedMapObject]);
|
FreezeMapObject(&gMapObjects[gSelectedMapObject]);
|
||||||
gTasks[taskId].data[1] = 1;
|
gTasks[taskId].data[1] = 1;
|
||||||
@ -128,7 +128,7 @@ static void sub_80985BC(u8 taskId)
|
|||||||
sub_808B864();
|
sub_808B864();
|
||||||
task->data[0] = 1;
|
task->data[0] = 1;
|
||||||
}
|
}
|
||||||
if (!task->data[1] && !gMapObjects[mapObjectId].mapobj_bit_1)
|
if (!task->data[1] && !gMapObjects[mapObjectId].singleMovementActive)
|
||||||
{
|
{
|
||||||
FreezeMapObject(&gMapObjects[mapObjectId]);
|
FreezeMapObject(&gMapObjects[mapObjectId]);
|
||||||
task->data[1] = 1;
|
task->data[1] = 1;
|
||||||
@ -147,14 +147,14 @@ void sub_8098630(void)
|
|||||||
sub_8098074(trainerObjectId1, trainerObjectId2);
|
sub_8098074(trainerObjectId1, trainerObjectId2);
|
||||||
taskId = CreateTask(sub_80985BC, 80);
|
taskId = CreateTask(sub_80985BC, 80);
|
||||||
gTasks[taskId].data[2] = trainerObjectId1;
|
gTasks[taskId].data[2] = trainerObjectId1;
|
||||||
if(!gMapObjects[trainerObjectId1].mapobj_bit_1)
|
if(!gMapObjects[trainerObjectId1].singleMovementActive)
|
||||||
{
|
{
|
||||||
FreezeMapObject(&gMapObjects[trainerObjectId1]);
|
FreezeMapObject(&gMapObjects[trainerObjectId1]);
|
||||||
gTasks[taskId].data[1] = 1;
|
gTasks[taskId].data[1] = 1;
|
||||||
}
|
}
|
||||||
taskId = CreateTask(sub_80985BC, 81);
|
taskId = CreateTask(sub_80985BC, 81);
|
||||||
gTasks[taskId].data[2] = trainerObjectId2;
|
gTasks[taskId].data[2] = trainerObjectId2;
|
||||||
if(!gMapObjects[trainerObjectId2].mapobj_bit_1)
|
if(!gMapObjects[trainerObjectId2].singleMovementActive)
|
||||||
{
|
{
|
||||||
FreezeMapObject(&gMapObjects[trainerObjectId2]);
|
FreezeMapObject(&gMapObjects[trainerObjectId2]);
|
||||||
gTasks[taskId].data[1] = 1;
|
gTasks[taskId].data[1] = 1;
|
||||||
@ -165,7 +165,7 @@ void sub_8098630(void)
|
|||||||
FreezeMapObjectsExceptOne(trainerObjectId1);
|
FreezeMapObjectsExceptOne(trainerObjectId1);
|
||||||
taskId = CreateTask(sub_80985BC, 80);
|
taskId = CreateTask(sub_80985BC, 80);
|
||||||
gTasks[taskId].data[2] = trainerObjectId1;
|
gTasks[taskId].data[2] = trainerObjectId1;
|
||||||
if(!gMapObjects[trainerObjectId1].mapobj_bit_1)
|
if(!gMapObjects[trainerObjectId1].singleMovementActive)
|
||||||
{
|
{
|
||||||
FreezeMapObject(&gMapObjects[trainerObjectId1]);
|
FreezeMapObject(&gMapObjects[trainerObjectId1]);
|
||||||
gTasks[taskId].data[1] = 1;
|
gTasks[taskId].data[1] = 1;
|
||||||
|
@ -2202,7 +2202,7 @@ static void sub_8086A68(void)
|
|||||||
|
|
||||||
static void sub_8086A80(void)
|
static void sub_8086A80(void)
|
||||||
{
|
{
|
||||||
gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_15 = 1;
|
gMapObjects[gPlayerAvatar.mapObjectId].trackedByCamera = 1;
|
||||||
InitCameraUpdateCallback(gPlayerAvatar.spriteId);
|
InitCameraUpdateCallback(gPlayerAvatar.spriteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2921,7 +2921,7 @@ static void SpawnLinkPlayerMapObject(u8 linkPlayerId, s16 x, s16 y, u8 a4)
|
|||||||
linkPlayerMapObj->mode = 0;
|
linkPlayerMapObj->mode = 0;
|
||||||
|
|
||||||
mapObj->active = 1;
|
mapObj->active = 1;
|
||||||
mapObj->mapobj_bit_1 = a4;
|
mapObj->singleMovementActive = a4;
|
||||||
mapObj->range.as_byte = 2;
|
mapObj->range.as_byte = 2;
|
||||||
mapObj->spriteId = 64;
|
mapObj->spriteId = 64;
|
||||||
|
|
||||||
@ -2930,12 +2930,12 @@ static void SpawnLinkPlayerMapObject(u8 linkPlayerId, s16 x, s16 y, u8 a4)
|
|||||||
|
|
||||||
static void InitLinkPlayerMapObjectPos(struct MapObject *mapObj, s16 x, s16 y)
|
static void InitLinkPlayerMapObjectPos(struct MapObject *mapObj, s16 x, s16 y)
|
||||||
{
|
{
|
||||||
mapObj->coords2.x = x;
|
mapObj->currentCoords.x = x;
|
||||||
mapObj->coords2.y = y;
|
mapObj->currentCoords.y = y;
|
||||||
mapObj->coords3.x = x;
|
mapObj->previousCoords.x = x;
|
||||||
mapObj->coords3.y = y;
|
mapObj->previousCoords.y = y;
|
||||||
sub_8093038(x, y, &mapObj->coords1.x, &mapObj->coords1.y);
|
sub_8093038(x, y, &mapObj->initialCoords.x, &mapObj->initialCoords.y);
|
||||||
mapObj->coords1.x += 8;
|
mapObj->initialCoords.x += 8;
|
||||||
FieldObjectUpdateZCoord(mapObj);
|
FieldObjectUpdateZCoord(mapObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2971,8 +2971,8 @@ static void sub_8087878(u8 linkPlayerId, u16 *x, u16 *y)
|
|||||||
{
|
{
|
||||||
u8 mapObjId = gLinkPlayerMapObjects[linkPlayerId].mapObjId;
|
u8 mapObjId = gLinkPlayerMapObjects[linkPlayerId].mapObjId;
|
||||||
struct MapObject *mapObj = &gMapObjects[mapObjId];
|
struct MapObject *mapObj = &gMapObjects[mapObjId];
|
||||||
*x = mapObj->coords2.x;
|
*x = mapObj->currentCoords.x;
|
||||||
*y = mapObj->coords2.y;
|
*y = mapObj->currentCoords.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 sub_80878A0(u8 linkPlayerId)
|
static u8 sub_80878A0(u8 linkPlayerId)
|
||||||
@ -2986,14 +2986,14 @@ static u8 sub_80878C0(u8 linkPlayerId)
|
|||||||
{
|
{
|
||||||
u8 mapObjId = gLinkPlayerMapObjects[linkPlayerId].mapObjId;
|
u8 mapObjId = gLinkPlayerMapObjects[linkPlayerId].mapObjId;
|
||||||
struct MapObject *mapObj = &gMapObjects[mapObjId];
|
struct MapObject *mapObj = &gMapObjects[mapObjId];
|
||||||
return mapObj->mapobj_unk_0B_0;
|
return mapObj->currentElevation;
|
||||||
}
|
}
|
||||||
|
|
||||||
static s32 sub_80878E4(u8 linkPlayerId)
|
static s32 sub_80878E4(u8 linkPlayerId)
|
||||||
{
|
{
|
||||||
u8 mapObjId = gLinkPlayerMapObjects[linkPlayerId].mapObjId;
|
u8 mapObjId = gLinkPlayerMapObjects[linkPlayerId].mapObjId;
|
||||||
struct MapObject *mapObj = &gMapObjects[mapObjId];
|
struct MapObject *mapObj = &gMapObjects[mapObjId];
|
||||||
return 16 - (s8)mapObj->mapobj_unk_21;
|
return 16 - (s8)mapObj->directionSequenceIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 GetLinkPlayerIdAt(s16 x, s16 y)
|
static u8 GetLinkPlayerIdAt(s16 x, s16 y)
|
||||||
@ -3005,7 +3005,7 @@ static u8 GetLinkPlayerIdAt(s16 x, s16 y)
|
|||||||
&& (gLinkPlayerMapObjects[i].mode == 0 || gLinkPlayerMapObjects[i].mode == 2))
|
&& (gLinkPlayerMapObjects[i].mode == 0 || gLinkPlayerMapObjects[i].mode == 2))
|
||||||
{
|
{
|
||||||
struct MapObject *mapObj = &gMapObjects[gLinkPlayerMapObjects[i].mapObjId];
|
struct MapObject *mapObj = &gMapObjects[gLinkPlayerMapObjects[i].mapObjId];
|
||||||
if (mapObj->coords2.x == x && mapObj->coords2.y == y)
|
if (mapObj->currentCoords.x == x && mapObj->currentCoords.y == y)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3021,7 +3021,7 @@ static void sub_808796C(u8 linkPlayerId, u8 a2)
|
|||||||
if (linkPlayerMapObj->active)
|
if (linkPlayerMapObj->active)
|
||||||
{
|
{
|
||||||
if (a2 > 10)
|
if (a2 > 10)
|
||||||
mapObj->mapobj_bit_2 = 1;
|
mapObj->triggerGroundEffectsOnMove = 1;
|
||||||
else
|
else
|
||||||
gUnknown_08339E00[gUnknown_08339DC8[linkPlayerMapObj->mode](linkPlayerMapObj, mapObj, a2)](linkPlayerMapObj, mapObj);
|
gUnknown_08339E00[gUnknown_08339DC8[linkPlayerMapObj->mode](linkPlayerMapObj, mapObj, a2)](linkPlayerMapObj, mapObj);
|
||||||
}
|
}
|
||||||
@ -3060,7 +3060,7 @@ static u8 sub_8087A20(struct LinkPlayerMapObject *linkPlayerMapObj, struct MapOb
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mapObj->mapobj_unk_21 = 16;
|
mapObj->directionSequenceIndex = 16;
|
||||||
npc_coords_shift(mapObj, x, y);
|
npc_coords_shift(mapObj, x, y);
|
||||||
FieldObjectUpdateZCoord(mapObj);
|
FieldObjectUpdateZCoord(mapObj);
|
||||||
return 1;
|
return 1;
|
||||||
@ -3080,10 +3080,10 @@ static void sub_8087AA0(struct LinkPlayerMapObject *linkPlayerMapObj, struct Map
|
|||||||
|
|
||||||
static void sub_8087AA8(struct LinkPlayerMapObject *linkPlayerMapObj, struct MapObject *mapObj)
|
static void sub_8087AA8(struct LinkPlayerMapObject *linkPlayerMapObj, struct MapObject *mapObj)
|
||||||
{
|
{
|
||||||
mapObj->mapobj_unk_21--;
|
mapObj->directionSequenceIndex--;
|
||||||
linkPlayerMapObj->mode = 1;
|
linkPlayerMapObj->mode = 1;
|
||||||
MoveCoords(mapObj->range.as_byte, &mapObj->coords1.x, &mapObj->coords1.y);
|
MoveCoords(mapObj->range.as_byte, &mapObj->initialCoords.x, &mapObj->initialCoords.y);
|
||||||
if (!mapObj->mapobj_unk_21)
|
if (!mapObj->directionSequenceIndex)
|
||||||
{
|
{
|
||||||
npc_coords_shift_still(mapObj);
|
npc_coords_shift_still(mapObj);
|
||||||
linkPlayerMapObj->mode = 2;
|
linkPlayerMapObj->mode = 2;
|
||||||
@ -3117,8 +3117,8 @@ static u8 LinkPlayerDetectCollision(u8 selfMapObjId, u8 a2, s16 x, s16 y)
|
|||||||
{
|
{
|
||||||
if (i != selfMapObjId)
|
if (i != selfMapObjId)
|
||||||
{
|
{
|
||||||
if ((gMapObjects[i].coords2.x == x && gMapObjects[i].coords2.y == y)
|
if ((gMapObjects[i].currentCoords.x == x && gMapObjects[i].currentCoords.y == y)
|
||||||
|| (gMapObjects[i].coords3.x == x && gMapObjects[i].coords3.y == y))
|
|| (gMapObjects[i].previousCoords.x == x && gMapObjects[i].previousCoords.y == y))
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -3140,21 +3140,21 @@ static void CreateLinkPlayerSprite(u8 linkPlayerId, u8 gameVersion)
|
|||||||
{
|
{
|
||||||
case VERSION_FIRE_RED:
|
case VERSION_FIRE_RED:
|
||||||
case VERSION_LEAF_GREEN:
|
case VERSION_LEAF_GREEN:
|
||||||
mapObj->spriteId = AddPseudoFieldObject(sub_808BD6C(mapObj->mapobj_bit_1), SpriteCB_LinkPlayer, 0, 0, 0);
|
mapObj->spriteId = AddPseudoFieldObject(sub_808BD6C(mapObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);
|
||||||
break;
|
break;
|
||||||
case VERSION_RUBY:
|
case VERSION_RUBY:
|
||||||
case VERSION_SAPPHIRE:
|
case VERSION_SAPPHIRE:
|
||||||
mapObj->spriteId = AddPseudoFieldObject(sub_808BD7C(mapObj->mapobj_bit_1), SpriteCB_LinkPlayer, 0, 0, 0);
|
mapObj->spriteId = AddPseudoFieldObject(sub_808BD7C(mapObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);
|
||||||
break;
|
break;
|
||||||
case VERSION_EMERALD:
|
case VERSION_EMERALD:
|
||||||
mapObj->spriteId = AddPseudoFieldObject(GetRivalAvatarGraphicsIdByStateIdAndGender(0, mapObj->mapobj_bit_1), SpriteCB_LinkPlayer, 0, 0, 0);
|
mapObj->spriteId = AddPseudoFieldObject(GetRivalAvatarGraphicsIdByStateIdAndGender(0, mapObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprite = &gSprites[mapObj->spriteId];
|
sprite = &gSprites[mapObj->spriteId];
|
||||||
sprite->coordOffsetEnabled = TRUE;
|
sprite->coordOffsetEnabled = TRUE;
|
||||||
sprite->data[0] = linkPlayerId;
|
sprite->data[0] = linkPlayerId;
|
||||||
mapObj->mapobj_bit_2 = 0;
|
mapObj->triggerGroundEffectsOnMove = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3162,10 +3162,10 @@ static void SpriteCB_LinkPlayer(struct Sprite *sprite)
|
|||||||
{
|
{
|
||||||
struct LinkPlayerMapObject *linkPlayerMapObj = &gLinkPlayerMapObjects[sprite->data[0]];
|
struct LinkPlayerMapObject *linkPlayerMapObj = &gLinkPlayerMapObjects[sprite->data[0]];
|
||||||
struct MapObject *mapObj = &gMapObjects[linkPlayerMapObj->mapObjId];
|
struct MapObject *mapObj = &gMapObjects[linkPlayerMapObj->mapObjId];
|
||||||
sprite->pos1.x = mapObj->coords1.x;
|
sprite->pos1.x = mapObj->initialCoords.x;
|
||||||
sprite->pos1.y = mapObj->coords1.y;
|
sprite->pos1.y = mapObj->initialCoords.y;
|
||||||
SetObjectSubpriorityByZCoord(mapObj->elevation, sprite, 1);
|
SetObjectSubpriorityByZCoord(mapObj->previousElevation, sprite, 1);
|
||||||
sprite->oam.priority = ZCoordToPriority(mapObj->elevation);
|
sprite->oam.priority = ZCoordToPriority(mapObj->previousElevation);
|
||||||
|
|
||||||
if (!linkPlayerMapObj->mode)
|
if (!linkPlayerMapObj->mode)
|
||||||
StartSpriteAnim(sprite, FieldObjectDirectionToImageAnimId(mapObj->range.as_byte));
|
StartSpriteAnim(sprite, FieldObjectDirectionToImageAnimId(mapObj->range.as_byte));
|
||||||
@ -3173,7 +3173,7 @@ static void SpriteCB_LinkPlayer(struct Sprite *sprite)
|
|||||||
StartSpriteAnimIfDifferent(sprite, get_go_image_anim_num(mapObj->range.as_byte));
|
StartSpriteAnimIfDifferent(sprite, get_go_image_anim_num(mapObj->range.as_byte));
|
||||||
|
|
||||||
sub_80979D4(sprite, 0);
|
sub_80979D4(sprite, 0);
|
||||||
if (mapObj->mapobj_bit_2)
|
if (mapObj->triggerGroundEffectsOnMove)
|
||||||
{
|
{
|
||||||
sprite->invisible = ((sprite->data[7] & 4) >> 2);
|
sprite->invisible = ((sprite->data[7] & 4) >> 2);
|
||||||
sprite->data[7]++;
|
sprite->data[7]++;
|
||||||
|
@ -284,8 +284,8 @@ static u8 GetTrainerApproachDistance(struct MapObject *trainerObj)
|
|||||||
PlayerGetDestCoords(&x, &y);
|
PlayerGetDestCoords(&x, &y);
|
||||||
if (trainerObj->trainerType == 1) // can only see in one direction
|
if (trainerObj->trainerType == 1) // can only see in one direction
|
||||||
{
|
{
|
||||||
approachDistance = sDirectionalApproachDistanceFuncs[trainerObj->mapobj_unk_18 - 1](trainerObj, trainerObj->trainerRange_berryTreeId, x, y);
|
approachDistance = sDirectionalApproachDistanceFuncs[trainerObj->facingDirection - 1](trainerObj, trainerObj->trainerRange_berryTreeId, x, y);
|
||||||
return CheckPathBetweenTrainerAndPlayer(trainerObj, approachDistance, trainerObj->mapobj_unk_18);
|
return CheckPathBetweenTrainerAndPlayer(trainerObj, approachDistance, trainerObj->facingDirection);
|
||||||
}
|
}
|
||||||
else // can see in all directions
|
else // can see in all directions
|
||||||
{
|
{
|
||||||
@ -303,10 +303,10 @@ static u8 GetTrainerApproachDistance(struct MapObject *trainerObj)
|
|||||||
// Returns how far south the player is from trainer. 0 if out of trainer's sight.
|
// Returns how far south the player is from trainer. 0 if out of trainer's sight.
|
||||||
static u8 GetTrainerApproachDistanceSouth(struct MapObject *trainerObj, s16 range, s16 x, s16 y)
|
static u8 GetTrainerApproachDistanceSouth(struct MapObject *trainerObj, s16 range, s16 x, s16 y)
|
||||||
{
|
{
|
||||||
if (trainerObj->coords2.x == x
|
if (trainerObj->currentCoords.x == x
|
||||||
&& y > trainerObj->coords2.y
|
&& y > trainerObj->currentCoords.y
|
||||||
&& y <= trainerObj->coords2.y + range)
|
&& y <= trainerObj->currentCoords.y + range)
|
||||||
return (y - trainerObj->coords2.y);
|
return (y - trainerObj->currentCoords.y);
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -314,10 +314,10 @@ static u8 GetTrainerApproachDistanceSouth(struct MapObject *trainerObj, s16 rang
|
|||||||
// Returns how far north the player is from trainer. 0 if out of trainer's sight.
|
// Returns how far north the player is from trainer. 0 if out of trainer's sight.
|
||||||
static u8 GetTrainerApproachDistanceNorth(struct MapObject *trainerObj, s16 range, s16 x, s16 y)
|
static u8 GetTrainerApproachDistanceNorth(struct MapObject *trainerObj, s16 range, s16 x, s16 y)
|
||||||
{
|
{
|
||||||
if (trainerObj->coords2.x == x
|
if (trainerObj->currentCoords.x == x
|
||||||
&& y < trainerObj->coords2.y
|
&& y < trainerObj->currentCoords.y
|
||||||
&& y >= trainerObj->coords2.y - range)
|
&& y >= trainerObj->currentCoords.y - range)
|
||||||
return (trainerObj->coords2.y - y);
|
return (trainerObj->currentCoords.y - y);
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -325,10 +325,10 @@ static u8 GetTrainerApproachDistanceNorth(struct MapObject *trainerObj, s16 rang
|
|||||||
// Returns how far west the player is from trainer. 0 if out of trainer's sight.
|
// Returns how far west the player is from trainer. 0 if out of trainer's sight.
|
||||||
static u8 GetTrainerApproachDistanceWest(struct MapObject *trainerObj, s16 range, s16 x, s16 y)
|
static u8 GetTrainerApproachDistanceWest(struct MapObject *trainerObj, s16 range, s16 x, s16 y)
|
||||||
{
|
{
|
||||||
if (trainerObj->coords2.y == y
|
if (trainerObj->currentCoords.y == y
|
||||||
&& x < trainerObj->coords2.x
|
&& x < trainerObj->currentCoords.x
|
||||||
&& x >= trainerObj->coords2.x - range)
|
&& x >= trainerObj->currentCoords.x - range)
|
||||||
return (trainerObj->coords2.x - x);
|
return (trainerObj->currentCoords.x - x);
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -336,10 +336,10 @@ static u8 GetTrainerApproachDistanceWest(struct MapObject *trainerObj, s16 range
|
|||||||
// Returns how far east the player is from trainer. 0 if out of trainer's sight.
|
// Returns how far east the player is from trainer. 0 if out of trainer's sight.
|
||||||
static u8 GetTrainerApproachDistanceEast(struct MapObject *trainerObj, s16 range, s16 x, s16 y)
|
static u8 GetTrainerApproachDistanceEast(struct MapObject *trainerObj, s16 range, s16 x, s16 y)
|
||||||
{
|
{
|
||||||
if (trainerObj->coords2.y == y
|
if (trainerObj->currentCoords.y == y
|
||||||
&& x > trainerObj->coords2.x
|
&& x > trainerObj->currentCoords.x
|
||||||
&& x <= trainerObj->coords2.x + range)
|
&& x <= trainerObj->currentCoords.x + range)
|
||||||
return (x - trainerObj->coords2.x);
|
return (x - trainerObj->currentCoords.x);
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -357,8 +357,8 @@ static u8 CheckPathBetweenTrainerAndPlayer(struct MapObject *trainerObj, u8 appr
|
|||||||
if (approachDistance == 0)
|
if (approachDistance == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
x = trainerObj->coords2.x;
|
x = trainerObj->currentCoords.x;
|
||||||
y = trainerObj->coords2.y;
|
y = trainerObj->currentCoords.y;
|
||||||
|
|
||||||
MoveCoords(direction, &x, &y);
|
MoveCoords(direction, &x, &y);
|
||||||
for (i = 0; i < approachDistance - 1; i++, MoveCoords(direction, &x, &y))
|
for (i = 0; i < approachDistance - 1; i++, MoveCoords(direction, &x, &y))
|
||||||
@ -441,7 +441,7 @@ static bool8 sub_80B417C(u8 taskId, struct Task *task, struct MapObject *trainer
|
|||||||
|
|
||||||
FieldObjectGetLocalIdAndMap(trainerObj, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]);
|
FieldObjectGetLocalIdAndMap(trainerObj, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]);
|
||||||
FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON_1);
|
FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON_1);
|
||||||
direction = GetFaceDirectionAnimId(trainerObj->mapobj_unk_18);
|
direction = GetFaceDirectionAnimId(trainerObj->facingDirection);
|
||||||
FieldObjectSetSpecialAnim(trainerObj, direction);
|
FieldObjectSetSpecialAnim(trainerObj, direction);
|
||||||
task->tFuncId++;
|
task->tFuncId++;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -456,9 +456,9 @@ static bool8 sub_80B41C0(u8 taskId, struct Task *task, struct MapObject *trainer
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
task->tFuncId++;
|
task->tFuncId++;
|
||||||
if (trainerObj->animPattern == 57 || trainerObj->animPattern == 58)
|
if (trainerObj->movementType == 57 || trainerObj->movementType == 58)
|
||||||
task->tFuncId = 6;
|
task->tFuncId = 6;
|
||||||
if (trainerObj->animPattern == 63)
|
if (trainerObj->movementType == 63)
|
||||||
task->tFuncId = 8;
|
task->tFuncId = 8;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -470,7 +470,7 @@ static bool8 sub_80B4200(u8 taskId, struct Task *task, struct MapObject *trainer
|
|||||||
{
|
{
|
||||||
if (task->tTrainerRange)
|
if (task->tTrainerRange)
|
||||||
{
|
{
|
||||||
FieldObjectSetSpecialAnim(trainerObj, GetGoSpeed0AnimId(trainerObj->mapobj_unk_18));
|
FieldObjectSetSpecialAnim(trainerObj, GetGoSpeed0AnimId(trainerObj->facingDirection));
|
||||||
task->tTrainerRange--;
|
task->tTrainerRange--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -489,8 +489,8 @@ static bool8 sub_80B425C(u8 taskId, struct Task *task, struct MapObject *trainer
|
|||||||
if (FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(trainerObj) && !FieldObjectClearAnimIfSpecialAnimFinished(trainerObj))
|
if (FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(trainerObj) && !FieldObjectClearAnimIfSpecialAnimFinished(trainerObj))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
npc_set_running_behaviour_etc(trainerObj, npc_running_behaviour_by_direction(trainerObj->mapobj_unk_18));
|
npc_set_running_behaviour_etc(trainerObj, npc_running_behaviour_by_direction(trainerObj->facingDirection));
|
||||||
sub_808F23C(trainerObj, npc_running_behaviour_by_direction(trainerObj->mapobj_unk_18));
|
sub_808F23C(trainerObj, npc_running_behaviour_by_direction(trainerObj->facingDirection));
|
||||||
sub_808F208(trainerObj);
|
sub_808F208(trainerObj);
|
||||||
|
|
||||||
playerObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
playerObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
@ -498,7 +498,7 @@ static bool8 sub_80B425C(u8 taskId, struct Task *task, struct MapObject *trainer
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
sub_808BCE8();
|
sub_808BCE8();
|
||||||
FieldObjectSetSpecialAnim(&gMapObjects[gPlayerAvatar.mapObjectId], GetFaceDirectionAnimId(GetOppositeDirection(trainerObj->mapobj_unk_18)));
|
FieldObjectSetSpecialAnim(&gMapObjects[gPlayerAvatar.mapObjectId], GetFaceDirectionAnimId(GetOppositeDirection(trainerObj->facingDirection)));
|
||||||
task->tFuncId++;
|
task->tFuncId++;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -547,8 +547,8 @@ static bool8 sub_80B43E0(u8 taskId, struct Task *task, struct MapObject *trainer
|
|||||||
{
|
{
|
||||||
if (FieldObjectCheckIfSpecialAnimFinishedOrInactive(trainerObj))
|
if (FieldObjectCheckIfSpecialAnimFinishedOrInactive(trainerObj))
|
||||||
{
|
{
|
||||||
gFieldEffectArguments[0] = trainerObj->coords2.x;
|
gFieldEffectArguments[0] = trainerObj->currentCoords.x;
|
||||||
gFieldEffectArguments[1] = trainerObj->coords2.y;
|
gFieldEffectArguments[1] = trainerObj->currentCoords.y;
|
||||||
gFieldEffectArguments[2] = gSprites[trainerObj->spriteId].subpriority - 1;
|
gFieldEffectArguments[2] = gSprites[trainerObj->spriteId].subpriority - 1;
|
||||||
gFieldEffectArguments[3] = 2;
|
gFieldEffectArguments[3] = 2;
|
||||||
task->tOutOfAshSpriteId = FieldEffectStart(FLDEFF_POP_OUT_OF_ASH);
|
task->tOutOfAshSpriteId = FieldEffectStart(FLDEFF_POP_OUT_OF_ASH);
|
||||||
@ -563,13 +563,13 @@ static bool8 sub_80B4438(u8 taskId, struct Task *task, struct MapObject *trainer
|
|||||||
|
|
||||||
if (gSprites[task->tOutOfAshSpriteId].animCmdIndex == 2)
|
if (gSprites[task->tOutOfAshSpriteId].animCmdIndex == 2)
|
||||||
{
|
{
|
||||||
trainerObj->mapobj_bit_26 = 0;
|
trainerObj->fixedPriority = 0;
|
||||||
trainerObj->mapobj_bit_2 = 1;
|
trainerObj->triggerGroundEffectsOnMove = 1;
|
||||||
|
|
||||||
sprite = &gSprites[trainerObj->spriteId];
|
sprite = &gSprites[trainerObj->spriteId];
|
||||||
sprite->oam.priority = 2;
|
sprite->oam.priority = 2;
|
||||||
FieldObjectClearAnimIfSpecialAnimFinished(trainerObj);
|
FieldObjectClearAnimIfSpecialAnimFinished(trainerObj);
|
||||||
FieldObjectSetSpecialAnim(trainerObj, sub_80934BC(trainerObj->mapobj_unk_18));
|
FieldObjectSetSpecialAnim(trainerObj, sub_80934BC(trainerObj->facingDirection));
|
||||||
task->tFuncId++;
|
task->tFuncId++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -604,13 +604,13 @@ static void sub_80B44C8(u8 taskId)
|
|||||||
sTrainerSeeFuncList2[task->data[0]](taskId, task, mapObj);
|
sTrainerSeeFuncList2[task->data[0]](taskId, task, mapObj);
|
||||||
if (task->data[0] == 3 && !FieldEffectActiveListContains(FLDEFF_POP_OUT_OF_ASH))
|
if (task->data[0] == 3 && !FieldEffectActiveListContains(FLDEFF_POP_OUT_OF_ASH))
|
||||||
{
|
{
|
||||||
npc_set_running_behaviour_etc(mapObj, npc_running_behaviour_by_direction(mapObj->mapobj_unk_18));
|
npc_set_running_behaviour_etc(mapObj, npc_running_behaviour_by_direction(mapObj->facingDirection));
|
||||||
sub_808F23C(mapObj, npc_running_behaviour_by_direction(mapObj->mapobj_unk_18));
|
sub_808F23C(mapObj, npc_running_behaviour_by_direction(mapObj->facingDirection));
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mapObj->mapobj_bit_7 = 0;
|
mapObj->heldMovementFinished = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,14 +765,14 @@ void sub_80B4808(void)
|
|||||||
if (gUnknown_030060AC == 1)
|
if (gUnknown_030060AC == 1)
|
||||||
{
|
{
|
||||||
trainerObj = &gMapObjects[gApproachingTrainers[gUnknown_03006080].mapObjectId];
|
trainerObj = &gMapObjects[gApproachingTrainers[gUnknown_03006080].mapObjectId];
|
||||||
gUnknown_03006084[0] = GetFaceDirectionAnimId(GetOppositeDirection(trainerObj->mapobj_unk_18));
|
gUnknown_03006084[0] = GetFaceDirectionAnimId(GetOppositeDirection(trainerObj->facingDirection));
|
||||||
gUnknown_03006084[1] = 0xFE;
|
gUnknown_03006084[1] = 0xFE;
|
||||||
ScriptMovement_StartObjectMovementScript(0xFF, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gUnknown_03006084);
|
ScriptMovement_StartObjectMovementScript(0xFF, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gUnknown_03006084);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
trainerObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
trainerObj = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
gUnknown_03006084[0] = GetFaceDirectionAnimId(trainerObj->mapobj_unk_18);
|
gUnknown_03006084[0] = GetFaceDirectionAnimId(trainerObj->facingDirection);
|
||||||
gUnknown_03006084[1] = 0xFE;
|
gUnknown_03006084[1] = 0xFE;
|
||||||
ScriptMovement_StartObjectMovementScript(0xFF, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gUnknown_03006084);
|
ScriptMovement_StartObjectMovementScript(0xFF, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gUnknown_03006084);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user