Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/CPZ/ChemicalPool.h
338 views
1
#ifndef OBJ_CHEMICALPOOL_H
2
#define OBJ_CHEMICALPOOL_H
3
4
#include "Game.h"
5
6
typedef enum { CHEMICALPOOL_BLUE, CHEMICALPOOL_GREEN, CHEMICALPOOL_CYAN } ChemicalPoolTypes;
7
8
// Object Class
9
struct ObjectChemicalPool {
10
RSDK_OBJECT
11
TABLE(color surfaceColorsFlash[4], { 0xF0F0F0, 0xF0F0F0, 0xE0E0E0, 0xE0E0E0 });
12
uint16 aniFrames;
13
int32 surfaceDeformation[0x1000];
14
int32 deformTable[0x1000];
15
int32 impactTable[0x1000];
16
uint16 unused; // exists, it's in the static object, but never used
17
uint16 sfxChemYellow;
18
uint16 sfxChemRed;
19
uint16 sfxChemChange;
20
};
21
22
// Entity Class
23
struct EntityChemicalPool {
24
RSDK_ENTITY
25
StateMachine(state);
26
int32 type;
27
Vector2 size;
28
int32 changeTimer;
29
int32 timer;
30
int32 tileSizeX;
31
int32 offsetY;
32
int32 maxDeform;
33
int32 r;
34
int32 g;
35
int32 b;
36
int32 leftEdge;
37
int32 rightEdge;
38
int32 impactPower;
39
int32 impactPowerSides;
40
Hitbox hitbox;
41
Vector2 vertices[66];
42
color surfaceColors[4];
43
Animator animator;
44
};
45
46
// Object Struct
47
extern ObjectChemicalPool *ChemicalPool;
48
49
// Standard Entity Events
50
void ChemicalPool_Update(void);
51
void ChemicalPool_LateUpdate(void);
52
void ChemicalPool_StaticUpdate(void);
53
void ChemicalPool_Draw(void);
54
void ChemicalPool_Create(void *data);
55
void ChemicalPool_StageLoad(void);
56
#if GAME_INCLUDE_EDITOR
57
void ChemicalPool_EditorDraw(void);
58
void ChemicalPool_EditorLoad(void);
59
#endif
60
void ChemicalPool_Serialize(void);
61
62
// Extra Entity Functions
63
void ChemicalPool_ChangeState(EntityChemicalPool *chemPool, int32 newType, int32 newR, int32 newG, int32 newB);
64
void ChemicalPool_ProcessDeformations(void);
65
void ChemicalPool_SetDeform(int32 impactX, int32 impactVelocity);
66
void ChemicalPool_SpawnDebris(int32 x, int32 y);
67
void ChemicalPool_SetupColors(void);
68
69
// States
70
void ChemicalPool_State_HarmfulBlue(void);
71
void ChemicalPool_State_Green(void);
72
void ChemicalPool_State_Cyan(void);
73
void ChemicalPool_State_Changing(void);
74
75
#endif //! OBJ_CHEMICALPOOL_H
76
77