Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/MMZ/Gachapandora.h
338 views
1
#ifndef OBJ_GACHAPANDORA_H
2
#define OBJ_GACHAPANDORA_H
3
4
#include "Game.h"
5
6
#define GACHAPANDORA_CAPSULE_COUNT (4)
7
8
typedef enum {
9
GACHAPANDORA_MAIN,
10
GACHAPANDORA_EGGMAN,
11
GACHAPANDORA_PRIZE,
12
GACHAPANDORA_AMY,
13
GACHAPANDORA_DRILLER,
14
GACHAPANDORA_FIREDROPPER,
15
GACHAPANDORA_FIREBALL,
16
GACHAPANDORA_DEBRIS,
17
GACHAPANDORA_SPARK,
18
} GachapandoraTypes;
19
20
// Object Class
21
struct ObjectGachapandora {
22
RSDK_OBJECT
23
TABLE(int32 capsuleOffsets[56],
24
{ 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 49, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53,
25
54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 53, 53, 53, 52, 52, 52, 52, 51, 51, 51, 50, 50, 50, 50, 49, 49, 48, 48 });
26
uint8 destroyedToys;
27
uint8 handleDir;
28
uint8 eggmanDir;
29
uint8 capsuleOffsetL[4];
30
uint8 capsuleSpeedL[4];
31
uint8 capsuleMaxL[4];
32
uint8 capsuleTypeL[4];
33
uint8 capsuleDelayL[4];
34
uint8 capsuleOffsetR[4];
35
uint8 capsuleSpeedR[4];
36
uint8 capsuleMaxR[4];
37
uint8 capsuleTypeR[4];
38
uint8 capsuleDelayR[4];
39
int16 handleSpinTimer;
40
uint8 nextPrizeType;
41
int8 nextCapsuleL;
42
int8 nextCapsuleR;
43
int8 lastCapsuleType;
44
uint8 capsuleCount[3];
45
uint8 capsuleSide;
46
uint8 debrisTimer;
47
uint8 sideSparkTimer[2];
48
int32 unused1;
49
int32 unused2;
50
uint8 activeToys;
51
uint8 awardAchievement;
52
EntityGachapandora *eggman;
53
uint16 aniFrames;
54
uint16 eggmanFrames;
55
Hitbox hitboxHandle;
56
Hitbox hitboxAmyRange;
57
Hitbox hitboxAmy;
58
Hitbox hitboxFireball;
59
Hitbox hitboxDrill;
60
Hitbox hitboxSpark;
61
uint16 sfxHit;
62
uint16 sfxExplosion;
63
uint16 sfxUnravel;
64
uint16 sfxPon;
65
uint16 sfxFireball;
66
uint16 sfxGiggle;
67
};
68
69
// Entity Class
70
struct EntityGachapandora {
71
RSDK_ENTITY
72
StateMachine(state);
73
StateMachine(stateDraw);
74
int32 unused;
75
uint8 type;
76
uint16 shakeTimer;
77
uint16 shakeCount;
78
uint16 prevShakeFlags;
79
int32 timer;
80
int32 startY;
81
int32 invincibilityTimer;
82
uint8 health;
83
Vector2 originPos;
84
EntityGachapandora *parent;
85
Animator mainAnimator;
86
Animator eggmanAnimator;
87
Animator handleAnimator;
88
Animator capsuleAnimator;
89
Hitbox hitbox;
90
};
91
92
// Object Struct
93
extern ObjectGachapandora *Gachapandora;
94
95
// Standard Entity Events
96
void Gachapandora_Update(void);
97
void Gachapandora_LateUpdate(void);
98
void Gachapandora_StaticUpdate(void);
99
void Gachapandora_Draw(void);
100
void Gachapandora_Create(void *data);
101
void Gachapandora_StageLoad(void);
102
#if GAME_INCLUDE_EDITOR
103
void Gachapandora_EditorDraw(void);
104
void Gachapandora_EditorLoad(void);
105
#endif
106
void Gachapandora_Serialize(void);
107
108
// Extra Entity Functions
109
void Gachapandora_CheckPlayerCollisions_Prize(void);
110
void Gachapandora_Explode(int32 xMin, int32 xMax, int32 yMin, int32 yMax);
111
112
void Gachapandora_Player_StateInput_P1Grabbed(void);
113
void Gachapandora_Player_StateInput_P2PlayerGrabbed(void);
114
void Gachapandora_Player_StateInput_P2AIGrabbed(void);
115
116
void Gachapandora_HandleSparksAndDebris(void);
117
void Gachapandora_HandleAnimations(void);
118
119
void Gachapandora_StateBoss_SetupArena(void);
120
void Gachapandora_StateBoss_AwaitPlayer(void);
121
void Gachapandora_StateBoss_EnterEggman(void);
122
void Gachapandora_StateBoss_FloatAround(void);
123
void Gachapandora_StateBoss_HandleSpun(void);
124
void Gachapandora_StateBoss_Explode(void);
125
void Gachapandora_StateBoss_PanicFlee(void);
126
void Gachapandora_StateBoss_EnsureAllCapsulesDestroyed(void);
127
void Gachapandora_StateBoss_LastDitchAttack(void);
128
void Gachapandora_StateBoss_Defeated(void);
129
void Gachapandora_StateBoss_EggmanFallOut(void);
130
void Gachapandora_StateBoss_Finish(void);
131
void Gachapandora_Draw_Boss(void);
132
void Gachapandora_Draw_BossDestroyed(void);
133
134
void Gachapandora_StatePrize_CapsuleFall(void);
135
void Gachapandora_StatePrize_ExitCapsule(void);
136
void Gachapandora_StatePrize_Destroyed(void);
137
void Gachapandora_StatePrize_DrillerCapsuleExitBounce(void);
138
void Gachapandora_StatePrize_DrillerMove(void);
139
void Gachapandora_StatePrize_FireDropperMove(void);
140
void Gachapandora_StatePrize_AmyIdle(void);
141
void Gachapandora_StatePrize_AmyWalk(void);
142
void Gachapandora_StatePrize_AmyJump(void);
143
void Gachapandora_StatePrize_AmyRebound(void);
144
void Gachapandora_StatePrize_AmyGrabbed(void);
145
void Gachapandora_Draw_Prize(void);
146
147
void Gachapandora_StateFireball_Falling(void);
148
void Gachapandora_StateFireball_BurnGround(void);
149
150
void Gachapandora_Draw_Simple(void);
151
152
void Gachapandora_StateDebris_Delay(void);
153
void Gachapandora_StateDebris_Falling(void);
154
void Gachapandora_StateDebris_BossDebris(void);
155
void Gachapandora_Draw_BossDebris(void);
156
157
void Gachapandora_StateSpark_Attached(void);
158
void Gachapandora_StateSpark_Detached(void);
159
160
void Gachapandora_StateEggman_Falling(void);
161
void Gachapandora_StateEggman_Escape(void);
162
void Gachapandora_StateEggman_RunAway(void);
163
164
#endif //! OBJ_GACHAPANDORA_H
165
166