// Priority is set to -50 to ensure that all integration is completed before stage initialization. CrT recipes should be registered prior
// to this point. The actual staging script will fire at priority -99.
#priority -50

import crafttweaker.item.IIngredient;
import crafttweaker.enchantments.IEnchantmentDefinition;

import scripts.gamestages.classes.gamestage.GameStage;

static stageName as string = "occultism";

/**
 *  List of modids that will be staged. Specific unstaged items can be specified in the stagedNamesBlacklist.
 */
static stagedMods as string[] = [
	"bewitchment",
	"bloodmagic",
	"bloodarsenal",
	"enderstorage",
	"animus"
];

/**
 *  Staged items.
 */
static stagedItems as IIngredient[] = [
	<patchouli:guide_book>.withTag({"patchouli:book": "bewitchment:book_of_shadows"}),
	<patchouli:guide_book>.withTag({"patchouli:book": "bewitchment:codex_infernalis"}),
	
	// xreliquary
	<xreliquary:emperor_chalice:*>,
	<xreliquary:ender_staff:*>,
	<xreliquary:wraith_node:*>,
	<xreliquary:magicbane:*>,
	<xreliquary:alkahestry_tome:*>,
	<xreliquary:infernal_chalice:*>,
	<xreliquary:infernal_claws:*>,
	<xreliquary:infernal_tear:*>,
	<xreliquary:twilight_cloak:*>,
	<xreliquary:mob_charm:*>,
	<xreliquary:mob_charm_fragment:*>,
	<xreliquary:mob_charm_belt:*>,
	
	// wings
	<wings:dragon_wings:*>,
	<wings:evil_wings:*>,
	<wings:bat_wings:*>,
	
	// ender io
	<enderio:block_painter:*>,
	<enderio:item_travel_staff:*>,
	<enderio:item_soul_vial:*>,
	<enderio:item_staff_of_levity:*>,
	<enderio:item_xp_transfer:*>,
	<enderio:block_enderman_skull:*>,
	<enderio:block_enchanter:2>,
	<enderio:block_farm_station:*>,
	<enderio:block_zombie_generator:*>,
	<enderio:block_franken_zombie_generator:*>,
	<enderio:block_ender_generator:*>,
	<enderio:block_killer_joe:*>,
	<enderio:block_attractor_obelisk:*>,
	<enderio:block_aversion_obelisk:*>,
	<enderio:block_inhibitor_obelisk:*>,
	<enderio:block_relocator_obelisk:*>,
	<enderio:block_weather_obelisk:*>,
	<enderio:block_experience_obelisk:*>,
	<enderio:block_powered_spawner:*>,
	<enderio:block_slice_and_splice:*>,
	<enderio:block_soul_binder:*>,
	<enderio:block_transceiver:*>,
	<enderio:block_vacuum_chest:*>,
	<enderio:block_xp_vacuum:*>,
	<enderio:block_travel_anchor:*>,
	<enderio:block_tele_pad:*>,
	<enderio:block_dialing_device:*>,
	<enderio:block_wireless_charger:*>,
	<enderio:block_normal_wireless_charger:*>,
	<enderio:block_enhanced_wireless_charger:*>,
	<enderio:block_wireless_charger_extension:*>,
	<enderio:item_conduit_facade:*>,
	<enderio:item_conduit_probe:*>,
	<enderio:item_yeta_wrench:*>,
	<enderio:block_dark_steel_anvil:*>,
	<enderio:block_vat:*>,
	<enderio:block_cap_bank:2>,
	<enderio:block_alloy_smelter:*>,
	<enderio:item_item_conduit:*>,
	<enderio:item_liquid_conduit:*>,
	<enderio:item_redstone_conduit:*>,
	<enderio:block_reservoir:*>,
	<enderio:block_omni_reservoir:*>,
	<enderio:block_tank:*>,
	<enderio:block_wired_charger:*>,
	<enderio:block_crafter:*>,
	<enderio:block_gauge:*>,
	<enderio:block_inventory_panel:*>,
	<enderio:block_inventory_panel_sensor:*>,
	<enderio:block_inventory_chest_tiny:*>,
	<enderio:block_inventory_chest_small:*>,
	<enderio:block_inventory_chest_medium:*>,
	<enderio:block_inventory_chest_big:*>,
	<enderio:block_inventory_chest_large:*>,
	<enderio:block_inventory_chest_huge:*>,
	<enderio:block_inventory_chest_enormous:*>,
	<enderio:block_inventory_chest_warehouse:*>,
	<enderio:block_inventory_chest_warehouse13:*>,
	<enderio:item_data_conduit:*>,
	<enderio:item_inventory_remote:*>
];

