forked from cacklingfiend/lignumis
		
	Any planet start: Move code to data final fixes
This commit is contained in:
		
							parent
							
								
									75cbfe2083
								
							
						
					
					
						commit
						14880dbdde
					
				
					 3 changed files with 79 additions and 82 deletions
				
			
		|  | @ -6,10 +6,88 @@ local target_planet = settings.startup["aps-planet"].value | |||
| 
 | ||||
| if target_planet == "none" or target_planet == "nauvis" then return end | ||||
| 
 | ||||
| Technology:new("tree-seeding"):setPrerequisites({ "wood-science-pack" }) | ||||
| 
 | ||||
| 
 | ||||
| -- Switch planet discovery technology to the new planet | ||||
| local planet_discovery = data.raw.technology["planet-discovery-" .. target_planet] or data.raw.technology["moon-discovery-" .. target_planet] | ||||
| Technology:new(planet_discovery) | ||||
|     :assign({ | ||||
|         enabled = true, | ||||
|         hidden = false | ||||
|         hidden = false, | ||||
|         unit = { | ||||
|             count = 100, | ||||
|             ingredients = { | ||||
|                 { "wood-science-pack",  1 }, | ||||
|                 { "steam-science-pack", 1 } | ||||
|             }, | ||||
|             time = 30 | ||||
|         } | ||||
|     }) | ||||
|     :setPrerequisites({ "provisional-rocketry" }) | ||||
| Technology:new("iron-processing"):replacePrerequisite("planet-discovery-nauvis", planet_discovery.name) | ||||
| Technology:new("copper-processing"):replacePrerequisite("planet-discovery-nauvis", planet_discovery.name) | ||||
| 
 | ||||
| 
 | ||||
| -- Vulcanus | ||||
| if target_planet == "vulcanus" then | ||||
|     Technology:new("automation"):addPrerequisite("iron-processing") | ||||
|     Technology:new("steel-processing"):addPrerequisite("iron-processing") | ||||
|     Technology:new("tungsten-carbide"):addPrerequisite("planet-discovery-vulcanus") | ||||
|     Technology:new("iron-processing").prototype.research_trigger.entity = "big-volcanic-rock" | ||||
|     Technology:new("copper-processing").prototype.research_trigger.entity = "big-volcanic-rock" | ||||
| 
 | ||||
|     data.raw.resource["tungsten-ore"].category = "basic-solid" | ||||
| 
 | ||||
|     if mods["bztitanium"] and mods["crushing-industry"] then | ||||
|         Technology:new("foundry"):addRecipe("crushed-titanium-ore") | ||||
|         data.raw.recipe["crushed-titanium-ore"].category = "basic-crushing" | ||||
|     end | ||||
| 
 | ||||
|     if mods["bzcarbon"] then | ||||
|         Technology:new("graphite-processing"):addPrerequisite("planet-discovery-vulcanus") | ||||
|         Technology:new("diamond-processing-2"):addPrerequisite("planet-discovery-vulcanus") | ||||
|     end | ||||
| 
 | ||||
|     if mods["bzsilicon"] then | ||||
|         Technology:new("silica-processing"):addPrerequisite("planet-discovery-vulcanus") | ||||
|     end | ||||
| 
 | ||||
|     if mods["bzzirconium"] then | ||||
|         Technology:new("zirconia-processing"):addPrerequisite("planet-discovery-vulcanus") | ||||
|     end | ||||
| end | ||||
| 
 | ||||
| 
 | ||||
| -- Fulgora | ||||
| if target_planet == "fulgora" then | ||||
|     data.raw.recipe["medium-electric-pole"].enabled = false | ||||
|     Technology:new("recycling") | ||||
|         :addPrerequisite("planet-discovery-fulgora") | ||||
|         :addRecipe("medium-electric-pole") | ||||
|     Technology:new("iron-processing").prototype.research_trigger.entity = "scrap" | ||||
|     Technology:new("copper-processing").prototype.research_trigger.entity = "scrap" | ||||
| 
 | ||||
|     if mods["fulgora-coralmium-agriculture"] then | ||||
|         Technology:new("coralmium-recycling") | ||||
|             :addPrerequisite("recycling") | ||||
|             :removeRecipe("agricultural-tower") | ||||
|     end | ||||
| end | ||||
| 
 | ||||
| 
 | ||||
