

-- groupId: autobuilder group ; list_autobuilders: autobuilders that will have those recipse ; ...: list of CRecipe
function CreateRecipesGroup( groupId, list_autobuilders, ... )
	local obj = Create("CRecipesGroup");
	obj.LuaInit(groupId, list_autobuilders, { ... } );
	return obj;
end

-- idOut: crafted item id ; nbOut: nb of crafted items ; idInt1: first component item ; (...); isUpgrade: is the first component an item to be upgraded (removed)?
function CreateRecipe(idOut, nbOut, idInt1, nbIn1, idIn2, nbIn2, idIn3, nbIn3, isUpgrade)
	local recipe = Create("CRecipe");
	recipe.InitLua(idOut, nbOut, idInt1, nbIn1, idIn2, nbIn2, idIn3, nbIn3, isUpgrade)
	return recipe;
end


recipesMK1 = CreateRecipesGroup( "MK I", { "autoBuilderMK1", "autoBuilderMK2", "autoBuilderMK3", "autoBuilderMK4", "autoBuilderMK5", "autoBuilderUltimate" }
	, CreateRecipe( "potionHp", 1, "bloodyFlesh1", 1 )

	, CreateRecipe( "gunRifle", 1, "bloodyFlesh1", 3 )
	, CreateRecipe( "gunShotgun", 1, "bloodyFlesh1", 5 )
	
	, CreateRecipe( "platform", 12, "bloodyFlesh1", 1 )
	, CreateRecipe( "wallWood", 8, "bloodyFlesh1", 1 )
	
	, CreateRecipe( "turret360", 1, "bloodyFlesh1", 2 )
	
	, CreateRecipe( "autoBuilderMK1", 1, "bloodyFlesh1", 15 ) 
	, CreateRecipe( "autoBuilderMK2", 1, "autoBuilderMK1", 1, "bloodyFlesh1", 15, nil, 0, true )
)

recipesMK2 = CreateRecipesGroup( "MK II", { "autoBuilderMK2", "autoBuilderMK3", "autoBuilderMK4", "autoBuilderMK5", "autoBuilderUltimate"}

	, CreateRecipe( "miniaturizorMK2", 1, "miniaturizorMK1", 1, "bloodyFlesh1", 2, nil, 0, true )
	, CreateRecipe( "potionHpRegen", 1, "bloodyFlesh1", 2 )
	, CreateRecipe( "potionHpRegen", 1, "potionPheromones", 2 )	
	, CreateRecipe( "armorMk1", 1, "bloodyFlesh1", 10 )
	, CreateRecipe( "flashLight", 1, "bloodyFlesh1", 4 )
	, CreateRecipe( "minimapper", 1, "bloodyFlesh1", 4 )

	, CreateRecipe( "gunMachineGun", 1, "bloodyFlesh1", 10 )
	
	, CreateRecipe( "wallConcrete", 8, "bloodyFlesh1", 1 )
	, CreateRecipe( "wallIronSupport", 8, "bloodyFlesh1", 1 )
	, CreateRecipe( "backwall", 16, "bloodyFlesh1", 1 )

	, CreateRecipe( "turretGatling", 1, "bloodyFlesh1", 6 )
	, CreateRecipe( "turretReparator", 1, "bloodyFlesh1", 20 )

	, CreateRecipe( "light", 3, "bloodyFlesh1", 1 ) 
	, CreateRecipe( "autoBuilderMK3", 1, "autoBuilderMK2", 1, "bloodyFlesh1", 30, nil, 0, true ) -- OK 
);

