//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 = {
    divine: {
        B: Fluid.of(EE("molten_coal"), 1000),
        C: F('#gems/coke'),
        D: PRE('klein_star_drei'), //(2048*8+8192)*4*4 = 393k
        E: Fluid.of(TC("molten_brass"), 1000),
        loops: 1,
        base: {
            helmet: Item.of(CA("material_armor_helmet")).ignoreNBT(),
            chestplate: Item.of(CA("material_armor_chestplate")).ignoreNBT(),
            leggings: Item.of(CA("material_armor_leggings")).ignoreNBT(),
            boots: Item.of(CA("material_armor_boots")).ignoreNBT(),
        },
    },
    bone: {
        B: Fluid.of(TC("molten_obsidian"), 1000),
		C: MC('bone'),
		D: AE2("charged_certus_quartz_crystal"),
		E: AE2('sky_dust'),
        F: PRE('klein_star_zwei'), //2048*8+8192)*4*4*4 = 1.57 mil
        G: Fluid.of(EE("molten_redstone"), 1000),
        loops: 16,
        base: {
            helmet: Item.of(IA("divine_helmet")).ignoreNBT(),
            chestplate: Item.of(IA("divine_chestplate")).ignoreNBT(),
            leggings: Item.of(IA("divine_leggings")).ignoreNBT(),
            boots: Item.of(IA("divine_boots")).ignoreNBT(),
        },
    },
    wither: {
        B: Fluid.of(EE("molten_cast_iron"), 1000),
        C: TC("necrotic_bone"),
        D: F("#ingots/red_alloy"),
        E: CR("electron_tube"),
        F: PRE('klein_star_drei'), ////393216*4*4 = 6.2 mil
        G: Fluid.of(EE("molten_redstone"), 1000),
        loops: 16,
        base: {
            helmet: Item.of(IA("bone_helmet")).ignoreNBT(),
            chestplate: Item.of(IA("bone_chestplate")).ignoreNBT(),
            leggings: Item.of(IA("bone_leggings")).ignoreNBT(),
            boots: Item.of(IA("bone_boots")).ignoreNBT(),
        },
    },
    prismarine: {
        B: MC('prismarine_shard'),
        C: AE2('singularity'),
        D: CC('monstrous_horn'),
        E: PRE('klein_star_omega'), //25 mil
        base: {
            helmet: Item.of(IA("wither_helmet")).ignoreNBT(),
            chestplate: Item.of(IA("wither_chestplate")).ignoreNBT(),
            leggings: Item.of(IA("wither_leggings")).ignoreNBT(),
            boots: Item.of(IA("wither_boots")).ignoreNBT(),
        },
    },
    steampunk: {
        B: CRAD('overcharged_alloy'),
        C: F('#cogwheels'),
        D: PRE('collector_mk1'),
        E: PRE('klein_star_omega'), //25 mil
        base: {
            helmet: Item.of(IA("prismarine_helmet")).ignoreNBT(),
            chestplate: Item.of(IA("prismarine_chestplate")).ignoreNBT(),
            leggings: Item.of(IA("prismarine_leggings")).ignoreNBT(),
            boots: Item.of(IA("prismarine_boots")).ignoreNBT(),
        },
    },
    robe: {
		A: KJ('computation_matrix'),
		B: KJ('missingno'),
		C: CM('star_infused_netherite_ingot'),
		D: KJ("64k_component_wafer"),
		F: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:energy_collector_mk1" }),
        G: PREXP('magnum_star_ein'), //100.64 mil
        base: {
            helmet: Item.of(IA("steampunk_helmet")).ignoreNBT(),
            chestplate: Item.of(IA("steampunk_chestplate")).ignoreNBT(),
            leggings: Item.of(IA("steampunk_leggings")).ignoreNBT(),
            boots: Item.of(IA("steampunk_boots")).ignoreNBT(),
        },
    },
    unstable: {
		A: KJ('1m_component_wafer'),
		B: IF("plastic"),
		C: EC("ender_star"),
        D: PREXP('magnum_star_zwei'), //400 mil
        fluid: IF("latex"),
        fluidAmount: 8000,
        base: {
            helmet: IA("robe_helmet"),
            chestplate: IA("robe_chestplate"),
            leggings: IA("robe_leggings"),
            boots: IA("robe_boots"),
        }
    },
    infused: {
        A: AV("endest_pearl"),
        B: F("ingots/pink_slime"),
        C: PRE("collector_mk2"),
        D: PREXP("magnum_star_drei"), //1.6 bil
        fluid: IF("pink_slime"),
        fluidAmount: 8000,
        base: {
            helmet: MU('unstable_helmet'),
            chestplate: MU('unstable_chestplate'),
            leggings: MU('unstable_leggings'),
            boots: MU('unstable_boots'),
        },
    },
    ignitium: {
        A: AV("endest_pearl"),
        B: CC("ignitium_block"),
        C: PRE("relay_mk2"),
        D: PREXP("magnum_star_drei"), //1.6 bil
        fluid: IF("ether_gas"),
        fluidAmount: 8000,
        base: {
            helmet: MU('infused_helmet'),
            chestplate: MU('infused_chestplate'),
            leggings: MU('infused_leggings'),
            boots: MU('infused_boots'),
        },
    },
    dm: {
		A: PRE('dark_matter_block'),
		B: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:dark_matter" }),
		C: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:energy_collector_mk2" }),
		D: KJ('4m_component_wafer'),
		F: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:the_final_opinium_core" }),
		G: PREXP('magnum_star_drei'), // 1.6 bil
        base: {
            helmet: CC("ignitium_helmet"),
            chestplate: CC("ignitium_elytra_chestplate"),
            leggings: CC("ignitium_leggings"),
            boots: CC("ignitium_boots"),
        },
    },
    rm: {
        A: SS("red_nether_star"),
		B: PRE('red_matter_block'),
        C: PREXP("dark_power_flower"),
        D: PREXP("magnum_star_drei"), //1.6 bil
        fluid: BT("oil"),
        fluidAmount: 8000,
        base: {
            helmet: PRE('dm_helmet'),
            chestplate: PRE('dm_chestplate'),
            leggings: PRE('dm_leggings'),
            boots: PRE('dm_boots'),
        },
    },
    gem: {
        A: M("ultimate_induction_cell"),
		B: PREXP("magnum_star_drei"), //1.6 bil
        C: M("ultimate_induction_provider"),
        D: KJ('4m_component_wafer'), 
        fluid: M("lithium"),
        fluidAmount: 8000,
        base: {
            helmet: PRE("rm_helmet"),
            chestplate: PRE("rm_chestplate"),
            leggings: PRE("rm_leggings"),
            boots: PRE("rm_boots"),
        },
    },
    meka: {
		A: M('ultimate_induction_cell'),
		B: M("reprocessed_fissile_fragment"),
		C: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:energy_collector_mk3" }),
		D: AV("neutronium_ingot"),
		F: M("pellet_antimatter"),
        G: PREXP('magnum_star_vier'), // 6.4 bil
        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'),
        },
    },
    hazmat: {
        A: F("#plates/lead"),
		B: F("#dyes/orange"),
		C: PREXP("magnum_star_drei"), // 1.6 bil
		D: PREXP("blue_matter"), //151 mil
		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'),
        },
    },
    space: {
        A: BT('compressed_steel'),
        B: M('hdpe_stick'),
        C: BT('oxygen_tank'),
        D: PREXP("cyan_matter"), //500 mil
        F: PREXP('magnum_star_vier'), //6.4 bil
        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: Item.of('extendedcrafting:singularity', { Id:"extendedcrafting:the_final_opinium_core" }),
        D: PREXP("green_matter"), // 1.71 bil
        F: PREXP('magnum_star_sphere'), // ~20 bil
        G: AV('neutronium_ingot'),
        base: {
            helmet: BT('oxygen_mask'),
            chestplate: BT('space_suit'),
            leggings: BT('space_pants'),
            boots: BT('space_boots'),
        },
    },
}

