mirror of
				https://asciireactor.com/factorio/adamo-physics.git
				synced 2025-10-31 23:18:04 +00:00 
			
		
		
		
	init
This commit is contained in:
		
						commit
						ba7fc9dbe0
					
				
							
								
								
									
										67
									
								
								changelog.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								changelog.txt
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,67 @@ | ||||
| --------------------------------------------------------------------------------------------------- | ||||
| Version: 0.0.9 | ||||
| Date: 2020-02-22 | ||||
| 
 | ||||
|   Graphics: | ||||
|     - Changed glow color of chemical-fueled | ||||
|       entities to be more physical. | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------- | ||||
| Version: 0.0.8 | ||||
| Date: 2020-02-03 | ||||
| 
 | ||||
|   Changes: | ||||
|     - Moved mod to version 18. | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------- | ||||
| Version: 0.0.7 | ||||
| Date: 2019-10-02 | ||||
| 
 | ||||
|   Entities: | ||||
|     - Reset base_area to vanilla values | ||||
|       and doubled height on fluid boxes | ||||
|       to improve megareactor throughput. | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------- | ||||
| Version: 0.0.6 | ||||
| Date: 2019-09-28 | ||||
| 
 | ||||
|   Balancing: | ||||
|     - Drain reduced by factor of 24 on all  | ||||
|       electric-turret entities, e.g. laser- | ||||
|       turret. | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------- | ||||
| Version: 0.0.5 | ||||
| Date: 2019-09-15 | ||||
| 
 | ||||
|   Changes: | ||||
|     - Added support for fluid-powered furnaces. | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------- | ||||
| Version: 0.0.4 | ||||
| Date: 2019-08-31 | ||||
| 
 | ||||
|   Balancing: | ||||
|     - Increased solar panel power to 6kW and | ||||
|       decreased accumulator power to 30kW. | ||||
|       Panel:accumulator ratio now matches vanilla, | ||||
|       with vanilla energy capacity but 1/10 power. | ||||
|       Thanks for pointing that out, mmmPi. | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------- | ||||
| Version: 0.0.3 | ||||
| Date: 2019-08-29 | ||||
| 
 | ||||
|   Balancing: | ||||
|     - Increased slightly the efficiency of burner-powered | ||||
|       assembling-machine prototypes, to match furnaces. | ||||
|       (Removed the "mechanical cost", metaphorically.) | ||||
| 
 | ||||
| --------------------------------------------------------------------------------------------------- | ||||
| Version: 0.0.2 | ||||
| Date: 2019-08-26 | ||||
| 
 | ||||
|   Changes: | ||||
|     - Mod display name changed. | ||||
|     - Some refactoring and fortification of fluid fuel compatibility. | ||||
							
								
								
									
										245
									
								
								data-final-fixes.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										245
									
								
								data-final-fixes.lua
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,245 @@ | ||||
| require("factsheet") | ||||
| 
 | ||||
| -- Updates to rocket physics. | ||||
| data.raw.ammo["rocket"].ammo_type.action.action_delivery.starting_speed = 0.95 | ||||
| data.raw.ammo["explosive-rocket"].ammo_type.action.action_delivery.starting_speed = .95 | ||||
| data.raw.projectile["rocket"].acceleration=0.8 | ||||
| data.raw.projectile["explosive-rocket"].acceleration=0.8 | ||||
| if data.raw.gun["rocket-launcher"] then | ||||
|     data.raw.gun["rocket-launcher"].attack_parameters.range=38 | ||||
| end | ||||
| 
 | ||||
| -- Reduce electric-turret drain by factor of 24. | ||||
| for _,turret in pairs(data.raw["electric-turret"]) do | ||||
| 	if turret.energy_source | ||||
| 	and turret.energy_source.type | ||||
| 	and turret.energy_source.type == "electric" then | ||||
| 		turret.energy_source.drain =  | ||||
| 			energy_div( | ||||
| 				(turret.energy_source.drain or "24kW"), | ||||
| 				24 | ||||
| 			) | ||||
| 	end | ||||
| end | ||||
| 
 | ||||
| -- Pre rocket launcher | ||||
| if data.raw["ammo-turret"]["pre-rocket-turret"] then | ||||
| 		data.raw["ammo-turret"]["pre-rocket-turret"].attack_parameters.range=60 | ||||
| 		data.raw["ammo-turret"]["pre-rocket-turret"].attack_parameters.min_range=25 | ||||
| end | ||||
| 
 | ||||