-- MK3: monsters 2 & 3, rock layer, chasm, mountain (objective: close islands & ocean surface)
recipesMK3 = CreateRecipesGroup( "MK III", { "autoBuilderMK3", "autoBuilderMK4", "autoBuilderMK5", "autoBuilderUltimate"}

	, CreateRecipe( "miniaturizorMK3", 1, "miniaturizorMK2", 1, "bloodyFlesh2", 2, nil, 0, true )
	, CreateRecipe( "potionHpBig", 1, "bloodyFlesh2", 2  )
	, CreateRecipe( "potionCritics", 1, "bloodyFlesh2", 2 )
	, CreateRecipe( "armorMk2", 1, "armorMk1", 1, "bloodyFlesh2", 10, nil, 0, true )
	, CreateRecipe( "effeilGlasses", 1, "bloodyFlesh2", 4 )
	, CreateRecipe( "waterDetector", 1, "bloodyFlesh2", 4 )
	, CreateRecipe( "drone", 1, "bloodyFlesh2", 4 )

	, CreateRecipe( "gunLaser", 1, "bloodyFlesh2", 10 )
	, CreateRecipe( "gunSnipe", 1, "bloodyFlesh2", 10 )
	, CreateRecipe( "gunRocket", 1, "bloodyFlesh2", 10 ) 
	
	, CreateRecipe( "wallReinforced", 8, "bloodyFlesh2", 1 )
	, CreateRecipe( "wallDoor", 1, "bloodyFlesh2", 1)
	, CreateRecipe( "platformSteel", 12, "bloodyFlesh2", 1 )
	, CreateRecipe( "generatorWater", 1, "bloodyFlesh2", 2 ) 
	, CreateRecipe( "waterPump", 1, "bloodyFlesh2", 2 ) 
	
	, CreateRecipe( "turretHeavy", 1, "bloodyFlesh2", 6 )
	, CreateRecipe( "turretReparatorMK2", 1, "bloodyFlesh2", 6 )
	, CreateRecipe( "turretMine", 1, "bloodyFlesh2", 6 )
	, CreateRecipe( "turretSpikes", 1, "bloodyFlesh2", 6 )
	
	, CreateRecipe( "lightSticky", 4, "bloodyFlesh2", 1 )
	, CreateRecipe( "electricWire", 15, "bloodyFlesh2", 1 )
	, CreateRecipe( "generatorSun", 1, "bloodyFlesh2", 1 ) 
	, CreateRecipe( "lightSun", 1, "bloodyFlesh2", 1 )
	, CreateRecipe( "teleport", 1, "bloodyFlesh2", 4 )
	, CreateRecipe( "elecSwitch", 3, "bloodyFlesh2", 1 )
	, CreateRecipe( "autoBuilderMK4", 1, "autoBuilderMK3", 1, "bloodyFlesh2", 30, nil, 0, true )

--	, CreateRecipe( "coal", 1, "wood", 10 )
	, CreateRecipe( "bloodyFlesh1", 3, "bloodyFlesh2", 2 )
	, CreateRecipe( "bloodyFlesh2", 1, "bloodyFlesh1", 2 )
);

-- MK4: monsters 3 & 4, ocean, high islands, crystal layer (objective:skylands, black crystals)
recipesMK4 = CreateRecipesGroup( "MK IV", { "autoBuilderMK4", "autoBuilderMK5", "autoBuilderUltimate"}
	, CreateRecipe( "miniaturizorMK4", 1, "miniaturizorMK3", 1, "bloodyFlesh2", 2, nil, 0, true )
	, CreateRecipe( "flashLightMK2", 1, "flashLight", 1, "bloodyFlesh2", 4, nil, 0, true )
	, CreateRecipe( "potionHpMega", 1, "bloodyFlesh2", 2 )
	, CreateRecipe( "potionArmor", 1, "bloodyFlesh2", 2 )
	, CreateRecipe( "potionInvisibility", 1, "bloodyFlesh2", 2 )
	, CreateRecipe( "waterBreather", 1, "bloodyFlesh2", 4 )
	, CreateRecipe( "jetpack", 1, "bloodyFlesh2", 10 )
	, CreateRecipe( "armorMk3", 1, "armorMk2", 1, "bloodyFlesh2", 10, nil, 0, true )
	, CreateRecipe( "invisibilityDevice", 1, "bloodyFlesh2",4 )
	, CreateRecipe( "droneCombat", 1, "drone", 1, "bloodyFlesh2", 10, nil, 0, true )

	, CreateRecipe( "gunMegaSnipe", 1, "bloodyFlesh2", 10 )
	, CreateRecipe( "gunZF0", 1, "bloodyFlesh2", 10 )
	, CreateRecipe( "gunLaserGatling", 1, "bloodyFlesh2", 10 )
	, CreateRecipe( "gunStorm", 1, "bloodyFlesh2", 10 ) -- 
	, CreateRecipe( "gunGrenadeLaunch", 1, "bloodyFlesh2", 10 )
				
	, CreateRecipe( "wallComposite", 8, "bloodyFlesh2", 1 )
	, CreateRecipe( "wallCompositeDoor", 1, "bloodyFlesh2", 1)
	, CreateRecipe( "wallCompositeSupport", 12, "bloodyFlesh2", 1 )
	, CreateRecipe( "wallCompositeLight", 8, "bloodyFlesh2", 1 )

	, CreateRecipe( "turretCeiling", 1, "bloodyFlesh2", 6 )
	, CreateRecipe( "turretLaser", 1, "bloodyFlesh2", 6 )
	, CreateRecipe( "turretTesla", 1, "bloodyFlesh2", 6 )

	, CreateRecipe( "elecSwitchPush", 3, "bloodyFlesh2", 1 )
	, CreateRecipe( "elecSwitchRelay", 3, "bloodyFlesh2", 1 )
	, CreateRecipe( "elecCross", 3, "bloodyFlesh2", 1 )
	, CreateRecipe( "elecSignal", 3, "bloodyFlesh2", 1 )
	, CreateRecipe( "elecClock", 3,  "bloodyFlesh2", 1 )
	, CreateRecipe( "elecToggle", 3,  "bloodyFlesh2", 1 )
	, CreateRecipe( "elecDelay", 3,  "bloodyFlesh2", 1 )
	, CreateRecipe( "elecWaterSensor", 3,  "bloodyFlesh2", 1 )
	, CreateRecipe( "elecProximitySensor", 3, "bloodyFlesh2", 1 )	
	, CreateRecipe( "elecDistanceSensor", 3, "bloodyFlesh2", 1 )		
	, CreateRecipe( "elecAND", 3,    "bloodyFlesh2", 1 )
	, CreateRecipe( "elecOR", 3,     "bloodyFlesh2", 1 )
	, CreateRecipe( "elecXOR", 3,    "bloodyFlesh2", 1 )
	, CreateRecipe( "elecNOT", 3,    "bloodyFlesh2", 1 )
	, CreateRecipe( "elecLight", 3,  "bloodyFlesh2", 1 )
	, CreateRecipe( "elecAlarm", 3,  "bloodyFlesh2", 1 )
	, CreateRecipe( "autoBuilderMK5", 1, "autoBuilderMK4", 1, "bloodyFlesh2", 30, nil, 0, true )
	
);

