Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions LandfillPainting/data.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
require "util"
local tile_collision_masks = require("__base__/prototypes/tile/tile-collision-masks")

-- Collision masks have been replaced with CollisionMaskConnector prototypes in 2.0, which contains a property "layers"
-- Settings layers to empty means that the tile can be placed on top of anything
LANDFILL_COLLISION_MASK_CONNECTOR = {
layers = {}
}

LANDFILL_TILE_CONDITION = data.raw.item["landfill"].place_as_tile.tile_condition

-- Define the names of each terrain type we're adding
local terrains = {
"dry-dirt",
Expand All @@ -28,15 +31,15 @@ local names = {
local baserecipe = data.raw.recipe['landfill']
local technology = data.raw.technology['landfill']

if mods['angelssmelting'] and data.raw.technology['water-washing-1'] and
(data.raw.technology['water-washing-1'].enabled == nil or data.raw.technology['water-washing-1'].enabled) and
data.raw.recipe['solid-mud-landfill'] then
baserecipe = data.raw.recipe['solid-mud-landfill']
technology = data.raw.technology['water-washing-1']
if mods['angelssmelting'] and data.raw.technology['angels-water-washing-1'] and
(data.raw.technology['angels-water-washing-1'].enabled == nil or data.raw.technology['angels-water-washing-1'].enabled) and
data.raw.recipe['angels-solid-mud-landfill'] then
baserecipe = data.raw.recipe['angels-solid-mud-landfill']
technology = data.raw.technology['angels-water-washing-1']
data:extend({{
type = "item-subgroup",
name = "water-landfill",
group = "water-treatment",
group = "angels-water-treatment",
order = "eb"
}})
baserecipe.subgroup = "water-landfill"
Expand Down Expand Up @@ -67,24 +70,30 @@ for i,v in ipairs(terrains) do
{
result = v,
condition_size = 1,
condition = LANDFILL_COLLISION_MASK_CONNECTOR
condition = LANDFILL_COLLISION_MASK_CONNECTOR,
tile_condition = LANDFILL_TILE_CONDITION
},
}
local recipe = util.table.deepcopy(baserecipe)

recipe.name = "landfill-" .. v
recipe.localised_name = {v .. '-name.name'}

if recipe.results then
recipe.results[1].name = "landfill-" .. v
else
recipe.result = "landfill-" .. v
end

data.raw.tile[v].minable = {mining_time = 0.5, result = "landfill-"..v}
data.raw.tile[v].collision_mask = tile_collision_masks.ground()
data.raw.tile[v].is_foundation = true

data:extend({item})
data:extend({recipe})
table.insert(technology.effects, { type = "unlock-recipe", recipe = "landfill-" .. v })
end



data.raw.item['landfill'].icon = "__LandfillPainting__/graphics/icons/landfill-landfill.png"
data.raw.item['landfill'].place_as_tile.condition = LANDFILL_COLLISION_MASK_CONNECTOR

Expand Down