| -- Aircraft mod launcher. | ||||
| if data.raw.gun["aircraft-rocket-launcher"] then | ||||
| 		data.raw.gun["aircraft-rocket-launcher"]. | ||||
| 			attack_parameters.range=60 | ||||
| end | ||||
| 
 | ||||
| -- Helicopter mod launcher | ||||
| if data.raw.gun["heli-rocket-launcher-item"] then | ||||
| 	data.raw.gun["heli-rocket-launcher-item"].attack_parameters.range=60 | ||||
| end | ||||
| 
 | ||||
| -- Predictabowl's vehicle rocket launcher | ||||
|  if data.raw.gun["vehicle-rocket-launcher"] then | ||||
|      data.raw.gun["vehicle-rocket-launcher"].attack_parameters.range=50 | ||||
|  end | ||||
|   | ||||
|  if data.raw.gun["vehicle-rocket-launcher-2"] then | ||||
|      data.raw.gun["vehicle-rocket-launcher-2"].attack_parameters.range=60 | ||||
|  end | ||||
| 
 | ||||
| for _,heatpipe in pairs(data.raw["heat-pipe"]) do | ||||
| 	heatpipe.heat_buffer.specific_heat = | ||||
| 		energy_div( | ||||
| 			heatpipe.heat_buffer.specific_heat, | ||||
| 			nuke_fuel_quotient | ||||
| 		) | ||||
| 	heatpipe.heat_buffer.max_transfer = | ||||
| 		energy_div( | ||||
| 			heatpipe.heat_buffer.max_transfer, | ||||
| 			gen_eff | ||||
| 		) | ||||
| end | ||||
| 
 | ||||
| local set_burner_colors = function(entity) | ||||
| 	local entity = entity_or_bust(entity) | ||||
| 	if not entity then return end | ||||
| 	local burner = table_or_bust(get_energy_source(entity)) | ||||
| 	if not burner then return end | ||||
| 	local color | ||||
| 	if burner.type == "fluid" and burner.burns_fluid then | ||||
| 		color = colors.gas_fire_glow | ||||
| 	elseif uses_fuel_type("chemical",entity) then | ||||
| 		color = colors.chemical_fire_glow | ||||
| 	elseif burner.type == "heat" then | ||||
| 		color = colors.chemical_fire_glow | ||||
| 	else return end | ||||
| 	local min_size = 0.05*get_collision_hypotenuse(entity) | ||||
| 	local glow_num = 0.3*get_collision_hypotenuse(entity) | ||||
| 	burner.light_flicker = { | ||||
| 		color = color, | ||||
| 		minimum_light_size = min_size, | ||||
| 		light_intensity_to_size_coefficient = glow_num | ||||
| 	} | ||||
| 	local viz = table_or_bust(entity.working_visualisations) | ||||
| 	if viz then | ||||
| 		for _,subtab in pairs(viz) do | ||||
| 			if type(subtab.light) == "table" then | ||||
| 				subtab.light.color = color | ||||
| 			end | ||||
| 		end | ||||
| 	end | ||||
| 	log("Made physical burner colors for " | ||||
| 		..entity.name | ||||
| 		.." (" | ||||
| 		..tostring(color.r) | ||||
| 		.." " | ||||
| 		..tostring(color.g) | ||||
| 		.." " | ||||
| 		..tostring(color.b) | ||||
| 		..")" | ||||
| 		) | ||||
| end | ||||
| 
 | ||||
| for _,boiler in pairs(data.raw.boiler) do | ||||
| 	boiler.target_temperature = chem_temp_max | ||||
| 	boiler.fluid_box.height = | ||||
| 		(boiler.fluid_box.height or 1)/gen_eff | ||||
| 	boiler.output_fluid_box.height = | ||||
| 		(boiler.output_fluid_box.height or 1)/gen_eff | ||||
| 	boiler.energy_consumption = energy_div( | ||||
| 		boiler.energy_consumption,gen_eff | ||||
| 	) | ||||
| 	if boiler.burner | ||||
| 	and type(boiler.burner) == "table" then | ||||
| 		boiler.burner.effectivity =  | ||||
| 			(boiler.burner.effectivity or 1) | ||||
| 			*boiler_eff | ||||
| 	end | ||||
| 	if boiler.energy_source | ||||
| 	and type(boiler.energy_source) == "table" then | ||||
| 		boiler.energy_source.effectivity = | ||||
| 			(boiler.energy_source.effectivity or 1) | ||||
| 			*boiler_eff | ||||
| 		if boiler.energy_source.type == "heat" then | ||||
| 			boiler.target_temperature =	nuke_temp_max | ||||
| 		elseif boiler.energy_source.type == "electric" then | ||||
| 			boiler.target_temperature = 100 | ||||
| 		else | ||||
| 			set_burner_colors(boiler) | ||||
| 		end | ||||
| 	end | ||||
| end | ||||
| 
 | ||||
