Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/ERZ/PhantomGunner.h
338 views
1
#ifndef OBJ_PHANTOMGUNNER_H
2
#define OBJ_PHANTOMGUNNER_H
3
4
#include "Game.h"
5
6
typedef enum {
7
PHANTOMGUNNER_BOSS,
8
PHANTOMGUNNER_LAUNCHROCKET,
9
PHANTOMGUNNER_MORTAR,
10
PHANTOMGUNNER_NAPALM,
11
PHANTOMGUNNER_DUD,
12
PHANTOMGUNNER_NAPALM_EXPLOSION,
13
PHANTOMGUNNER_MORTAR_EXPLOSION,
14
} PhantomGunnerTypes;
15
16
// Object Class
17
struct ObjectPhantomGunner {
18
RSDK_OBJECT
19
// Technically a "Vector2" but since that can't be saved in static objects, it's an int array
20
TABLE(int32 rocketOffsets[0x20], { -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
uint16 sfxCannonFire;
28
};
29
30
// Entity Class
31
struct EntityPhantomGunner {
32
RSDK_ENTITY
33
StateMachine(state);
34
StateMachine(stateDraw);
35
Vector2 originPos;
36
Vector2 startPos;
37
int32 type;
38
EntityPhantomGunner *parent;
39
int32 timer;
40
int32 invincibilityTimer;
41
int32 unused;
42
int32 fireAnimTimer;
43
int32 rocketLaunchCount;
44
int32 rocketOffsetID;
45
int32 napalmExplosionPos;
46
Vector2 screenPos;
47
Animator mainAnimator;
48
Animator fxAnimator;
49
Animator tailAnimator;
50
Animator parachuteAnimator;
51
Animator unusedAnimator;
52
};
53
54
// Object Struct
55
extern ObjectPhantomGunner *PhantomGunner;
56
57
// Standard Entity Events
58
void PhantomGunner_Update(void);
59
void PhantomGunner_LateUpdate(void);
60
void PhantomGunner_StaticUpdate(void);
61
void PhantomGunner_Draw(void);
62
void PhantomGunner_Create(void *data);
63
void PhantomGunner_StageLoad(void);
64
#if GAME_INCLUDE_EDITOR
65
void PhantomGunner_EditorDraw(void);
66
void PhantomGunner_EditorLoad(void);
67
#endif
68
void PhantomGunner_Serialize(void);
69
70
// Extra Entity Functions
71
void PhantomGunner_HandleDudExhaust(void);
72
void PhantomGunner_HandleMalfunctionDudExhaust(void);
73
void PhantomGunner_SpawnDust(void);
74
void PhantomGunner_HandleRotations(int32 angle);
75
void PhantomGunner_CheckPlayerMissileCollisions(void);
76
void PhantomGunner_CheckPlayerExplosionCollisions(void);
77
void PhantomGunner_Hit(EntityPhantomGunner *entity);
78
79
void PhantomGunner_Draw_Gunner(void);
80
void PhantomGunner_Draw_RocketLaunch(void);
81
void PhantomGunner_Draw_Rocket(void);
82
83
void PhantomGunner_State_ResetState(void);
84
void PhantomGunner_State_Idle(void);
85
void PhantomGunner_State_LaunchRockets(void);
86
87
void PhantomGunner_State_LaunchedRocket(void);
88
void PhantomGunner_State_Mortar(void);
89
void PhantomGunner_State_Napalm(void);
90
void PhantomGunner_State_Dud_Active(void);
91
void PhantomGunner_State_Dud_HitByPlayer(void);
92
void PhantomGunner_State_Dud_Malfunction(void);
93
void PhantomGunner_State_Dud_Explode(void);
94
95
void PhantomGunner_State_NapalmExplosion(void);
96
void PhantomGunner_State_MortarExplosion(void);
97
98
#endif //! OBJ_PHANTOMGUNNER_H
99
100