var listBonus = [];
var LANG = navigator.language.substr(0, 2).toLowerCase();
var SPEED_GAME = 1;
var lSpeedBonus = [];
var lShieldBonus = [];
var lAttackBonus = [];
const MYSELF = 'myself';
const MY_TEAM = 'myTeam';
const SHIELD_PER_SECOND = 5;
const COLOR_ATTACK = 0xff0000;
const COLOR_MOVE = 0x0000ff;
const COLOR_CONDITION = 0x0e0e0e;
const COLOR_RED = 0xff0000;
const COLOR_ORANGE = 0xff7f00;
const COLOR_GREEN = 0x008000;
const COLOR_RANGE = 0x008000;
const COLOR_SPEED_RELOAD = 0x7f00ff;
const NUMBER_LEVEL = 8;
const COLOR_SELECTED = 0xEFD807;

const COLOR_MYSELF = 0x6666ff;
const WIDTH_WINDOW = window.innerWidth - 20;
const HEIGHT_WINDOW = window.innerHeight - 20;
var OFFX_MAP = WIDTH_WINDOW / 20;
var OFFY_MAP;
var WIDTH_MAP;
var OFFY_TREE_BEGIN;
var CENTERX_TREE;
var HEIGHT_TITLE;
var HEIGHT_NODE;
var HEIGHT_BUTTON_TEXT;
var ORIENTATION_VERTICAL = true;
if (WIDTH_WINDOW < HEIGHT_WINDOW) {
    WIDTH_MAP = WIDTH_WINDOW * 0.65;
    OFFY_MAP = OFFX_MAP * 2;
    HEIGHT_BUTTON_TEXT = WIDTH_WINDOW / 15;
    if (WIDTH_MAP > HEIGHT_WINDOW * 0.4) {
        WIDTH_MAP = HEIGHT_WINDOW * 0.4;
        OFFX_MAP = OFFX_MAP * 3;
    }
    OFFY_TREE_BEGIN = WIDTH_MAP + OFFY_MAP * 2;
    CENTERX_TREE = WIDTH_WINDOW / 2;
    HEIGHT_TITLE = WIDTH_WINDOW / 5;
    HEIGHT_NODE = (HEIGHT_WINDOW - WIDTH_MAP) / 6;
} else {
    ORIENTATION_VERTICAL = false;
    WIDTH_MAP = HEIGHT_WINDOW * 0.8;
    HEIGHT_NODE = HEIGHT_WINDOW / 7;
    HEIGHT_BUTTON_TEXT = HEIGHT_WINDOW / 9;
    if (WIDTH_MAP > WIDTH_WINDOW * 0.5) {
        WIDTH_MAP = WIDTH_WINDOW * 0.4;
        HEIGHT_NODE = (WIDTH_WINDOW - (WIDTH_MAP + OFFX_MAP)) / 6;
        HEIGHT_BUTTON_TEXT = HEIGHT_WINDOW / 15;
    }
    OFFY_MAP = (HEIGHT_WINDOW - WIDTH_MAP) / 2;
    OFFY_TREE_BEGIN = OFFY_MAP + WIDTH_MAP / 8;
    CENTERX_TREE = (WIDTH_WINDOW - (WIDTH_MAP + OFFX_MAP + WIDTH_MAP / 4)) / 2 + (WIDTH_MAP + OFFX_MAP + WIDTH_MAP / 4);
    HEIGHT_TITLE = HEIGHT_WINDOW / 5;
}
const WIDTH_LINE = HEIGHT_NODE / 20;
const OFFX_TREE = HEIGHT_NODE;
const OFFY_TREE = HEIGHT_NODE * 1.1;
const WIDTH_BUTTON = WIDTH_MAP / 10;

const SCORE_HIT = 5;
const SCORE_KILL = 15;
const SCORE_BONUS = 4;

const HEIGHT_BAR = WIDTH_MAP / 20;

const LIFE = 100;
const SHIELD = 100;

const VALUE_MAX_BAR = 5;

const SPEED = WIDTH_MAP / 1000;
const SPEED_BASE = 1;
const SPEED_BEGIN = 3;

const RANGE = WIDTH_MAP / 16;
const RANGE_BASE = 3;
const RANGE_BEGIN = 2;

const SPEED_RELOAD = 4000;
const SPEED_RELOAD_BASE = 2;
const SPEED_RELOAD_BEGIN = 3;

const DAMAGE = 2;
const DAMAGE_BASE = 10;
const DAMAGE_BEGIN = 2;

const HEIGHT_BONUS = WIDTH_MAP / 10;
const HEIGHT_DAMAGE = WIDTH_MAP / 20;
const DURATION_DAMAGE = 700;