-- MK5: monsters 5, moria, volcano, organic island
recipesMK5 = CreateRecipesGroup( "MK V", { "autoBuilderMK5", "autoBuilderUltimate"}
	, CreateRecipe( "miniaturizorMK5", 1, "miniaturizorMK4", 1, "bloodyFlesh3", 2, nil, 0, true ) 
	, CreateRecipe( "potionSpeed", 1, "bloodyFlesh3", 2 )
	, CreateRecipe( "defenseShield", 1, "bloodyFlesh3", 10 )
	, CreateRecipe( "droneWar", 1, "droneCombat", 1, "bloodyFlesh3", 10, nil, 0, true )

	, CreateRecipe( "gunParticlesShotgun", 1, "bloodyFlesh3", 10 )
	, CreateRecipe( "gunParticlesSniper", 1, "bloodyFlesh3", 10 )
	, CreateRecipe( "gunFlamethrower", 1, "bloodyFlesh3", 10 )

	, CreateRecipe( "turretFlame", 1, "bloodyFlesh3", 6 )
	, CreateRecipe( "turretParticles", 1, "bloodyFlesh3", 8 )
	, CreateRecipe( "explosive", 1, "bloodyFlesh3", 4 )

	, CreateRecipe( "reactor", 1, "bloodyFlesh3", 16 )

	, CreateRecipe( "rocketTop", 1, "bloodyFlesh3", 20 )
	, CreateRecipe( "rocketTank", 1, "bloodyFlesh3", 10 )
	, CreateRecipe( "rocketEngine", 1, "bloodyFlesh3", 20 )

	, CreateRecipe( "bloodyFlesh2", 3, "bloodyFlesh3", 2 )
	, CreateRecipe( "bloodyFlesh3", 1, "bloodyFlesh2", 2 )
);


list_recipesgroups = { recipesMK1, recipesMK2, recipesMK3, recipesMK4, recipesMK5, Solo.recipesUltimate }


-- /*
-- fernRed // peu de dispos (bien à cultiver), pas utilisé en end game
-- blackGrass // dur à trouver (bien à cultiver), utilisé une fois	
-- blackMushroom	 // dur à trouver (bien à cultiver), utilisé une fois
-- bushGranit // peu de dispo (bien à cultiver), utilisé qu'une fois
-- lavaPlant // difficile à trouver, jamais utilisé
-- 
-- flowerBlue // facile à trouver, utilisé
-- bush // facile à trouver, jamais utilisé
-- lavaFlower // difficile à trouver, peu utilsié
-- 
-- tree // moyen à trouver, jamais utilisé		
-- treePine // moyen à trouver, jamais utilisé
-- treeWater // moyen à trouver, jamais utilisé
-- treeGranit // moyen à trouver, jamais utilisé
-- 
-- waterCoral // facile à trouver, pas utilisé en end game			
-- waterLight // facile à trouver, utilisé
-- woodwater // facile à trouver, jamais utilisé
-- 
-- waterBush // facile à trouver, utilisé une fois
-- skyBush // facile à trouver, pas utilisé en end game
-- flowerWhite // facile à trouver, utilisé
-- 
--  * 
--  * 
-- woodGranit // moyen à trouver, utilisé
-- woodSky	// trop facile à trouver
-- treeSky	// trop facile à trouver			
-- wood // trop utilisé
-- 
-- */