Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/SPZ/LoveTester.h
338 views
1
#ifndef OBJ_LOVETESTER_H
2
#define OBJ_LOVETESTER_H
3
4
#include "Game.h"
5
6
typedef enum {
7
LOVETESTER_LIST_NONE,
8
LOVETESTER_LIST_SONIC,
9
LOVETESTER_LIST_TAILS,
10
LOVETESTER_LIST_KNUX,
11
LOVETESTER_LIST_EGGMAN,
12
LOVETESTER_LIST_AMY,
13
LOVETESTER_LIST_HEART,
14
LOVETESTER_LIST_HEARTBROKEN,
15
} LoveTesterDisplays;
16
17
// Object Class
18
struct ObjectLoveTester {
19
RSDK_OBJECT
20
Hitbox hitboxEntry;
21
Hitbox hitboxL;
22
Hitbox hitboxR;
23
uint16 aniFrames;
24
uint16 sfxScore;
25
Vector2 tvOffsetTop;
26
Vector2 tvOffsetBottom;
27
Vector2 lightOffset[10];
28
};
29
30
// Entity Class
31
struct EntityLoveTester {
32
RSDK_ENTITY
33
StateMachine(state);
34
StateMachine(stateLights);
35
uint8 activePlayers;
36
Vector2 startPos;
37
EntityPlayer *playerPtr;
38
bool32 matchingFinished;
39
bool32 isTVActiveTop;
40
uint8 tvDisplayTop;
41
uint8 tvFrameTop;
42
bool32 isTVActiveBottom;
43
uint8 tvDisplayBottom;
44
uint8 tvFrameBottom;
45
uint8 nextDisplayBottom;
46
int32 timer;
47
int32 lightsID;
48
Animator mainAnimator;
49
Animator lightAnimator[10];
50
};
51
52
// Object Struct
53
extern ObjectLoveTester *LoveTester;
54
55
// Standard Entity Events
56
void LoveTester_Update(void);
57
void LoveTester_LateUpdate(void);
58
void LoveTester_StaticUpdate(void);
59
void LoveTester_Draw(void);
60
void LoveTester_Create(void *data);
61
void LoveTester_StageLoad(void);
62
#if GAME_INCLUDE_EDITOR
63
void LoveTester_EditorDraw(void);
64
void LoveTester_EditorLoad(void);
65
#endif
66
void LoveTester_Serialize(void);
67
68
// Extra Entity Functions
69
void LoveTester_SetupHitboxes(void);
70
void LoveTester_SetupLightOffsets(void);
71
void LoveTester_DrawSprites(void);
72
void LoveTester_DrawTVDisplay(uint8 displayList, uint8 frame, bool32 isTVActive);
73
void LoveTester_CheckPlayerCollisions_Solid(void);
74
void LoveTester_CheckPlayerCollisions_Entry(bool32 allowSidekick);
75
void LoveTester_GiveScore(EntityPlayer *player);
76
void LoveTester_CreateHeartParticles(void);
77
78
void LoveTester_State_Init(void);
79
void LoveTester_State_WaitForActivated(void);
80
void LoveTester_State_SetupTopDisplay(void);
81
void LoveTester_State_SetupMatching(void);
82
void LoveTester_State_UnluckyMatch(void);
83
void LoveTester_State_GoodMatch(void);
84
void LoveTester_State_BadMatch(void);
85
void LoveTester_State_ReleasePlayers(void);
86
87
void LoveTester_State_HeartParticles(void);
88
89
void LoveTester_StateLights_FlashSlow(void);
90
void LoveTester_StateLights_FlashMed(void);
91
void LoveTester_StateLights_FlashFast(void);
92
93
#endif //! OBJ_LOVETESTER_H
94
95