#pragma once

#define LIST_ENTITIES \
	X_LIST_ENTITIES(OBJ_PLAYER,		100,	0,	ES_PLAYER,			-1,		ES_PLAYER_HURT,		ES_PLAYER_DIE,		-1,		NULL,	0.25f) \
	X_LIST_ENTITIES(OBJ_FIREBALL,	10,		0,	ES_FIREBALL_FLY,	)

//				  enum name				frame	action function				sound effect			entity flags								next state				next delay
#define LIST_STATES \
	X_LIST_STATES(ES_PLAYER,			12,		NULL,						SFX_NONE,				EF_NORMAL,									-1,						0) \
	X_LIST_STATES(ES_PLAYER_HEAL,		12,		NULL,						SFX_PLAYER_DRINK,		EF_NORMAL,									ES_PLAYER,				48) \
	X_LIST_STATES(ES_PLAYER_HURT,		12,		NULL,						SFX_PLAYER_HURT,		EF_NORMAL,									ES_PLAYER,				14) \
	X_LIST_STATES(ES_PLAYER_DIE,		12,		Player_OnDeath,				SFX_PLAYER_DIE,			EF_DEAD,									-1,						0) \
	X_LIST_STATES(ES_FIREBALL_FLY,		0,		NULL,						SFX_FIREBALL_TRAVEL,	EF_TICKER | EF_GLOW | EF_FLYING,			ES_FIREBALL_FLY,		14) \
	X_LIST_STATES(ES_SMFIREBALL_FLY,	32,		NULL,						SFX_FIREBALL_TRAVEL,	EF_TICKER | EF_GLOW | EF_FLYING,			ES_SMFIREBALL_FLY,		14) \
	X_LIST_STATES(ES_FIREBALL_HIT,		1,		AI_Generic_StopMoving,		SFX_FIREBALL_HIT,		EF_DEAD | EF_GLOW | EF_FLYING,				ES_DELETEME,			12) \
	X_LIST_STATES(ES_EORB_FLY,			33,		NULL,						SFX_ENERGY_TRAVEL,		EF_TICKER | EF_GLOW | EF_FLYING,			ES_EORB_FLY,			14) \
	X_LIST_STATES(ES_EORB_HIT,			34,		AI_Generic_StopMoving,		SFX_ENERGY_HIT,			EF_DEAD | EF_GLOW | EF_FLYING,				ES_DELETEME,			8) \
	X_LIST_STATES(ES_CHEST,				8,		NULL,						SFX_NONE,				EF_NORMAL | EF_CANUSE,						-1,						0) \
	X_LIST_STATES(ES_CHEST_OPEN,		9,		AI_ChestOpen,				SFX_NONE,				EF_NORMAL,									-1,						0) \
	X_LIST_STATES(ES_CHEST_BROKEN,		14,		NULL,						SFX_NONE,				EF_DEAD,									-1,						0) \
	X_LIST_STATES(ES_WIZARD_IDLE,		16,		AI_Generic_LookForPlayer,	SFX_NONE,				EF_NORMAL,									ES_WIZARD_IDLE,			24) \
	X_LIST_STATES(ES_WIZARD_WALK0,		17,		AI_WizardWalk,				SFX_NONE,				EF_NORMAL,									ES_WIZARD_WALK1,		20) \
	X_LIST_STATES(ES_WIZARD_WALK1,		16,		NULL,						SFX_NONE,				EF_NORMAL,									ES_WIZARD_WALK2,		20) \
	X_LIST_STATES(ES_WIZARD_WALK2,		18,		NULL,						SFX_NONE,				EF_NORMAL,									ES_WIZARD_WALK3,		20) \
	X_LIST_STATES(ES_WIZARD_WALK3,		16,		NULL,						SFX_NONE,				EF_NORMAL,									ES_WIZARD_WALK0,		20) \
	X_LIST_STATES(ES_WIZARD_SHOOT0,		19,		NULL,						SFX_WIZARD_CHARGE,		EF_NORMAL,									ES_WIZARD_SHOOT1,		48) \
	X_LIST_STATES(ES_WIZARD_SHOOT1,		20,		AI_WizardShoot,				SFX_NONE,				EF_NORMAL,									ES_WIZARD_WALK0,		20) \
	X_LIST_STATES(ES_WIZARD_HURT,		21,		NULL,						SFX_WIZARD_HURT,		EF_NORMAL,									ES_WIZARD_WALK0,		14) \
	X_LIST_STATES(ES_WIZARD_DIE0,		22,		AI_Generic_StopMoving,		SFX_WIZARD_DIE,			EF_DEAD,									ES_WIZARD_DIE1,			24) \
	X_LIST_STATES(ES_WIZARD_DIE1,		23,		NULL,						SFX_NONE,				EF_DEAD,									-1,						0) \
	X_LIST_STATES(ES_ENRGYWIZ_IDLE,		40,		AI_Generic_LookForPlayer,	SFX_NONE,				EF_NORMAL,									ES_ENRGYWIZ_IDLE,		24) \
	X_LIST_STATES(ES_ENRGYWIZ_WALK0,	41,		AI_EnergyWizardWalk,		SFX_NONE,				EF_NORMAL,									ES_ENRGYWIZ_WALK1,		20) \
	X_LIST_STATES(ES_ENRGYWIZ_WALK1,	40,		NULL,						SFX_NONE,				EF_NORMAL,									ES_ENRGYWIZ_WALK2,		20) \
	X_LIST_STATES(ES_ENRGYWIZ_WALK2,	42,		NULL,						SFX_NONE,				EF_NORMAL,									ES_ENRGYWIZ_WALK3,		20) \
	X_LIST_STATES(ES_ENRGYWIZ_WALK3,	40,		NULL,						SFX_NONE,				EF_NORMAL,									ES_ENRGYWIZ_WALK0,		20) \
	X_LIST_STATES(ES_ENRGYWIZ_SHOOT0,	43,		NULL,						SFX_WIZARD_CHARGE,		EF_NORMAL,									ES_ENRGYWIZ_SHOOT1,		34) \
	X_LIST_STATES(ES_ENRGYWIZ_SHOOT1,	44,		AI_EnergyWizardShoot,		SFX_NONE,				EF_NORMAL,									ES_ENRGYWIZ_WALK0,		20) \
	X_LIST_STATES(ES_ENRGYWIZ_HURT,		45,		NULL,						SFX_WIZARD_HURT,		EF_NORMAL,									ES_ENRGYWIZ_SHOOT0,		14) \
	X_LIST_STATES(ES_ENRGYWIZ_DIE0,		46,		AI_Generic_StopMoving,		SFX_WIZARD_DIE,			EF_DEAD,									ES_ENRGYWIZ_DIE1,		24) \
	X_LIST_STATES(ES_ENRGYWIZ_DIE1,		47,		NULL,						SFX_NONE,				EF_DEAD,									-1,						0) \
	X_LIST_STATES(ES_FROG_IDLE,			2,		AI_Generic_LookForPlayer,	SFX_NONE,				EF_NORMAL,									ES_FROG_IDLE,			24) \
	X_LIST_STATES(ES_FROG_WAIT,			2,		AI_Generic_StopMoving,		SFX_NONE,				EF_NORMAL,									ES_FROG_JUMP,			32) \
	X_LIST_STATES(ES_FROG_JUMP,			3,		AI_FrogJump,				SFX_FROG_JUMP,			EF_NORMAL | EF_FLYING,						ES_FROG_IDLE,			24) \
	X_LIST_STATES(ES_FROG_HURT,			4,		NULL,						SFX_FROG_HURT,			EF_NORMAL,									ES_FROG_JUMP,			14) \
	X_LIST_STATES(ES_FROG_DIE,			5,		AI_Generic_StopMoving,		SFX_NONE,				EF_DEAD,									-1,						0) \
	X_LIST_STATES(ES_SKEL_IDLE,			24,		AI_Generic_LookForPlayer,	SFX_NONE,				EF_NORMAL,									ES_SKEL_IDLE,			24) \
	X_LIST_STATES(ES_SKEL_WALK0,		25,		AI_SkeletonWalk,			SFX_SKEL_STEP,			EF_NORMAL,									ES_SKEL_WALK1,			14) \
	X_LIST_STATES(ES_SKEL_WALK1,		24,		AI_SkeletonWalk,			SFX_NONE,				EF_NORMAL,									ES_SKEL_WALK2,			14) \
	X_LIST_STATES(ES_SKEL_WALK2,		26,		AI_SkeletonWalk,			SFX_SKEL_STEP,			EF_NORMAL,									ES_SKEL_WALK3,			14) \
	X_LIST_STATES(ES_SKEL_WALK3,		24,		AI_SkeletonWalk,			SFX_NONE,				EF_NORMAL,									ES_SKEL_WALK0,			14) \
	X_LIST_STATES(ES_SKEL_ATTACK0,		27,		NULL,						SFX_SWORD_MISS,			EF_NORMAL,									ES_SKEL_ATTACK1,		18) \
	X_LIST_STATES(ES_SKEL_ATTACK1,		28,		AI_SkeletonAttack,			SFX_SWORD_HIT,			EF_NORMAL,									ES_SKEL_WALK0,			20) \
	X_LIST_STATES(ES_SKEL_HURT,			29,		NULL,						SFX_NONE,				EF_NORMAL,									ES_SKEL_WALK0,			14) \
	X_LIST_STATES(ES_SKEL_DIE0,			30,		AI_Generic_StopMoving,		SFX_NONE,				EF_DEAD,									ES_SKEL_DIE1,			24) \
	X_LIST_STATES(ES_SKEL_DIE1,			31,		NULL,						SFX_NONE,				EF_DEAD,									-1,						0) \
	X_LIST_STATES(ES_ROCKGUY_IDLE,		48,		AI_Generic_LookForPlayer,	SFX_NONE,				EF_NORMAL & ~EF_CANKNOCKBACK,				ES_ROCKGUY_IDLE,		24) \
	X_LIST_STATES(ES_ROCKGUY_WALK0,		49,		AI_RockGuyWalk,				SFX_ROCKGUY_STEP,		EF_NORMAL & ~EF_CANKNOCKBACK,				ES_ROCKGUY_WALK1,		24) \
	X_LIST_STATES(ES_ROCKGUY_WALK1,		48,		AI_RockGuyWalk,				SFX_NONE,				EF_NORMAL & ~EF_CANKNOCKBACK,				ES_ROCKGUY_WALK2,		24) \
	X_LIST_STATES(ES_ROCKGUY_WALK2,		50,		AI_RockGuyWalk,				SFX_ROCKGUY_STEP,		EF_NORMAL & ~EF_CANKNOCKBACK,				ES_ROCKGUY_WALK3,		24) \
	X_LIST_STATES(ES_ROCKGUY_WALK3,		48,		AI_RockGuyWalk,				SFX_NONE,				EF_NORMAL & ~EF_CANKNOCKBACK,				ES_ROCKGUY_WALK0,		24) \
	X_LIST_STATES(ES_ROCKGUY_ATTACK0,	51,		NULL,						SFX_ROCKGUY_ATTACK,		EF_NORMAL & ~EF_CANKNOCKBACK,				ES_ROCKGUY_ATTACK1,		32) \
	X_LIST_STATES(ES_ROCKGUY_ATTACK1,	52,		AI_RockGuyAttack,			SFX_EXPLODE,			EF_NORMAL & ~EF_CANKNOCKBACK,				ES_ROCKGUY_WALK0,		48) \
	X_LIST_STATES(ES_ROCKGUY_DIE0,		53,		AI_Generic_StopMoving,		SFX_NONE,				EF_DEAD,									ES_ROCKGUY_DIE1,		32) \
	X_LIST_STATES(ES_ROCKGUY_DIE1,		54,		NULL,						SFX_NONE,				EF_DEAD,									-1,						0) \
	X_LIST_STATES(ES_MIMIC_IDLE,		8,		NULL,						SFX_NONE,				EF_NORMAL | EF_CANUSE,						-1,						0) \
	X_LIST_STATES(ES_MIMIC_ATTACK0,		12,		AI_MimicAttack0,			SFX_MIMIC,				EF_NORMAL,									ES_MIMIC_ATTACK1,		20) \
	X_LIST_STATES(ES_MIMIC_ATTACK1,		13,		AI_MimicAttack1,			SFX_NONE,				EF_NORMAL,									ES_MIMIC_ATTACK0,		12) \
	X_LIST_STATES(ES_WATBEAST_HIDE,		35,		AI_WatbeastHiding,			SFX_NONE,				EF_TICKER | EF_CANHURT | EF_FLYING,			ES_WATBEAST_HIDE,		48) \
	X_LIST_STATES(ES_WATBEAST_ATTACK0,	36,		NULL,						SFX_NONE,				(EF_NORMAL | EF_FLYING) & ~EF_CANKNOCKBACK,	ES_WATBEAST_ATTACK1,	24) \
	X_LIST_STATES(ES_WATBEAST_ATTACK1,	37,		AI_WatbeastShoot,			SFX_NONE,				(EF_NORMAL | EF_FLYING) & ~EF_CANKNOCKBACK,	ES_WATBEAST_ATTACK2,	36) \
	X_LIST_STATES(ES_WATBEAST_ATTACK2,	36,		NULL,						SFX_NONE,				(EF_NORMAL | EF_FLYING) & ~EF_CANKNOCKBACK,	ES_WATBEAST_HIDE,		24) \
	X_LIST_STATES(ES_WATBEAST_HURT,		38,		NULL,						SFX_WATBEAST_HURT,		(EF_NORMAL | EF_FLYING) & ~EF_CANKNOCKBACK,	ES_WATBEAST_HIDE,		16) \
	X_LIST_STATES(ES_WATBEAST_DIE,		39,		NULL,						SFX_WATBEAST_DIE,		EF_DEAD | EF_FLYING,						ES_DELETEME,			24) \
	X_LIST_STATES(ES_GHOST_FLY,			11,		AI_GhostFly,				SFX_GHOST,				EF_NORMAL | EF_FLYING | EF_GLOW,			ES_GHOST_FLY,			24) \
	X_LIST_STATES(ES_GHOST_SHOOT,		11,		AI_GhostShoot,				SFX_NONE,				EF_NORMAL | EF_FLYING,						ES_GHOST_FLY,			4) \
	X_LIST_STATES(ES_EXPLNUT_IDLE,		55,		NULL,						SFX_NONE,				EF_NORMAL,									-1,						0) \
	X_LIST_STATES(ES_EXPLNUT_HURT,		55,		NULL,						SFX_NONE,				EF_NORMAL | EF_INVERT,						ES_EXPLNUT_IDLE,		24) \
	X_LIST_STATES(ES_BOMB_TICK,			63,		AI_BombTick,				SFX_BOMB_TICK,			(EF_NORMAL | EF_INVERT) & ~EF_CANHURT,		ES_BOMB_WAIT,			6) \
	X_LIST_STATES(ES_BOMB_WAIT,			63,		NULL,						SFX_NONE,				EF_NORMAL & ~EF_CANHURT,					ES_BOMB_TICK,			24) \
	X_LIST_STATES(ES_LANTERN,			6,		NULL,						SFX_NONE,				EF_GLOW,									-1,						0) \
	X_LIST_STATES(ES_TREE,				15,		NULL,						SFX_NONE,				EF_NORMAL & ~EF_CANKNOCKBACK,				-1,						0) \
	X_LIST_STATES(ES_EXPLODE,			1,		AI_Generic_Explode,			SFX_EXPLODE,			EF_TICKER | EF_GLOW,						ES_DELETEME,			24) \
	X_LIST_STATES(ES_DELETEME,			0,		Game_RemoveObject,			SFX_NONE,				EF_DEAD,									-1,						0)
