Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/HCZ/PullChain.h
338 views
1
#ifndef OBJ_PULLCHAIN_H
2
#define OBJ_PULLCHAIN_H
3
4
#include "Game.h"
5
6
typedef enum {
7
PULLCHAIN_NORMAL,
8
} PullChainTypes;
9
10
typedef enum {
11
PULLCHAIN_INPUT_NONE,
12
PULLCHAIN_INPUT_LEFT,
13
PULLCHAIN_INPUT_RIGHT,
14
PULLCHAIN_INPUT_UP,
15
PULLCHAIN_INPUT_DOWN,
16
} PullChainInputMasks;
17
18
// Object Class
19
struct ObjectPullChain {
20
RSDK_OBJECT
21
// left, left, left, right, right, right, up, up, up!
22
TABLE(int32 dunkeyCode[18], { 0, 1, 0, 1, 0, 1, 0, 2, 0, 2, 0, 2, 0, 3, 0, 3, 0, 3 });
23
uint16 aniFrames;
24
uint16 sfxPullChain;
25
};
26
27
// Entity Class
28
struct EntityPullChain {
29
MANIA_BUTTON_BASE
30
31
Animator hookAnimator;
32
int32 length;
33
int32 decorMode;
34
uint8 activePlayers;
35
uint8 releasedPlayers;
36
Vector2 basePos;
37
int32 unused;
38
int32 chainOffset;
39
int32 grabDelay[PLAYER_COUNT];
40
uint8 codeButtonMasks;
41
int32 cheatCodeInputs[18];
42
Hitbox hitbox;
43
Animator chainAnimator;
44
};
45
46
// Object Struct
47
extern ObjectPullChain *PullChain;
48
49
// Standard Entity Events
50
void PullChain_Update(void);
51
void PullChain_LateUpdate(void);
52
void PullChain_StaticUpdate(void);
53
void PullChain_Draw(void);
54
void PullChain_Create(void *data);
55
void PullChain_StageLoad(void);
56
#if GAME_INCLUDE_EDITOR
57
void PullChain_EditorDraw(void);
58
void PullChain_EditorLoad(void);
59
#endif
60
void PullChain_Serialize(void);
61
62
// Extra Entity Functions
63
#if GAME_VERSION == VER_100
64
bool32 PullChain_HandleDunkeyCode(EntityPlayer *player);
65
#endif
66
67
#endif //! OBJ_PULLCHAIN_H
68
69