Path: blob/master/SonicMania/Objects/Global/ItemBox.h
338 views
#ifndef OBJ_ITEMBOX_H1#define OBJ_ITEMBOX_H23#include "Game.h"45typedef enum {6ITEMBOX_RING,7ITEMBOX_BLUESHIELD,8ITEMBOX_BUBBLESHIELD,9ITEMBOX_FIRESHIELD,10ITEMBOX_LIGHTNINGSHIELD,11ITEMBOX_INVINCIBLE,12ITEMBOX_SNEAKERS,13ITEMBOX_1UP_SONIC,14ITEMBOX_1UP_TAILS,15ITEMBOX_1UP_KNUX,16ITEMBOX_EGGMAN,17ITEMBOX_HYPERRING,18ITEMBOX_SWAP,19ITEMBOX_RANDOM,20ITEMBOX_SUPER,21#if MANIA_USE_PLUS22ITEMBOX_1UP_MIGHTY,23ITEMBOX_1UP_RAY,24ITEMBOX_STOCK,25#endif26ITEMBOX_COUNT27} ItemBoxTypes;2829// Object Class30struct ObjectItemBox {31RSDK_OBJECT32Hitbox hitboxItemBox;33Hitbox hitboxHidden;34int32 brokenFrame;35uint16 aniFrames;36uint16 sfxDestroy;37uint16 sfxTeleport;38uint16 sfxHyperRing;39#if MANIA_USE_PLUS40uint16 sfxPowerDown;41uint16 sfxRecovery;42#endif43};4445// Entity Class46struct EntityItemBox {47RSDK_ENTITY48StateMachine(state);49ItemBoxTypes type;50Vector2 contentsPos;51Vector2 moveOffset;52int32 contentsSpeed;53Entity *storedEntity;54int32 timer;55bool32 isFalling;56bool32 isContents;57bool32 hidden;58PlaneFilterTypes planeFilter;59bool32 lrzConvPhys;60Animator boxAnimator;61Animator contentsAnimator;62Animator overlayAnimator;63Animator debrisAnimator;64#if MANIA_USE_PLUS65Entity *parent;66#endif67};6869// Object Struct70extern ObjectItemBox *ItemBox;7172// Standard Entity Events73void ItemBox_Update(void);74void ItemBox_LateUpdate(void);75void ItemBox_StaticUpdate(void);76void ItemBox_Draw(void);77void ItemBox_Create(void *data);78void ItemBox_StageLoad(void);79#if GAME_INCLUDE_EDITOR80void ItemBox_EditorDraw(void);81void ItemBox_EditorLoad(void);82#endif83void ItemBox_Serialize(void);8485// Extra Entity Functions86void ItemBox_DebugDraw(void);87void ItemBox_DebugSpawn(void);88void ItemBox_CheckHit(void);89void ItemBox_GivePowerup(void);90void ItemBox_Break(EntityItemBox *itemBox, EntityPlayer *player);91bool32 ItemBox_HandleFallingCollision(void);92bool32 ItemBox_HandlePlatformCollision(void *platform);93void ItemBox_HandleObjectCollisions(void);9495// Entity States96void ItemBox_State_Broken(void);97void ItemBox_State_Break(void);98void ItemBox_State_IconFinish(void);99void ItemBox_State_Idle(void);100void ItemBox_State_Falling(void);101void ItemBox_State_Conveyor(void);102103#endif //! OBJ_ITEMBOX_H104105106