/*
 ╔══════════════════════════════════════╗
 ║   ///////         Θ             Γ    ╟───────────────┐
 ║       //     Γ              Ω        ║ Thomas Powers │▌
 ║  Γ   //              Γ               ║ April 22 2010 │▌
 ║	   //  ZOMBIES & Landmines          ╟───────────────┘▌
 ║    //                        Θ       ║▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
 ║   //       Γ               Γ     ▒   ║▌
 ║Γ /////////////////////               ║▌
 ╚══════════════════════════════════════╝▌
  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
*/
// basic stuff that everything uses (zombies, players, weapons, main)


#ifndef included_common
#define included_common

const int GRID_ROWS=20;
const int GRID_COLS=70;

const char PLAYER_ICON=char(234); // Ω
const char ZOMBIE_ICON=char(226); // Γ
const char CORPSE_ICON=char(158); // ₧
const char EXIT_ICON  =char(176); // ░
const char MINE_ICON  =char(233); // Θ
const char EMPTY_ICON =char(32);  // {space}
const char BULLET_ICON=char(249); // ∙

const int NUM_WEAPONS			=3;
const int BLAST_RANGE			=5;	 // the blast radius of an explosion
const int COST_MARKUP_PER_LEVEL	=3;	 // each level the cost of items will increase by this much
const int MONIES_PER_LEVEL		=3;	 // each level completed, the player will receive this * the level in monies
const int RUNNING_SHOES_COST	=75; // cost to unlock running (with keypad)
const int EXTRA_LIFE_COST		=200;// cost to buy an extra life
const int MAX_ZOMBIE_SPEED		=200;// ms delay (in real-time mode)
const int BULLET_SPEED			=10; // ms delay

const int ALL_ZOMBIE_BONUS=10;		// bonus monies for killing all zombies in a level

//const bool REAL_TIME_ACTION=true;	// real-time or turn based gameplay?
const int STARTING_LIVES=3;
const int MIN_ZOMBIE_DISTANCE=3;	// minimum distance a zombie must be from the player when it spawns

enum colors
{
	black,	 blue,   green,   cyan,   red,   purple,   yellow,   white, 
	BRblack, BRblue, BRgreen, BRcyan, BRred, BRpurple, BRyellow, BRwhite
};
enum keys
{	KEY_UP=72,	KEY_DOWN=80,	KEY_LEFT=75,	KEY_RIGHT=77 };
enum direction
{	DIR_UP, DIR_DOWN, DIR_LEFT, DIR_RIGHT };
enum weapons
{	weapon_pistol, weapon_rifle, weapon_mine  };

const int BKG_COLOR		= blue;
const int ZOMBIE_COLOR	= BRcyan;
const int CORPSE_COLOR	= BRred;
const int MINE_COLOR	= BRgreen;

struct square
{
	char sqIcon;
	int FGcolor;
	int BGcolor;
	square()
	{
		sqIcon=EMPTY_ICON;
		BGcolor=black;
		FGcolor=BKG_COLOR;
	}
};

struct position
{
	int row;
	int col;
};

square* gridSquare(position pos);
void updateGridSquare(position pos);
void setScreenPos(position pos, bool absolute=true);
void setColor(int foreground, int background);
void explosion(position pos);
int calcDistance(position A, position B);

#endif