Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/ERZ/PhantomKing.h
338 views
1
#ifndef OBJ_PHANTOMKING_H
2
#define OBJ_PHANTOMKING_H
3
4
#include "Game.h"
5
6
typedef enum {
7
PHANTOMKING_KING,
8
PHANTOMKING_ARM_L,
9
PHANTOMKING_ARM_R,
10
} PhantomKingTypes;
11
12
// Object Class
13
struct ObjectPhantomKing {
14
RSDK_OBJECT
15
int32 boundsL;
16
int32 boundsR;
17
int32 boundsM;
18
int32 boundsT;
19
int32 boundsB;
20
uint16 sfxHit;
21
uint16 sfxExplosion;
22
uint16 aniFrames;
23
bool32 defeated;
24
};
25
26
// Entity Class
27
struct EntityPhantomKing {
28
RSDK_ENTITY
29
StateMachine(state);
30
StateMachine(stateDraw);
31
Vector2 originPos;
32
int32 type;
33
int32 timer;
34
int32 invincibilityTimer;
35
int32 health;
36
int32 typeChangeTimer; // Leftover from ERZKing, never used but the draw code for it is still there
37
int32 bodyAngle;
38
int32 armAngles[10];
39
Vector2 armPositions[10];
40
Vector2 armBezierPos;
41
Vector2 rubyPos;
42
Vector2 unused;
43
bool32 drawRuby;
44
bool32 canLaunchAttacks;
45
EntityPhantomKing *parent;
46
int32 armRadius;
47
int32 armAngle;
48
int32 armAngleOffset;
49
Animator basicAnimator;
50
Animator headAnimator;
51
Animator bodyAnimator;
52
Animator beltAnimator;
53
Animator particleAnimator;
54
Animator rubyAnimator;
55
Animator unusedAnimator;
56
Animator armAnimator;
57
Animator cuffAnimator;
58
Animator handAnimator;
59
Hitbox hitbox;
60
uint8 storeDrawFX;
61
bool32 finishedMovingRuby;
62
};
63
64
// Object Struct
65
extern ObjectPhantomKing *PhantomKing;
66
67
// Standard Entity Events
68
void PhantomKing_Update(void);
69
void PhantomKing_LateUpdate(void);
70
void PhantomKing_StaticUpdate(void);
71
void PhantomKing_Draw(void);
72
void PhantomKing_Create(void *data);
73
void PhantomKing_StageLoad(void);
74
#if GAME_INCLUDE_EDITOR
75
void PhantomKing_EditorDraw(void);
76
void PhantomKing_EditorLoad(void);
77
#endif
78
void PhantomKing_Serialize(void);
79
80
// Extra Entity Functions
81
void PhantomKing_CheckPlayerCollisions(void);
82
void PhantomKing_Oscillate(void);
83
void PhantomKing_Hit(void);
84
void PhantomKing_Explode(void);
85
void PhantomKing_HandleFrames(void);
86
void PhantomKing_HandleAttacks(void);
87
void PhantomKing_SwitchToEggman(void);
88
void PhantomKing_SetupKing(EntityPhantomKing *king);
89
90
void PhantomKing_Draw_Body(void);
91
void PhantomKing_Draw_Arm(void);
92
93
void PhantomKing_State_Initialize(void);
94
void PhantomKing_State_SetupArms(void);
95
void PhantomKing_State_EnterKing(void);
96
void PhantomKing_State_InitialHover(void);
97
void PhantomKing_State_TakeRubyAway(void);
98
void PhantomKing_State_RubyHoldHover(void);
99
void PhantomKing_State_WrestleEggman(void);
100
void PhantomKing_State_FlyAround(void);
101
void PhantomKing_State_Switch(void);
102
void PhantomKing_State_HitFall(void);
103
104
void PhantomKing_StateArm_Idle(void);
105
void PhantomKing_StateArm_WrestleEggman(void);
106
void PhantomKing_HandleArmMovement(void);
107
void PhantomKing_StateArm_PullBack(void);
108
void PhantomKing_StateArm_Point(void);
109
110
void PhantomKing_DestroyEntity(void);
111
112
void PhantomKing_State_Explode(void);
113
void PhantomKing_State_Destroyed(void);
114
115
#endif //! OBJ_PHANTOMKING_H
116
117