Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/GHZ/DDWrecker.h
338 views
1
#ifndef OBJ_DDWRECKER_H
2
#define OBJ_DDWRECKER_H
3
4
#include "Game.h"
5
6
typedef enum {
7
DDWRECKER_SETUP,
8
DDWRECKER_BALL1,
9
DDWRECKER_BALL2,
10
DDWRECKER_CHAIN,
11
DDWRECKER_CORE,
12
} DDWreckerTypes;
13
14
// Object Class
15
struct ObjectDDWrecker {
16
RSDK_OBJECT
17
int32 camBoundL;
18
int32 camBoundR;
19
int32 bossBoundL;
20
int32 bossBoundR;
21
int32 bossBoundT;
22
int32 attackVelocities[3];
23
TABLE(int32 spinOffset[6], { -64, -32, -16, 16, 32, 64 });
24
TABLE(int32 swingOffset[6], { 32, 48, 64, 80, 96, 128 });
25
uint16 aniFrames;
26
uint16 sfxBossHit;
27
uint16 sfxExplosion;
28
uint16 sfxDrop;
29
uint16 sfxImpact;
30
uint16 sfxAssemble;
31
uint16 sfxRotate;
32
uint16 sfxSharp;
33
};
34
35
// Entity Class
36
struct EntityDDWrecker {
37
RSDK_ENTITY
38
StateMachine(state);
39
StateMachine(stateBall);
40
Vector2 originPos;
41
int32 type;
42
int32 timer;
43
int32 invincibilityTimer;
44
int32 health;
45
bool32 swapBalls;
46
int32 angleVel;
47
int32 spinTimer;
48
int32 spinAngle;
49
int32 radius;
50
uint16 siblingSlots[6];
51
EntityDDWrecker *bodyA;
52
EntityDDWrecker *bodyB;
53
int32 unused1;
54
int32 unusedAngle; // updated but never used..
55
int32 unused2;
56
int32 unused3;
57
int32 blendAmount;
58
Animator animator;
59
Hitbox hitbox;
60
};
61
62
// Object Struct
63
extern ObjectDDWrecker *DDWrecker;
64
65
// Standard Entity Events
66
void DDWrecker_Update(void);
67
void DDWrecker_LateUpdate(void);
68
void DDWrecker_StaticUpdate(void);
69
void DDWrecker_Draw(void);
70
void DDWrecker_Create(void *data);
71
void DDWrecker_StageLoad(void);
72
#if GAME_INCLUDE_EDITOR
73
void DDWrecker_EditorDraw(void);
74
void DDWrecker_EditorLoad(void);
75
#endif
76
void DDWrecker_Serialize(void);
77
78
// Extra Entity Functions
79
void DDWrecker_State_SetupArena(void);
80
void DDWrecker_State_InitChildren(void);
81
void DDWrecker_State_Assemble(void);
82
void DDWrecker_State_EnterWreckers(void);
83
void DDWrecker_State_AttackDelay(void);
84
void DDWrecker_State_SwingRight(void);
85
void DDWrecker_State_SwingLeft(void);
86
void DDWrecker_State_SwingMoveToCenter(void);
87
void DDWrecker_State_HandleSpinning(void);
88
void DDWrecker_State_SwingSlowDown(void);
89
void DDWrecker_State_PrepareBounceAttack(void);
90
void DDWrecker_State_SignalBounceAttackStart(void);
91
void DDWrecker_State_HandleBounceAttack(void);
92
void DDWrecker_State_EndBounceAttack(void);
93
94
void DDWrecker_StateBall_Vulnerable(void);
95
void DDWrecker_StateBall_Spiked(void);
96
void DDWrecker_StateBall_Partnerless(void);
97
98
void DDWrecker_Hit(void);
99
void DDWrecker_Spin(void);
100
void DDWrecker_Swing(void);
101
void DDWrecker_Explode(void);
102
103
void DDWrecker_State_Debris(void);
104
void DDWrecker_State_Die(void);
105
void DDWrecker_State_SpawnSignpost(void);
106
107
#endif //! OBJ_DDWRECKER_H
108
109