progress
|
@ -0,0 +1,48 @@
|
|||
function onTick(event)
|
||||
for radius = 0, 4 do
|
||||
if event.tick % 30 == radius then
|
||||
for _, surface in pairs(game.surfaces) do
|
||||
local filters = surface.find_entities_filtered {
|
||||
name = {"air-filter-machine-1", "air-filter-machine-2", "air-filter-machine-3"}
|
||||
}
|
||||
updateAirFilters(surface, filters, radius)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function updateAirFilters(surface, filters, radius)
|
||||
-- Carefull not to suck in more pollution than can process
|
||||
-- This would make air filters OP because they would capture cloud without the need to filter
|
||||
for _, filter in pairs(filters) do
|
||||
local chunk_pollution = surface.get_pollution(filter.position)
|
||||
if chunk_pollution > 0 then
|
||||
local to_insert = math.min(chunk_pollution, 4)
|
||||
local inserted_amount = filter.insert_fluid({name="pollution", amount=to_insert})
|
||||
surface.pollute(filter.position, -inserted_amount)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function iteratePerChunk(filters)
|
||||
-- TODO implement
|
||||
end
|
||||
|
||||
function movePollution(chunkFrom, chunkTo, amount)
|
||||
-- TODO should make machine consume power to move?
|
||||
end
|
||||
|
||||
function getPurificationRate(entity)
|
||||
-- TODO implement
|
||||
-- 0 if not able to run
|
||||
-- based on crafting speed and amount of power (if possible)
|
||||
-- based on recipe? Maybe not -> machine not stronger/weaker
|
||||
end
|
||||
|
||||
-- TODO
|
||||
-- Make multiple filters in same chunk absorb balanced amount of pollution (not iterative)
|
||||
-- Make more efficient
|
||||
--
|
||||
|
||||
script.on_event(defines.events.on_tick, onTick)
|
||||
|
Before Width: | Height: | Size: 386 KiB After Width: | Height: | Size: 386 KiB |
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 235 KiB |
Before Width: | Height: | Size: 236 KiB After Width: | Height: | Size: 236 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
|
@ -1,13 +1,14 @@
|
|||
{
|
||||
"name": "better-air-filtering",
|
||||
"version": "0.1.0",
|
||||
"title": "Better Air Filtering",
|
||||
"author": "Joey De Pauw",
|
||||
"contact": "joeydepauw@gmail.com",
|
||||
"homepage": "",
|
||||
"factorio_version": "0.17",
|
||||
"dependencies": [
|
||||
"base >= 0.17"
|
||||
],
|
||||
"description": "An extension to the air filtering mod by Schorty."
|
||||
"name": "better-air-filtering",
|
||||
"version": "0.1.0",
|
||||
"title": "Better Air Filtering",
|
||||
"author": "Joey De Pauw",
|
||||
"contact": "joeydepauw@gmail.com",
|
||||
"homepage": "",
|
||||
"factorio_version": "0.17",
|
||||
"dependencies": [
|
||||
"base >= 0.17",
|
||||
"!air-filtering"
|
||||
],
|
||||
"description": "An extension to the air filtering mod by Schorty."
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[entity-name]
|
||||
air-filter-machine=Air filter machine 1
|
||||
air-filter-machine-mk2=Air filter machine 2
|
||||
air-filter-machine-mk3=Air filter machine 3
|
||||
air-filter-machine-1=Air filter machine 1
|
||||
air-filter-machine-2=Air filter machine 2
|
||||
air-filter-machine-3=Air filter machine 3
|
||||
|
||||
[item-name]
|
||||
expendable-air-filter=Expendable air FIlter
|
||||
|
@ -20,12 +20,12 @@ air-filter-recycling=Recycle used air filter
|
|||
|
||||
[technology-name]
|
||||
air-filtering=Air filtering 1
|
||||
air-filtering-mk2=Air filtering 2
|
||||
air-filtering-mk3=Air filtering 3
|
||||
air-filtering-2=Air filtering 2
|
||||
air-filtering-3=Air filtering 3
|
||||
air-filter-recycling=Recycle used air filter
|
||||
|
||||
[technology-description]
|
||||
air-filtering=Enables the crafting of Air Filter Machines to improve air quality by reducing pollution
|
||||
air-filtering-mk2=Improved versions of the Air Filter Machines can filter the air better. Has increased power and air filter consumption.
|
||||
air-filtering-mk3=The fastest alternative for cleaning the air but at the cost of a high amount of power. It also uses air filters much more quickly.
|
||||
air-filtering-2=Improved versions of the Air Filter Machines can filter the air better. Has increased power and air filter consumption.
|
||||
air-filtering-3=The fastest alternative for cleaning the air but at the cost of a high amount of power. It also uses air filters much more quickly.
|
||||
air-filter-recycling=Used air filters can be reused after being recycled by using a bit of coal to refill them.
|
|
@ -1,11 +1,11 @@
|
|||
data:extend({
|
||||
{
|
||||
type = "assembling-machine",
|
||||
name = "air-filter-machine",
|
||||
icon = "__better-air-filtering__/graphics/icons/air-filter-machine.png",
|
||||
name = "air-filter-machine-1",
|
||||
icon = "__better-air-filtering__/graphics/icons/air-filter-machine-1.png",
|
||||
icon_size = 32,
|
||||
flags = { "placeable-neutral", "placeable-player", "player-creation" },
|
||||
minable = { hardness = 0.2, mining_time = 0.5, result = "air-filter-machine" },
|
||||
minable = { hardness = 0.2, mining_time = 0.5, result = "air-filter-machine-1" },
|
||||
fast_replaceable_group = "air-filter-machine",
|
||||
max_health = 150,
|
||||
corpse = "medium-remnants",
|
||||
|
@ -14,7 +14,7 @@ data:extend({
|
|||
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
|
||||
animation =
|
||||
{
|
||||
filename = "__better-air-filtering__/graphics/entity/air-filter-machine.png",
|
||||
filename = "__better-air-filtering__/graphics/entity/air-filter-machine-1.png",
|
||||
priority = "high",
|
||||
width = 99,
|
||||
height = 102,
|
||||
|
@ -52,7 +52,7 @@ data:extend({
|
|||
fuel_inventory_size = 1,
|
||||
burnt_inventory_size = 1,
|
||||
},
|
||||
energy_usage = "0.5MW",
|
||||
energy_usage = "100kW",
|
||||
fixed_recipe = "filter-air",
|
||||
ingredient_count = 1,
|
||||
module_slots = 0,
|
||||
|
@ -60,11 +60,11 @@ data:extend({
|
|||
},
|
||||
{
|
||||
type = "assembling-machine",
|
||||
name = "air-filter-machine-mk2",
|
||||
icon = "__better-air-filtering__/graphics/icons/air-filter-machine-mk2.png",
|
||||
name = "air-filter-machine-2",
|
||||
icon = "__better-air-filtering__/graphics/icons/air-filter-machine-2.png",
|
||||
icon_size = 32,
|
||||
flags = { "placeable-neutral", "placeable-player", "player-creation" },
|
||||
minable = { hardness = 0.2, mining_time = 0.5, result = "air-filter-machine" },
|
||||
minable = { hardness = 0.2, mining_time = 0.5, result = "air-filter-machine-2" },
|
||||
fast_replaceable_group = "air-filter-machine",
|
||||
max_health = 150,
|
||||
corpse = "medium-remnants",
|
||||
|
@ -73,7 +73,7 @@ data:extend({
|
|||
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
|
||||
animation =
|
||||
{
|
||||
filename = "__better-air-filtering__/graphics/entity/air-filter-machine-mk2.png",
|
||||
filename = "__better-air-filtering__/graphics/entity/air-filter-machine-2.png",
|
||||
priority = "high",
|
||||
width = 99,
|
||||
height = 102,
|
||||
|
@ -126,19 +126,20 @@ data:extend({
|
|||
{
|
||||
type = "electric",
|
||||
usage_priority = "secondary-input",
|
||||
drain="150kW",
|
||||
},
|
||||
energy_usage = "1MW",
|
||||
energy_usage = "150kW",
|
||||
ingredient_count = 1,
|
||||
module_slots = 0,
|
||||
allowed_effects=nill
|
||||
},
|
||||
{
|
||||
type = "assembling-machine",
|
||||
name = "air-filter-machine-mk3",
|
||||
icon = "__better-air-filtering__/graphics/icons/air-filter-machine-mk3.png",
|
||||
name = "air-filter-machine-3",
|
||||
icon = "__better-air-filtering__/graphics/icons/air-filter-machine-3.png",
|
||||
icon_size = 32,
|
||||
flags = { "placeable-neutral", "placeable-player", "player-creation" },
|
||||
minable = { hardness = 0.2, mining_time = 0.5, result = "air-filter-machine-mk3" },
|
||||
minable = { hardness = 0.2, mining_time = 0.5, result = "air-filter-machine-3" },
|
||||
fast_replaceable_group = "air-filter-machine",
|
||||
max_health = 150,
|
||||
corpse = "medium-remnants",
|
||||
|
@ -146,7 +147,7 @@ data:extend({
|
|||
selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } },
|
||||
animation =
|
||||
{
|
||||
filename = "__better-air-filtering__/graphics/entity/air-filter-machine-mk3.png",
|
||||
filename = "__better-air-filtering__/graphics/entity/air-filter-machine-3.png",
|
||||
priority = "high",
|
||||
width = 99,
|
||||
height = 102,
|
||||
|
@ -199,10 +200,15 @@ data:extend({
|
|||
{
|
||||
type = "electric",
|
||||
usage_priority = "secondary-input",
|
||||
drain="200kW",
|
||||
},
|
||||
energy_usage = "1MW",
|
||||
energy_usage = "200kW",
|
||||
ingredient_count = 1,
|
||||
module_slots = 0,
|
||||
allowed_effects=nill
|
||||
},
|
||||
{
|
||||
type = "highlight-box",
|
||||
name = "air-filter-highlight-chunk",
|
||||
}
|
||||
})
|
||||
|
|
|
@ -5,35 +5,35 @@ data:extend({
|
|||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "air-filter-machine",
|
||||
icon = "__better-air-filtering__/graphics/icons/air-filter-machine.png",
|
||||
name = "air-filter-machine-1",
|
||||
icon = "__better-air-filtering__/graphics/icons/air-filter-machine-1.png",
|
||||
icon_size = 32,
|
||||
flags = {},
|
||||
subgroup = "production-machine",
|
||||
order = "f[air-filter-machine]",
|
||||
place_result = "air-filter-machine",
|
||||
order = "f[air-filter-machine-1]",
|
||||
place_result = "air-filter-machine-1",
|
||||
stack_size = 10,
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "air-filter-machine-mk2",
|
||||
icon = "__better-air-filtering__/graphics/icons/air-filter-machine-mk2.png",
|
||||
name = "air-filter-machine-2",
|
||||
icon = "__better-air-filtering__/graphics/icons/air-filter-machine-2.png",
|
||||
icon_size = 32,
|
||||
flags = {},
|
||||
subgroup = "production-machine",
|
||||
order = "f[air-filter-machine]-g[air-filter-machine-mk2]",
|
||||
place_result = "air-filter-machine-mk2",
|
||||
order = "f[air-filter-machine-1]-g[air-filter-machine-2]",
|
||||
place_result = "air-filter-machine-2",
|
||||
stack_size = 10
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = "air-filter-machine-mk3",
|
||||
icon = "__better-air-filtering__/graphics/icons/air-filter-machine-mk3.png",
|
||||
name = "air-filter-machine-3",
|
||||
icon = "__better-air-filtering__/graphics/icons/air-filter-machine-3.png",
|
||||
icon_size = 32,
|
||||
flags = {},
|
||||
subgroup = "production-machine",
|
||||
order = "g[air-filter-machine-mk2]-h[air-filter-machine-mk3]",
|
||||
place_result = "air-filter-machine-mk3",
|
||||
order = "g[air-filter-machine-2]-h[air-filter-machine-3]",
|
||||
place_result = "air-filter-machine-3",
|
||||
stack_size = 10
|
||||
},
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ data:extend({
|
|||
stack_size = 10,
|
||||
fuel_category = "pollution-filter",
|
||||
burnt_result = nill,
|
||||
fuel_value = "120MW",
|
||||
fuel_value = "60MW",
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
|
@ -60,7 +60,7 @@ data:extend({
|
|||
stack_size = 50,
|
||||
fuel_category = "pollution-filter",
|
||||
burnt_result = "used-air-filter",
|
||||
fuel_value = "400MW",
|
||||
fuel_value = "120MW",
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
|
|
|
@ -9,7 +9,7 @@ data:extend({
|
|||
},
|
||||
{
|
||||
type = "recipe",
|
||||
name = "air-filter-machine",
|
||||
name = "air-filter-machine-1",
|
||||
energy_required = 10.0,
|
||||
enabled = "false",
|
||||
ingredients =
|
||||
|
@ -18,31 +18,31 @@ data:extend({
|
|||
{ "electronic-circuit", 5 },
|
||||
{ "steel-plate", 10 }
|
||||
},
|
||||
result = "air-filter-machine"
|
||||
result = "air-filter-machine-1"
|
||||
},
|
||||
{
|
||||
type = "recipe",
|
||||
name = "air-filter-machine-mk2",
|
||||
name = "air-filter-machine-2",
|
||||
energy_required = 10.0,
|
||||
enabled = "false",
|
||||
ingredients =
|
||||
{
|
||||
{ "air-filter-machine", 2 },
|
||||
{ "air-filter-machine-1", 2 },
|
||||
{ "advanced-circuit", 10 }
|
||||
},
|
||||
result = "air-filter-machine-mk2"
|
||||
result = "air-filter-machine-2"
|
||||
},
|
||||
{
|
||||
type = "recipe",
|
||||
name = "air-filter-machine-mk3",
|
||||
name = "air-filter-machine-3",
|
||||
energy_required = 10.0,
|
||||
enabled = "false",
|
||||
ingredients =
|
||||
{
|
||||
{ "air-filter-machine-mk2", 2 },
|
||||
{ "air-filter-machine-2", 2 },
|
||||
{ "processing-unit", 10 }
|
||||
},
|
||||
result = "air-filter-machine-mk3"
|
||||
result = "air-filter-machine-3"
|
||||
},
|
||||
{
|
||||
type = "recipe",
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
data:extend({
|
||||
{
|
||||
type = "technology",
|
||||
name = "air-filtering",
|
||||
icon = "__better-air-filtering__/graphics/technology/air-filtering.png",
|
||||
name = "air-filtering-1",
|
||||
icon = "__better-air-filtering__/graphics/technology/air-filtering-1.png",
|
||||
icon_size = "64",
|
||||
prerequisites = {"plastics", "steel-processing", "advanced-electronics"},
|
||||
effects =
|
||||
{
|
||||
{
|
||||
type = "unlock-recipe",
|
||||
recipe = "air-filter-machine"
|
||||
recipe = "air-filter-machine-1"
|
||||
},
|
||||
{
|
||||
type = "unlock-recipe",
|
||||
|
@ -33,15 +33,15 @@ data:extend({
|
|||
},
|
||||
{
|
||||
type = "technology",
|
||||
name = "air-filtering-mk2",
|
||||
icon = "__better-air-filtering__/graphics/technology/air-filtering-mk2.png",
|
||||
name = "air-filtering-2",
|
||||
icon = "__better-air-filtering__/graphics/technology/air-filtering-2.png",
|
||||
icon_size = "64",
|
||||
prerequisites = {"air-filtering"},
|
||||
prerequisites = {"air-filtering-1"},
|
||||
effects =
|
||||
{
|
||||
{
|
||||
type = "unlock-recipe",
|
||||
recipe = "air-filter-machine-mk2"
|
||||
recipe = "air-filter-machine-2"
|
||||
}
|
||||
},
|
||||
unit =
|
||||
|
@ -58,15 +58,15 @@ data:extend({
|
|||
},
|
||||
{
|
||||
type = "technology",
|
||||
name = "air-filtering-mk3",
|
||||
icon = "__better-air-filtering__/graphics/technology/air-filtering-mk3.png",
|
||||
name = "air-filtering-3",
|
||||
icon = "__better-air-filtering__/graphics/technology/air-filtering-3.png",
|
||||
icon_size = "64",
|
||||
prerequisites = {"air-filtering-mk2"},
|
||||
prerequisites = {"air-filtering-2"},
|
||||
effects =
|
||||
{
|
||||
{
|
||||
type = "unlock-recipe",
|
||||
recipe = "air-filter-machine-mk3"
|
||||
recipe = "air-filter-machine-3"
|
||||
}
|
||||
},
|
||||
unit =
|
||||
|
@ -87,7 +87,7 @@ data:extend({
|
|||
name = "air-filter-recycling",
|
||||
icon = "__better-air-filtering__/graphics/technology/air-filter-recycling.png",
|
||||
icon_size = "64",
|
||||
prerequisites = {"air-filtering"},
|
||||
prerequisites = {"air-filtering-1"},
|
||||
effects =
|
||||
{
|
||||
{
|
||||
|
|