// 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 = "druidity";

/**
 *  List of modids that will be staged. Specific unstaged items can be specified in the stagedNamesBlacklist.
 */
static stagedMods as string[] = [
	"botania",
	"incorporeal",
	"naturesaura",
	"roots"
];

/**
 *  Staged items.
 */
static stagedItems as IIngredient[] = [
	<patchouli:guide_book>.withTag({"patchouli:book": "naturesaura:book"}),
	
	// specific additional roots stuff that didnt get staged above for some reason
	<roots:spell_modifier:*>,
	<roots:spell_icon:*>,
	<roots:spell_dust:*>,
	<roots:staff:*>,
	<roots:ritual_healing_aura>,
	<roots:ritual_heavy_storms>,
	<roots:ritual_divine_protection>,
	<roots:ritual_fire_storm>,
	<roots:ritual_spreading_forest>,
	<roots:ritual_windwall>,
	<roots:ritual_warding_protection>,
	<roots:ritual_germination>,
	<roots:ritual_purity>,
	<roots:ritual_frost_lands>,
	<roots:ritual_animal_harvest>,
	<roots:ritual_summon_creatures>,
	<roots:ritual_wildroot_growth>,
	<roots:ritual_overgrowth>,
	<roots:ritual_flower_growth>,
	<roots:ritual_transmutation>,
	<roots:ritual_gathering>,
	<roots:ritual_grove_supplication>,
	<roots:fey_fire>,
	
	// yoyos
	<yoyos:mana_cord:0>,
	<yoyos:manasteel_yoyo:*>,
	<yoyos:elementium_yoyo:*>,
	<yoyos:terrasteel_yoyo:*>,
	
	// xreliquary
	<xreliquary:witherless_rose:*>,
	
	// spartan stuff
	<spartanshields:shield_botania_elementium:*>,
	<spartanweaponryarcana:dagger_elementium:*>,
	<spartanweaponryarcana:longsword_elementium:*>,
	<spartanweaponryarcana:katana_elementium:*>,
	<spartanweaponryarcana:saber_elementium:*>,
	<spartanweaponryarcana:rapier_elementium:*>,
	<spartanweaponryarcana:greatsword_elementium:*>,
	<spartanweaponryarcana:hammer_elementium:*>,
	<spartanweaponryarcana:warhammer_elementium:*>,
	<spartanweaponryarcana:spear_elementium:*>,
	<spartanweaponryarcana:halberd_elementium:*>,
	<spartanweaponryarcana:pike_elementium:*>,
	<spartanweaponryarcana:lance_elementium:*>,
	<spartanweaponryarcana:longbow_elementium:*>,
	<spartanweaponryarcana:crossbow_elementium:*>,
	<spartanweaponryarcana:throwing_knife_elementium:*>,
	<spartanweaponryarcana:throwing_axe_elementium:*>,
	<spartanweaponryarcana:javelin_elementium:*>,
	<spartanweaponryarcana:boomerang_elementium:*>,
	<spartanweaponryarcana:battleaxe_elementium:*>,
	<spartanweaponryarcana:mace_elementium:*>,
	<spartanweaponryarcana:glaive_elementium:*>,
	<spartanweaponryarcana:staff_elementium:*>,
	<spartanweaponryarcana:parrying_dagger_elementium:*>,
	
	<spartanshields:shield_botania_manasteel:*>,
	<spartanweaponryarcana:dagger_manasteel:*>,
	<spartanweaponryarcana:longsword_manasteel:*>,
	<spartanweaponryarcana:katana_manasteel:*>,
	<spartanweaponryarcana:saber_manasteel:*>,
	<spartanweaponryarcana:rapier_manasteel:*>,
	<spartanweaponryarcana:greatsword_manasteel:*>,
	<spartanweaponryarcana:hammer_manasteel:*>,
	<spartanweaponryarcana:warhammer_manasteel:*>,
	<spartanweaponryarcana:spear_manasteel:*>,
	<spartanweaponryarcana:halberd_manasteel:*>,
	<spartanweaponryarcana:pike_manasteel:*>,
	<spartanweaponryarcana:lance_manasteel:*>,
	<spartanweaponryarcana:longbow_manasteel:*>,
	<spartanweaponryarcana:crossbow_manasteel:*>,
	<spartanweaponryarcana:throwing_knife_manasteel:*>,
	<spartanweaponryarcana:throwing_axe_manasteel:*>,
	<spartanweaponryarcana:javelin_manasteel:*>,
	<spartanweaponryarcana:boomerang_manasteel:*>,
	<spartanweaponryarcana:battleaxe_manasteel:*>,
	<spartanweaponryarcana:mace_manasteel:*>,
	<spartanweaponryarcana:glaive_manasteel:*>,
	<spartanweaponryarcana:staff_manasteel:*>,
	<spartanweaponryarcana:parrying_dagger_manasteel:*>,
	
	<spartanshields:shield_botania_terrasteel:*>,
	<spartanweaponryarcana:dagger_terrasteel:*>,
	<spartanweaponryarcana:longsword_terrasteel:*>,
	<spartanweaponryarcana:katana_terrasteel:*>,
	<spartanweaponryarcana:saber_terrasteel:*>,
	<spartanweaponryarcana:rapier_terrasteel:*>,
	<spartanweaponryarcana:greatsword_terrasteel:*>,
	<spartanweaponryarcana:hammer_terrasteel:*>,
	<spartanweaponryarcana:warhammer_terrasteel:*>,
	<spartanweaponryarcana:spear_terrasteel:*>,
	<spartanweaponryarcana:halberd_terrasteel:*>,
	<spartanweaponryarcana:pike_terrasteel:*>,
	<spartanweaponryarcana:lance_terrasteel:*>,
	<spartanweaponryarcana:longbow_terrasteel:*>,
	<spartanweaponryarcana:crossbow_terrasteel:*>,
	<spartanweaponryarcana:throwing_knife_terrasteel:*>,
	<spartanweaponryarcana:throwing_axe_terrasteel:*>,
	<spartanweaponryarcana:javelin_terrasteel:*>,
	<spartanweaponryarcana:boomerang_terrasteel:*>,
	<spartanweaponryarcana:battleaxe_terrasteel:*>,
	<spartanweaponryarcana:mace_terrasteel:*>,
	<spartanweaponryarcana:glaive_terrasteel:*>,
	<spartanweaponryarcana:staff_terrasteel:*>,
	<spartanweaponryarcana:parrying_dagger_terrasteel:*>,
	
	// wings
	<wings:angel_wings:*>,
	<wings:fairy_wings:*>,
	<wings:blue_butterfly_wings:*>,
	<wings:monarch_butterfly_wings:*>
];

