Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/TMZ/SentryBug.h
338 views
1
#ifndef OBJ_SENTRYBUG_H
2
#define OBJ_SENTRYBUG_H
3
4
#include "Game.h"
5
6
// Object Class
7
struct ObjectSentryBug {
8
RSDK_OBJECT
9
TABLE(int32 orbOffsets_Attached[84], { -0x50000, 0x30000, -0x90000, 0xA0000, -0x70000, 0x100000, 0x70000, 0x30000, 0x30000, 0xA0000,
10
-0x30000, 0x100000, -0x70000, 0x30000, -0xB0000, 0xA0000, -0x80000, 0x100000, 0x90000, 0x30000,
11
0x60000, 0xA0000, 0, 0x100000, -0x90000, 0x30000, -0xB0000, 0xA0000, -0x80000, 0x100000,
12
0x90000, 0x30000, 0x80000, 0xA0000, 0x30000, 0x100000, -0x90000, 0x30000, -0xB0000, 0xA0000,
13
-0x80000, 0x100000, 0x90000, 0x30000, 0xB0000, 0xA0000, 0x80000, 0x100000, 0x90000, 0x30000,
14
0xB0000, 0xA0000, 0x80000, 0x100000, -0x90000, 0x30000, -0x80000, 0xA0000, -0x30000, 0x100000,
15
0x70000, 0x30000, 0xB0000, 0xA0000, 0x80000, 0x100000, -0x90000, 0x30000, -0x60000, 0xA0000,
16
0, 0x100000, 0x50000, 0x30000, 0x90000, 0xA0000, 0x70000, 0x100000, -0x70000, 0x30000,
17
-0x30000, 0xA0000, 0x30000, 0x100000 });
18
TABLE(int32 dropVelR[12], { -0x10000, -0x10000, -0x20000, -0x8000, -0x10000, 0x8000, 0x10000, -0x10000, 0x20000, -0x8000, 0x10000, 0x8000 });
19
TABLE(int32 dropVelL[12], { 0x10000, -0x10000, 0x20000, -0x8000, 0x10000, 0x8000, -0x10000, -0x10000, -0x20000, -0x8000, -0x10000, 0x8000 });
20
Hitbox hitbox;
21
uint16 meshFrames;
22
uint16 sceneIndex;
23
uint16 aniFrames;
24
uint16 sfxPon;
25
uint16 sfxSwarm;
26
};
27
28
// Entity Class
29
struct EntitySentryBug {
30
RSDK_ENTITY
31
StateMachine(state);
32
StateMachine(stateOrbs);
33
uint8 speed;
34
Vector2 amplitude;
35
bool32 orbsDetached;
36
bool32 showNet;
37
int32 timer;
38
Vector2 originPos;
39
Vector2 startPos;
40
EntityPlayer *playerPtr;
41
Vector2 netPos;
42
int32 netRotation;
43
int32 netScale;
44
int32 netColor;
45
Vector2 orbPositions[6];
46
Vector2 orbVelocities[6];
47
Animator unusedAnimator;
48
Matrix matUnused;
49
Matrix matTransform;
50
Matrix matWorld;
51
Animator bugAnimator;
52
Animator orbAnimator;
53
};
54
55
// Object Struct
56
extern ObjectSentryBug *SentryBug;
57
58
// Standard Entity Events
59
void SentryBug_Update(void);
60
void SentryBug_LateUpdate(void);
61
void SentryBug_StaticUpdate(void);
62
void SentryBug_Draw(void);
63
void SentryBug_Create(void *data);
64
void SentryBug_StageLoad(void);
65
#if GAME_INCLUDE_EDITOR
66
void SentryBug_EditorDraw(void);
67
void SentryBug_EditorLoad(void);
68
#endif
69
void SentryBug_Serialize(void);
70
71
// Extra Entity Functions
72
void SentryBug_DebugSpawn(void);
73
void SentryBug_DebugDraw(void);
74
75
void SentryBug_CheckPlayerCollisions(void);
76
77
void SentryBug_SetupOrbDropVelocity(void);
78
void SentryBug_StateOrbs_Attached(void);
79
void SentryBug_StateOrbs_Dropped(void);
80
void SentryBug_StateOrbs_BeginNetRotation(void);
81
void SentryBug_StateOrbs_RotateAroundNet(void);
82
void SentryBug_StateOrbs_ReturnToSlots(void);
83
84
void SentryBug_State_AwaitPlayer(void);
85
void SentryBug_State_DropOrbs(void);
86
void SentryBug_State_NetAppear(void);
87
void SentryBug_State_NetShrink(void);
88
void SentryBug_State_NetFlash(void);
89
void SentryBug_State_ReturnToSlots(void);
90
91
#endif //! OBJ_SENTRYBUG_H
92
93