forked from snesrev/zelda3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.h
242 lines (234 loc) · 7.92 KB
/
player.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
#pragma once
#include "types.h"
extern const uint8 kSwimmingTab1[4];
extern const uint8 kSwimmingTab2[2];
enum {
kPlayerState_Ground = 0,
kPlayerState_FallingIntoHole = 1,
kPlayerState_RecoilWall = 2,
kPlayerState_SpinAttacking = 3,
kPlayerState_Swimming = 4,
kPlayerState_TurtleRock = 5,
kPlayerState_RecoilOther = 6,
kPlayerState_Electrocution = 7,
kPlayerState_Ether = 8,
kPlayerState_Bombos = 9,
kPlayerState_Quake = 10,
kPlayerState_FallOfLeftRightLedge = 12,
kPlayerState_JumpOffLedgeDiag = 14,
kPlayerState_StartDash = 17,
kPlayerState_StopDash = 18,
kPlayerState_Hookshot = 19,
kPlayerState_Mirror = 20,
kPlayerState_HoldUpItem = 21,
kPlayerState_AsleepInBed = 22,
kPlayerState_PermaBunny = 23,
kPlayerState_ReceivingEther = 25,
kPlayerState_ReceivingBombos = 26,
kPlayerState_OpeningDesertPalace = 27,
kPlayerState_TempBunny = 28,
kPlayerState_PullForRupees = 29,
kPlayerState_SpinAttackMotion = 30,
};
void Dungeon_HandleLayerChange();
void CacheCameraProperties();
void CheckAbilityToSwim();
void Link_Main();
void Link_ControlHandler();
void LinkState_Default();
void HandleLink_From1D();
void PlayerHandler_00_Ground_3();
bool Link_HandleBunnyTransformation();
void LinkState_TemporaryBunny();
void PlayerHandler_17_Bunny();
void LinkState_Bunny_recache();
void Link_TempBunny_Func2();
void LinkState_HoldingBigRock();
void EtherTablet_StartCutscene();
void LinkState_ReceivingEther();
void BombosTablet_StartCutscene();
void LinkState_ReceivingBombos();
void LinkState_ReadingDesertTablet();
void HandleSomariaAndGraves();
void LinkState_Recoil();
void Link_HandleRecoilAndTimer(bool jump_into_middle);
void LinkState_OnIce();
void Link_HandleChangeInZVelocity();
void Player_ChangeZ(uint8 zd);
void LinkHop_HoppingSouthOW();
void LinkState_HandlingJump();
void LinkHop_FindTileToLandOnSouth();
void LinkState_HoppingHorizontallyOW();
void Link_HoppingHorizontally_FindTile_Y();
void Link_SetToDeepWater();
void LinkState_0F();
uint8 Link_HoppingHorizontally_FindTile_X(uint8 o);
void LinkState_HoppingDiagonallyUpOW();
void LinkState_HoppingDiagonallyDownOW();
void LinkHop_FindLandingSpotDiagonallyDown();
void Link_SplashUponLanding();
void LinkState_Dashing();
void LinkState_ExitingDash();
void Link_CancelDash();
void RepelDash();
void LinkApplyTileRebound();
void Sprite_RepelDash();
void Flag67WithDirections();
void LinkState_Pits();
void HandleLayerOfDestination();
void DungeonPitDoDamage();
void HandleDungeonLandingFromPit();
void PlayerHandler_04_Swimming();
void Link_HandleSwimMovements();
void Link_FlagMaxAccels();
void Link_SetIceMaxAccel();
void Link_SetMomentum();
void Link_ResetSwimmingState();
void Link_ResetStateAfterDamagingPit();
void ResetAllAcceleration();
void Link_HandleSwimAccels();
void Link_SetTheMaxAccel();
void LinkState_Zapped();
void PlayerHandler_15_HoldItem();
void Link_ReceiveItem(uint8 item, int chest_position);
void Link_TuckIntoBed();
void LinkState_Sleeping();
void Link_HandleSwordCooldown();
void Link_HandleYItem();
void Link_HandleAPress();
void Link_APress_PerformBasic(uint8 action_x2);
void HandleSwordSfxAndBeam();
void Link_CheckForSwordSwing();
void HandleSwordControls();
void Link_ResetSwordAndItemUsage();
void Player_Sword_SpinAttackJerks_HoldDown();
void LinkItem_Rod();
void LinkItem_Hammer();
void LinkItem_Bow();
void LinkItem_Boomerang();
void Link_ResetBoomerangYStuff();
void LinkItem_Bombs();
void LinkItem_Bottle();
void LinkItem_Lamp();
void LinkItem_Powder();
void LinkItem_ShovelAndFlute();
void LinkItem_Shovel();
void LinkItem_Flute();
void LinkItem_Book();
void LinkItem_Ether();
void LinkState_UsingEther();
void LinkItem_Bombos();
void LinkState_UsingBombos();
void LinkItem_Quake();
void LinkState_UsingQuake();
void Link_ActivateSpinAttack();
void Link_AnimateVictorySpin();
void LinkState_SpinAttack();
void LinkItem_Mirror();
void DoSwordInteractionWithTiles_Mirror();
void LinkState_CrossingWorlds();
void Link_PerformDesertPrayer();
void HandleFollowersAfterMirroring();
void LinkItem_Hookshot();
void LinkState_Hookshotting();
void LinkItem_Cape();
void Link_ForceUnequipCape();
void Link_ForceUnequipCape_quietly();
void HaltLinkWhenUsingItems();
void Link_HandleCape_passive_LiftCheck();
void Player_CheckHandleCapeStuff();
void LinkItem_CaneOfSomaria();
void LinkItem_CaneOfByrna();
bool SearchForByrnaSpark();
void LinkItem_Net();
bool CheckYButtonPress();
bool LinkCheckMagicCost(uint8 x);
void Refund_Magic(uint8 x);
void Link_ItemReset_FromOverworldThings();
void Link_PerformThrow();
void Link_APress_LiftCarryThrow();
void Link_PerformDash();
void Link_PerformGrab();
void Link_APress_PullObject();
void Link_PerformStatueDrag();
void Link_APress_StatueDrag();
void Link_PerformRupeePull();
void LinkState_TreePull();
void Link_PerformRead();
void Link_PerformOpenChest();
bool Link_CheckNewAPress();
bool Link_HandleToss();
void Link_HandleDiagonalCollision();
void Player_LimitDirections_Inner();
void Link_HandleCardinalCollision();
void RunSlopeCollisionChecks_VerticalFirst();
void RunSlopeCollisionChecks_HorizontalFirst();
bool CheckIfRoomNeedsDoubleLayerCheck();
void CreateVelocityFromMovingBackground();
void StartMovementCollisionChecks_Y();
void StartMovementCollisionChecks_Y_HandleIndoors();
void HandlePushingBonkingSnaps_Y();
void StartMovementCollisionChecks_Y_HandleOutdoors();
bool RunLedgeHopTimer(); // carry
void Link_BonkAndSmash();
void Link_AddInVelocityYFalling();
void CalculateSnapScratch_Y();
void ChangeAxisOfPerpendicularDoorMovement_Y();
void Link_AddInVelocityY();
void Link_HopInOrOutOfWater_Y();
void Link_FindValidLandingTile_North();
void Link_FindValidLandingTile_DiagonalNorth();
void StartMovementCollisionChecks_X();
void StartMovementCollisionChecks_X_HandleIndoors();
void HandlePushingBonkingSnaps_X();
void StartMovementCollisionChecks_X_HandleOutdoors();
void SnapOnX();
void CalculateSnapScratch_X();
int8 ChangeAxisOfPerpendicularDoorMovement_X();
void Link_HopInOrOutOfWater_X();
void Link_HandleDiagonalKickback();
void TileDetect_MainHandler(uint8 item);
bool Link_PermissionForSloshSounds();
bool PushBlock_AttemptToPushTheBlock(uint8 what, uint16 x, uint16 y);
uint8 Link_HandleLiftables();
void HandleNudging(int8 arg_r0);
void TileBehavior_HandleItemAndExecute(uint16 x, uint16 y);
uint8 PushBlock_GetTargetTileFlag(uint16 x, uint16 y);
void FlagMovingIntoSlopes_Y();
void FlagMovingIntoSlopes_X();
void Link_HandleRecoiling();
void Player_HandleIncapacitated_Inner2();
void Link_HandleVelocity();
void LinkHop_FindArbitraryLandingSpot();
void Link_HandleVelocityAndSandDrag(uint16 x, uint16 y);
void HandleSwimStrokeAndSubpixels();
void Player_SomethingWithVelocity_TiredOrSwim(uint16 xvel, uint16 yvel);
void Link_HandleMovingFloor();
void Link_ApplyMovingFloorVelocity();
void Link_ApplyConveyor();
void Link_HandleMovingAnimation_FullLongEntry();
void Link_HandleMovingAnimation_StartWithDash();
void Link_HandleMovingAnimationSwimming();
void Link_HandleMovingAnimation_Dash();
void HandleIndoorCameraAndDoors();
void HandleDoorTransitions();
void ApplyLinksMovementToCamera();
uint8 FindFreeMovingBlockSlot(uint8 x);
bool InitializePushBlock(uint8 r14, uint8 idx);
void Sprite_Dungeon_DrawSinglePushBlock(int j);
void Link_Initialize();
void Link_ResetProperties_A();
void Link_ResetProperties_B();
void Link_ResetProperties_C();
bool Link_CheckForEdgeScreenTransition();
void CacheCameraPropertiesIfOutdoors();
void SomariaBlock_HandlePlayerInteraction(int k);
void Gravestone_Move(int k);
void Gravestone_ActAsBarrier(int k);
void AncillaAdd_DugUpFlute(uint8 a, uint8 y);
void AncillaAdd_CaneOfByrnaInitSpark(uint8 a, uint8 y);
void AncillaAdd_ShovelDirt(uint8 a, uint8 y);
void AncillaAdd_Hookshot(uint8 a, uint8 y);
void ResetSomeThingsAfterDeath(uint8 a);
void SpawnHammerWaterSplash();
void DiggingGameGuy_AttemptPrizeSpawn();