/**
 *  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[] = [
	// MysticalWorld Mobs
	"mysticalworld:entity_sprout",
	"mysticalworld:entity_hell_sprout",
	
	// Grimoire of Gaia Mobs
	"grimoireofgaia:bee",
	"grimoireofgaia:dryad",
	"grimoireofgaia:satyress"
];

/**
 *  Enchantments that will only appear if the player has this stage.
 */
static stagedEnchants as IEnchantmentDefinition[] = [];

/**
 *  JEI categories that will be hidden until the player unlocks this stage.
 */
static stagedJeiCategories as string[] = [
	"roots.spell_imposing",
	"roots.spell_imbuing",
	"roots.ritual_visualise",
	"roots.pyre_light",
	"roots.soil",
	"roots.right_click_block",
	"roots.block_break",
	"roots.runic_shears_summon_entity",
	"roots.loot",
	"roots.runed_wood",
	"roots.transmutation",
	"roots.mortar_and_pestle",
	"roots.summon_creatures",
	"roots.runic_shears_entity",
	"roots.terra_moss",
	"roots.spell_costs",
	"roots.fey_crafting",
	"roots.ritual",
	"roots.chrysopoeia",
	"roots.ritual_crafting",
	"roots.runic_shears",
	"roots.bark_carving",
	"botania.orechid_ignem",
	"botania.orechid",
	"botania.manaPool",
	"botania.elvenTrade",
	"botania.petals",
	"botania.runicAltar",
	"botania.pureDaisy",
	"botania.brewery",
	"naturesaura.animal_spawner",
	"naturesaura.offering",
	"naturesaura.altar",
	"naturesaura.tree_ritual"
];

/**
 *  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[] = [];

/**
 *  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[] = [];

/**
 *  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;
}