Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/Global/Animals.h
338 views
1
#ifndef OBJ_ANIMALS_H
2
#define OBJ_ANIMALS_H
3
4
#include "Game.h"
5
6
typedef enum {
7
ANIMAL_FLICKY,
8
ANIMAL_RICKY,
9
ANIMAL_POCKY,
10
ANIMAL_PECKY,
11
ANIMAL_PICKY,
12
ANIMAL_CUCKY,
13
ANIMAL_ROCKY,
14
ANIMAL_BECKY,
15
ANIMAL_LOCKY,
16
ANIMAL_TOCKY,
17
ANIMAL_WOCKY,
18
ANIMAL_MICKY,
19
} AnimalTypes;
20
21
typedef enum {
22
ANIMAL_BEHAVE_FREE,
23
ANIMAL_BEHAVE_FOLLOW,
24
ANIMAL_BEHAVE_FIXED,
25
} AnimalBehaviours;
26
27
// Object Class
28
struct ObjectAnimals {
29
RSDK_OBJECT
30
TABLE(int32 hitboxes[12], { 0x70000, 0x70000, 0xC0000, 0xA0000, 0x80000, 0x80000, 0x80000, 0x80000, 0x70000, 0x50000, 0x70000, 0x60000 });
31
TABLE(int32 gravityStrength[12], { 0x1800, 0x3800, 0x3800, 0x3800, 0x3800, 0x3800, 0x3800, 0x3800, 0x1800, 0x3800, 0x3800, 0x3800 });
32
TABLE(int32 yVelocity[12],
33
{ -0x40000, -0x38000, -0x40000, -0x30000, -0x30000, -0x30000, -0x18000, -0x30000, -0x30000, -0x20000, -0x30000, -0x38000 });
34
TABLE(int32 xVelocity[12],
35
{ -0x30000, -0x28000, -0x20000, -0x18000, -0x1C000, -0x20000, -0x14000, -0x20000, -0x28000, -0x14000, -0x2C000, -0x20000 });
36
uint16 aniFrames;
37
int32 animalTypes[2];
38
bool32 hasPlatform;
39
bool32 hasBridge;
40
};
41
42
// Entity Class
43
struct EntityAnimals {
44
RSDK_ENTITY
45
StateMachine(state);
46
int32 timer;
47
AnimalTypes type;
48
AnimalBehaviours behaviour;
49
Animator animator;
50
Hitbox hitboxAnimal;
51
};
52
53
// Object Struct
54
extern ObjectAnimals *Animals;
55
56
// Standard Entity Events
57
void Animals_Update(void);
58
void Animals_LateUpdate(void);
59
void Animals_StaticUpdate(void);
60
void Animals_Draw(void);
61
void Animals_Create(void *data);
62
void Animals_StageLoad(void);
63
#if GAME_INCLUDE_EDITOR
64
void Animals_EditorDraw(void);
65
void Animals_EditorLoad(void);
66
#endif
67
void Animals_Serialize(void);
68
69
// Extra Entity Functions
70
void Animals_CheckDirection(void);
71
bool32 Animals_CheckPlatformCollision(void *platform);
72
bool32 Animals_CheckGroundCollision(void);
73
74
void Animals_State_Fall(void);
75
void Animals_State_Bounce(void);
76
void Animals_State_Fly(void);
77
void Animals_State_Placed(void);
78
#endif //! OBJ_ANIMALS_H
79
80