Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/LRZ/Fireworm.h
338 views
1
#ifndef OBJ_FIREWORM_H
2
#define OBJ_FIREWORM_H
3
4
#include "Game.h"
5
6
#define FIREWORM_SEGMENT_COUNT (1 + 4) // Head + 4 Segments
7
8
// Object Class
9
struct ObjectFireworm {
10
RSDK_OBJECT
11
Hitbox hitboxBadnik;
12
Hitbox hitboxRange;
13
Animator holeAnimator;
14
uint16 aniFrames;
15
};
16
17
// Entity Class
18
struct EntityFireworm {
19
RSDK_ENTITY
20
StateMachine(state);
21
Vector2 startPos;
22
uint8 startDir;
23
Vector2 bodyPositions[FIREWORM_SEGMENT_COUNT];
24
Vector2 bodyVelocities[FIREWORM_SEGMENT_COUNT];
25
uint8 bodyDirections[FIREWORM_SEGMENT_COUNT];
26
uint16 bodyAngles[FIREWORM_SEGMENT_COUNT];
27
uint8 bodyTimers[FIREWORM_SEGMENT_COUNT];
28
uint8 flameExhaustDelays[FIREWORM_SEGMENT_COUNT];
29
int32 bodyOriginY[FIREWORM_SEGMENT_COUNT];
30
int32 timer;
31
int32 boundsL;
32
int32 boundsR;
33
Animator bodyAnimators[FIREWORM_SEGMENT_COUNT];
34
Animator flameAnimators[FIREWORM_SEGMENT_COUNT];
35
};
36
37
// Object Struct
38
extern ObjectFireworm *Fireworm;
39
40
// Standard Entity Events
41
void Fireworm_Update(void);
42
void Fireworm_LateUpdate(void);
43
void Fireworm_StaticUpdate(void);
44
void Fireworm_Draw(void);
45
void Fireworm_Create(void *data);
46
void Fireworm_StageLoad(void);
47
#if GAME_INCLUDE_EDITOR
48
void Fireworm_EditorDraw(void);
49
void Fireworm_EditorLoad(void);
50
#endif
51
void Fireworm_Serialize(void);
52
53
// Extra Entity Functions
54
void Fireworm_DebugSpawn(void);
55
void Fireworm_DebugDraw(void);
56
57
void Fireworm_CheckPlayerCollisions(void);
58
void Fireworm_CheckOffScreen(void);
59
60
void Fireworm_State_Init(void);
61
void Fireworm_State_AwaitPlayer(void);
62
void Fireworm_State_HeadAppear(void);
63
64
void Fireworm_State_BodyAppear(void);
65
void Fireworm_State_FlyAround(void);
66
67
#endif //! OBJ_FIREWORM_H
68
69