use crate::eval::score::*;
 
//PIECE WEIGHTS
pub const PAWN: Score = S!(  71,   96);
pub const KNIGHT: Score = S!( 350,  312);
pub const BISHOP: Score = S!( 345,  328);
pub const ROOK: Score = S!( 508,  532);
pub const QUEEN: Score = S!(1032, 1031);
 
//EXTRA CALCS
pub const TEMPO: Score = S!(  20,   20);

pub const PAWN_MOBILITY: [Score; 5] = [
    S!(   2,    4), S!(   1,   -4), S!(   0,    1), S!(   4,    2), S!(  -5,   -4), 
];
pub const KNIGHT_MOBILITY: [Score; 9] = [
    S!( -21,   -9), S!(  -2,   -2), S!(  -3,   -3), S!(   1,    0), S!(   1,    0), S!(  -1,    0), S!(  -1,    0), S!(  -1,    0), 
    S!(   9,   -8), 
];
pub const BISHOP_MOBILITY: [Score; 14] = [
    S!(   0,    0), S!( -70,  -65), S!( -43,  -35), S!( -16,  -16), S!( -11,  -11), S!(  -8,   -8), S!(   1,    0), S!(   3,    1), 
    S!(   1,    1), S!(   0,    0), S!(  10,    5), S!(   7,    7), S!(  13,   -3), S!(  20,  -13), 
];
pub const ROOK_MOBILITY: [Score; 15] = [
    S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!( -96,  -30), S!( -25,  -23), S!(  -3,   -3), 
    S!( -11,  -11), S!( -15,  -12), S!( -17,  -11), S!( -16,   -7), S!(  -9,   -3), S!(  -4,    4), S!(   2,    2), 
];
pub const QUEEN_MOBILITY: [Score; 28] = [
    S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), 
    S!(   0,    0), S!(  19,   19), S!(   5,   -1), S!(   1,   -4), S!( -18,  -14), S!(  -6,   -8), S!(  -4,   -4), S!(  -6,   -6), 
    S!(  -5,  -10), S!(   1,    0), S!(  -4,   -3), S!(  -5,   -4), S!(  -3,    1), S!(   1,    6), S!(  -1,    0), S!(  -1,    0), 
    S!(  -1,    0), S!(  16,   13), S!(   0,    0), S!(   0,    0), 
];
pub const KING_MOBILITY: [Score; 9] = [
    S!(  13,   13), S!(  18,   -5), S!(  17,  -16), S!(   9,  -10), S!(  -6,    3), S!(  -3,   -4), S!( -12,    8), S!( -15,    8), 
    S!(  -6,    6), 
];
pub const VIRTUAL_MOBILITY: [Score; 28] = [
    S!(   8,    8), S!(  16,   16), S!(  12,   12), S!(  15,    6), S!(  11,    8), S!(  12,    6), S!(   9,    7), S!(   4,    2), 
    S!(   6,    2), S!(   3,    2), S!(  -6,    3), S!( -14,    7), S!( -19,    4), S!( -29,   11), S!(   1,    0), S!( -34,   11), 
    S!( -33,    7), S!(   1,    0), S!( -23,    0), S!( -14,   -3), S!(  -5,   -5), S!( -15,  -10), S!( -12,  -12), S!( -21,  -18), 
    S!( -20,  -30), S!( -13,  -31), S!( -22,  -22), S!( -36,  -33), 
];

pub const BISHOP_PAIR_BONUS: Score = S!(  33,   45);
pub const PASSED_PAWN_BONUS: Score = S!(  11,   22);
pub const PAWN_ISLAND_PENALTY: Score = S!(  -6,  -12);
pub const PAWN_ISOLATION_PENALTY: Score = S!( -10,  -10);
pub const ROOK_OPEN_FILE_BONUS: Score = S!(  25,   26);
pub const ROOK_SEMI_FILE_BONUS: Score = S!(  15,   16);
pub const CONNECTED_PASSED_PAWN: Score = S!(  11,    5);
pub const KING_ON_SEMI_OPEN_FILE: Score = S!(   3,    2);
pub const KING_ON_OPEN_FILE: Score = S!( -54,   -3);
 
