Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/OOZ/MegaOctus.h
338 views
1
#ifndef OBJ_MEGAOCTUS_H
2
#define OBJ_MEGAOCTUS_H
3
4
#include "Game.h"
5
6
typedef enum {
7
MEGAOCTUS_BODY,
8
MEGAOCTUS_UNUSED1,
9
MEGAOCTUS_HARPOON,
10
MEGAOCTUS_CANNON,
11
MEGAOCTUS_ORB,
12
MEGAOCTUS_ARM,
13
MEGAOCTUS_LASER,
14
MEGAOCTUS_ORBSHOT,
15
MEGAOCTUS_UNUSED8,
16
MEGAOCTUS_LASERFIRE,
17
} MegaOctusTypes;
18
19
// Object Class
20
struct ObjectMegaOctus {
21
RSDK_OBJECT
22
EntityMegaOctus *bossEntity;
23
Animator noseAnimator;
24
Animator boltsAnimator;
25
Animator eggmanAnimator;
26
Animator hatchBaseAnimator;
27
Animator hatchOpenAnimator;
28
int32 eggmanOffset;
29
int32 eggmanVelocity;
30
bool32 spawnHarpoon;
31
int32 turnPos;
32
TABLE(int32 turnOffsets[11], { -0x200000, -0x180000, -0x100000, -0xC0000, -0x80000, 0, 0x80000, 0xC0000, 0x100000, 0x180000, 0x200000 });
33
TABLE(int32 cannonHeights[4], { -0x780000, -0x800000, -0x700000, -0x510000 });
34
int32 orbHealth[2];
35
bool32 defeated;
36
uint16 aniFrames;
37
uint16 eggmanFrames;
38
uint16 hatchFrames;
39
Hitbox hitbox;
40
uint16 sfxBossHit;
41
uint16 sfxExplosion;
42
uint16 sfxLaser;
43
uint16 sfxBullet;
44
uint16 sfxHarpoon;
45
uint16 sfxSurface;
46
uint16 sfxLaserSplash;
47
};
48
49
// Entity Class
50
struct EntityMegaOctus {
51
RSDK_ENTITY
52
StateMachine(state);
53
StateMachine(stateDraw);
54
uint8 type;
55
int32 timer;
56
int32 orbMoveAngle;
57
int32 targetPos;
58
int32 lastAttackHeight;
59
int32 shotCount;
60
int32 invincibilityTimer;
61
uint8 health;
62
Vector2 origin;
63
int32 orbID;
64
Entity *parent;
65
#if MANIA_USE_PLUS
66
int32 tilePlatY;
67
#endif
68
Animator animator;
69
Animator altAnimator;
70
Hitbox hitbox;
71
};
72
73
// Object Struct
74
extern ObjectMegaOctus *MegaOctus;
75
76
// Standard Entity Events
77
void MegaOctus_Update(void);
78
void MegaOctus_LateUpdate(void);
79
void MegaOctus_StaticUpdate(void);
80
void MegaOctus_Draw(void);
81
void MegaOctus_Create(void *data);
82
void MegaOctus_StageLoad(void);
83
#if GAME_INCLUDE_EDITOR
84
void MegaOctus_EditorDraw(void);
85
void MegaOctus_EditorLoad(void);
86
#endif
87
void MegaOctus_Serialize(void);
88
89
// Extra Entity Functions
90
void MegaOctus_CheckPlayerCollisions_Body(void);
91
void MegaOctus_HandleEggmanAnim(void);
92
void MegaOctus_Hit(void);
93
void MegaOctus_Explode(void);
94
void MegaOctus_HandleDirectionChange(void);
95
96
void MegaOctus_State_SetupBounds(void);
97
void MegaOctus_State_SetupArena(void);
98
void MegaOctus_State_None(void);
99
void MegaOctus_State_EnterMegaOctus(void);
100
void MegaOctus_State_OpenHatchAndLaugh(void);
101
void MegaOctus_State_CloseHatch(void);
102
void MegaOctus_State_DiveIntoOil(void);
103
void MegaOctus_State_SpawnWeapons(void);
104
void MegaOctus_State_CannonThenSpawnOrbs(void);
105
void MegaOctus_State_Destroyed(void);
106
void MegaOctus_State_Finish(void);
107
void MegaOctus_Draw_Body(void);
108
109
void MegaOctus_CheckPlayerCollisions_Harpoon(void);
110
void MegaOctus_State_HarpoonLeft(void);
111
void MegaOctus_State_HarpoonRight(void);
112
void MegaOctus_Draw_HarpoonLeft(void);
113
void MegaOctus_Draw_HarpoonRight(void);
114
115
void MegaOctus_CheckPlayerCollisions_Cannon(void);
116
void MegaOctus_StateCannon_RiseUp(void);
117
void MegaOctus_StateCannon_Idle(void);
118
void MegaOctus_StateCannon_FireLaser(void);
119
void MegaOctus_StateCannon_SinkDown(void);
120
void MegaOctus_Draw_Cannon(void);
121
122
void MegaOctus_CheckPlayerCollisions_Orb(void);
123
void MegaOctus_StateOrb_Wait(void);
124
void MegaOctus_StateOrb_FireShot(void);
125
void MegaOctus_StateOrb_Idle(void);
126
void MegaOctus_StateOrb_Destroyed(void);
127
void MegaOctus_Draw_Orb(void);
128
129
void MegaOctus_StateArm_WrapAroundPlatform(void);
130
void MegaOctus_StateArm_GrabbedPlatform(void);
131
void MegaOctus_StateArm_PullPlatformDown(void);
132
void MegaOctus_StateArm_RisePlatformUp(void);
133
void MegaOctus_Draw_Arm_WrapAroundPlatformBase(void);
134
135
void MegaOctus_StateArm_GrabPlatform(void);
136
void MegaOctus_Draw_Arm_WrapAroundPlatformTop(void);
137
138
void MegaOctus_State_Laser(void);
139
140
void MegaOctus_State_LaserFire(void);
141
void MegaOctus_Draw_Laser(void);
142
143
void MegaOctus_State_Shot(void);
144
void MegaOctus_Draw_OrbShot(void);
145
146
#if MANIA_USE_PLUS
147
void MegaOctus_TilePlatformState_RiseOuttaOil(void);
148
#endif
149
150
#endif //! OBJ_MEGAOCTUS_H
151
152