Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/SSZ/Beanstalk.h
338 views
1
#ifndef OBJ_BEANSTALK_H
2
#define OBJ_BEANSTALK_H
3
4
#include "Game.h"
5
6
typedef enum {
7
BEANSTALK_BEGIN,
8
BEANSTALK_NODE,
9
BEANSTALK_PLATFORM,
10
BEANSTALK_CHOMPER,
11
} BeanstalkTypes;
12
13
// Object Class
14
struct ObjectBeanstalk {
15
RSDK_OBJECT
16
uint16 aniFrames;
17
Hitbox hitboxSeed;
18
Hitbox hitboxPlatform;
19
Hitbox hitboxPlant;
20
uint16 sfxImpact;
21
uint16 sfxBeanNode;
22
uint16 sfxBeanChomp;
23
};
24
25
// Entity Class
26
struct EntityBeanstalk {
27
RSDK_ENTITY
28
StateMachine(state);
29
uint8 type;
30
int32 bezCtrlAngle;
31
int32 bezCtrlLength;
32
bool32 forceEnd;
33
uint8 moveAngle;
34
int32 timer;
35
uint16 curBezierPos;
36
int32 size;
37
int32 bezierInc;
38
int32 bezierPos;
39
uint8 curNodeID;
40
uint8 curDecorID;
41
bool32 setupDecorNodeID;
42
Vector2 startPos;
43
Vector2 platformPos;
44
int32 stoodAngle;
45
int32 chomperOffset;
46
uint8 activePlayers;
47
Animator nodeAnimator;
48
Animator plantAnimator;
49
Animator fillerAnimator;
50
bool32 startGrowth;
51
bool32 shown;
52
bool32 finished;
53
};
54
55
// Object Struct
56
extern ObjectBeanstalk *Beanstalk;
57
58
// Standard Entity Events
59
void Beanstalk_Update(void);
60
void Beanstalk_LateUpdate(void);
61
void Beanstalk_StaticUpdate(void);
62
void Beanstalk_Draw(void);
63
void Beanstalk_Create(void *data);
64
void Beanstalk_StageLoad(void);
65
#if GAME_INCLUDE_EDITOR
66
void Beanstalk_EditorDraw(void);
67
void Beanstalk_EditorLoad(void);
68
#endif
69
void Beanstalk_Serialize(void);
70
71
// Extra Entity Functions
72
int32 Beanstalk_GetNextNodeDistance(void);
73
int32 Beanstalk_GetRemainingDistance(void);
74
int32 Beanstalk_GetBezierInc(void);
75
76
void Beanstalk_DrawNodes(void);
77
void Beanstalk_DrawCreationNode(void);
78
79
void Beanstalk_HandleNodeMovement(void);
80
void Beanstalk_HandleNodeAppear(void);
81
82
void Beanstalk_CheckPlayerCollisions_Platform(void);
83
void Beanstalk_CheckPlayerCollisions_Chomper(void);
84
85
void Beanstalk_State_Init(void);
86
void Beanstalk_StateDirt_WaitForStart(void);
87
void Beanstalk_StateDirt_GrowthDelay(void);
88
void Beanstalk_StateDirt_Grow(void);
89
90
void Beanstalk_State_Node(void);
91
void Beanstalk_State_Platform(void);
92
void Beanstalk_State_Chomper(void);
93
94
#endif //! OBJ_BEANSTALK_H
95
96