Path: blob/master/SonicMania/Objects/OOZ/BallCannon.h
338 views
#ifndef OBJ_BALLCANNON_H1#define OBJ_BALLCANNON_H23#include "Game.h"45typedef enum {6BALLCANNON_CANNON,7BALLCANNON_CORKV,8BALLCANNON_CORKH,9} BallCannonTypes;1011typedef enum {12// Clockwise by default13BALLCANNON_DIR_RIGHT_CW,14BALLCANNON_DIR_DOWN_CW,15BALLCANNON_DIR_LEFT_CW,16BALLCANNON_DIR_UP_CW,17BALLCANNON_DIR_DOWN_CCW,18BALLCANNON_DIR_LEFT_CCW,19BALLCANNON_DIR_UP_CCW,20BALLCANNON_DIR_RIGHT_CCW,21} BallCannonAngles;2223// Object Class24struct ObjectBallCannon {25RSDK_OBJECT26Hitbox hitboxCannon;27Hitbox hitboxCorkBlock;28Hitbox hitboxCorkEntry;29uint16 aniFrames;30TABLE(int32 corkDebrisOffset[32], { -0xC0000, -0xC0000, -0x40000, -0xC0000, 0x40000, -0xC0000, 0xC0000, -0xC0000, -0xC0000, -0x40000, -0x40000,31-0x40000, 0x40000, -0x40000, 0xC0000, -0x40000, -0xC0000, 0x40000, -0x40000, 0x40000, 0x40000, 0x40000,320xC0000, 0x40000, -0xC0000, 0xC0000, -0x40000, 0xC0000, 0x40000, 0xC0000, 0xC0000, 0xC0000 });33TABLE(int32 corkDebrisVelocity[32], { -0x40000, -0x40000, -0x20000, -0x40000, 0x20000, -0x40000, 0x40000, -0x40000, -0x3C000, -0x20000, -0x1C000,34-0x20000, 0x1C000, -0x20000, 0x3C000, -0x20000, -0x38000, 0x20000, -0x18000, 0x20000, 0x18000, 0x20000,350x38000, 0x20000, -0x34000, 0x40000, -0x14000, 0x40000, 0x14000, 0x40000, 0x34000, 0x40000 });36uint16 sfxLedgeBreak;37uint16 sfxFire;38};3940// Entity Class41struct EntityBallCannon {42RSDK_ENTITY43StateMachine(state);44uint8 type;45bool32 exit;46uint8 unused1;47uint8 activePlayers;48uint8 playerTimers[PLAYER_COUNT];49int32 unused2;50int32 rotationSpeed;51Animator animator;52};5354// Object Struct55extern ObjectBallCannon *BallCannon;5657// Standard Entity Events58void BallCannon_Update(void);59void BallCannon_LateUpdate(void);60void BallCannon_StaticUpdate(void);61void BallCannon_Draw(void);62void BallCannon_Create(void *data);63void BallCannon_StageLoad(void);64#if GAME_INCLUDE_EDITOR65void BallCannon_EditorDraw(void);66void BallCannon_EditorLoad(void);67#endif68void BallCannon_Serialize(void);6970// Extra Entity Functions71void BallCannon_CheckPlayerEntry(void);72void BallCannon_State_Idle(void);73void BallCannon_State_Inserted(void);74void BallCannon_State_Turning(void);75void BallCannon_State_EjectPlayer(void);76void BallCannon_State_CorkBlocked(void);77void BallCannon_State_CorkOpened(void);78void BallCannon_State_CorkDebris(void);7980#endif //! OBJ_BALLCANNON_H818283