Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/SSZ/HotaruHiWatt.h
338 views
1
#ifndef OBJ_HOTARUHIWATT_H
2
#define OBJ_HOTARUHIWATT_H
3
4
#include "Game.h"
5
6
typedef enum {
7
HHW_BOSS,
8
HHW_SINGLE_HOTARU,
9
HHW_PAIR_HOTARU,
10
HHW_UNUSED1,
11
HHW_SMALL_HOTARU,
12
HHW_FLASH,
13
HHW_UNUSED2,
14
HHW_MINILASER,
15
HHW_ELECTRICORB,
16
} HHWTypes;
17
18
// Object Class
19
struct ObjectHotaruHiWatt {
20
RSDK_OBJECT
21
TABLE(int32 debrisInfo[33],
22
{ 8, 0, 0, -0x20000, -0x28000, 1, 0, 0x20000, -0x28000, 2, 0, -0x28000, -0x20000, 3, 0, 0x28000, -0x20000,
23
4, 0, -0x28000, -0x18000, 5, 0, 0x28000, -0x18000, 6, 0, -0x20000, -0x10000, 7, 0, 0x20000, -0x10000 });
24
int32 boundsL;
25
int32 boundsM;
26
int32 boundsR;
27
int32 boundsT;
28
int32 boundsB;
29
int32 startY;
30
bool32 spawnedLaserStrike;
31
uint16 sfxHit;
32
uint16 sfxExplosion;
33
uint16 sfxHHWAppear;
34
uint16 sfxFlash;
35
uint16 sfxLaser;
36
uint16 sfxAppear;
37
uint16 sfxFly;
38
uint16 sfxFlyUp;
39
uint16 sfxCharge;
40
uint16 aniFrames;
41
uint16 hotaruFrames;
42
};
43
44
// Entity Class
45
struct EntityHotaruHiWatt {
46
RSDK_ENTITY
47
StateMachine(state);
48
StateMachine(nextState);
49
StateMachine(stateDraw);
50
int32 type;
51
int32 timer;
52
int32 invincibilityTimer;
53
int32 health;
54
int32 formationCircleRadius;
55
int32 bulbAlpha;
56
int32 unused;
57
Vector2 originPos;
58
Vector2 targetPos;
59
Vector2 laserImpactPos;
60
EntityHotaruHiWatt *parents[3];
61
bool32 playingBossTrack;
62
Animator mainAnimator;
63
Animator headAnimator;
64
Animator bulbAnimator;
65
Animator bulbFlashAnimator;
66
Animator laserImpactAnimator;
67
Hitbox hitbox;
68
};
69
70
// Object Struct
71
extern ObjectHotaruHiWatt *HotaruHiWatt;
72
73
// Standard Entity Events
74
void HotaruHiWatt_Update(void);
75
void HotaruHiWatt_LateUpdate(void);
76
void HotaruHiWatt_StaticUpdate(void);
77
void HotaruHiWatt_Draw(void);
78
void HotaruHiWatt_Create(void *data);
79
void HotaruHiWatt_StageLoad(void);
80
#if GAME_INCLUDE_EDITOR
81
void HotaruHiWatt_EditorDraw(void);
82
void HotaruHiWatt_EditorLoad(void);
83
#endif
84
void HotaruHiWatt_Serialize(void);
85
86
// Extra Entity Functions
87
bool32 HotaruHiWatt_SfxCheck_Zap(void);
88
bool32 HotaruHiWatt_SfxCheck_HHWLaser(void);
89
void HotaruHiWatt_SfxUpdate_HHWLaser(int32 sfx);
90
91
void HotaruHiWatt_Hit(void);
92
void HotaruHiWatt_Explode(void);
93
94
void HotaruHiWatt_CheckPlayerCollisions_Hotaru(void);
95
void HotaruHiWatt_CheckPlayerCollisions_Boss(void);
96
void HotaruHiWatt_CheckPlayerCollisions_MiniLaser(void);
97
void HotaruHiWatt_CheckPlayerCollisions_BossLaser(void);
98
99
// Drawing
100
void HotaruHiWatt_Draw_Hotaru(void);
101
void HotaruHiWatt_Draw_HotaruAttacking(void);
102
void HotaruHiWatt_Draw_Boss(void);
103
void HotaruHiWatt_Draw_BossLaserCharging(void);
104
void HotaruHiWatt_Draw_BossLaser(void);
105
void HotaruHiWatt_Draw_FormingHHW(void);
106
void HotaruHiWatt_Draw_FlashAppear(void);
107
108
// End of attack helpers
109
void HotaruHiWatt_SpawnPairHotarus(void);
110
void HotaruHiWatt_SetupHHWReappear(void);
111
112
// HotaruHiWatt Appear
113
void HotaruHiWatt_StateBoss_SetupArena(void);
114
void HotaruHiWatt_StateBoss_AwaitPlayer(void);
115
void HotaruHiWatt_StateBoss_Appear(void);
116
void HotaruHiWatt_StateBoss_FlyUp(void);
117
118
// Hotaru Misc
119
void HotaruHiWatt_StateHotaru_MoveToTarget(void);
120
121
void HotaruHiWatt_StateBoss_FlashFadeOut(void);
122
123
// Dimming/Undimming the screen
124
void HotaruHiWatt_StateBoss_HiddenDimScreen(void);
125
void HotaruHiWatt_StateBoss_HiddenUndimScreen(void);
126
127
// Single Hotaru
128
void HotaruHiWatt_StateHotaru_DimScreen(void);
129
void HotaruHiWatt_StateHotaru_Charging(void);
130
void HotaruHiWatt_StateHotaru_Attacking(void);
131
void HotaruHiWatt_StateHotaru_FinishedAttack(void);
132
void HotaruHiWatt_StateHotaru_EndAttackSequence(void);
133
134
// Single Hotaru (Laser)
135
void HotaruHiWatt_State_MiniLaser(void);
136
void HotaruHiWatt_State_MiniLaserStrike(void);
137
138
// Pair Hotarus
139
void HotaruHiWatt_StateHotaruPair_DimScreen(void);
140
void HotaruHiWatt_StateHotaruPair_PrepareAttack(void);
141
void HotaruHiWatt_StateHotaruPair_Charging(void);
142
void HotaruHiWatt_StateHotaruPair_AttackDelay(void);
143
void HotaruHiWatt_StateHotaruPair_AttackMovingDown(void);
144
void HotaruHiWatt_StateHotaruPair_AttackMovingUp(void);
145
146
// Sparky Orb
147
void HotaruHiWatt_State_SparkyOrb(void);
148
void HotaruHiWatt_State_SparkyOrb_FadeOut(void);
149
150
// HotaruHiWatt
151
void HotaruHiWatt_StateBoss_DimScreen(void);
152
void HotaruHiWatt_StateBoss_CreateSmallHHWs(void);
153
void HotaruHiWatt_StateBoss_FormingHHW(void);
154
void HotaruHiWatt_StateBoss_FlashAppear(void);
155
void HotaruHiWatt_StateBoss_LaserAttackDelay(void);
156
void HotaruHiWatt_StateBoss_ChargingLaser(void);
157
void HotaruHiWatt_StateBoss_LaserAttack_Right(void);
158
void HotaruHiWatt_StateBoss_LaserAttack_Left(void);
159
void HotaruHiWatt_StateBoss_FinishedLaserAttack(void);
160
void HotaruHiWatt_StateBoss_Destroyed(void);
161
void HotaruHiWatt_StateBoss_Finished(void);
162
163
#endif //! OBJ_HOTARUHIWATT_H
164
165