Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/Puyo/PuyoMatch.h
338 views
1
#ifndef OBJ_PUYOMATCH_H
2
#define OBJ_PUYOMATCH_H
3
4
#include "Game.h"
5
6
// Object Class
7
struct ObjectPuyoMatch {
8
RSDK_OBJECT
9
int32 comboPower;
10
TABLE(int32 comboBonus[24], { 4, 20, 24, 32, 48, 96, 160, 240, 320, 480, 600, 700, 800, 900, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999 });
11
TABLE(int32 unusedTable[24], { 0, 8, 16, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480, 512, 544, 576, 608, 640, 672 });
12
TABLE(int32 beanBonusTable[8], { 0, 2, 3, 4, 5, 6, 7, 10 });
13
TABLE(int32 concurrentBonusTable[6], { 0, 0, 3, 6, 12, 24 });
14
TABLE(int32 beanDropColumnIDs[24], { 0, 2, 5, 1, 3, 4, 5, 3, 4, 0, 1, 2, 3, 1, 0, 4, 2, 5, 0, 2, 1, 3, 5, 4 });
15
uint16 aniFrames;
16
};
17
18
// Entity Class
19
struct EntityPuyoMatch {
20
RSDK_ENTITY
21
StateMachine(state);
22
StateMachine(stateInput);
23
StateMachine(matchWinCB);
24
StateMachine(matchLoseCB);
25
int32 playerID;
26
int32 score;
27
int32 comboScore;
28
int32 selectedLevel;
29
int32 comboCount;
30
int32 comboBeanCount;
31
int32 *comboBonusTable;
32
int32 concurrentBonus;
33
int32 beanBonus;
34
int32 timer;
35
int32 junkDropCount;
36
int32 junkBeanCount;
37
Vector2 beanDropPos;
38
EntityPuyoBean *beanPtr;
39
int32 matchKey;
40
Animator beanLAnimator;
41
Animator beanRAnimator;
42
Animator lightAnimator;
43
Animator junkPreviewAnimator;
44
Animator unusedAnimator;
45
};
46
47
// Object Struct
48
extern ObjectPuyoMatch *PuyoMatch;
49
50
// Standard Entity Events
51
void PuyoMatch_Update(void);
52
void PuyoMatch_LateUpdate(void);
53
void PuyoMatch_StaticUpdate(void);
54
void PuyoMatch_Draw(void);
55
void PuyoMatch_Create(void *data);
56
void PuyoMatch_StageLoad(void);
57
#if GAME_INCLUDE_EDITOR
58
void PuyoMatch_EditorDraw(void);
59
void PuyoMatch_EditorLoad(void);
60
#endif
61
void PuyoMatch_Serialize(void);
62
63
// Extra Entity Functions
64
void PuyoMatch_AddPuyoCombo(int32 playerID, int32 score);
65
void PuyoMatch_SetupNextBeans(EntityPuyoMatch *match);
66
void PuyoMatch_DropNextBeans(void);
67
void PuyoMatch_DropJunkBeans(void);
68
void PuyoMatch_DrawJunkBeanPreviews(void);
69
70
void PuyoMatch_State_HandleMatch(void);
71
void PuyoMatch_State_HandleCombos(void);
72
void PuyoMatch_State_HandleComboEnd(void);
73
void PuyoMatch_State_Lose(void);
74
75
#endif //! OBJ_PUYOMATCH_H
76
77