Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/PGZ/JuggleSaw.h
338 views
1
#ifndef OBJ_JUGGLESAW_H
2
#define OBJ_JUGGLESAW_H
3
4
#include "Game.h"
5
6
typedef enum { JUGGLESAW_NO_SAW = 0, JUGGLESAW_HAS_SAW = 1, JUGGLESAW_AWAITING_SAW = 2 } JuggleSawMode;
7
8
#define JUGGLESAW_MAX_FRIENDS (8)
9
10
// Object Class
11
struct ObjectJuggleSaw {
12
RSDK_OBJECT
13
Hitbox hitboxBadnik;
14
Hitbox hitboxFriendRange;
15
Hitbox hitboxSaw;
16
Hitbox hitboxGrabV;
17
Hitbox hitboxGrabH;
18
uint16 aniFrames;
19
uint16 sfxExplode;
20
uint16 sfxJuggle;
21
uint16 sfxThrow;
22
};
23
24
// Entity Class
25
struct EntityJuggleSaw {
26
RSDK_ENTITY
27
StateMachine(state);
28
uint16 sawDelay;
29
uint32 sawSpeed;
30
bool32 hasSaw;
31
uint16 setID;
32
EntityJuggleSaw *friends[JUGGLESAW_MAX_FRIENDS];
33
uint8 friendCount;
34
uint8 sawTimer;
35
Vector2 startPos;
36
uint8 startDir;
37
Animator animator;
38
};
39
40
// Object Struct
41
extern ObjectJuggleSaw *JuggleSaw;
42
43
// Standard Entity Events
44
void JuggleSaw_Update(void);
45
void JuggleSaw_LateUpdate(void);
46
void JuggleSaw_StaticUpdate(void);
47
void JuggleSaw_Draw(void);
48
void JuggleSaw_Create(void *data);
49
void JuggleSaw_StageLoad(void);
50
#if GAME_INCLUDE_EDITOR
51
void JuggleSaw_EditorDraw(void);
52
void JuggleSaw_EditorLoad(void);
53
#endif
54
void JuggleSaw_Serialize(void);
55
56
void JuggleSaw_DebugDraw(void);
57
void JuggleSaw_DebugSpawn(void);
58
59
// Extra Entity Functions
60
void JuggleSaw_CheckPlayerCollisions(void);
61
void JuggleSaw_CheckOffScreen(void);
62
63
void JuggleSaw_StateCrab_Setup(void);
64
void JuggleSaw_StateCrab_Handle(void);
65
void JuggleSaw_StateCrab_ThrowSaw(void);
66
67
void JuggleSaw_StateSaw_Handle(void);
68
void JuggleSaw_StateSaw_Debris(void);
69
70
#endif //! OBJ_JUGGLESAW_H
71
72