// ALLDEFS.HPP
//
// all enums, #defines, etc for BAM
// this is cleaner than including the HPP for the related module, because those require other HPPs

// player ownership defines (who owns a unit, a building, etc)
#ifndef ALLDEFS_HPP
#define ALLDEFS_HPP

// for QA version
#define NDEBUG
//#define DEBUG_BIG_NET

#define INTERACTIVE_DEMO

// resource #s for sound FX - to be entered as they are implemented
#define SND_HEAL_REPAIR	7200
#define SND_BELL_TOLL	7202
#define SND_LAVA			7204
#define SND_GET_ITEM		7206
#define SND_DEATH_SQUEAL	7208
#define SND_CRASH			7210
#define SND_DEATH_FIRE	7212
#define SND_DROWNING		7214
#define SND_DEATH_FEMALE1 7216
#define SND_TRUMPET		7218
#define SND_DEATH_MALE	7220
#define SND_DEATH_UNDEAD 7222
#define SND_CAVERN		7224	// waiting for sound
#define SND_SUMMON		7226
#define SND_TRANSFORM	7226
#define SND_ROAR			7228
#define SND_DROP_ITEM	7230
#define SND_VOLCANO		7232	// unimplemented
#define SND_WATER_SPLASH 7234
#define SND_DRUMS			7236
#define SND_FLAME_SPURT	7238
#define SND_SHATTER		7240
#define SND_WATERFALL	7242
#define SND_DISBAND		7244
#define SND_FEMALE_WAIL	7246
#define SND_CRUMBLE		7248
#define SND_FEMALE_SONG	7250
#define SND_CACKLE		7252
#define SND_BIRD_CRY		7254
#define SND_WHACK			7256
#define SND_SCRAPE		7258
#define SND_SWORD_CLASH 7260
#define SND_ZAP			7262
#define SND_DEATH_FEMALE2 7264
#define SND_GIGGLE		7266
#define SND_ERROR			7268
#define SND_GUST_O_WIND 7270
#define SND_BOW_TWANG	7272
#define SND_SPEAR_CHUCK	7274
#define SND_TRIPSWITCH			7276
#define SND_PRESSUREPLATE		7278
#define SND_BRIDGE_OPEN_CLOSE	7280

#define SND_FIRE_GRATE_OPEN_CLOSE	7284
#define SND_MAGICAL_ENERGY		7286
#define SND_WELL_O_IMMORTALS	7288
#define SND_CAULDRON				7290
#define SND_ETCHING_PEN			7291
#define SND_PAGE_TURNS			7292
#define SND_DEMONIC_WAIL		7294
#define SND_IF_A_TREE_FALLS_AND_NO_ONE 7296
#define SND_MONSTROUS_FEMALE_SCREAM 7298
#define SND_MASCULINE_SCREAM	7300
#define SND_BESTIAL_ROAR		7302
#define SND_SMALL_SPLASH		7304
#define SND_METALLIC_ROAR		7306
#define SND_HISSING_SHOT		7308
#define SND_COLLAPSING_STONES	7310
#define SND_AVIAN_ROAR			7312
#define SND_CHOPPING_STRIKE	7314
#define SND_SAWBLADE_STRIKE	7316
#define SND_WOODEN_SMACK		7318
#define SND_METALLIC_STRIKE	7320
#define SND_HERALD_TRUMPET		7322
#define SND_METAPOD_START		7324

enum UNIT_RESPONSE_FX
{ SND_DRUID = 7471, SND_GARGOYLE, SND_GHOUL, SND_GNOME, SND_GORGON,
	SND_GRIFFIN, SND_JUGGERNAUT, SND_NYMPH, SND_METAPOD, SND_WIZARD,
	SND_WOLF, SND_WRAITH, SND_WYRM, SND_ZOMBIE, SND_TORTOISE, SND_HARPY,
	SND_GUARDIAN, SND_BRIGAND
};

enum UNIT_RESPONSE_VOC
{
	SND_ACOLYTE = 7450, SND_GOBLIN, SND_CLERIC, SND_PEASANT, SND_FURY,
	SND_STONE_GOLEM, SND_PALADIN, SND_RANGER, SND_TROLL, SND_WARRIOR
};

//#define ENABLE_EDITOR	// turn off to remove code for Editor mode

// player ownership defines (who owns a unit, a building, etc)
#define SIDE0		0x01		// neutral (peasants, etc)
#define SIDE1		0x02
#define SIDE2		0x04
#define SIDE3		0x00		// hates everyone
#define SIDE4		0x03		// place-holder, not used
const int TOTAL_SIDES	= 5;

// color look-up table info (for dynamic color remapping of units, buildings, etc)
#define CLUT_SIZE				8
#define CLUT_TEAM_COLORS	192
#define CLUT0_START			34
#define CLUT1_START			192
#define CLUT2_START			200

