Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/MSZ/Rattlekiller.h
338 views
1
#ifndef OBJ_RATTLEKILLER_H
2
#define OBJ_RATTLEKILLER_H
3
4
#include "Game.h"
5
6
#define RATTLEKILLER_SEGMENT_COUNT (10)
7
8
typedef enum {
9
RATTLEKILLER_IDLE,
10
RATTLEKILLER_TWIST_HORIZONTAL,
11
RATTLEKILLER_TWIST_DOWN,
12
RATTLEKILLER_TWIST_UP,
13
RATTLEKILLER_PLAYERDETECTED,
14
RATTLEKILLER_STRETCHBODY,
15
RATTLEKILLER_EXTEND,
16
RATTLEKILLER_RETRACT,
17
} RattlekillerBodyStates;
18
19
// Object Class
20
struct ObjectRattlekiller {
21
RSDK_OBJECT
22
Hitbox hitboxSegment;
23
uint16 sfxRocketJet;
24
uint16 aniFrames;
25
};
26
27
// Entity Class
28
struct EntityRattlekiller {
29
RSDK_ENTITY
30
StateMachine(state); // Unused
31
StateMachine(stateDraw); // Unused
32
int32 timer;
33
int32 bodyStates[RATTLEKILLER_SEGMENT_COUNT];
34
Vector2 bodyPositions[RATTLEKILLER_SEGMENT_COUNT];
35
Vector2 bodyOriginPos[RATTLEKILLER_SEGMENT_COUNT];
36
Vector2 bodyVelocities[RATTLEKILLER_SEGMENT_COUNT];
37
int32 bodyAngles[RATTLEKILLER_SEGMENT_COUNT];
38
int32 bodyDepth[RATTLEKILLER_SEGMENT_COUNT];
39
int32 bodyDelays[RATTLEKILLER_SEGMENT_COUNT];
40
int32 bodyIDs[RATTLEKILLER_SEGMENT_COUNT];
41
Animator *bodyAnimators[RATTLEKILLER_SEGMENT_COUNT];
42
Vector2 topBounds;
43
Vector2 bottomBounds;
44
Vector2 targetPos;
45
int32 length;
46
Animator headAnimator;
47
Animator bodyAnimator;
48
Animator tailAnimator;
49
};
50
51
// Object Struct
52
extern ObjectRattlekiller *Rattlekiller;
53
54
// Standard Entity Events
55
void Rattlekiller_Update(void);
56
void Rattlekiller_LateUpdate(void);
57
void Rattlekiller_StaticUpdate(void);
58
void Rattlekiller_Draw(void);
59
void Rattlekiller_Create(void *data);
60
void Rattlekiller_StageLoad(void);
61
#if GAME_INCLUDE_EDITOR
62
void Rattlekiller_EditorDraw(void);
63
void Rattlekiller_EditorLoad(void);
64
#endif
65
void Rattlekiller_Serialize(void);
66
67
// Extra Entity Functions
68
void Rattlekiller_DebugSpawn(void);
69
void Rattlekiller_DebugDraw(void);
70
71
void Rattlekiller_HandleSorting(void);
72
73
#endif //! OBJ_RATTLEKILLER_H
74
75