Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/GHZ/DERobot.h
338 views
1
#ifndef OBJ_DEROBOT_H
2
#define OBJ_DEROBOT_H
3
4
#include "Game.h"
5
6
typedef enum {
7
DEROBOT_BODY,
8
DEROBOT_HEAD,
9
DEROBOT_ARM,
10
DEROBOT_LEG,
11
DEROBOT_SPIKES,
12
DEROBOT_ARM_THREAD,
13
DEROBOT_TARGET_EDGE,
14
DEROBOT_TARGET_CENTER,
15
DEROBOT_TARGET_LOCK,
16
DEROBOT_BOMB,
17
DEROBOT_BODY_CUTSCENE,
18
} DERobotAniLists;
19
20
// Object Class
21
struct ObjectDERobot {
22
RSDK_OBJECT
23
uint16 aniFrames;
24
Hitbox hitboxHand;
25
Hitbox hitboxBody;
26
uint16 unused1;
27
uint16 unused2;
28
uint16 unused3;
29
uint16 unused4;
30
uint16 sfxHit;
31
uint16 sfxExplosion;
32
uint16 sfxTargeting;
33
uint16 sfxImpact;
34
uint16 sfxLedgeBreak;
35
uint16 sfxBuzzsaw;
36
uint16 sfxDrop;
37
uint16 sfxButton2;
38
uint16 sfxHullClose;
39
};
40
41
// Entity Class
42
struct EntityDERobot {
43
RSDK_ENTITY
44
StateMachine(state);
45
StateMachine(stateDraw);
46
int32 unused1;
47
int32 unused2;
48
int32 unused3;
49
int32 unused4;
50
Entity *parent;
51
EntityDERobot *head;
52
EntityDERobot *shoulderFront;
53
EntityEggman *eggman;
54
EntityDERobot *legs[6]; // knee, leg, foot (for back, then for front)
55
EntityDERobot *arms[4]; // arm, hand, (for back, then for front)
56
int32 movingSide;
57
int32 unused5;
58
int32 angleVel;
59
int32 angleInc;
60
Vector2 offset;
61
int32 timer;
62
int32 invincibilityTimer;
63
int32 health;
64
int32 armExtend;
65
int32 destroyedTerrainX;
66
int32 kneeAngleVel;
67
int32 angleVelStart;
68
int32 angleMaxInc;
69
Hitbox hitbox;
70
Animator mainAnimator;
71
Animator altAnimator;
72
Animator armAnimator;
73
int32 aniID;
74
int32 frameID;
75
};
76
77
// Object Struct
78
extern ObjectDERobot *DERobot;
79
80
// Standard Entity Events
81
void DERobot_Update(void);
82
void DERobot_LateUpdate(void);
83
void DERobot_StaticUpdate(void);
84
void DERobot_Draw(void);
85
void DERobot_Create(void *data);
86
void DERobot_StageLoad(void);
87
#if GAME_INCLUDE_EDITOR
88
void DERobot_EditorDraw(void);
89
void DERobot_EditorLoad(void);
90
#endif
91
void DERobot_Serialize(void);
92
93
// Extra Entity Functions
94
void DERobot_HandleScreenBounds(void);
95
void DERobot_HandleLegMovement(int32 offset);
96
void DERobot_HandleLegMovement2(int32 offset);
97
void DERobot_HandleArmMovement(int32 offset);
98
void DERobot_HandleTerrainDestruction(void);
99
void DERobot_DestroyTerrainFinal(void);
100
void DERobot_Hit(void);
101
void DERobot_Explode(void);
102
103
void DERobot_CheckPlayerCollisions_Body(void);
104
void DERobot_CheckPlayerCollisions_ArmExtend(void);
105
void DERobot_CheckPlayerCollisions_Hand(void);
106
bool32 DERobot_CheckRubyGrabbed(void);
107
void DERobot_CheckPlayerCollisions_Bomb(void);
108
109
void DERobot_Draw_RelativeToParent(void);
110
void DERobot_Draw_Arm(void);
111
void DERobot_Draw_Simple(void);
112
void DERobot_Draw_FrontLeg(void);
113
void DERobot_Draw_Target(void);
114
115
void DERobot_State_ArmIdle(void);
116
void DERobot_State_ArmExtendPrepare(void);
117
void DERobot_State_ArmExtending(void);
118
void DERobot_State_ArmRetracting(void);
119
void DERobot_State_ArmDestroyed(void);
120
121
void DERobot_Cutscene_ActivateArm(void);
122
void DERobot_Cutscene_ReachForRuby(void);
123
void DERobot_Cutscene_GrabbedRuby(void);
124
void DERobot_Cutscene_ArmDeactivate(void);
125
126
void DERobot_State_CloseHeadHatch(void);
127
void DERobot_State_BombLaunched(void);
128
void DERobot_State_BombLanded(void);
129
void DERobot_State_BombExplode(void);
130
131
void DERobot_State_SetupArena(void);
132
void DERobot_State_SetupBoss(void);
133
134
void DERobot_State_Target(void);
135
136
void DERobot_State_SurpriseFall(void);
137
void DERobot_State_FallLand(void);
138
void DERobot_State_Walk(void);
139
void DERobot_State_ArmAttack(void);
140
void DERobot_State_Explode(void);
141
void DERobot_State_ExplodeTerrain(void);
142
void DERobot_State_Finish(void);
143
144
void DERobot_State_DebrisFall(void);
145
146
void DERobot_State_FinishBounds(void);
147
void DERobot_State_CutsceneExplode(void);
148
149
#endif //! OBJ_DEROBOT_H
150
151