//priority: 3004

const armorPieces = {
    vanilla: ["helmet", "chestplate", "leggings", "boots"],
    hazmat: ["mask", "gown", "pants", "boots"],
    meka: ["helmet", "bodyarmor", "pants", "boots"],
    space: ["oxygen_mask", "space_suit", "space_pants", "space_boots"],
}

const armorMats = {
    dm: {
        A: PRE('dark_matter_block'),
        B: AE2('singularity'),
        base: {
            helmet: Item.of(MU('unstable_helmet')).ignoreNBT(),
            chestplate: Item.of(MU('unstable_chestplate')).ignoreNBT(),
            leggings: Item.of(MU('unstable_leggings')).ignoreNBT(),
            boots: Item.of(MU('unstable_boots')).ignoreNBT(),
        },
    },
    rm: {
        A: PRE('red_matter_block'),
        B: CR('shadow_steel'),
        base: {
            helmet: PRE('dm_helmet'),
            chestplate: PRE('dm_chestplate'),
            leggings: PRE('dm_leggings'),
            boots: PRE('dm_boots'),
        },
    },
    hazmat: {
        A: F("#plates/lead"),
		B: F("#dyes/orange"),
		C: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:klein_star_omega" }),
		D: PREXP("magenta_matter"),
		F: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:lead" }),
		G: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:lead" }),
        base: {
            helmet: MU('unstable_helmet'),
            chestplate: MU('unstable_chestplate'),
            leggings: MU('unstable_leggings'),
            boots: MU('unstable_boots'),
        },
    },
    meka: {
        A: M("hdpe_sheet"),
		B: M("ultimate_control_circuit"),
		C: M("basic_induction_cell"),
		D: PREXP("cyan_matter"),
		F: M("reprocessed_fissile_fragment"),
		G: M("reprocessed_fissile_fragment"),
        base: {
            helmet: MU('infused_helmet'),
            chestplate: MU('infused_chestplate'),
            leggings: MU('infused_leggings'),
            boots: MU('infused_boots'),
        },
    },
    space: {
        A: BT('compressed_steel'),
        B: M('hdpe_stick'),
        C: BT('oxygen_tank'),
        D: PREXP("violet_matter"),
        F: PREXP('magnum_star_ein'),
        G: BT('oxygen_gear'),
        base: {
            helmet: M('hazmat_mask'),
            chestplate: M('hazmat_gown'),
            leggings: M('hazmat_pants'),
            boots: M('hazmat_boots'),
        },
    },
    spaceNetherite: {
        A: MC('netherite_ingot'),
        B: BT('compressed_desh'),
        C: MU('the_final_opinium_core'),
        D: PREXP("blue_matter"),
        F: PREXP('magnum_star_zwei'),
        G: AV('neutronium_ingot'),
        base: {
            helmet: BT('oxygen_mask'),
            chestplate: BT('space_suit'),
            leggings: BT('space_pants'),
            boots: BT('space_boots'),
        },
    },
    gem: {
        A: PREXP("magenta_matter_block"),
        B: MU("experience_opinium_core"),
        C: KJ("computation_matrix"),
		D: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:klein_star_omega" }),
        E: MU("chorus_opinium_core"),
        G: F("#angelring"),
        base: {
            helmet: PRE("rm_helmet"),
            chestplate: PRE("rm_chestplate"),
            leggings: PRE("rm_leggings"),
            boots: PRE("rm_boots"),
        },
    },
    infused: {
        A: MU('nether_star_opinium_core'),
        B: MU('the_final_opinium_core'),
        C: PREXP('magnum_star_zwei'),
        D: PREXP("blue_matter"),
        F: Item.of('extendedcrafting:singularity', {Id:"extendedcrafting:blue_matter"}),
        G: MU('nether_star_opinium_core'),
        base: {
            helmet: PRE('gem_helmet'),
            chestplate: PRE('gem_chestplate'),
            leggings: PRE('gem_leggings'),
            boots: PRE('gem_boots'),
        },
    },
    infinity: {
        A: EC('the_ultimate_ingot'),
        B: AV('infinity_ingot'),
        C: AV('infinity_catalyst'),
        D: PREXP("fading_matter"),
        F: PREXP('colossal_star_omega'),
        G: EC("ultimate_singularity"),
        base: {
            helmet: M('mekasuit_helmet'),
            chestplate: M('mekasuit_bodyarmor'),
            leggings: M('mekasuit_pants'),
            boots: M('mekasuit_boots'),
        },
    },
}

const armorObj = {
    advanced: function (mat, base) {
        return {
            A: mat.A,
            B: mat.B,
            C: mat.base[base],
        }
    },
    elite: function (mat, base, addExtra) {
        const returnObj = {
            A: mat.A,
            B: mat.B,
            C: mat.C,
            D: mat.D,
            E: mat.E,
            F: mat.base[base],
        }
        addExtra ? returnObj.G = mat.G : null

        return returnObj
    },
    ultimate: function (mat, base) {
        return {
            A: mat.A,
            B: mat.B,
            C: mat.C,
            D: mat.D,
            E: mat.base[base],
            F: mat.F,
            G: mat.G,
        }
    }
}

const templates = {
    advanced: {
        helmet: [
            ' AAA ',
            'AAAAA',
            'AACAA',
            'A B A',
            'A   A',
        ],
        chestplate: [
            'AA AA',
            'AABAA',
            'AACAA',
            'AAAAA',
            ' AAA ',
        ],
        leggings: [
            'AAAAA',
            'AABAA',
            'AACAA',
            'AA AA',
            'AA AA',
        ],
        boots: [
            '  B  ',
            'AACAA',
            'AA AA',
            'AA AA',
        ],
    },
    elite: {
        helmet: [
            ' AAAAA ',
            'ABCCCBA',
            'AACDCAA',
            'AECFCEA',
            'AA A AA',
            'AA   AA',
            'AA   AA',
        ],
        chestplate: [
            'AAA AAA',
            'ABCCCBA',
            'AACDCAA',
            'AECFCEA',
            'AAAAAAA',
            'AAAAAAA',
            ' AAAAA ',
        ],
        leggings: [
            'AAAAAAA',
            'ABCCCBA',
            'AACDCAA',
            'AECFCEA',
            'AA   AA',
            'AA   AA',
            'AA   AA',
        ],
        boots: [
            ' BCCCB ',
            '  CDC  ',
            'AECFCEA',
            'AA G AA',
            'AA   AA',
            'AA   AA',
        ],
    },
    ultimate: {
        helmet: [
            ' AAAAAAA ',
            'AABBBBBAA',
            'AFBDDDBFA',
            'ABBDEDBBA',
            'ABCDDDCBA',
            'AB     BA',
            'AB     BA',
            'AB     BA',
            'ABG   GBA',
        ],
        chestplate: [
            'AAAA AAAA',
            'AABBBBBAA',
            'AFBDDDBFA',
            'ABBDEDBBA',
            'ABCDDDCBA',
            'ABBBGBBBA',
            'AAABBBAAA',
            'AAAAAAAAA',
            ' AAAAAAA ',
        ],
        leggings: [
            'AAAAAAAAA',
            'ABBBBBBBA',
            'ABADDDABA',
            'ABADEDABA',
            'ABCDDDCBA',
            'ABAF FABA',
            'ABA   ABA',
            'ABA   ABA',
            'AGA   AGA',
        ],
        boots: [
            '         ',
            '         ',
            '   DDD   ',
            '   DED   ',
            'AACDDDCAA',
            'ABBA ABBA',
            'ABBA ABBA',
            'ABBA ABBA',
            'FBBG GBBF',
        ]
    },
}