Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/SPZ/PopcornMachine.h
338 views
1
#ifndef OBJ_POPCORNMACHINE_H
2
#define OBJ_POPCORNMACHINE_H
3
4
#include "Game.h"
5
6
typedef enum {
7
POPCORNMACHINE_LEFT,
8
POPCORNMACHINE_RIGHT,
9
POPCORNMACHINE_BOTH,
10
} PopcornMachineTypes;
11
12
// Object Class
13
struct ObjectPopcornMachine {
14
RSDK_OBJECT
15
uint16 aniFrames;
16
Hitbox hitboxEntryL;
17
Hitbox hitboxEntryR;
18
int32 unused1;
19
int32 unused2;
20
uint16 sfxFanStart;
21
uint16 sfxShoot;
22
uint16 sfxPopcornLaunch;
23
};
24
25
// Entity Class
26
struct EntityPopcornMachine {
27
RSDK_ENTITY
28
StateMachine(state);
29
uint8 type;
30
uint8 height;
31
int32 timer;
32
EntityPopcornMachine *parent;
33
EntityPlayer *player;
34
int32 bounds[PLAYER_COUNT];
35
Vector2 dispenserHolderPos;
36
Vector2 dispenserPos;
37
Animator animator;
38
Hitbox hitboxSideL;
39
Hitbox hitboxSideR;
40
Hitbox hitboxTop;
41
};
42
43
// Object Struct
44
extern ObjectPopcornMachine *PopcornMachine;
45
46
// Standard Entity Events
47
void PopcornMachine_Update(void);
48
void PopcornMachine_LateUpdate(void);
49
void PopcornMachine_StaticUpdate(void);
50
void PopcornMachine_Draw(void);
51
void PopcornMachine_Create(void *data);
52
void PopcornMachine_StageLoad(void);
53
#if GAME_INCLUDE_EDITOR
54
void PopcornMachine_EditorDraw(void);
55
void PopcornMachine_EditorLoad(void);
56
#endif
57
void PopcornMachine_Serialize(void);
58
59
// Extra Entity Functions
60
void PopcornMachine_LinkPlayer(EntityPlayer *player);
61
void PopcornMachine_CheckPlayerCollisions(void);
62
63
void PopcornMachine_State_Idle(void);
64
void PopcornMachine_State_ShowDispenser(void);
65
void PopcornMachine_State_Shaking(void);
66
void PopcornMachine_State_HideDispenser(void);
67
68
void PopcornMachine_StateController_ReadyPlayer(void);
69
void PopcornMachine_StateController_RisePlayer(void);
70
void PopcornMachine_StateController_FirePlayer(void);
71
void PopcornMachine_StateController_HandleFinish(void);
72
73
#endif //! OBJ_POPCORNMACHINE_H
74
75