| for _,generator in pairs(data.raw.generator) do | ||||
| 	generator.effectivity = | ||||
| 		(generator.effectivity or 1) | ||||
| 		*gen_eff | ||||
| 	if generator.fluid_box then | ||||
| 		generator.fluid_box.height =  | ||||
| 			(generator.fluid_box.height or 1)/gen_eff | ||||
| 	end | ||||
| 	if generator.name:find "steam" then | ||||
| 		if generator.name:find "turbine" then | ||||
| 			generator.maximum_temperature =	nuke_temp_max | ||||
| 		else | ||||
| 			generator.maximum_temperature =	chem_temp_max | ||||
| 		end | ||||
| 	end | ||||
| end | ||||
| 
 | ||||
| for _,item in pairs(data.raw.item) do | ||||
| 	if item.fuel_value then | ||||
| 		if item.fuel_category == "chemical" then | ||||
| 			item.fuel_value = energy_div( | ||||
| 				item.fuel_value,chem_fuel_quotient | ||||
| 			) | ||||
| 		elseif item.fuel_category == "nuclear" | ||||
| 		or item.fuel_category  | ||||
| 		== "adamo-nuclear-thermal-reaction" then | ||||
| 			item.fuel_value = energy_div( | ||||
| 				item.fuel_value,nuke_fuel_quotient | ||||
| 			) | ||||
| 		end | ||||
| 	end | ||||
| end | ||||
| 
 | ||||
| for _,fluid in pairs(data.raw.fluid) do | ||||
| 	if fluid.fuel_value then | ||||
| 		fluid.fuel_value = energy_div( | ||||
| 			fluid.fuel_value,chem_fuel_quotient | ||||
| 		) | ||||
| 	end | ||||
| end | ||||
| 
 | ||||
| for _,furnace in pairs(data.raw.furnace) do | ||||
| 	set_burner_colors(furnace) | ||||
| 	if furnace.energy_source | ||||
| 	and ( | ||||
| 		furnace.energy_source.type == "burner" | ||||
| 		or furnace.energy_source.type == "fluid" | ||||
| 	) then | ||||
| 		 | ||||
| 		furnace.energy_source.effectivity =  | ||||
| 			(furnace.energy_source.effectivity or 1) | ||||
| 			*furnace_eff | ||||
| 	elseif furnace.burner then | ||||
| 		furnace.burner.effectivity =  | ||||
| 			(furnace.burner.effectivity or 1) | ||||
| 			*furnace_eff | ||||
| 	end | ||||
| end | ||||
| 
 | ||||
| for _,machine in pairs(data.raw["assembling-machine"]) do | ||||
| 	if machine.energy_source.type == "burner" then | ||||
| 		set_burner_colors(machine) | ||||
| 		machine.energy_source.effectivity =  | ||||
| 			(machine.energy_source.effectivity or 1) | ||||
| 			*(furnace_eff) | ||||
| 	elseif machine.burner then | ||||
| 		set_burner_colors(machine) | ||||
| 		machine.burner.effectivity =  | ||||
| 			(machine.burner.effectivity or 1) | ||||
| 			*(furnace_eff) | ||||
| 	end | ||||
| end | ||||
| 
 | ||||
| -- nuclear fuel items must have their fuel_values  | ||||
| -- adjusted elsewhere to compenstate for this increase | ||||
| for _,reactor in pairs(data.raw.reactor) do  | ||||
| 	reactor.consumption	=  | ||||
| 		energy_mult(reactor.consumption,reactor_consump_mult) | ||||
| 	reactor.energy_source.effectivity = reactor_eff | ||||
| 	reactor.heat_buffer.max_transfer = energy_div( | ||||
| 		reactor.heat_buffer.max_transfer,gen_eff | ||||
| 		) | ||||
| end | ||||
| 
 | ||||