//#define XP_DESTROY_KEEP		250
//#define XP_DESTROY_SPECIAL 250
//#define XP_DESTROY_STRUCT  100
#define XP_USE_ITEM			5
#define XP_USE_SKILL			5
#define XP_CREATE_SPECIAL	250
#define XP_MAX					99999
#define RESEARCH_PHASES		6

#define MAX_UNITS_PER_SIDE	100

#define MAX_SERIAL_NUMS		400
#define ABetween(num, low, high) ((num)>=(low)&&(num)<=(high))

enum itemUsage
{
	ITEM_NONE = 0, ITEM_AUTOMATIC, ITEM_MANUAL, ITEM_TARGET
};

enum tutorialGoals
{
	TUT_ACOLYTES_CREATED = 0, TUT_ITEM_FOUND, TUT_UNIT_TRANSFORMED, TUT_UNIT_HEALED, TUT_BLDG_REPAIRED,
	TUT_BUILDING_MADE, TUT_UNIT_RESEARCHED, TUT_BLDG_DESTROYED, TUT_DUMMY_GOAL, TUT_TOTAL_GOALS
};

enum unitType
{
	NOUNIT = 0, ACOLYTE,		BANSHEE,		BRIGAND,	CLERIC,	DRUID,		ENCHANTER,	FURY, 		GARGOYLE,
	GHOUL, 		GNOME, 		GOBLIN,		GOLEM,	GORGON,	GRIFFIN,		GUARDIAN,	HARPY,		JUGGERNAUT,
	NYMPH,		OBELISK,		PALADIN,		PEASANT,	RANGER,	ROC,	 		ROC_EGG,		TORTOISE,	TROLL,
	WARRIOR,		WIZARD,		WOLF,			WRAITH,	WYRM,	 	ZOMBIE,
	UNIT_WEIRD_WARD,			UNIT_TERRAIN, 			UNIT_FIRE, UNIT_WATER, DOPPLEGANGER, UNIT_ARCH_FIRE,
	UNITMAXTYPES
};

enum tSkillType {SKILL_NONE = 0, SKILL_AGGRESSIVE, SKILL_PASSIVE};

// UNIT_TERRAIN used as attacker unit type when unit steps in damaging terrain

enum itemType
{ NO_ITEM = 0, BERSERKER_BREW, BOAR_BURGER, BOG_BOOTS, DAEMONS_BANE, DOWRY_CHEST, DRIFT_DISC, FROST_CAPE,
	HEALING_SALVE, KEY, MAP, MIGHT_MANTLE, SACRED_URN, COMPONENT, SHRUB_SPRITE, STORM_BRACERS, TELEPORT_TOME,
	TRAILFINDER, VERDANT_SHIELD, VIRTUE_VEIL, WEIRD_WAND, MASON_MIX, MANA_ORB, HARPY_NET,
	WEIRD_WARD, ENDOFITEMTYPES
};
#define MAXITEMTYPES (ENDOFITEMTYPES - 1)

#define WORLD_HEIGHT	40
#define WORLD_WIDTH	32
#define WORLD_SIZE (WORLD_WIDTH * WORLD_HEIGHT)

enum funcType
{
	FUNC_MISC = 0, FUNC_ARBORLODGE, FUNC_BARRACKS, FUNC_CRYPT, FUNC_RUNESTONE, FUNC_TEMPLE, FUNC_FLAMESPOUT,
	FUNC_MINESHAFT, FUNC_PORTAL, FUNC_WHIRLPOOL, FUNC_HOME, FUNC_ARBOR_FOUND, FUNC_BARRACKS_FOUND,
	FUNC_CRYPT_FOUND, FUNC_RUNE_FOUND, FUNC_TEMPLE_FOUND, FUNC_KEEP, FUNC_AQUEDUCT, FUNC_GATE, FUNC_CAMP,
	FUNC_CAULDRON,	FUNC_SWTRIP, FUNC_SWPRESSURE, FUNC_IMM_GATE, FUNC_IMM_WELL, FUNC_GEN_FOUND, 
	FUNC_BANISH_STONE, FUNC_PRISON_PIT, TOTALFUNCTIONS};
#define MAX_FUNCS	(TOTALFUNCTIONS - 1)

