Move field effects enum to defines
This commit is contained in:
@@ -1,25 +1,25 @@
|
||||
#include "global.h"
|
||||
#include "battle_transition.h"
|
||||
#include "unk_transition.h"
|
||||
#include "main.h"
|
||||
#include "overworld.h"
|
||||
#include "task.h"
|
||||
#include "palette.h"
|
||||
#include "trig.h"
|
||||
#include "field_effect.h"
|
||||
#include "bg.h"
|
||||
#include "decompress.h"
|
||||
#include "field_camera.h"
|
||||
#include "field_effect.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "main.h"
|
||||
#include "malloc.h"
|
||||
#include "overworld.h"
|
||||
#include "palette.h"
|
||||
#include "random.h"
|
||||
#include "sprite.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "sound.h"
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
#include "unk_transition.h"
|
||||
#include "util.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/trainers.h"
|
||||
#include "field_camera.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "malloc.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "decompress.h"
|
||||
#include "bg.h"
|
||||
#include "util.h"
|
||||
|
||||
struct TransitionData
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "script.h"
|
||||
#include "sound.h"
|
||||
#include "task.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/flags.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
@@ -18,10 +18,12 @@
|
||||
#include "random.h"
|
||||
#include "rom_818CFC8.h"
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "trainer_see.h"
|
||||
#include "util.h"
|
||||
#include "constants/event_object_movement_constants.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/field_effects.h"
|
||||
|
||||
// this file was known as evobjmv.c in Game Freak's original source
|
||||
|
||||
|
||||
@@ -558,8 +558,7 @@ static bool8 TryStartCoordEventScript(struct MapPosition *position)
|
||||
|
||||
static bool8 TryStartMiscWalkingScripts(u16 metatileBehavior)
|
||||
{
|
||||
s16 x;
|
||||
s16 y;
|
||||
s16 x, y;
|
||||
|
||||
if (MetatileBehavior_IsCrackedFloorHole(metatileBehavior))
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,7 @@
|
||||
#include "sound.h"
|
||||
#include "sprite.h"
|
||||
#include "trig.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
#define EVENT_OBJ_PAL_TAG_NONE 0x11FF // duplicate of define in event_object_movement.c
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "field_camera.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "field_effect.h"
|
||||
#include "field_effect_helpers.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "fieldmap.h"
|
||||
#include "global.fieldmap.h"
|
||||
#include "menu.h"
|
||||
#include "metatile_behavior.h"
|
||||
#include "overworld.h"
|
||||
@@ -25,6 +24,7 @@
|
||||
#include "constants/abilities.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/event_object_movement_constants.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/flags.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/moves.h"
|
||||
@@ -35,39 +35,15 @@ static EWRAM_DATA u8 gUnknown_0203734C = 0;
|
||||
EWRAM_DATA struct EventObject gEventObjects[EVENT_OBJECTS_COUNT] = {};
|
||||
EWRAM_DATA struct PlayerAvatar gPlayerAvatar = {};
|
||||
|
||||
static void StartStrengthAnim(u8, u8);
|
||||
static bool8 ShouldJumpLedge(s16, s16, u8);
|
||||
static bool8 sub_808B1BC(s16, s16, u8);
|
||||
static u8 sub_808B164(struct EventObject *, s16, s16, u8, u8);
|
||||
static u8 sub_808B238(s16, s16, u8);
|
||||
static void check_acro_bike_metatile(s16, s16, u8, u8 *);
|
||||
static void PlayerNotOnBikeCollide(u8);
|
||||
static void PlayCollisionSoundIfNotFacingWarp(u8 a);
|
||||
static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8);
|
||||
static void PlayerRun(u8);
|
||||
static void MovePlayerNotOnBike(u8, u16);
|
||||
static u8 CheckMovementInputNotOnBike(u8);
|
||||
static void DoPlayerMatSpin(void);
|
||||
static void DoPlayerMatJump(void);
|
||||
static u8 CheckForPlayerAvatarCollision(u8);
|
||||
// static declarations
|
||||
|
||||
static u8 EventObjectCB2_NoMovement2();
|
||||
static void sub_808C280(struct EventObject *);
|
||||
static bool8 TryInterruptEventObjectSpecialAnim(struct EventObject *, u8);
|
||||
static void npc_clear_strange_bits(struct EventObject *);
|
||||
static void DoPlayerAvatarTransition(void);
|
||||
static bool8 player_is_anim_in_certain_ranges(void);
|
||||
static bool8 sub_808B618(void);
|
||||
static bool8 PlayerIsAnimActive(void);
|
||||
static bool8 PlayerCheckIfAnimFinishedOrInactive(void);
|
||||
static bool8 TryDoMetatileBehaviorForcedMovement();
|
||||
static void MovePlayerAvatarUsingKeypadInput(u8, u16, u16);
|
||||
static void PlayerAllowForcedMovementIfMovingSameDirection();
|
||||
static u8 sub_808B028(u8);
|
||||
static bool8 TryDoMetatileBehaviorForcedMovement();
|
||||
static u8 GetForcedMovementByMetatileBehavior();
|
||||
static void PlayerNotOnBikeNotMoving(u8, u16);
|
||||
static void PlayerNotOnBikeTurningInPlace(u8, u16);
|
||||
static void PlayerNotOnBikeMoving(u8, u16);
|
||||
static void sub_808C750(u8);
|
||||
|
||||
static bool8 ForcedMovement_None(void);
|
||||
static bool8 ForcedMovement_Slip(void);
|
||||
@@ -87,25 +63,63 @@ static bool8 ForcedMovement_0xBB(void);
|
||||
static bool8 ForcedMovement_0xBC(void);
|
||||
static bool8 ForcedMovement_MuddySlope(void);
|
||||
|
||||
static void MovePlayerNotOnBike(u8, u16);
|
||||
static u8 CheckMovementInputNotOnBike(u8);
|
||||
static void PlayerNotOnBikeNotMoving(u8, u16);
|
||||
static void PlayerNotOnBikeTurningInPlace(u8, u16);
|
||||
static void PlayerNotOnBikeMoving(u8, u16);
|
||||
static u8 CheckForPlayerAvatarCollision(u8);
|
||||
static u8 sub_808B028(u8);
|
||||
static u8 sub_808B164(struct EventObject *, s16, s16, u8, u8);
|
||||
static bool8 sub_808B1BC(s16, s16, u8);
|
||||
static bool8 ShouldJumpLedge(s16, s16, u8);
|
||||
static u8 sub_808B238(s16, s16, u8);
|
||||
static void check_acro_bike_metatile(s16, s16, u8, u8 *);
|
||||
|
||||
static void DoPlayerAvatarTransition(void);
|
||||
static void PlayerAvatarTransition_Dummy(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_Normal(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_MachBike(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_AcroBike(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_Surfing(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_Underwater(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_ReturnToField(struct EventObject *a);
|
||||
static void PlayerAvatarTransition_Dummy(struct EventObject *a);
|
||||
|
||||
static bool8 player_is_anim_in_certain_ranges(void);
|
||||
static bool8 sub_808B618(void);
|
||||
static bool8 PlayerIsAnimActive(void);
|
||||
static bool8 PlayerCheckIfAnimFinishedOrInactive(void);
|
||||
|
||||
static void PlayerRun(u8);
|
||||
static void PlayerNotOnBikeCollide(u8);
|
||||
static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8);
|
||||
|
||||
static void PlayCollisionSoundIfNotFacingWarp(u8 a);
|
||||
|
||||
static void sub_808C280(struct EventObject *);
|
||||
|
||||
static void StartStrengthAnim(u8, u8);
|
||||
static void Task_BumpBoulder(u8 taskId);
|
||||
static u8 sub_808C3A4(struct Task *task, struct EventObject *playerObject, struct EventObject *strengthObject);
|
||||
static u8 do_boulder_dust(struct Task *task, struct EventObject *playerObject, struct EventObject *strengthObject);
|
||||
static u8 sub_808C484(struct Task *task, struct EventObject *playerObject, struct EventObject *strengthObject);
|
||||
|
||||
static void DoPlayerMatJump(void);
|
||||
static void DoPlayerAvatarSecretBaseMatJump(u8 taskId);
|
||||
static u8 PlayerAvatar_DoSecretBaseMatJump(struct Task *task, struct EventObject *eventObject);
|
||||
|
||||
static void DoPlayerMatSpin(void);
|
||||
static void PlayerAvatar_DoSecretBaseMatSpin(u8 taskId);
|
||||
static bool8 PlayerAvatar_SecretBaseMatSpinStep0(struct Task *task, struct EventObject *eventObject);
|
||||
static bool8 PlayerAvatar_SecretBaseMatSpinStep1(struct Task *task, struct EventObject *eventObject);
|
||||
static bool8 PlayerAvatar_SecretBaseMatSpinStep2(struct Task *task, struct EventObject *eventObject);
|
||||
static bool8 PlayerAvatar_SecretBaseMatSpinStep3(struct Task *task, struct EventObject *eventObject);
|
||||
|
||||
static void sub_808C750(u8);
|
||||
static void taskFF_0805D1D4(u8 taskId);
|
||||
static void sub_808C814(u8 taskId);
|
||||
|
||||
static void Task_Fishing(u8 taskId);
|
||||
static u8 Fishing1(struct Task *task);
|
||||
static u8 Fishing2(struct Task *task);
|
||||
static u8 Fishing3(struct Task *task);
|
||||
@@ -122,6 +136,11 @@ static u8 Fishing13(struct Task *task);
|
||||
static u8 Fishing14(struct Task *task);
|
||||
static u8 Fishing15(struct Task *task);
|
||||
static u8 Fishing16(struct Task *task);
|
||||
static void AlignFishingAnimationFrames(void);
|
||||
|
||||
static u8 sub_808D38C(struct EventObject *object, s16 *a1);
|
||||
|
||||
// .rodata
|
||||
|
||||
static bool8 (*const sForcedMovementTestFuncs[])(u8) =
|
||||
{
|
||||
@@ -283,6 +302,7 @@ static bool8 (*const sPlayerAvatarSecretBaseMatSpin[])(struct Task *, struct Eve
|
||||
};
|
||||
|
||||
// .text
|
||||
|
||||
void MovementType_Player(struct Sprite *sprite)
|
||||
{
|
||||
UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, EventObjectCB2_NoMovement2);
|
||||
@@ -728,18 +748,18 @@ static u8 sub_808B238(s16 x, s16 y, u8 direction)
|
||||
{
|
||||
u8 eventObjectId = GetEventObjectIdByXY(x, y);
|
||||
|
||||
if (eventObjectId != 16 && gEventObjects[eventObjectId].graphicsId == 0x57)
|
||||
if (eventObjectId != 16 && gEventObjects[eventObjectId].graphicsId == EVENT_OBJ_GFX_PUSHABLE_BOULDER)
|
||||
{
|
||||
x = gEventObjects[eventObjectId].currentCoords.x;
|
||||
y = gEventObjects[eventObjectId].currentCoords.y;
|
||||
MoveCoords(direction, &x, &y);
|
||||
if (GetCollisionAtCoords(&gEventObjects[eventObjectId], x, y, direction) == 0
|
||||
&& MetatileBehavior_IsNonAnimDoor(MapGridGetMetatileBehaviorAt(x, y)) == 0)
|
||||
{
|
||||
x = gEventObjects[eventObjectId].currentCoords.x;
|
||||
y = gEventObjects[eventObjectId].currentCoords.y;
|
||||
MoveCoords(direction, &x, &y);
|
||||
if (GetCollisionAtCoords(&gEventObjects[eventObjectId], x, y, direction) == 0
|
||||
&& MetatileBehavior_IsNonAnimDoor(MapGridGetMetatileBehaviorAt(x, y)) == 0)
|
||||
{
|
||||
StartStrengthAnim(eventObjectId, direction);
|
||||
return 1;
|
||||
}
|
||||
StartStrengthAnim(eventObjectId, direction);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -981,7 +1001,7 @@ void PlayerGoSpeed4(u8 a)
|
||||
PlayerSetAnimId(GetWalkFastestMovementAction(a), 2);
|
||||
}
|
||||
|
||||
void PlayerRun(u8 a)
|
||||
static void PlayerRun(u8 a)
|
||||
{
|
||||
PlayerSetAnimId(GetPlayerRunMovementAction(a), 2);
|
||||
}
|
||||
@@ -997,13 +1017,13 @@ void PlayerOnBikeCollideWithFarawayIslandMew(u8 a)
|
||||
PlayerSetAnimId(GetWalkInPlaceNormalMovementAction(a), 2);
|
||||
}
|
||||
|
||||
void PlayerNotOnBikeCollide(u8 a)
|
||||
static void PlayerNotOnBikeCollide(u8 a)
|
||||
{
|
||||
PlayCollisionSoundIfNotFacingWarp(a);
|
||||
PlayerSetAnimId(GetWalkInPlaceSlowMovementAction(a), 2);
|
||||
}
|
||||
|
||||
void PlayerNotOnBikeCollideWithFarawayIslandMew(u8 a)
|
||||
static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8 a)
|
||||
{
|
||||
PlayerSetAnimId(GetWalkInPlaceSlowMovementAction(a), 2);
|
||||
}
|
||||
@@ -1450,8 +1470,6 @@ static void sub_808C280(struct EventObject *eventObject)
|
||||
|
||||
/* Strength */
|
||||
|
||||
static void Task_BumpBoulder(u8 taskId);
|
||||
|
||||
static void StartStrengthAnim(u8 a, u8 b)
|
||||
{
|
||||
u8 taskId = CreateTask(Task_BumpBoulder, 0xFF);
|
||||
@@ -1523,8 +1541,6 @@ static bool8 sub_808C484(struct Task *task, struct EventObject *playerObject, st
|
||||
|
||||
/* Some field effect */
|
||||
|
||||
static void DoPlayerAvatarSecretBaseMatJump(u8 taskId);
|
||||
|
||||
static void DoPlayerMatJump(void)
|
||||
{
|
||||
DoPlayerAvatarSecretBaseMatJump(CreateTask(DoPlayerAvatarSecretBaseMatJump, 0xFF));
|
||||
@@ -1557,8 +1573,6 @@ static u8 PlayerAvatar_DoSecretBaseMatJump(struct Task *task, struct EventObject
|
||||
|
||||
/* Some field effect */
|
||||
|
||||
static void PlayerAvatar_DoSecretBaseMatSpin(u8 taskId);
|
||||
|
||||
static void DoPlayerMatSpin(void)
|
||||
{
|
||||
u8 taskId = CreateTask(PlayerAvatar_DoSecretBaseMatSpin, 0xFF);
|
||||
@@ -1632,9 +1646,6 @@ static bool8 PlayerAvatar_SecretBaseMatSpinStep3(struct Task *task, struct Event
|
||||
|
||||
/* Some Field effect */
|
||||
|
||||
static void taskFF_0805D1D4(u8 taskId);
|
||||
static void sub_808C814(u8 taskId);
|
||||
|
||||
static void sub_808C750(u8 a)
|
||||
{
|
||||
u8 taskId;
|
||||
@@ -1699,9 +1710,6 @@ static bool8 (*const sFishingStateFuncs[])(struct Task *) =
|
||||
Fishing16,
|
||||
};
|
||||
|
||||
static void Task_Fishing(u8 taskId);
|
||||
static void AlignFishingAnimationFrames(void);
|
||||
|
||||
#define tStep data[0]
|
||||
#define tFrameCounter data[1]
|
||||
#define tNumDots data[2]
|
||||
@@ -2082,8 +2090,6 @@ static u8 sub_808D080(void)
|
||||
return gUnknown_0203734C;
|
||||
}
|
||||
|
||||
static u8 sub_808D38C(struct EventObject *object, s16 *a1);
|
||||
|
||||
static void sub_808D094(u8 taskId)
|
||||
{
|
||||
struct EventObject *object = &gEventObjects[gPlayerAvatar.eventObjectId];
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "global.h"
|
||||
#include "main.h"
|
||||
#include "battle.h"
|
||||
#include "battle_tower.h"
|
||||
#include "cable_club.h"
|
||||
@@ -13,7 +12,6 @@
|
||||
#include "field_effect.h"
|
||||
#include "field_message_box.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "field_region_map.h"
|
||||
#include "field_screen.h"
|
||||
#include "field_specials.h"
|
||||
#include "field_weather.h"
|
||||
@@ -21,6 +19,7 @@
|
||||
#include "item_icon.h"
|
||||
#include "link.h"
|
||||
#include "list_menu.h"
|
||||
#include "main.h"
|
||||
#include "malloc.h"
|
||||
#include "match_call.h"
|
||||
#include "menu.h"
|
||||
@@ -46,6 +45,7 @@
|
||||
#include "wallclock.h"
|
||||
#include "window.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/songs.h"
|
||||
@@ -80,6 +80,7 @@ extern const u16 gEventObjectPalette34[];
|
||||
|
||||
extern void LoadPalette(const void *src, u32 offset, u16 size); // incorrect signature, needed to match
|
||||
extern void BlendPalettes(u32, u8, u16);
|
||||
extern void FieldInitRegionMap(MainCallback callback);
|
||||
|
||||
void UpdateMovedLilycoveFanClubMembers(void);
|
||||
void sub_813BF60(void);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "trig.h"
|
||||
#include "constants/abilities.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
extern void ScriptUnfreezeEventObjects(void);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "script.h"
|
||||
#include "task.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/field_effects.h"
|
||||
|
||||
// static functions
|
||||
static void FldEff_UseStrength(void);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "wild_encounter.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/rgb.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "overworld.h"
|
||||
#include "rom6.h"
|
||||
#include "task.h"
|
||||
#include "constants/field_effects.h"
|
||||
|
||||
static void FieldCallback_Teleport(void);
|
||||
static void StartTeleportFieldEffect(void);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "task.h"
|
||||
#include "constants/event_object_movement_constants.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/map_types.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
#include "global.h"
|
||||
#include "trainer_see.h"
|
||||
#include "battle_setup.h"
|
||||
#include "pokemon.h"
|
||||
#include "sprite.h"
|
||||
#include "field_effect.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "pokenav.h"
|
||||
#include "task.h"
|
||||
#include "util.h"
|
||||
#include "script.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "field_effect.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "pokemon.h"
|
||||
#include "pokenav.h"
|
||||
#include "script.h"
|
||||
#include "script_movement.h"
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "trainer_see.h"
|
||||
#include "util.h"
|
||||
#include "constants/field_effects.h"
|
||||
|
||||
extern bool8 InBattlePyramid(void);
|
||||
extern bool32 InTrainerHill(void);
|
||||
|
||||
Reference in New Issue
Block a user