//PSTs
pub const P: [Score; 64] = [
    S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), 
    S!( -21,   13), S!( -14,   11), S!(  -6,    6), S!( -22,    2), S!(  -1,   13), S!(  19,    3), S!(  26,    3), S!(  -7,   -6), 
    S!( -20,    3), S!( -19,    0), S!( -12,   -7), S!( -15,   10), S!(   1,   -2), S!(   0,    2), S!(  13,   -7), S!(   5,  -11), 
    S!( -17,   17), S!( -14,    9), S!(  -4,   -2), S!(  14,  -10), S!(  12,  -10), S!(  15,   -7), S!(   8,   -4), S!(   2,   -3), 
    S!(   1,   40), S!(  10,   21), S!(  14,   13), S!(  16,    2), S!(  40,   -6), S!(  31,    7), S!(  26,   15), S!(  20,   19), 
    S!(  26,  109), S!(  14,  119), S!(  58,   81), S!(  63,   64), S!(  61,   54), S!(  60,   61), S!(  80,   85), S!(  57,   81), 
    S!( 162,  157), S!( 151,  154), S!( 141,  144), S!( 130,  128), S!( 116,  125), S!( 102,  106), S!(   4,  168), S!( 109,  133), 
    S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(   0,    0)
];
pub const N: [Score; 64] = [
    S!( -90,  -52), S!( -53,  -54), S!( -53,  -17), S!( -43,  -20), S!( -39,  -17), S!( -34,  -29), S!( -47,  -31), S!( -50,  -50), 
    S!( -57,  -30), S!( -46,  -11), S!( -24,  -13), S!( -21,   -5), S!( -20,   -5), S!(  -4,   -4), S!( -28,  -35), S!( -29,  -29), 
    S!( -40,  -29), S!( -25,    1), S!( -14,    1), S!(   6,    5), S!(   9,   17), S!(  -9,   -3), S!(  -4,   -4), S!( -30,  -24), 
    S!( -27,   -8), S!(   1,    0), S!(  11,   26), S!(   9,   23), S!(  19,   29), S!(  14,   16), S!(  19,   10), S!( -10,  -13), 
    S!(  -7,   -7), S!(  -3,    9), S!(  24,   24), S!(  24,   24), S!(  27,   27), S!(  54,   30), S!(  17,   18), S!(  15,   -2), 
    S!( -15,  -16), S!(  16,    2), S!(  60,    7), S!(  62,   14), S!(  51,   27), S!(  44,   20), S!(  29,    5), S!(  -9,  -18), 
    S!( -35,  -31), S!(  -2,  -10), S!(  32,  -14), S!(  22,   -2), S!(  20,   -4), S!(  57,    4), S!(   0,  -23), S!(  24,  -35), 
    S!( -50,  -50), S!( -40,  -40), S!( -29,  -30), S!( -22,  -24), S!( -10,  -15), S!( -46,  -47), S!( -42,  -43), S!( -50,  -50)
];
pub const B: [Score; 64] = [
    S!( -20,  -25), S!(   5,   -1), S!( -19,  -15), S!( -14,  -10), S!( -13,  -13), S!( -13,  -13), S!(  17,  -31), S!( -13,  -24), 
    S!(   4,  -33), S!(  -4,  -14), S!(  16,  -11), S!( -12,   -1), S!(   0,    1), S!(   4,   -9), S!(   8,   -8), S!( -13,  -12), 
    S!(  -3,   -9), S!(   5,    2), S!(   0,    4), S!(   8,   -4), S!(   5,   11), S!(   1,    5), S!(   0,   -2), S!(   3,   -9), 
    S!( -14,  -11), S!(   5,    4), S!(   3,    3), S!(  26,   10), S!(  19,   17), S!(   3,    4), S!(   4,    4), S!(  -3,  -20), 
    S!(  -9,   -9), S!(   5,    5), S!(   9,    9), S!(  40,   24), S!(  27,   19), S!(  35,    8), S!(   6,    6), S!(  -4,   -3), 
    S!(  -6,    2), S!(  12,    5), S!(  27,    4), S!(  45,   -8), S!(  25,    8), S!(  32,    9), S!(  31,    8), S!(  23,   -1), 
    S!(  -7,  -11), S!(  23,    0), S!(   9,  -12), S!(   2,    1), S!(  27,   -8), S!(  -1,    0), S!(  -1,    0), S!( -17,  -16), 
    S!( -14,  -15), S!( -10,  -10), S!(  -7,  -11), S!( -10,  -10), S!( -24,  -16), S!( -76,   -3), S!(  -8,   -8), S!( -20,  -20)
];
pub const R: [Score; 64] = [
    S!( -13,  -14), S!( -15,   -3), S!( -14,   -4), S!(  -9,   -7), S!(  -5,  -11), S!( -16,   -6), S!(  -6,   -6), S!( -20,  -21), 
    S!( -39,   -2), S!( -20,   -9), S!(   1,    0), S!( -19,   -6), S!( -19,   -6), S!( -14,   -9), S!(  -5,  -10), S!( -30,  -11), 
    S!( -17,   -5), S!( -23,    0), S!( -26,    0), S!( -18,   -4), S!( -22,    2), S!( -18,  -12), S!(   8,   -3), S!(  -4,  -18), 
    S!( -39,    6), S!( -24,    0), S!( -18,   12), S!( -10,    3), S!(  -4,   -4), S!(   1,    0), S!(   6,    2), S!(  -4,   -2), 
    S!(  -4,   -5), S!(  22,   -2), S!( -10,   13), S!(   7,    4), S!(  -6,   -5), S!(  -1,    0), S!(  12,    1), S!(  14,  -10), 
    S!(   1,   -1), S!(   5,   11), S!(  10,    6), S!(  13,    8), S!(  15,    6), S!(  -1,    0), S!(  -1,    0), S!(  21,   12), 
    S!(   8,   12), S!(  10,   10), S!(  10,   10), S!(  14,   15), S!(  12,    8), S!(  29,   16), S!(  13,   14), S!(   5,    5), 
    S!(  17,   16), S!(   0,    0), S!(   0,    0), S!(  15,   12), S!(   0,    0), S!(   0,    0), S!(   0,    0), S!(  28,   23)
];
pub const Q: [Score; 64] = [
    S!( -17,  -16), S!( -24,  -19), S!( -20,  -20), S!( -13,  -18), S!( -18,  -22), S!( -30,  -29), S!( -10,  -10), S!( -21,  -24), 
    S!( -19,  -22), S!( -14,  -14), S!(   1,    0), S!(   1,    0), S!(  -3,   -8), S!(  -6,  -18), S!( -16,  -14), S!(  -1,  -57), 
    S!( -12,  -12), S!(  -7,   -5), S!(  -8,    1), S!(  -8,    6), S!( -12,   15), S!(  -3,    1), S!(   5,   -3), S!(   2,    0), 
    S!( -14,  -13), S!( -10,   -1), S!(  -7,    4), S!(   5,    5), S!(   5,    5), S!(   5,   10), S!(  -1,    0), S!(  10,    8), 
    S!(  -5,   -5), S!(  -1,    1), S!(   6,    5), S!(   7,   24), S!(   5,    5), S!(  23,   23), S!(  -1,    0), S!(  23,   20), 
    S!(  -3,   -3), S!(  -5,   -3), S!(  11,   18), S!(  16,   15), S!(  39,   36), S!(  51,   49), S!(  52,   31), S!(   0,   -1), 
    S!(  -7,  -12), S!(  -6,   -8), S!(  -1,    0), S!(  -1,    0), S!(  24,   46), S!(  29,   26), S!(  21,   12), S!(  43,   24), 
    S!( -28,  -13), S!( -21,  -22), S!(   1,   -1), S!(   0,   -1), S!(   0,   -1), S!(   0,   -1), S!(   3,   -5), S!(   9,    4)
];
pub const K: [Score; 64] = [
    S!(  23,  -61), S!(  51,  -37), S!(  23,  -25), S!( -56,   -2), S!(  -3,  -27), S!( -23,  -24), S!(  35,  -37), S!(  32,  -69), 
    S!(  28,  -25), S!(  25,  -24), S!(   2,   -3), S!( -27,    6), S!( -19,    5), S!(  -8,   -9), S!(  31,  -17), S!(  25,  -35), 
    S!(   6,  -23), S!( -18,   -5), S!( -36,   12), S!( -48,   23), S!( -31,   21), S!( -35,   12), S!( -16,   -7), S!( -12,  -24), 
    S!( -16,  -21), S!( -22,    1), S!( -34,   30), S!( -39,   45), S!( -53,   47), S!( -42,   30), S!( -21,    2), S!( -12,  -18), 
    S!( -14,  -15), S!(  -6,   20), S!( -36,   39), S!( -38,   51), S!( -43,   53), S!( -27,   44), S!(  -8,   25), S!( -10,  -11), 
    S!( -17,   -6), S!( -27,    9), S!( -11,   37), S!( -20,   58), S!( -19,   62), S!(  -1,   56), S!(  20,   46), S!(   3,    3), 
    S!( -22,  -19), S!( -12,    7), S!( -23,    7), S!( -26,   25), S!( -25,   26), S!(  -8,   30), S!(  45,   33), S!(   6,    1), 
    S!( -31,  -51), S!( -17,  -22), S!( -33,  -24), S!( -40,  -12), S!( -27,   -1), S!( -12,   -7), S!(   0,   -1), S!( -28,  -52)
];