// POSITIONING FNS
// floors prevent subpixel rendering which looks trash

const CANVAS_WIDTH = () => Math.floor(window.innerHeight * 1.6);
const CANVAS_HEIGHT = () => Math.floor(window.innerHeight);

const headerWidth = () => CANVAS_WIDTH();
const headerHeight = () => Math.floor(CANVAS_HEIGHT() * 0.05);

const menuCrypListWidth = () => Math.floor(CANVAS_WIDTH() * 0.3);
const menuCrypListHeight = () => Math.floor(CANVAS_HEIGHT() - headerHeight());
const menuCrypListX = () => Math.floor(CANVAS_WIDTH() * 0.3);
const menuCrypListY = () => headerHeight();

const itemListWidth = () => Math.floor(CANVAS_WIDTH() * 0.5);
const itemListHeight = () => Math.floor(CANVAS_HEIGHT() * 0.95);
const itemListX = () => 0;
const itemListY = () => headerHeight();
const itemBlockWidth = () => Math.floor(itemListWidth() * 0.12);
const itemBlockHeight = () => Math.floor(itemListHeight() * 0.04);

const menuNavigationWidth = () => Math.floor(CANVAS_WIDTH() * 0.5);
const menuNavigationHeight = () => Math.floor(CANVAS_HEIGHT() * 0.3);
const menuNavigationX = () => Math.floor(CANVAS_WIDTH() * 0.5);
const menuNavigationY = () => Math.floor(CANVAS_HEIGHT() * 0.7);

const menuMainWidth = () => Math.floor(CANVAS_WIDTH() * 0.4);
const menuMainHeight = () => Math.floor(CANVAS_HEIGHT() * 0.5);
const menuMainX = () => Math.floor(CANVAS_WIDTH() * 0.65);
const menuMainY = () => headerHeight();

const homeMainWidth = () => Math.floor(CANVAS_WIDTH() * 0.6);
const homeMainHeight = () => Math.floor(CANVAS_HEIGHT() * 0.5);
const homeMainX = () => Math.floor(CANVAS_WIDTH() * 0.4);
const homeMainY = () => headerHeight();

const combatWidth = () => CANVAS_WIDTH();
const combatHeight = () => CANVAS_HEIGHT() - headerHeight();
const combatY = () => headerHeight();
const combatX = () => 0;
const combatCrypMargin = () => Math.floor((CANVAS_HEIGHT() - headerHeight()) / 4.5);
const combatTextMargin = () => Math.floor((CANVAS_HEIGHT() - headerHeight()) / 35);

const statsWidth = () => Math.floor(CANVAS_WIDTH() - menuCrypListWidth());
const statsHeight = () => CANVAS_HEIGHT() - headerHeight();
const statsY = () => headerHeight();
const statsX = () => menuCrypListWidth();
const statsKnownX = () => Math.floor(statsX() + statsWidth() / 4);
const statsLearnableX = () => Math.floor(statsX() + statsWidth() / 2);
const statsTextMargin = () => 24;
const statsLearnableMargin = () => 12;

const logWidth = () => Math.floor(combatWidth() * 0.5);
const logHeight = () => Math.floor(combatHeight() * 0.3);
const logY = () => Math.floor(headerHeight() + (combatHeight() * 0.7));
const logX = () => Math.floor(combatWidth() * 0.2);


