Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/ERZ/KleptoMobile.h
338 views
1
#ifndef OBJ_KLEPTOMOBILE_H
2
#define OBJ_KLEPTOMOBILE_H
3
4
#include "Game.h"
5
6
typedef enum {
7
KLEPTOMOBILE_EGGMAN,
8
KLEPTOMOBILE_ARM_L,
9
KLEPTOMOBILE_ARM_R,
10
KLEPTOMOBILE_HAND,
11
} KleptoMobileTypes;
12
13
// Object Class
14
struct ObjectKleptoMobile {
15
RSDK_OBJECT
16
TABLE(int32 debrisInfo[29], { 4, 0, 0, -0x20000, -0x28000, 1, 0, -0x20000, -0x28000, 2, 0, 0x20000, -0x20000, 3, 0, 0x28000,
17
-0x20000, 4, 0, -0x10000, -0x10000, 5, 0, 0x10000, -0x10000, 6, 0, -0x8000, -0x10000 });
18
int32 boundsL;
19
int32 boundsR;
20
int32 boundsM;
21
int32 boundsT;
22
int32 boundsB;
23
uint16 sfxHit;
24
uint16 sfxExplosion;
25
uint16 sfxFlail;
26
uint16 sfxWhack;
27
uint16 sfxPowerUp;
28
uint16 sfxRocketJet;
29
uint16 aniFrames;
30
bool32 defeated;
31
};
32
33
// Entity Class
34
struct EntityKleptoMobile {
35
RSDK_ENTITY
36
StateMachine(state);
37
StateMachine(stateDraw);
38
int32 type;
39
int32 timer;
40
int32 invincibilityTimer;
41
int32 health;
42
Vector2 originPos;
43
int32 armAngles[10]; // array of angles for the arm nodes, not actually used lol, possibly leftover from ERZ/PhantomKing?
44
Vector2 armPositions[10];
45
Vector2 armBezierPos;
46
Vector2 bashArmTargetPos;
47
Vector2 bashArmStartPos;
48
int32 attackCount;
49
int32 bashArmDelay;
50
int32 bashArmID;
51
bool32 canBashAttack;
52
Vector2 rubyPos;
53
bool32 holdingRuby;
54
int32 armAngle;
55
int32 circleRadius;
56
int32 explosionVolume;
57
EntityKleptoMobile *parent;
58
Animator basicAnimator; // not actually used it seems
59
Animator mobileTopAnimator;
60
Animator eggmanAnimator;
61
Animator mobileAnimator;
62
Animator unusedAnimator1;
63
Animator unusedAnimator2;
64
Animator orbAnimator;
65
Animator handAnimator;
66
Animator finger1Animator;
67
Animator finger2Animator;
68
Animator rubyAnimator;
69
Hitbox hitbox;
70
};
71
72
// Object Struct
73
extern ObjectKleptoMobile *KleptoMobile;
74
75
// Standard Entity Events
76
void KleptoMobile_Update(void);
77
void KleptoMobile_LateUpdate(void);
78
void KleptoMobile_StaticUpdate(void);
79
void KleptoMobile_Draw(void);
80
void KleptoMobile_Create(void *data);
81
void KleptoMobile_StageLoad(void);
82
#if GAME_INCLUDE_EDITOR
83
void KleptoMobile_EditorDraw(void);
84
void KleptoMobile_EditorLoad(void);
85
#endif
86
void KleptoMobile_Serialize(void);
87
88
// Extra Entity Functions
89
void KleptoMobile_HandleAnimations(void);
90
void KleptoMobile_CheckPlayerCollisions(void);
91
void KleptoMobile_Hit(void);
92
void KleptoMobile_Explode(void);
93
void KleptoMobile_HandleFrames(void);
94
void KleptoMobile_SwitchToKing(void);
95
96
void KleptoMobile_Draw_KleptoMobile(void);
97
void KleptoMobile_State_SetupArena(void);
98
void KleptoMobile_State_CutsceneControlled(void);
99
void KleptoMobile_State_MoveAround(void);
100
void KleptoMobile_State_Hover(void);
101
void KleptoMobile_HandleArmPositions(void);
102
void KleptoMobile_HandleChargeFinish(void);
103
void KleptoMobile_State_FirstChargeAttack(void);
104
void KleptoMobile_State_NextChargeAttacks(void);
105
void KleptoMobile_State_Switch(void);
106
void KleptoMobile_State_HitFall(void);
107
108
void KleptoMobile_StateHand_Cutscene(void);
109
void KleptoMobile_StateHand_Boss(void);
110
void KleptoMobile_Draw_Hand(void);
111
112
void KleptoMobile_CheckPlayerCollisions_Arm(void);
113
114
void KleptoMobile_StateArm_Cutscene(void);
115
void KleptoMobile_StateArm_Idle(void);
116
void KleptoMobile_StateArm_BashAttack(void);
117
void KleptoMobile_StateArm_ChargeAttack(void);
118
void KleptoMobile_Draw_Arm(void);
119
120
void KleptoMobile_State_Destroyed(void);
121
void KleptoMobile_State_Explode(void);
122
void KleptoMobile_State_CutsceneExplode(void);
123
124
#endif //! OBJ_KLEPTOMOBILE_H
125
126