enum terrainType
{
	UNDEFINED = 0, BRAMBLES, CHASM, FLAME_SPOUT, FOLIAGE, ROUGH_LAND, HOTBED, MARSH,
	MINE, BROKEN_LAND, ROAD, OPEN_LAND, PORTAL, RUINS, SWAMP, WATER,
	WHIRLPOOL, HIGH_FOLIAGE, OBSTRUCTION, FOG_TERR, ROC_NEST, TERR21, TERR22, TERR23,
	TERR24, TERR25, TERR26, TERR27, TERR28, TERR29, ARBOR_LODGE, BARRACKS,
	CAMP, CRYPT, GATE, KEEP, RUNESTONE, TEMPLE, STRUCTURE, WALL,
	MONUMENT, BRIDGE, STOCKPILE, GREAT_WALL, FOUND_ARBORLODGE, FOUND_BARRACKS, FOUND_CRYPT, FOUND_RUNESTONE,
	FOUND_TEMPLE, CAULDRON, ATLANTEAN_RUIN, AQUEDUCT, TERR52, TERR53, TERR54, TRIP_SWITCH,
	PRESSURE_PLATE, WIND_WALL, GUARDIAN_PORTAL, GOLEM_PORTAL, TURRET, TURRET1, TURRET2, TURRET3,
	TURRET4, TURRET5, TURRET6, TURRET7, TURRET8, TURRET9, TURRET10, TURRET11,
	TURRET12, TURRET13, TURRET14, TURRET15, PALADIN_PORTAL, WARRIOR_PORTAL, WELL_OF_IMMORTALS, PLATFORM, FOUND_GENERIC,
	BRIDGE2, BANISH_STONE, PRISON_PIT, TERRAINMAXTYPES
};

// describes what the cursor is currently focused on, and what is thus displayed by DrawStatusBox()
enum TargetType
{
	NOTARGET = 0, TERRAIN, UNIT, BUILDING, ITEM, TERRAIN_ANI, TRANSFORMING, MAXTARGTYPES
};

// active terrain types
enum activeTerrain_t
{
	ACTIVE_NONE = 0, ACTIVE_FIRE, ACTIVE_FLAME_SPOUT, ACTIVE_ARCH_FIRE, MAX_ACTIVE_TERRAINS
};

//===========================================
#define	MAX_CAMPAIGN_SCORE 99999

enum
{
	STORY_NONE=0,
	STORYLINE1,
	STORYLINE2,
	STORYLINE3,
	STORYLINE4,
	STORYLINE5,
	LEGEND,
	NETGAME,
	TUTORIAL,
	SHOW_OFF,
	STORY_LAST
};

enum
{
  	HALL_NO_ERROR=0,
	HALL_NO_CAMP_CHARS=15,
	HALL_NO_NET_CAMP_CHARS,
	HALL_NO_OPEN_FILE=100,
	HALL_NO_OPEN_NET_FILE,
	HALL_NO_READ_HEADER,
	HALL_NO_READ_NET_HEADER
};

const int STORYLINE1_DONE = 0x0001;
const int STORYLINE2_DONE = 0x0002;
const int STORYLINE3_DONE = 0x0004;
const int STORYLINE4_DONE = 0x0008;
const int STORYLINE5_DONE = 0x0010;	

#define	STORY_SQB  		1000
#define	MAKECHAR_SQB  	1410
#define	MEN_SQB			1420
#define	WOMEN_SQB  		1430
#define	OTHER_SQB  		1440
#define	ASSESS_SQB 		1510
#define	HALL_SQB 		1610
#define	CHOOSE_SQB 		1710
#define	DEATH_SQB 		1810
#define	RANK_SQB			1010
#define	STORYLINE_SQB	1020
#define	STORY_CHAR_SQB	1030
#define	REGION_SQB		1040
#define	ABBR_NAME_SQB	1050
#define	ALIGN_SQB		1060
#define  REGION2_SQB		1070
#define	OPTION_SQB		1910
#define	OPTION2_SQB		1920
#define	WINLOSE_SQB		2010
#define	WINLOSE2_SQB	3010
#define	ENCYMENU_SQB	4010
#define	ENDQUOTE_SQB	6000
#define	NETCHAR_SQB		9010
#define	POPUP_SQB		9110
#define	LEGENDOPP_SQB	9210
#define	TUTORIAL_SQB 	9310
//SEE ALSO THE DEFINES IN MAINMENU.HPP
//SEE ALSO THE DEFINES IN CREDITS.CPP
//SEE ALSO THE DEFINES IN ENCYCLO.CPP


//===========================================
//every packet sent should have a BamMessage structure at the front of it.
//this way each room may have its own type of packet which the BamMessage
//structure need not be aware of.

// enums are assigned to packet's ID

enum BAMPacketType
{	UNIT_ACTION,
	UNIT_NEW,
	PLAYER_MSG,
	BMSG_NULL,
	BMSG_INIT,
	BMSG_DONE,
	BMSG_DISCONNECT,
	BMSG_DATA,
	BMSG_ERROR,
	BMSG_SAVE,
	BMSG_RESTORE,
	BMSG_RESTORE_ACK,	//for a restore verify matching serialNum
	BMSG_RESTORE_NAK,	//verify failed
	PAUSE_ON,
	PAUSE_OFF,
	PLAYER_LEAVING,
	NS_EMPTY,
	NS_DONE,
	NS_UNDONE,
	NS_LAST,
	TOTAL_BAM_PACKET_TYPES
};

struct	BamPacketHdr
{
	int	sourceRoom;
	int	serialNum;	//used in SAVE/RESTORE msg
	int	aux1;			//used for versionNum
	int	aux2;			//used for versionSubNum
};

#define	NET_SAVEGAME_NUM	11

#endif