module.exports = {
    TEXT: {
        NORMAL: { fontFamily: 'Jura', fontSize: 18, color: '#ffffff' },
        LEARNABLE: { fontFamily: 'Jura', fontSize: 18, color: '#ffffff' },
        HEADER: { fontFamily: 'Jura', fontSize: 24, color: '#ffffff', fontStyle: 'bold' },
        HOVER: { fontFamily: 'Jura', fontSize: 16, color: '#ffffff', backgroundColor: '#222222' },
    },

    POSITIONS: {
        HEADER: {
            width: headerWidth,
            height: headerHeight,
        },

        CRYP_LIST: {
            x: menuCrypListX,
            y: menuCrypListY,
            width: menuCrypListWidth,
            height: menuCrypListHeight,
        },

        MENU_MAIN: {
            x: menuMainX,
            y: menuMainY,
            width: menuMainWidth,
            height: menuMainHeight,

        },

        HOME_MAIN: {
            x: homeMainX,
            y: homeMainY,
            width: homeMainWidth,
            height: homeMainHeight,

        },


        NAVIGATION: {
            x: menuNavigationX,
            y: menuNavigationY,
            width: menuNavigationWidth,
            height: menuNavigationHeight,
        },

        ITEM_LIST: {
            x: itemListX,
            y: itemListY,
            width: itemListWidth,
            height: itemListHeight,
            itemWidth: itemBlockWidth,
            itemHeight: itemBlockHeight,

        },

        STATS: {
            x: statsX,
            y: statsY,
            width: statsWidth,
            height: statsHeight,
            knownX: statsKnownX,
            learnableX: statsLearnableX,
            textMargin: statsTextMargin,
            learnableMargin: statsLearnableMargin,
        },

        COMBAT: {
            x: combatX,
            y: combatY,
            width: combatWidth,
            height: combatHeight,
            crypMargin: combatCrypMargin,
            textMargin: combatTextMargin,


            LOG: {
                x: logX,
                y: logY,
                width: logWidth,
                height: logHeight,
            },
        },
    },

    COLOURS: {
        BLUE: 0x004bfe,
        CYAN: 0x27e7c0,
        PURPLE: 0x61008c,
        YELLOW: 0xfdfe02,
        ORANGE: 0xff9215,
        PINK: 0xe766b6,
        GRAY: 0x9d9ea0,
        LBLUE: 0x87c6f2,
        GREEN: 0x166c4f,
        BROWN: 0x583108,
        BLACK: 0x000000,
        RED: 0xff0000,
        WHITE: 0xffffff,

        SELECT: 0x003300,
    },

    DELAYS: {
        MOVE_CREEP: 500,
        DAMAGE_TICK: 500,
        ANIMATION_DURATION: 1000,
        // wall: [500],
        // spit: [300, 500],
        // gravBomb: [300, 500],
        // gravBlast: [300, 500],
        // chargeBall: [300, 500],
    },

    ITEMS: {
        SKILLS: {
            Amplify: {
                description: 'increase the magic damage dealt by a cryp',
                colours: '1 Green 1 Blue',
            },

            Attack: {
                description: 'a fast attack with red damage',
                upgrades: 'combine with 2 red / blue / green - red + blue attack not implemented',
            },

            Banish: {
                description: 'target cryp is prevented from casting any skills and taking any damage',
                colours: '1 Red 1 Green',

            },

            Blast: {
                description: 'blast the target with magic damage',
                colours: '2 Blue',
            },

            Block: {
                description: 'decreases incoming red damage for 1T',
                upgrades: 'combine with 2 red / blue / green',
            },

            Buff: {
                description: 'increase target cryp speed',
                upgrades: 'combine with 2 red / blue / green',
            },

            Clutch: {
                description: '??????',
                colours: '1 Red 1 Green',
            },

            Corrupt: {
                description: 'Inflicts a dot to attacker while active',
                colours: '2 Blue',
            },

            Curse: {
                description: 'target cryp takes increased magic damage',
                colours: '2 Blue',
            },

            Debuff: {
                description: 'reduce target cryp speed',
                upgrades: 'combine with 2 red / blue / green',
            },

            Decay: {
                description: 'afflict a cryp with a blue damage based damage over time debuff',
                colours: '1 Green 1 Blue',
            },

            Empower: {
                description: 'increase the red damage dealt by a cryp',
                colours: '2 Red',
            },

            Haste: {
                description: 'magical skill that increases speed of target cryp',
                colours: '1 Red 1 Blue',
            },

            Heal: {
                description: 'heal a cryp with blue damage',
                colours: '2 Green',
            },

            Hex: {
                description: 'magical bsed skill that prevents target cryp from using any skills',
                colours: '1 Red 1 Blue',
            },

            Hostility: {
                description: 'magical bsed skill that prevents target cryp from using any skills',
                colours: '2 Blue',
            },

            Invert: {
                description: 'reverse ???',
                colours: '1 Red 1 Blue',
            },

            Parry: {
                description: 'prevents all red damage for 1T',
                colours: '2 Red',
            },

            Purge: {
                description: 'remove magical buffs from target cryp',
                colours: '2 Green',
            },

            Purify: {
                description: 'remove magical debuffs from target cryp',
                colours: '1 Red 1 Green',
            },

            Recharge: {
                description: 'restore something',
                colours: '1 Red 1 Blue',
            },

            Reflect: {
                description: 'reflect damage back to attacker',
                colours: '2 Green',
            },

            Riposte: {
                description: '???',
            },

            Ruin: {
                description: 'Stun the entire enemy team',
                colours: '2 Blue',
            },

            Shield: {
                description: 'grants immunity to magical skills to target cryp',
                colours: '1 Green 1 Blue',
            },

            Silence: {
                description: 'prevent target cryp from casting magical skills',
                colours: '1 Green 1 Blue',
            },

            Siphon: {
                description: 'siphon hp from target cryp with a blue damage based debuff',
                colours: '1 Green 1 Blue',
            },

            Slay: {
                description: '????',
            },

            Slow: {
                description: 'magical skill that reduces speed of target cryp',
                colours: '1 Red 1 Green',
            },

            Snare: {
                description: 'prevents red skills from being used for 2T',
                colours: '2 Red',
            },

            Strangle: {
                description: 'Stun the enemy and inflict physical damage over 3T',
                colours: '2 Red',
            },

            Strike: {
                description: 'Fast attacking red skill',
                colours: '2 Red',
            },

            Stun: {
                description: 'red skill hat prevents target cryp from using any skills',
                upgrades: 'combine with 2 red / blue / green',

            },

            Taunt: {
                description: 'Enemy skills will prioritise cryps with this skill active',
                colours: '1 Red 1 Green',
            },

            Throw: {
                description: 'stuns and makes the target take increased red damage',
                colours: '2 Green',
            },

            Triage: {
                description: 'grants a blue damage based healing over time buff',
                colours: '2 Green',
            },
        },

        SPECS: {
            Damage: {
                description: 'Increase red / green / blue power stats cryp',
                upgrades: 'combine with 2 red / blue / green',

            },

            Hp: {
                description: 'Increases health of cryp',
                upgrades: 'combine with 2 red / blue / green',

            },

            Speed: {
                description: 'Increases speed of cryp',
                upgrades: 'combine with 2 red / blue / green',
            },
        },

        COLOURS: {
            Red: {
                description: 'Used to create offensive type combos - fast and chaotic',
            },

            Green: {
                description: 'Used to create defensive / healing type combos',
            },

            Blue: {
                description: 'Used to create offensive type combos - slow and reliable',
            },
        },
    },
};
