Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/OOZ/Hatch.h
338 views
1
#ifndef OBJ_HATCH_H
2
#define OBJ_HATCH_H
3
4
#include "Game.h"
5
6
typedef enum {
7
HATCH_GO_SUBENTRYHATCH,
8
HATCH_GO_SUBEXITHATCH_COPYTILES,
9
HATCH_GO_SUBENTRYHATCH_SMOGONLY,
10
HATCH_GO_SUBEXIT,
11
HATCH_GO_SUBEXITHATCH_NOCOPY,
12
} HatchGoTypes;
13
14
// Object Class
15
struct ObjectHatch {
16
RSDK_OBJECT
17
Hitbox hitboxSubExit;
18
Hitbox hitboxRange;
19
Hitbox hitboxL;
20
Hitbox hitboxR;
21
Hitbox hitboxEntry;
22
uint16 aniFrames;
23
uint16 sfxHatchOpen;
24
uint16 sfxHatchClose;
25
uint16 sfxDescend;
26
uint16 sfxSurface;
27
uint16 sfxGasPop;
28
};
29
30
// Entity Class
31
struct EntityHatch {
32
RSDK_ENTITY
33
StateMachine(state);
34
uint8 go;
35
Vector2 subOff1;
36
Vector2 subOff2;
37
int32 depth;
38
int32 dest;
39
Vector2 startPos;
40
int32 hScrollPos;
41
int32 vScrollPos;
42
int32 timer;
43
bool32 useMoveLayer;
44
EntityPlayer *playerPtr;
45
StateMachine(stateStore);
46
bool32 interactionStore;
47
bool32 tileColStore;
48
Animator baseAnimator;
49
Animator hatchAnimator;
50
Hitbox hitbox;
51
Hitbox hitboxWarpDoor;
52
};
53
54
// Object Struct
55
extern ObjectHatch *Hatch;
56
57
// Standard Entity Events
58
void Hatch_Update(void);
59
void Hatch_LateUpdate(void);
60
void Hatch_StaticUpdate(void);
61
void Hatch_Draw(void);
62
void Hatch_Create(void *data);
63
void Hatch_StageLoad(void);
64
#if GAME_INCLUDE_EDITOR
65
void Hatch_EditorDraw(void);
66
void Hatch_EditorLoad(void);
67
#endif
68
void Hatch_Serialize(void);
69
70
// Extra Entity Functions
71
void Hatch_State_SubEntryHatch(void);
72
void Hatch_State_PlayerEntered(void);
73
void Hatch_State_Descend(void);
74
void Hatch_State_MoveToDestPos(void);
75
void Hatch_State_Surfacing(void);
76
void Hatch_State_OpenHatchReleasePlayer(void);
77
void Hatch_State_CloseHatch(void);
78
void Hatch_State_FadeIn(void);
79
void Hatch_State_SubExit(void);
80
void Hatch_State_FadeOut(void);
81
void Hatch_State_SubExitHatch(void);
82
83
#endif //! OBJ_HATCH_H
84
85