Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/TMZ/CrimsonEye.h
338 views
1
#ifndef OBJ_CRIMSONEYE_H
2
#define OBJ_CRIMSONEYE_H
3
4
#include "Game.h"
5
6
typedef enum {
7
CRIMSONEYE_CONTAINER,
8
CRIMSONEYE_CORE,
9
CRIMSONEYE_BALL,
10
CRIMSONEYE_ARROW,
11
CRIMSONEYE_SPIKE,
12
CRIMSONEYE_SHOT,
13
} CrimsonEyeTypes;
14
15
typedef enum {
16
CE_ARROW_DOWN = 1,
17
CE_ARROW_UP = 4,
18
CE_ARROW_OFF = 0xFF,
19
} CrimsonEyeArrowTypes;
20
21
// Object Class
22
struct ObjectCrimsonEye {
23
RSDK_OBJECT
24
TABLE(int32 debrisInfo[97],
25
{ 24, 0, 0, -0x28000, -0x28000, 1, 0, -0x14000, -0x28000, 2, 0, 0x14000, -0x26000, 3, 0, 0x28000, -0x26000, 4, 0, -0x26000,
26
-0x24000, 5, 0, 0x26000, -0x24000, 6, 0, -0x26000, -0x22000, 7, 0, 0x26000, -0x22000, 8, 0, -0x24000, -0x20000, 9, 0, -0x12000,
27
-0x20000, 10, 0, 0x12000, -0x20000, 11, 0, 0x24000, -0x20000, 12, 0, -0x22000, -0x1E000, 13, 0, -0x11000, -0x1E000, 14, 0, 0x11000,
28
-0x1E000, 15, 0, 0x22000, -0x1E000, 16, 0, -0x20000, -0x1C000, 17, 0, -0x10000, -0x1C000, 18, 0, 0x10000, -0x1C000, 19, 0, 0x20000,
29
-0x1C000, 20, 0, -0x1A000, -0x1A000, 21, 0, -0xD000, -0x1A000, 22, 0, 0xD000, -0x1A000, 23, 0, 0x1A000, -0x1A000 });
30
uint8 health;
31
uint8 invincibilityTimer;
32
uint8 ballSpinAngleX;
33
uint8 ballSpinAngleY;
34
int32 ballSpinRadius;
35
int32 ballOffsetY;
36
Vector2 containerPos;
37
Vector2 eyePositions[3];
38
TABLE(int32 ballDestroyOrder[8], { 1, 5, 2, 6, 3, 7, 4, 8 });
39
int32 destroyedBallCount;
40
int32 elevatorSpeed;
41
int32 targetElevatorSpeed;
42
int32 nextTargetElevatorSpeed;
43
int32 elevatorGravity; // probably not this, but I really didn't have much to work with here, sorry!
44
int32 shotTimer;
45
uint8 shotsRemaining;
46
int32 unused;
47
uint16 aniFrames;
48
Hitbox hitboxEye;
49
Hitbox hitboxBall;
50
Hitbox hitboxOrb;
51
Hitbox hitboxBlock;
52
Hitbox hitboxElecOrb;
53
Hitbox hitboxUnused1;
54
Hitbox hitboxUnused2;
55
uint16 sfxHit;
56
uint16 sfxExplosion;
57
uint16 sfxHover;
58
uint16 sfxHover2;
59
uint16 sfxElevator;
60
uint16 sfxShot;
61
uint16 sfxBeep;
62
uint16 sfxHullClose;
63
uint16 sfxButton;
64
uint16 sfxImpact;
65
TileLayer *liftBackground;
66
TileLayer *bg2Layer;
67
};
68
69
// Entity Class
70
struct EntityCrimsonEye {
71
RSDK_ENTITY
72
StateMachine(state);
73
StateMachine(stateEye);
74
StateMachine(stateDraw);
75
int32 type;
76
int32 timer;
77
int32 ballTimer;
78
int32 ballRadiusTimer;
79
Vector2 originPos;
80
Animator animator;
81
};
82
83
// Object Struct
84
extern ObjectCrimsonEye *CrimsonEye;
85
86
// Standard Entity Events
87
void CrimsonEye_Update(void);
88
void CrimsonEye_LateUpdate(void);
89
void CrimsonEye_StaticUpdate(void);
90
void CrimsonEye_Draw(void);
91
void CrimsonEye_Create(void *data);
92
void CrimsonEye_StageLoad(void);
93
#if GAME_INCLUDE_EDITOR
94
void CrimsonEye_EditorDraw(void);
95
void CrimsonEye_EditorLoad(void);
96
#endif
97
void CrimsonEye_Serialize(void);
98
99
// Extra Entity Functions
100
void CrimsonEye_Explode(void);
101
void CrimsonEye_Hit(void);
102
103
void CrimsonEye_SetupBG2Layer(void);
104
void CrimsonEye_DrawHook_DisableFGSilhouette(void);
105
void CrimsonEye_DrawHook_EnableFGSilhouette(void);
106
107
void CrimsonEye_SetArrowDir(int32 type);
108
109
void CrimsonEye_StateContainer_SetupArena(void);
110
void CrimsonEye_StateContainer_AwaitPlayer(void);
111
void CrimsonEye_StateContainer_StartFight(void);
112
void CrimsonEye_StateContainer_CoreActive(void);
113
void CrimsonEye_StateContainer_HandleElevator(void);
114
void CrimsonEye_StateContainer_Explode(void);
115
void CrimsonEye_StateContainer_MoveElevatorToTMZ2Entry(void);
116
void CrimsonEye_Draw_Container(void);
117
118
void CrimsonEye_StateEye_EnterBalls(void);
119
void CrimsonEye_StateEye_SpinningBalls(void);
120
void CrimsonEye_StateEye_LowerBalls(void);
121
void CrimsonEye_StateEye_LoweredBalls(void);
122
void CrimsonEye_StateEye_ExtendBallAttack(void);
123
void CrimsonEye_StateEye_FinishExtendAttack(void);
124
void CrimsonEye_StateEye_RaiseBalls(void);
125
126
void CrimsonEye_ShootShot(void);
127
void CrimsonEye_SetupEyePositions(void);
128
void CrimsonEye_DestroyBall(void);
129
void CrimsonEye_CheckPlayerCollisions(void);
130
131
void CrimsonEye_StateCore_ContainerActive(void);
132
void CrimsonEye_StateCore_BreakOut(void);
133
void CrimsonEye_StateCore_BrokenOut(void);
134
void CrimsonEye_StateCore_Hovering(void);
135
void CrimsonEye_StateCore_ImpactLift(void);
136
void CrimsonEye_StateCore_Explode(void);
137
void CrimsonEye_StateCore_SpawnSignPost(void);
138
void CrimsonEye_Draw_Core(void);
139
140
void CrimsonEye_CheckPlayerCollisions_Ball(void);
141
void CrimsonEye_StateBall_Spinning(void);
142
void CrimsonEye_StateBall_Destroyed(void);
143
144
void CrimsonEye_Draw_Simple(void);
145
146
void CrimsonEye_StateSpike_Harmful(void);
147
void CrimsonEye_StateSpike_Debris(void);
148
149
void CrimsonEye_State_Shot(void);
150
151
void CrimsonEye_State_Arrow(void);
152
void CrimsonEye_Draw_Arrow(void);
153
154
#endif //! OBJ_CRIMSONEYE_H
155
156