Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/ERZ/ERZGunner.h
338 views
1
#ifndef OBJ_ERZGUNNER_H
2
#define OBJ_ERZGUNNER_H
3
4
#include "Game.h"
5
6
typedef enum {
7
ERZGUNNER_BOSS,
8
ERZGUNNER_LAUNCHROCKET,
9
ERZGUNNER_MORTAR,
10
ERZGUNNER_NAPALM,
11
ERZGUNNER_DUD,
12
ERZGUNNER_NAPALM_EXPLOSION,
13
ERZGUNNER_MORTAR_EXPLOSION,
14
} ERZGunnerTypes;
15
16
// Object Class
17
struct ObjectERZGunner {
18
RSDK_OBJECT
19
// Technically a "Vector2" but since that can't be saved in static objects, it's an int32 array
20
TABLE(int32 rocketOffsets[32], { -22, -24, -10, -24, -22, -31, -10, -31, -22, -38, -10, -38, -22, -45, -10, -45,
21
10, -24, 22, -24, 10, -31, 22, -31, 10, -38, 22, -38, 10, -45, 22, -45 });
22
int32 launchedRocketID;
23
Hitbox hitboxNapalm;
24
Hitbox hitboxMortar;
25
Hitbox hitboxDud;
26
uint16 aniFrames;
27
};
28
29
// Entity Class
30
struct EntityERZGunner {
31
RSDK_ENTITY
32
StateMachine(state);
33
StateMachine(stateDraw);
34
Vector2 originPos;
35
int32 type;
36
EntityERZGunner *parent;
37
int32 timer;
38
int32 invincibilityTimer;
39
int32 fireAnimTimer;
40
int32 rocketLaunchCount;
41
int32 rocketOffsetID;
42
int32 napalmExplosionPos;
43
Vector2 screenPos;
44
Animator mainAnimator;
45
Animator fxAnimator;
46
Animator tailAnimator;
47
Animator parachuteAnimator;
48
Animator unusedAnimator;
49
};
50
51
// Object Struct
52
extern ObjectERZGunner *ERZGunner;
53
54
// Standard Entity Events
55
void ERZGunner_Update(void);
56
void ERZGunner_LateUpdate(void);
57
void ERZGunner_StaticUpdate(void);
58
void ERZGunner_Draw(void);
59
void ERZGunner_Create(void *data);
60
void ERZGunner_StageLoad(void);
61
#if GAME_INCLUDE_EDITOR
62
void ERZGunner_EditorDraw(void);
63
void ERZGunner_EditorLoad(void);
64
#endif
65
void ERZGunner_Serialize(void);
66
67
// Extra Entity Functions
68
void ERZGunner_HandleDudExhaust(void);
69
void ERZGunner_HandleMalfunctionDudExhaust(void);
70
void ERZGunner_SpawnDust(void);
71
void ERZGunner_HandleRotations(int32 angle);
72
void ERZGunner_CheckPlayerMissileCollisions(void);
73
void ERZGunner_CheckPlayerExplosionCollisions(void);
74
void ERZGunner_Hit(EntityERZGunner *entity);
75
76
void ERZGunner_Draw_Gunner(void);
77
void ERZGunner_Draw_RocketLaunch(void);
78
void ERZGunner_Draw_Rocket(void);
79
80
void ERZGunner_State_Idle(void);
81
void ERZGunner_State_LaunchRockets(void);
82
83
void ERZGunner_State_LaunchedRocket(void);
84
void ERZGunner_State_Mortar(void);
85
void ERZGunner_State_Napalm(void);
86
void ERZGunner_State_Dud_Active(void);
87
void ERZGunner_State_Dud_HitByPlayer(void);
88
void ERZGunner_State_Dud_Malfunction(void);
89
void ERZGunner_State_Dud_Explode(void);
90
91
void ERZGunner_State_NapalmExplosion(void);
92
void ERZGunner_State_MortarExplosion(void);
93
94
#endif //! OBJ_ERZGUNNER_H
95
96