const armorObj = {
    advanced: function (mat, base) {
        return {
            A: mat.base[base],
            B: mat.B,
            C: mat.C,
            D: mat.D,
            E: mat.E,
        }
    },
    elite: function (mat, base) {
        return {
            A: mat.base[base],
            B: mat.B,
            C: mat.C,
            D: mat.D,
            E: mat.E,
            F: mat.F,
        }
    },
    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 armorTemplates = {
    advanced: {
        helmet: [
            ' BBB ',
            'BCCCB',
            'BCACB',
            'BCECB',
            'D   D',
        ],
        chestplate: [
            'DB BD',
            'BCCCB',
            'BCACB',
            'BCECB',
            ' BBB ',
        ],
        leggings: [
            'BBBBB',
            'BCCCB',
            'BCACB',
            'BCECB',
            'BD DB',
        ],
        boots: [
            '  A  ',
            'BBEBB',
            'BC CB',
            'DC CD',
        ],
    },
    elite: {
        helmet: [
            ' BBBBB ',
            'BECCCEB',
            'BBCACBB',
            'BDCCCDB',
            'BB B BB',
            'BB   BB',
            'BB   BB',
        ],
        chestplate: [
            'BBB BBB',
            'BECCCEB',
            'BBCACBB',
            'BDCCCDB',
            'BBBBBBB',
            'BBBBBBB',
            ' BBBBB ',
        ],
        leggings: [
            'BBBBBBB',
            'BECCCEB',
            'BBCACBB',
            'BDCCCDB',
            'BB   BB',
            'BB   BB',
            'BB   BB',
        ],
        boots: [
            '  CCC  ',
            '  CAC  ',
            'BDCCCDB',
            'BB   BB',
            'BB   BB',
            'EB   BE',
        ],
    },
    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',
        ]
    },
}