Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/PGZ/PetalPile.h
338 views
1
#ifndef OBJ_PETALPILE_H
2
#define OBJ_PETALPILE_H
3
4
#include "Game.h"
5
6
typedef enum {
7
PETALPILE_FGHIGH,
8
PETALPILE_FGLOW,
9
} PetalPileLayerIDs;
10
11
typedef enum {
12
PETALPILE_PATTERN_0,
13
PETALPILE_PATTERN_1,
14
PETALPILE_PATTERN_2,
15
PETALPILE_PATTERN_3,
16
PETALPILE_PATTERN_4,
17
} PetalPilePatterns;
18
19
// Object Class
20
struct ObjectPetalPile {
21
RSDK_OBJECT
22
TABLE(int32 patternSize[5], { 7, 6, 6, 10, 3 });
23
TABLE(int32 pattern1[14],
24
{ -0x10000, 0x10000, -0x8000, -0x10000, -0x5555, 0x10000, 0, -0x10000, 0x5555, 0x10000, 0x8000, -0x10000, 0x10000, 0x10000 });
25
TABLE(int32 pattern2[12], { -0x10000, 0x10000, -0x5555, -0x5555, 0x10000, -0x10000, 0, 0xAAAA, 0xAAAA, 0, 0x10000, 0x10000 });
26
TABLE(int32 pattern3[12], { 0x10000, 0x10000, 0x5555, -0x5555, -0x10000, -0x10000, 0, 0xAAAA, -0xAAAA, 0, -0x10000, 0x10000 });
27
TABLE(int32 pattern4[20], { -0x10000, 0x10000, -0x8000, -0x10000, -0x5555, 0x10000, 0, -0x10000, 0x5555, 0x10000,
28
0x8000, -0x10000, 0x10000, 0x10000, -0xAAAA, 0, 0, 0, 0xAAAA, 0 });
29
TABLE(int32 pattern5[6], { 0, -0x10000, -0x10000, 0x10000, 0x10000, 0x10000 });
30
uint16 aniFrames;
31
uint16 sfxPetals;
32
};
33
34
// Entity Class
35
struct EntityPetalPile {
36
RSDK_ENTITY
37
StateMachine(state);
38
StateMachine(stateDraw);
39
uint16 timer;
40
int8 leafPattern;
41
int8 tileLayer;
42
Vector2 pileSize;
43
Vector2 maxSpeed;
44
bool32 emitterMode;
45
uint8 layerID;
46
Vector2 velStore;
47
Vector2 distance; // dunno if this is actually a vec2 but the .y is always set to 0 so maybe?
48
int32 petalVel;
49
int32 unused;
50
int8 petalDir;
51
int32 petalRadius;
52
int32 petalOffset;
53
bool32 noRemoveTiles;
54
Hitbox hitbox;
55
Animator animator;
56
};
57
58
// Object Struct
59
extern ObjectPetalPile *PetalPile;
60
61
// Standard Entity Events
62
void PetalPile_Update(void);
63
void PetalPile_LateUpdate(void);
64
void PetalPile_StaticUpdate(void);
65
void PetalPile_Draw(void);
66
void PetalPile_Create(void *data);
67
void PetalPile_StageLoad(void);
68
#if GAME_INCLUDE_EDITOR
69
void PetalPile_EditorDraw(void);
70
void PetalPile_EditorLoad(void);
71
#endif
72
void PetalPile_Serialize(void);
73
74
// Extra Entity Functions
75
int32 PetalPile_GetLeafPattern(Vector2 *patternPtr);
76
77
void PetalPile_State_Init(void);
78
void PetalPile_State_HandleInteractions(void);
79
void PetalPile_State_SetupEmitter(void);
80
void PetalPile_State_Emitter(void);
81
82
void PetalPile_StateLeaf_Setup(void);
83
void PetalPile_StateLeaf_Delay(void);
84
void PetalPile_StateLeaf_HandleVelocity(void);
85
void PetalPile_StateLeaf_Fall(void);
86
87
void PetalPile_Draw_Leaf(void);
88
89
#endif //! OBJ_PETALPILE_H
90
91