Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/LRZ/KingAttack.h
338 views
1
#ifndef OBJ_KINGATTACK_H
2
#define OBJ_KINGATTACK_H
3
4
#include "Game.h"
5
6
typedef enum {
7
KINGATTACK_LASER,
8
KINGATTACK_LASERBLAST,
9
KINGATTACK_ORBIT,
10
KINGATTACK_TRAIL,
11
KINGATTACK_LARGEBULLET,
12
KINGATTACK_ENERGYLINE,
13
KINGATTACK_SMALLBULLET,
14
} KingAttackTypes;
15
16
// Object Class
17
struct ObjectKingAttack {
18
RSDK_OBJECT
19
TABLE(int32 laserColors[8], { 0x000020, 0x000020, 0xE850D8, 0xE850D8, 0xE850D8, 0xE850D8, 0x000020, 0x000020 });
20
uint16 aniFrames;
21
uint16 sfxLaserSweep;
22
uint16 sfxLaserErupt;
23
uint16 sfxElecPulse;
24
uint16 sfxTwinShot;
25
bool32 laserEruptActive;
26
};
27
28
// Entity Class
29
struct EntityKingAttack {
30
RSDK_ENTITY
31
StateMachine(state);
32
int32 type;
33
int32 timer;
34
Entity *parent;
35
Vector2 targetPos;
36
Vector2 targetVelocity;
37
Vector2 laserVertPostions[8];
38
int32 *laserColors;
39
Hitbox hitbox;
40
Animator animator;
41
};
42
43
// Object Struct
44
extern ObjectKingAttack *KingAttack;
45
46
// Standard Entity Events
47
void KingAttack_Update(void);
48
void KingAttack_LateUpdate(void);
49
void KingAttack_StaticUpdate(void);
50
void KingAttack_Draw(void);
51
void KingAttack_Create(void *data);
52
void KingAttack_StageLoad(void);
53
#if GAME_INCLUDE_EDITOR
54
void KingAttack_EditorDraw(void);
55
void KingAttack_EditorLoad(void);
56
#endif
57
void KingAttack_Serialize(void);
58
59
// Extra Entity Functions
60
bool32 KingAttack_SfxCheck_ElecIdle(void);
61
void KingAttack_CheckPlayerCollisions(void);
62
void KingAttack_HandleLaserPositions(void);
63
64
void KingAttack_State_Laser(void);
65
void KingAttack_State_LaserBlast_Delay(void);
66
void KingAttack_State_LaserBlast_Erupt(void);
67
void KingAttack_State_OrbitAppear(void);
68
void KingAttack_State_Orbiting(void);
69
void KingAttack_State_OrbitLaunched(void);
70
void KingAttack_State_Trail(void);
71
void KingAttack_State_LargeBullet_Appear(void);
72
void KingAttack_State_EnergyLine(void);
73
void KingAttack_State_LargeBullet_TwinShot(void);
74
void KingAttack_State_SmallBullet(void);
75
void KingAttack_State_SmallBullet_Impact(void);
76
77
#endif //! OBJ_KINGATTACK_H
78
79