www.pudn.com > Chesssource.rar > ChessDef.h
#define GRID_WIDTH 0.25f
#define NUM_SOUNDS 1
char *g_SoundFilenames[NUM_SOUNDS] = {
{ "Data\\Attack1.wav" }
};
long g_CurrentMusic = -1;
char *g_MusicFilenames[] = {
{ "Data\\Magic_Harp.mid" }
};
static DWORD g_Timer = 0;
static int g_ChessmanType[32]=
{
6,6,6,6,6,6,6,6,
1,2,3,4,5,3,2,1,
6,6,6,6,6,6,6,6,
1,2,3,4,5,3,2,1
};
static int g_IsDisplay[33]=
{
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
};
static int g_ChessmanMap[8][8] =
{
{ 9, 1, 0, 0, 0, 0, 17, 25},
{ 10, 2, 0, 0, 0, 0, 18, 26},
{ 11, 3, 0, 0, 0, 0, 19, 27},
{ 12, 4, 0, 0, 0, 0, 20, 28},
{ 13, 5, 0, 0, 0, 0, 21, 29},
{ 14, 6, 0, 0, 0, 0, 22, 30},
{ 15, 7, 0, 0, 0, 0, 23, 31},
{ 16, 8, 0, 0, 0, 0, 24, 32}
};
static POINT g_PointChessman[33] =
{
{-1,-1},
{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}, {6,1}, {7,1},
{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}, {6,0}, {7,0},
{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}, {6,6}, {7,6},
{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}, {6,7}, {7,7}
};
// x/z
const float g_XCoordinateToPosition[8] =
{
-0.875f, -0.625f, -0.375f, -0.125f, 0.125f, 0.375f, 0.625f, 0.875f
};
const float g_ZCoordinateToPosition[8] =
{
0.875f, 0.625f, 0.375f, 0.125f, -0.125f, -0.375f, -0.625f, -0.875f
};
// 可行区域图
typedef struct _ChessmanCanGoMap
{
int ChessmanCanGoMap[8][8];
_ChessmanCanGoMap()
{
for( int i=0; i<8; i++ )
for( int j=0; j<8; j++ )
ChessmanCanGoMap[i][j] = -1;
}
void Reset()
{
for( int i=0; i<8; i++ )
for( int j=0; j<8; j++ )
ChessmanCanGoMap[i][j] = -1;
}
} _ChessmanCanGoMap;
_ChessmanCanGoMap g_sChessmanCanGoMap[33];
const int ManBPlus[2][9][8]=
{
{
{ 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 1, 2, 3, 4, 5},
{ 0, 0, 0, 1, 2, 3, 4, 5},
{ 0, 0, 0, 1, 2, 3, 4, 5},
{ 0, 0, 0, 1, 2, 3, 4, 5},
{ 0, 0, 0, 1, 2, 3, 4, 5},
{ 0, 0, 0, 1, 2, 3, 4, 5},
{ 0, 0, 0, 1, 2, 3, 4, 5},
{ 0, 0, 0, 1, 2, 3, 4, 5}
},
{
{ 0, 0, 0, 0, 0, 0, 0, 0},
{ 5, 4, 3, 2, 1, 0, 0, 0},
{ 5, 4, 3, 2, 1, 0, 0, 0},
{ 5, 4, 3, 2, 1, 0, 0, 0},
{ 5, 4, 3, 2, 1, 0, 0, 0},
{ 5, 4, 3, 2, 1, 0, 0, 0},
{ 5, 4, 3, 2, 1, 0, 0, 0},
{ 5, 4, 3, 2, 1, 0, 0, 0},
{ 5, 4, 3, 2, 1, 0, 0, 0}
}
};
//给出棋子序号!!,判断是红是黑
const int SideOfMan[33]=
{
-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
};
#define S_DEPTH 6
#define NOSELF(side,i,j) (SideOfMan[map[i][j]]!=side)
#define NOMAN(i,j) (map[i][j]==0)
// 车 马 相 王后 国王 兵
const int BV1[6]={100, 90,80,300, 50, 20};//基本价值
const int BV2[6]={10, 10, 10, 20, 1, 12};//活跃度
const int BV3[6]={5,15,25,35,70,300};//兵在不同位置的价值附加
const int contactpercent1=25;//防守的重视程度(百分比)
const int contactpercent2=30;//进攻的重视程度(百分比)
const int FistOfSide[2]={1,17};
const int LastOfSide[2]={17,33};
const int KingOfSide[2]={13,29};