From debc17df30610b3cb03dc7c0f3e5e3d5bb13a19a Mon Sep 17 00:00:00 2001 From: Joey De Pauw Date: Fri, 11 Oct 2019 15:48:24 +0200 Subject: [PATCH] start v0.1.2: fixed tech name, tier 2 is furnace and accepts expendable filters still --- better-air-filtering/info.json | 2 +- .../locale/en/air-filtering.cfg | 4 +- better-air-filtering/migrations/0.1.2.lua | 6 + better-air-filtering/prototypes/entity.lua | 133 ++++++++---------- better-air-filtering/prototypes/recipe.lua | 29 ++++ .../prototypes/technology.lua | 11 +- 6 files changed, 105 insertions(+), 80 deletions(-) create mode 100644 better-air-filtering/migrations/0.1.2.lua diff --git a/better-air-filtering/info.json b/better-air-filtering/info.json index e39f332..64c0008 100644 --- a/better-air-filtering/info.json +++ b/better-air-filtering/info.json @@ -1,6 +1,6 @@ { "name": "better-air-filtering", - "version": "0.1.1", + "version": "0.1.2", "title": "Better Air Filtering", "author": "Joey De Pauw", "contact": "joeydepauw@gmail.com", diff --git a/better-air-filtering/locale/en/air-filtering.cfg b/better-air-filtering/locale/en/air-filtering.cfg index 93f5a47..6fefc8d 100644 --- a/better-air-filtering/locale/en/air-filtering.cfg +++ b/better-air-filtering/locale/en/air-filtering.cfg @@ -25,16 +25,18 @@ polluted-water=Polluted Water [recipe-name] filter-air=Filter air filter-air2=Filter air +filter-air-expendable=Filter air liquid-pollution=Condense pollution air-filter-recycling=Recycle used air filter - [technology-name] air-filtering=Air filtering air-filter-recycling=Recycle used air filters +reusable-air-filters=Reusable air filters [technology-description] air-filtering-1=Enables the crafting of passive Air Filter Machines to improve air quality by reducing pollution. air-filtering-2=A stronger air filter that uses electricity to pull pollution towards it from a 2 chunk radius. air-filtering-3=An even stronger air filter, capable of cleaning pollution in a 3 chunk radius. +reusable-air-filters=More strudy air filters that can be recycled with future technology. air-filter-recycling=Used air filters can be reused after being recycled by using a bit of coal to refill them. \ No newline at end of file diff --git a/better-air-filtering/migrations/0.1.2.lua b/better-air-filtering/migrations/0.1.2.lua new file mode 100644 index 0000000..1e60c44 --- /dev/null +++ b/better-air-filtering/migrations/0.1.2.lua @@ -0,0 +1,6 @@ +for index, force in pairs(game.forces) do + local technologies = force.technologies + local recipes = force.recipes + + recipes["filter-air-expendable"].enabled = technologies["air-filtering-2"].researched +end \ No newline at end of file diff --git a/better-air-filtering/prototypes/entity.lua b/better-air-filtering/prototypes/entity.lua index 2147e5b..fa80b1c 100644 --- a/better-air-filtering/prototypes/entity.lua +++ b/better-air-filtering/prototypes/entity.lua @@ -12,26 +12,25 @@ data:extend({ alert_icon_shift = util.by_pixel(-3, -12), collision_box = { { -1.2, -1.2 }, { 1.2, 1.2 } }, selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } }, - animation = - { - layers = - { + animation = { + layers = { { filename = "__better-air-filtering__/graphics/entity/air-filter-machine-1.png", - priority="medium", + priority = "medium", width = 108, height = 114, frame_count = 32, - animation_speed=0.8, + animation_speed = 0.8, line_length = 8, shift = util.by_pixel(0, 2) }, { filename = "__better-air-filtering__/graphics/entity/air-filter-machine-shadow.png", - priority="medium", + priority = "medium", width = 95, height = 83, frame_count = 1, + animation_speed = 0.8, line_length = 1, repeat_count = 32, draw_as_shadow = true, @@ -42,17 +41,15 @@ data:extend({ match_animation_speed_to_activity = true, open_sound = { filename = "__base__/sound/machine-open.ogg", volume = 0.85 }, close_sound = { filename = "__base__/sound/machine-close.ogg", volume = 0.75 }, - working_sound = - { + working_sound = { sound = { { filename = "__base__/sound/electric-furnace.ogg", volume = 0.7 } }, idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 }, apparent_volume = 1.5, }, - fluid_boxes = - { + fluid_boxes = { { production_type = "input", - base_area = 10, + base_area = 2, base_level = -1, pipe_connections = {}, }, @@ -60,8 +57,7 @@ data:extend({ }, crafting_categories = { "air-filtering-basic" }, crafting_speed = 0.5, - energy_source = - { + energy_source = { type = "burner", fuel_category = "pollution-filter", usage_priority = "secondary-input", @@ -72,14 +68,13 @@ data:extend({ fixed_recipe = "filter-air", ingredient_count = 1, return_ingredients_on_change = true, - module_specification = - { + module_specification = { module_slots = 0 }, - allowed_effects=nil + allowed_effects = nil }, { - type = "assembling-machine", + type = "furnace", name = "air-filter-machine-2", icon = "__better-air-filtering__/graphics/icons/air-filter-machine-2.png", icon_size = 32, @@ -92,10 +87,8 @@ data:extend({ alert_icon_shift = util.by_pixel(-3, -12), collision_box = { { -1.2, -1.2 }, { 1.2, 1.2 } }, selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } }, - animation = - { - layers = - { + animation = { + layers = { { filename = "__better-air-filtering__/graphics/entity/air-filter-machine-2.png", priority = "medium", @@ -107,7 +100,7 @@ data:extend({ }, { filename = "__better-air-filtering__/graphics/entity/air-filter-machine-shadow.png", - priority="medium", + priority = "medium", width = 95, height = 83, frame_count = 1, @@ -119,57 +112,55 @@ data:extend({ } }, match_animation_speed_to_activity = true, + entity_info_icon_shift={0, -0.3}, + scale_entity_info_icon = true, open_sound = { filename = "__base__/sound/machine-open.ogg", volume = 0.85 }, close_sound = { filename = "__base__/sound/machine-close.ogg", volume = 0.75 }, - working_sound = - { + working_sound = { sound = { { filename = "__base__/sound/electric-furnace.ogg", volume = 0.7 } }, idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 }, apparent_volume = 1.5, }, - fluid_boxes = - { + fluid_boxes = { { production_type = "input", - base_area = 10, + base_area = 2, base_level = -1, - pipe_connections= {} - }, - { - production_type = "input", - pipe_picture = assembler2pipepictures(), - pipe_covers = pipecoverspictures(), - base_area = 10, - base_level = -1, - pipe_connections = {{ type="input", position = {0, -2} }} - }, - { - production_type = "output", - pipe_picture = assembler2pipepictures(), - pipe_covers = pipecoverspictures(), - base_area = 10, - base_level = 1, - pipe_connections = { { type = "output", position = { 0, 2 } } }, - secondary_draw_orders = { north = -1 } + pipe_connections = {} }, + --{ + -- production_type = "input", + -- pipe_picture = assembler2pipepictures(), + -- pipe_covers = pipecoverspictures(), + -- base_area = 10, + -- base_level = -1, + -- pipe_connections = {{ type="input", position = {0, -2} }} + --}, + --{ + -- production_type = "output", + -- pipe_picture = assembler2pipepictures(), + -- pipe_covers = pipecoverspictures(), + -- base_area = 10, + -- base_level = 1, + -- pipe_connections = { { type = "output", position = { 0, 2 } } }, + -- secondary_draw_orders = { north = -1 } + --}, off_when_no_fluid_recipe = true }, crafting_categories = { "air-filtering-advanced" }, crafting_speed = 1.0, - energy_source = - { + energy_source = { type = "electric", usage_priority = "secondary-input", - drain="100kW", + drain = "100kW", }, energy_usage = "50kW", - fixed_recipe = "filter-air2", - ingredient_count = 2, - module_specification = - { + result_inventory_size = 1, + source_inventory_size = 1, + module_specification = { module_slots = 2 }, - allowed_effects = {"consumption", "speed"}, + allowed_effects = { "consumption", "speed" }, return_ingredients_on_change = true, }, { @@ -184,10 +175,8 @@ data:extend({ corpse = "medium-remnants", collision_box = { { -1.2, -1.2 }, { 1.2, 1.2 } }, selection_box = { { -1.5, -1.5 }, { 1.5, 1.5 } }, - animation = - { - layers = - { + animation = { + layers = { { filename = "__better-air-filtering__/graphics/entity/air-filter-machine-3.png", priority = "medium", @@ -199,7 +188,7 @@ data:extend({ }, { filename = "__better-air-filtering__/graphics/entity/air-filter-machine-shadow.png", - priority="medium", + priority = "medium", width = 95, height = 83, frame_count = 1, @@ -213,33 +202,31 @@ data:extend({ match_animation_speed_to_activity = true, open_sound = { filename = "__base__/sound/machine-open.ogg", volume = 0.85 }, close_sound = { filename = "__base__/sound/machine-close.ogg", volume = 0.75 }, - working_sound = - { + working_sound = { sound = { { filename = "__base__/sound/electric-furnace.ogg", volume = 0.7 } }, idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 }, apparent_volume = 1.5, }, - fluid_boxes = - { + fluid_boxes = { { production_type = "input", - base_area = 10, + base_area = 2, base_level = -1, - pipe_connections= {} + pipe_connections = {} }, { production_type = "input", pipe_picture = assembler3pipepictures(), pipe_covers = pipecoverspictures(), - base_area = 10, + base_area = 2, base_level = -1, - pipe_connections = {{ type="input", position = {0, -2} }} + pipe_connections = { { type = "input", position = { 0, -2 } } } }, { production_type = "output", pipe_picture = assembler3pipepictures(), pipe_covers = pipecoverspictures(), - base_area = 10, + base_area = 2, base_level = 1, pipe_connections = { { type = "output", position = { 0, 2 } } }, secondary_draw_orders = { north = -1 } @@ -248,20 +235,18 @@ data:extend({ }, crafting_categories = { "air-filtering-advanced" }, crafting_speed = 1.25, - energy_source = - { + energy_source = { type = "electric", usage_priority = "secondary-input", - drain="200kW", + drain = "200kW", }, energy_usage = "100kW", fixed_recipe = "filter-air2", ingredient_count = 2, - module_specification = - { + module_specification = { module_slots = 3 }, - allowed_effects = {"consumption", "speed"}, + allowed_effects = { "consumption", "speed" }, return_ingredients_on_change = true, module_slots = 0, } diff --git a/better-air-filtering/prototypes/recipe.lua b/better-air-filtering/prototypes/recipe.lua index fadb072..04c865c 100644 --- a/better-air-filtering/prototypes/recipe.lua +++ b/better-air-filtering/prototypes/recipe.lua @@ -161,6 +161,35 @@ data:extend({ results = { { type = "item", name = "used-air-filter", amount = 1 } }, main_product = "" }, + { + type = "recipe", + name = "filter-air-expendable", + hide_from_player_crafting = true, + hide_from_stats = true, + icons = { + { + icon = "__base__/graphics/icons/fluid/pollution.png" + }, + { + icon = "__better-air-filtering__/graphics/icons/recipe/filter-air.png", + scale = 0.6, + shift = { 6, 6 } + }, + }, + icon_size = 32, + category = "air-filtering-advanced", + subgroup = "raw-material", + order = "b[filter-air]", + energy_required = 3, + enabled = false, + ingredients = + { + { type = "fluid", name = "pollution", amount = 10, fluidbox_index = 1 }, + { type = "item", name = "expendable-air-filter", amount = 1 }, + }, + results = {}, + main_product = "" + }, { type = "recipe", name = "liquid-pollution", diff --git a/better-air-filtering/prototypes/technology.lua b/better-air-filtering/prototypes/technology.lua index 2789b26..0c49c9e 100644 --- a/better-air-filtering/prototypes/technology.lua +++ b/better-air-filtering/prototypes/technology.lua @@ -2,7 +2,7 @@ data:extend({ { type = "technology", name = "air-filtering-1", - localised_description = {"technology-description.air-filtering-1"}, + localised_description = { "technology-description.air-filtering-1" }, icon = "__better-air-filtering__/graphics/technology/air-filtering-1.png", icon_size = "64", prerequisites = { "automation", "electronics" }, @@ -78,7 +78,7 @@ data:extend({ { type = "technology", name = "air-filtering-2", - localised_description = {"technology-description.air-filtering-2"}, + localised_description = { "technology-description.air-filtering-2" }, icon = "__better-air-filtering__/graphics/technology/air-filtering-2.png", icon_size = "64", prerequisites = { "air-filtering-1", "reusable-air-filters", "advanced-electronics" }, @@ -87,10 +87,13 @@ data:extend({ type = "unlock-recipe", recipe = "air-filter-machine-2" }, - { type = "unlock-recipe", recipe = "filter-air2" + }, + { + type = "unlock-recipe", + recipe = "filter-air-expendable" } }, unit = { @@ -107,7 +110,7 @@ data:extend({ { type = "technology", name = "air-filtering-3", - localised_description = {"technology-description.air-filtering-3"}, + localised_description = { "technology-description.air-filtering-3" }, icon = "__better-air-filtering__/graphics/technology/air-filtering-3.png", icon_size = "64", prerequisites = { "air-filtering-2" },