/**
 *  Names of recipes that will be staged. These only need to be set if there are different recipes for the same item in different stages.
 */
static stagedRecipeNames as string[] = [];

/**
 * Mobs that will only spawn around players with this stage unlocked.
 */
static stagedMobs as string[] = [
	// Bewitchment Monsters
	"bewitchment:black_dog",
	"bewitchment:demon",
	"bewitchment:demoness",
	"bewitchment:ghost",
	"bewitchment:feuerwurm",
	"bewitchment:shadow_person",
	"bewitchment:hellhound",
	"bewitchment:druden",
	"bewitchment:werewolf",
	"bewitchment:imp",
	"bewitchment:cleaver",
			
	// Bewitchment Animals
	"bewitchment:lizard",
	"bewitchment:owl",
	"bewitchment:raven",
	"bewitchment:snake",
	"bewitchment:toad"
];

/**
 *  Enchantments that will only appear if the player has this stage.
 */
static stagedEnchants as IEnchantmentDefinition[] = [
	<enchantment:bewitchment:magic_protection>
];

/**
 *  JEI categories that will be hidden until the player unlocks this stage.
 */
static stagedJeiCategories as string[] = [
	"EnderGenerator",
	"ZombieGenerator",
	"EIOWC",
	"Vat",
	"EIOTank",
	"SoulBinder",
	"SliceNSPlice",
	"Enchanter",
	"bloodmagic:armourDowngrade",
	"bloodmagic:salchemyTable",
	"bloodmagic:soulForge",
	"bloodmagic:alchemyArray",
	"bloodmagic:binding",
	"bloodmagic:altar",
	"bloodarsenal:sanguineInfusion",
	"tile.bewitchment.sigil_table.name",
	"jei.incense",
	"tile.bewitchment.frostfire.name",
	"tile.bewitchment.spinning_wheel.name",
	"tile.bewitchment.distillery.name",
	"tile.bewitchment.witches_oven.name",
	"jei.brew",
	"jei.cauldron",
	"jei.ritual",
	"infinityPowder",
	"xreliquary:alkahestryCrafting",
	"xreliquary:alkahestryCharging"
];

/**
 *  The partial names of any items that will be exluded during mod staging. This is useful to keep saplings or wood unstaged.
 */
static stagedNamesBlacklist as string[] = [
	// for bewitchment
	"amethyst",
	"silver",
	"coquina",
	"elder",
	"cypress",
	"juniper",
	"dragon"
];

/**
 *  The partial names of any items that will be excluded from any blacklist overlap. This is useful to ensure specific items are staged when there is overlap.
 */
static stagedNamesWhitelist as string[] = [
	// for bewitchment
	"poppet",
	"broom",
	"jelly",
	"tea",
	"resin",
	"altar",
	"key",
	"candelabra"
];

/**
 *  This function does not actually stage the items. It is used to create the GameStage object that will be used during the actual staging.
 */
function initStage() as GameStage {
    val stage = GameStage(stageName);

    stage.setStagedMods(stagedMods);
    stage.setStagedItems(stagedItems);
    stage.setStagedRecipeNames(stagedRecipeNames);
    stage.setStagedMobs(stagedMobs);
    stage.setStagedEnchants(stagedEnchants);
    stage.setStagedJeiCategories(stagedJeiCategories);

    stage.setNamesBlacklist(stagedNamesBlacklist);
    stage.setNamesWhitelist(stagedNamesWhitelist);

    return stage;
}