| for _,panel in pairs(data.raw["solar-panel"]) do | ||||
| 	panel.production =  | ||||
| 		energy_mult( | ||||
| 			panel.production, | ||||
| 			solar_panel_eff | ||||
| 		) | ||||
| end | ||||
| 
 | ||||
| for _,battery in pairs(data.raw["accumulator"]) do | ||||
| 	local energy_source = get_energy_source(battery) | ||||
| 	if energy_source then | ||||
| 		energy_source.input_flow_limit =  | ||||
| 			energy_mult( | ||||
| 				energy_source.input_flow_limit, | ||||
| 				solar_panel_eff | ||||
| 			) | ||||
| 		energy_source.output_flow_limit =  | ||||
| 			energy_mult( | ||||
| 				energy_source.output_flow_limit, | ||||
| 				solar_panel_eff | ||||
| 			) | ||||
| 	end	 | ||||
| end | ||||
| 
 | ||||
| -- This should only set colors on burner inserters. | ||||
| for _,inserter in pairs(data.raw["inserter"]) do | ||||
| 	set_burner_colors(inserter) | ||||
| end | ||||
							
								
								
									
										45
									
								
								data-updates.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								data-updates.lua
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,45 @@ | ||||
| require("factsheet") | ||||
| 
 | ||||
| local heu_fuel_recipe = data.raw.recipe["uranium-fuel-cell"] | ||||
| local heu_fuel_item = data.raw.item["uranium-fuel-cell"] | ||||
| local heu_fuel_reproc = data.raw.recipe["nuclear-fuel-reprocessing"] | ||||
| heu_fuel_recipe.ingredients = { | ||||
| 	{"uranium-235",1}, | ||||
| 	{"uranium-238",5}, | ||||
| 	{"iron-plate",3} | ||||
| } | ||||
| heu_fuel_recipe.result = "uranium-fuel-cell" | ||||
| heu_fuel_recipe.result_count = 3 | ||||
| heu_fuel_recipe.results = nil | ||||
| heu_fuel_reproc.results = {{"uranium-238",5}} | ||||
| heu_fuel_item.fuel_value = "100GJ" | ||||
| 
 | ||||
| 
 | ||||
| -- Increasing height of plumbing entities | ||||
| -- improves megareactor performance. | ||||
| 
 | ||||
| -- water pump | ||||
| data.raw["offshore-pump"]["offshore-pump"] | ||||
| .fluid_box.height =  | ||||
| 	(data.raw["offshore-pump"]["offshore-pump"] | ||||
| 	.fluid_box.height or 1)/gen_eff | ||||
| 
 | ||||
| -- powered pump | ||||
| data.raw.pump["pump"] | ||||
| .fluid_box.height = | ||||
| 	(data.raw.pump["pump"] | ||||
| 	.fluid_box.height or 1)/gen_eff | ||||
| data.raw.pump["pump"] | ||||
| .pumping_speed =  | ||||
| 	data.raw.pump["pump"].pumping_speed/gen_eff | ||||
| 
 | ||||
| -- iron pipes | ||||
| data.raw.pipe.pipe | ||||
| .fluid_box.height =  | ||||
| 	(data.raw.pipe.pipe | ||||
| 	.fluid_box.height or 1)/gen_eff | ||||
| data.raw["pipe-to-ground"]["pipe-to-ground"] | ||||
| .fluid_box.height = | ||||
| 	(data.raw["pipe-to-ground"]["pipe-to-ground"] | ||||
| 	.fluid_box.height or 1)/gen_eff | ||||
| 
 | ||||
							
								
								
									
										1
									
								
								factsheet.lua
									
									
									
									
									
										Symbolic link
									
								
							
							
						
						
									
										1
									
								
								factsheet.lua
									
									
									
									
									
										Symbolic link
									
								
							| @ -0,0 +1 @@ | ||||
| ../factsheet.lua | ||||
							
								
								
									
										11
									
								
								info.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								info.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,11 @@ | ||||
| { | ||||
|         "name": "adamo-physics", | ||||
|         "version": "1.0.0", | ||||
|         "title": "Physics", | ||||
|         "author": "adamo", | ||||
|         "dependencies": [ | ||||
|                 "base" | ||||
|         ], | ||||
|         "description": "All power is not created equal.", | ||||
|         "factorio_version": "0.18" | ||||
| } | ||||
							
								
								
									
										
											BIN
										
									
								
								thumbnail.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								thumbnail.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 35 KiB | 
		Loading…
	
		Reference in New Issue
	
	Block a user