| -- Gleba | ||||
| if target_planet == "gleba" then | ||||
|     Technology:new("landfill") | ||||
|         :setPrerequisites({ "burner-automation" }) | ||||
|         :assign({ | ||||
|             unit = { | ||||
|                 count = 50, | ||||
|                 ingredients = { { "wood-science-pack", 1 } }, | ||||
|                 time = 15 | ||||
|             } | ||||
|         }) | ||||
|         .prototype.research_trigger = nil | ||||
|     Technology:new("iron-processing").prototype.research_trigger.entity = "iron-stromatolite" | ||||
|     Technology:new("copper-processing").prototype.research_trigger.entity = "copper-stromatolite" | ||||
| end | ||||
|  |  | |||
|  | @ -1,80 +0,0 @@ | |||
| local Technology = require("__cf-lib__/data/Technology") | ||||
| 
 | ||||
| if not mods["any-planet-start"] then return end | ||||
| 
 | ||||
| local target_planet = settings.startup["aps-planet"].value | ||||
| 
 | ||||
| if target_planet == "none" or target_planet == "nauvis" then return end | ||||
| 
 | ||||
| Technology:new("tree-seeding"):setPrerequisites({ "wood-science-pack" }) | ||||
| 
 | ||||
| 
 | ||||
| -- Switch planet discovery technology to the new planet | ||||
| local planet_discovery = data.raw.technology["planet-discovery-" .. target_planet] or data.raw.technology["moon-discovery-" .. target_planet] | ||||
| Technology:new(planet_discovery) | ||||
|     :assign({ | ||||
|         enabled = true, | ||||
|         hidden = false, | ||||
|         unit = { | ||||
|             count = 100, | ||||
|             ingredients = { | ||||
|                 { "wood-science-pack",  1 }, | ||||
|                 { "steam-science-pack", 1 } | ||||
|             }, | ||||
|             time = 30 | ||||
|         } | ||||
|     }) | ||||
|     :setPrerequisites({ "provisional-rocketry" }) | ||||
| Technology:new("iron-processing"):replacePrerequisite("planet-discovery-nauvis", planet_discovery.name) | ||||
| Technology:new("copper-processing"):replacePrerequisite("planet-discovery-nauvis", planet_discovery.name) | ||||
| 
 | ||||
| 
 | ||||
| -- Vulcanus | ||||
| if target_planet == "vulcanus" then | ||||
|     Technology:new("automation"):addPrerequisite("iron-processing") | ||||
|     Technology:new("steel-processing"):addPrerequisite("iron-processing") | ||||
|     Technology:new("tungsten-carbide"):addPrerequisite("planet-discovery-vulcanus") | ||||
|     Technology:new("iron-processing").prototype.research_trigger.entity = "big-volcanic-rock" | ||||
|     Technology:new("copper-processing").prototype.research_trigger.entity = "big-volcanic-rock" | ||||
| 
 | ||||
|     data.raw.resource["tungsten-ore"].category = "basic-solid" | ||||
| 
 | ||||
|     if mods["bztitanium"] and mods["crushing-industry"] then | ||||
|         Technology:new("foundry"):addRecipe("crushed-titanium-ore") | ||||
|         data.raw.recipe["crushed-titanium-ore"].category = "basic-crushing" | ||||
|     end | ||||
| end | ||||
| 
 | ||||
| 
 | ||||
| -- Fulgora | ||||
| if target_planet == "fulgora" then | ||||
|     data.raw.recipe["medium-electric-pole"].enabled = false | ||||
|     Technology:new("recycling") | ||||
|         :addPrerequisite("planet-discovery-fulgora") | ||||
|         :addRecipe("medium-electric-pole") | ||||
|     Technology:new("iron-processing").prototype.research_trigger.entity = "scrap" | ||||
|     Technology:new("copper-processing").prototype.research_trigger.entity = "scrap" | ||||
| 
 | ||||
|     if mods["fulgora-coralmium-agriculture"] then | ||||
|         Technology:new("coralmium-recycling") | ||||
|             :addPrerequisite("recycling") | ||||
|             :removeRecipe("agricultural-tower") | ||||
|     end | ||||
| end | ||||
| 
 | ||||
| 
 | ||||
| -- Gleba | ||||
| if target_planet == "gleba" then | ||||
|     Technology:new("landfill") | ||||
|         :setPrerequisites({ "burner-automation" }) | ||||
|         :assign({ | ||||
|             unit = { | ||||
|                 count = 50, | ||||
|                 ingredients = { { "wood-science-pack", 1 } }, | ||||
|                 time = 15 | ||||
|             } | ||||
|         }) | ||||
|         .prototype.research_trigger = nil | ||||
|     Technology:new("iron-processing").prototype.research_trigger.entity = "iron-stromatolite" | ||||
|     Technology:new("copper-processing").prototype.research_trigger.entity = "copper-stromatolite" | ||||
| end | ||||
|  | @ -1,4 +1,3 @@ | |||
| require("aai-industry") | ||||
| require("gleba-reborn") | ||||
| require("any-planet-start") | ||||
| require("crushing-industry-updates") | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Simon Brodtmann
						Simon Brodtmann