Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/HCZ/Fan.h
338 views
1
#ifndef OBJ_FAN_H
2
#define OBJ_FAN_H
3
4
#include "Game.h"
5
6
typedef enum {
7
FAN_V,
8
FAN_H,
9
} FanTypes;
10
11
typedef enum {
12
FAN_ACTIVATE_NONE,
13
FAN_ACTIVATE_INTERVAL,
14
FAN_ACTIVATE_PLATFORM,
15
FAN_ACTIVATE_BUTTON,
16
} FanActivationTypes;
17
18
typedef enum {
19
FAN_DEACTIVATE_NONE,
20
FAN_DEACTIVATE_BUTTON,
21
} FanDeactivationTypes;
22
23
// Object Class
24
struct ObjectFan {
25
RSDK_OBJECT
26
int32 activePlayers;
27
uint8 unused;
28
int32 minVelocity;
29
Hitbox hitboxTop;
30
Hitbox hitboxBottom;
31
Hitbox hitboxSides;
32
Hitbox playerHitbox;
33
uint16 aniFrames;
34
uint16 sfxFan;
35
bool32 playingFanSfx;
36
};
37
38
// Entity Class
39
struct EntityFan {
40
RSDK_ENTITY
41
StateMachine(state);
42
StateMachine(stateActivate);
43
StateMachine(stateDeactivate);
44
uint8 type;
45
uint8 activation;
46
uint8 deactivation;
47
int32 size;
48
uint16 interval;
49
uint16 intervalOffset;
50
uint16 duration;
51
uint16 delay;
52
int32 buttonTag;
53
EntityButton *taggedButton;
54
Animator animator;
55
};
56
57
// Object Struct
58
extern ObjectFan *Fan;
59
60
// Standard Entity Events
61
void Fan_Update(void);
62
void Fan_LateUpdate(void);
63
void Fan_StaticUpdate(void);
64
void Fan_Draw(void);
65
void Fan_Create(void *data);
66
void Fan_StageLoad(void);
67
#if GAME_INCLUDE_EDITOR
68
void Fan_EditorDraw(void);
69
void Fan_EditorLoad(void);
70
#endif
71
void Fan_Serialize(void);
72
73
// Extra Entity Functions
74
void Fan_SetupTagLink(void);
75
76
void Fan_HandlePlayerInteractions_Top(void);
77
void Fan_HandlePlayerInteractions_Bottom(void);
78
void Fan_HandlePlayerInteractions_Left(void);
79
void Fan_HandlePlayerInteractions_Right(void);
80
81
void Fan_State_Started(void);
82
void Fan_State_Stopped(void);
83
84
void Fan_Activate_Interval(void);
85
void Fan_Activate_Button(void);
86
void Fan_Deactivate_Button(void);
87
void Fan_Activate_Platform(void);
88
void Fan_Activate(void);
89
90
#endif //! OBJ_FAN_H
91
92