Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/TMZ/LaunchSpring.h
338 views
1
#ifndef OBJ_LAUNCHSPRING_H
2
#define OBJ_LAUNCHSPRING_H
3
4
#include "Game.h"
5
6
typedef enum {
7
LAUNCHSPRING_SPINNING,
8
LAUNCHSPRING_CANNON,
9
LAUNCHSPRING_ROTATE_45DEG,
10
LAUNCHSPRING_ROTATE_90DEG,
11
LAUNCHSPRING_ROTATE_135DEG,
12
LAUNCHSPRING_ROTATE_180DEG,
13
} LaunchSpringTypes;
14
15
// Object Class
16
struct ObjectLaunchSpring {
17
RSDK_OBJECT
18
Hitbox hitbox;
19
bool32 isTMZ;
20
uint16 aniFrames;
21
uint16 sfxGrab;
22
uint16 sfxClack;
23
uint16 sfxSpeedBooster;
24
};
25
26
// Entity Class
27
struct EntityLaunchSpring {
28
RSDK_ENTITY
29
StateMachine(state);
30
Animator mainAnimator;
31
Animator jointAnimator;
32
Animator springAnimator;
33
uint8 type;
34
uint8 rotDir;
35
uint8 rotSpeed;
36
bool32 manual;
37
bool32 strict;
38
uint8 timer;
39
uint8 springPivot;
40
uint8 autoFireTimer;
41
int16 minAngle;
42
int16 maxAngle;
43
EntityPlayer *playerPtr;
44
};
45
46
// Object Struct
47
extern ObjectLaunchSpring *LaunchSpring;
48
49
// Standard Entity Events
50
void LaunchSpring_Update(void);
51
void LaunchSpring_LateUpdate(void);
52
void LaunchSpring_StaticUpdate(void);
53
void LaunchSpring_Draw(void);
54
void LaunchSpring_Create(void *data);
55
void LaunchSpring_StageLoad(void);
56
#if GAME_INCLUDE_EDITOR
57
void LaunchSpring_EditorDraw(void);
58
void LaunchSpring_EditorLoad(void);
59
#endif
60
void LaunchSpring_Serialize(void);
61
62
// Extra Entity Functions
63
bool32 LaunchSpring_CheckFireworkActive(EntityPlayer *player);
64
void LaunchSpring_CheckPlayerCollisions(void *nextState);
65
66
void LaunchSpring_LaunchPlayer(void);
67
void LaunchSpring_State_Spinning(void);
68
void LaunchSpring_State_Spinning_GrabbedPlayer(void);
69
void LaunchSpring_State_Spinning_ReadyToFire(void);
70
void LaunchSpring_State_Spinning_FiredPlayer(void);
71
void LaunchSpring_State_Spinning_ReadyUp(void);
72
void LaunchSpring_State_Cannon(void);
73
void LaunchSpring_State_Cannon_Fire_Automatic(void);
74
void LaunchSpring_State_Cannon_Fire_Manual(void);
75
void LaunchSpring_State_Cannon_FiredPlayer(void);
76
void LaunchSpring_State_Rotating(void);
77
void LaunchSpring_State_Rotate_Fire_Automatic(void);
78
void LaunchSpring_State_Rotate_Fire_Manual(void);
79
void LaunchSpring_State_Rotating_FiredPlayer(void);
80
81
#endif //! OBJ_LAUNCHSPRING_H
82
83