Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/Helpers/CompetitionSession.h
338 views
1
#ifndef OBJ_COMPETITIONSESSION_H
2
#define OBJ_COMPETITIONSESSION_H
3
4
#include "Game.h"
5
6
#if !MANIA_USE_PLUS
7
// preplus was always 2P
8
#define COMPETITION_PLAYER_COUNT (2)
9
10
#define CompSession_DeriveWinner CompetitionSession_DeriveWinner
11
#else
12
13
#define CompSession_DeriveWinner Competition_DeriveWinner
14
#endif
15
16
#define COMPETITION_STAGE_COUNT (12)
17
18
typedef enum {
19
FINISHTYPE_NOTFINISHED,
20
FINISHTYPE_GAMEOVER,
21
FINISHTYPE_PASSEDSIGNPOST,
22
} vsFinishFlags;
23
24
typedef enum {
25
VS_BORDER_NONE,
26
VS_BORDER_BOTTOMRIGHT,
27
VS_BORDER_BOTTOM,
28
VS_BORDER_BOTTOMLEFT,
29
VS_BORDER_TOPRIGHT,
30
VS_BORDER_TOP,
31
VS_BORDER_TOPLEFT,
32
} vsScreenBorderTypes;
33
34
// created so I can easily set up times in an array
35
typedef struct {
36
int32 minutes;
37
int32 seconds;
38
int32 milliseconds;
39
} vsTime;
40
41
// Object Class
42
struct ObjectCompetitionSession {
43
RSDK_OBJECT
44
};
45
46
// Entity Class
47
struct EntityCompetitionSession {
48
RSDK_ENTITY
49
bool32 inMatch;
50
int32 playerCount;
51
int32 stageIndex;
52
int32 zoneID;
53
int32 actID;
54
int32 matchID;
55
int32 matchCount;
56
int32 itemMode;
57
#if MANIA_USE_PLUS
58
int32 swapType;
59
#endif
60
bool32 completedStages[COMPETITION_STAGE_COUNT];
61
uint8 playerID[PLAYER_COUNT];
62
uint8 matchWinner[COMPETITION_STAGE_COUNT];
63
int32 rings[PLAYER_COUNT];
64
int32 score[PLAYER_COUNT];
65
int32 items[PLAYER_COUNT];
66
vsTime time[PLAYER_COUNT];
67
uint8 finishState[PLAYER_COUNT];
68
int32 totalRings[PLAYER_COUNT];
69
int32 wins[PLAYER_COUNT];
70
int32 lives[PLAYER_COUNT];
71
#if MANIA_USE_PLUS
72
int32 screenBorderType[SCREEN_COUNT];
73
int32 displayMode;
74
int32 inputSlots[PLAYER_COUNT];
75
int32 prevMatchID;
76
#endif
77
};
78
79
// Object Entity
80
extern ObjectCompetitionSession *CompetitionSession;
81
82
// Standard Entity Events
83
void CompetitionSession_Update(void);
84
void CompetitionSession_LateUpdate(void);
85
void CompetitionSession_StaticUpdate(void);
86
void CompetitionSession_Draw(void);
87
void CompetitionSession_Create(void *data);
88
void CompetitionSession_StageLoad(void);
89
#if GAME_INCLUDE_EDITOR
90
void CompetitionSession_EditorDraw(void);
91
void CompetitionSession_EditorLoad(void);
92
#endif
93
void CompetitionSession_Serialize(void);
94
95
// Extra Entity Functions
96
EntityCompetitionSession *CompetitionSession_GetSession(void);
97
98
#if !MANIA_USE_PLUS
99
void CompetitionSession_ResetOptions(void);
100
void CompetitionSession_ClearMatchData(void);
101
void CompetitionSession_DeriveWinner(int32 playerID, int32 finishType);
102
void CompetitionSession_WinMatchFor(int32 playerID);
103
#endif
104
105
#endif //! OBJ_COMPETITIONSESSION_H
106
107