Path: blob/master/SonicMania/Objects/ERZ/PhantomEgg.h
338 views
#ifndef OBJ_PHANTOMEGG_H1#define OBJ_PHANTOMEGG_H23#include "Game.h"45typedef enum {6PHANTOMEGG_EGGMAN,7} PhantomEggTypes;89// Names for the values in the attack tables10// Tables can only have int constants so we cant put these in there directly11typedef enum {12PHANTOMEGG_ATTACK_NONE,13PHANTOMEGG_ATTACK_JUMP,14PHANTOMEGG_ATTACK_SHOCK,15PHANTOMEGG_ATTACK_MISSILES,16PHANTOMEGG_ATTACK_WARP,17} PhantomEggAttackIDs;1819// Object Class20struct ObjectPhantomEgg {21RSDK_OBJECT22TABLE(int32 debrisInfo[29], { 4, 0, 0, -0x20000, -0x28000, 1, 0, -0x20000, -0x28000, 2, 0, 0x20000, -0x20000, 3, 0, 0x28000,23-0x20000, 4, 0, -0x10000, -0x10000, 5, 0, 0x10000, -0x10000, 6, 0, -0x8000, -0x10000 });24TABLE(int32 attackStateTable1[32], { 0, 0, 0, 0, 1, 0, 0, 2, 0, 1, 3, 0, 2, 0, 0, 4, 0, 0, 1, 0, 2, 0, 0, 3, 0, 0, 1, 0, 0, 2, 0, 4 });25TABLE(int32 attackStateTable2[32], { 0, 0, 2, 0, 1, 3, 0, 2, 0, 0, 3, 0, 2, 0, 0, 3, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 1, 0, 0, 2, 0, 4 });26TABLE(int32 attackStateTable3[32], { 0, 0, 2, 0, 1, 3, 3, 2, 0, 3, 3, 0, 2, 0, 0, 3, 0, 0, 0, 1, 2, 0, 0, 3, 0, 0, 1, 0, 0, 2, 0, 4 });27int32 boundsL;28int32 boundsR;29int32 boundsM;30int32 boundsT;31int32 boundsB;32int32 boundsStoreL1;33int32 boundsStoreR1;34int32 boundsStoreT1;35int32 boundsStoreB1;36int32 startScanline;37int32 endScanline;38bool32 setupPalette;39bool32 savedGameProgress;40uint16 sfxHit;41uint16 sfxExplosion2;42uint16 sfxRocketJet;43uint16 sfxExplosion3;44uint16 sfxJump;45uint16 sfxLand;46uint16 sfxRepel;47uint16 sfxShield;48uint16 sfxShock;49uint16 sfxSummon;50uint16 sfxMissile;51uint16 aniFrames;52bool32 disableSuperForm;53};5455// Entity Class56struct EntityPhantomEgg {57RSDK_ENTITY58StateMachine(state);59StateMachine(stateDraw);60int32 type;61int32 timer;62int32 invincibilityTimer;63int32 health;64int32 remainingJumps;65int32 attackTimer;66int32 phantomID;67int32 palBlendPercent;68Vector2 targetPos;69Vector2 targetVelocity;70int32 *attackStateTable;71int32 unused;72Animator crackAnimator;73Animator coreAnimator;74Animator legAnimator;75Animator armLAnimator;76Animator armRAnimator;77Animator eggmanAnimator;78Animator rubyAnimator;79Hitbox hitbox;80};8182// Object Struct83extern ObjectPhantomEgg *PhantomEgg;8485// Standard Entity Events86void PhantomEgg_Update(void);87void PhantomEgg_LateUpdate(void);88void PhantomEgg_StaticUpdate(void);89void PhantomEgg_Draw(void);90void PhantomEgg_Create(void *data);91void PhantomEgg_StageLoad(void);92#if GAME_INCLUDE_EDITOR93void PhantomEgg_EditorDraw(void);94void PhantomEgg_EditorLoad(void);95#endif96void PhantomEgg_Serialize(void);9798// Extra Entity Functions99void PhantomEgg_HandleAnimations(void);100void PhantomEgg_CheckPlayerCollisions(void);101void PhantomEgg_Hit(void);102void PhantomEgg_Explode(Hitbox *hitbox);103void PhantomEgg_HandleNextAttack(void);104void PhantomEgg_SetupWarpFX(void);105void PhantomEgg_HandlePhantomWarp(uint8 phantomID);106void PhantomEgg_HandleReturnWarp(void);107void PhantomEgg_Scanline_WarpFX(ScanlineInfo *scanlines);108109void PhantomEgg_Draw_Normal(void);110void PhantomEgg_Draw_Cracked(void);111112void PhantomEgg_State_SetupArena(void);113void PhantomEgg_State_DimArena(void);114void PhantomEgg_State_EnterEggman(void);115void PhantomEgg_State_AdjustStartingPos(void);116void PhantomEgg_State_IntroHover(void);117void PhantomEgg_State_BeginFight(void);118void PhantomEgg_State_MoveAround(void);119void PhantomEgg_State_Attack_Jumped(void);120void PhantomEgg_State_Attack_JumpLand(void);121void PhantomEgg_State_Attack_JumpAttack(void);122void PhantomEgg_State_Attack_CableShock(void);123void PhantomEgg_State_Attack_PrepareWarp(void);124void PhantomEgg_State_Attack_GrabPlayers(void);125void PhantomEgg_State_Attack_HandleWarp(void);126void PhantomEgg_State_Attack_WarpAway(void);127void PhantomEgg_State_Attack_WarpReturn(void);128void PhantomEgg_State_Destroyed(void);129void PhantomEgg_State_Exploding(void);130void PhantomEgg_State_StartBadEnd(void);131void PhantomEgg_State_CrackOpen(void);132void PhantomEgg_State_CrackedExploding(void);133void PhantomEgg_State_StartGoodEnd(void);134135#if MANIA_USE_PLUS136void PhantomEgg_SaveGameCB(bool32 success);137#else138void PhantomEgg_SaveGameCB(void);139#endif140141#endif //! OBJ_PHANTOMEGG_H142143144