Skip to content

Commit

Permalink
First round of incerator stuff
Browse files Browse the repository at this point in the history
Former-commit-id: 6c1c898
Former-commit-id: ffdeb433944df6abe37b033c27efd8095d8a6969
  • Loading branch information
Nexela committed Dec 21, 2017
1 parent 88a43ba commit 198bd47
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 50 deletions.
2 changes: 2 additions & 0 deletions data-final-fixes.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require("prototypes.void-recipes")

local Area = require('stdlib.area.area')

-- Make all storage-tanks fast replace with other other if they are the same size
Expand Down
Binary file added graphics/icons/no.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 13 additions & 36 deletions prototypes/buildings/gas-vent.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
local Recipe = require("stdlib/data/recipe")
local Pipes = require("stdlib.data.pipes")

local recipe = Recipe {
local recipe =
Recipe {
type = "recipe",
name = "py-gas-vent",
energy_required = 5,
enabled = true,
ingredients = {
{"iron-plate", 20},
{"pipe", 15},
{"pipe", 15},
{"stone-brick", 5}
},
result = "py-gas-vent"
Expand All @@ -26,14 +27,15 @@ local item = {
stack_size = 10
}

local entity =
{
type = "assembling-machine",
local entity = {
type = "furnace",
name = "py-gas-vent",
icon = "__pyindustry__/graphics/icons/py-gas-vent.png",
icon_size = 32,
flags = {"placeable-neutral", "placeable-player", "player-creation"},
minable = {mining_time = 1, result = "py-gas-vent"},
source_inventory_size = 1,
result_inventory_size = 0,
max_health = 400,
corpse = "medium-remnants",
repair_sound = {filename = "__base__/sound/manual-repair-simple.ogg"},
Expand Down Expand Up @@ -68,16 +70,15 @@ local entity =
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
crafting_categories = {"py-venting"},
energy_usage = "1kW",
ingredient_count = 2,
ingredient_count = 2,
crafting_speed = 1,
energy_source = {
type = "electric",
usage_priority = "secondary-input",
emissions = 0.0
},
},
animation = {
layers =
{
layers = {
{
filename = "__pyindustry__/graphics/entity/py-gas-vent/py-gas-vent.png",
priority = "extra-high",
Expand Down Expand Up @@ -109,11 +110,11 @@ local entity =
width = 150,
height = 46,
frame_count = 1,
draw_as_shadow = true,
draw_as_shadow = true,
shift = {1.3, -0.0},
scale = 0.5
}
},
}
}
},
fluid_boxes = {
Expand All @@ -125,32 +126,8 @@ local entity =
base_level = -1,
pipe_connections = {{type = "input", position = {1.0, 0.0}}}
},
{
production_type = "input",
pipe_picture = Pipes.pictures("assembling-machine-3", nil, nil, nil, nil),
pipe_covers = Pipes.covers(true, true, true, true),
base_area = 10,
base_level = -1,
pipe_connections = {{type = "input", position = {-1.0, 0.0}}}
},
{
production_type = "input",
pipe_picture = Pipes.pictures("assembling-machine-3", nil, nil, nil, nil),
pipe_covers = Pipes.covers(true, true, true, true),
base_area = 10,
base_level = -1,
pipe_connections = {{type = "input", position = {0.0, 1.0}}}
},
{
production_type = "input",
pipe_picture = Pipes.pictures("assembling-machine-3", nil, nil, nil, nil),
pipe_covers = Pipes.covers(true, true, true, true),
base_area = 10,
base_level = -1,
pipe_connections = {{type = "input", position = {0.0, -1.0}}}
},
off_when_no_fluid_recipe = false
},
fast_replaceable_group = "py-gas-vent",
fast_replaceable_group = "py-gas-vent"
}
data:extend {recipe, item, entity}
30 changes: 16 additions & 14 deletions prototypes/buildings/sinkhole.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
local Recipe = require("stdlib/data/recipe")
local Pipes = require("stdlib.data.pipes")

local recipe = Recipe {
local recipe =
Recipe {
type = "recipe",
name = "py-sinkhole",
energy_required = 10,
enabled = false,
ingredients = {
{"offshore-pump", 5},
{"iron-plate", 40},
{"pipe", 20},
{"pipe", 20},
{"steel-plate", 15},
{"stone-brick", 50}
},
Expand All @@ -28,9 +29,8 @@ local item = {
stack_size = 10
}

local entity =
{
type = "assembling-machine",
local entity = {
type = "furnace",
name = "py-sinkhole",
icon = "__pyindustry__/graphics/icons/py-sinkhole.png",
icon_size = 32,
Expand All @@ -43,6 +43,8 @@ local entity =
open_sound = {filename = "__base__/sound/machine-open.ogg", volume = 0.85},
close_sound = {filename = "__base__/sound/machine-close.ogg", volume = 0.75},
vehicle_impact_sound = {filename = "__base__/sound/car-stone-impact.ogg", volume = 1.0},
source_inventory_size = 0,
result_inventory_size = 0,
module_specification = {
module_slots = 6
},
Expand All @@ -68,17 +70,17 @@ local entity =
},
collision_box = {{-1.2, -1.2}, {1.2, 1.2}},
selection_box = {{-1.5, -1.5}, {1.5, 1.5}},
crafting_categories = {"py-incineration"},
crafting_categories = {"py-runoff"},
energy_usage = "1kW",
ingredient_count = 4,
ingredient_count = 4,
crafting_speed = 1,
energy_source = {
type = "electric",
usage_priority = "secondary-input",
emissions = 0.0
},
animation = _G.make_4way_animation_from_spritesheet({ layers =
{
},
animation = _G.make_4way_animation_from_spritesheet {
layers = {
{
filename = "__pyindustry__/graphics/entity/py-sinkhole/py-sinkhole.png",
priority = "extra-high",
Expand Down Expand Up @@ -110,13 +112,13 @@ local entity =
width = 197,
height = 192,
frame_count = 1,
draw_as_shadow = true,
draw_as_shadow = true,
shift = {0.3, -0.0},
scale = 0.5
}
},
}
}
}),
},
fluid_boxes = {
{
production_type = "input",
Expand All @@ -128,6 +130,6 @@ local entity =
},
off_when_no_fluid_recipe = false
},
fast_replaceable_group = "py-sinkhole",
fast_replaceable_group = "py-sinkhole"
}
data:extend {recipe, item, entity}
6 changes: 6 additions & 0 deletions prototypes/item-groups.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,11 @@ data:extend {
name = "py-tiles",
group = "py-industry",
order = "f"
},
{
type = "item-subgroup",
name = "py-void",
group = "py-industry",
order = "zzzzzzzzzzzzz"
}
}
4 changes: 4 additions & 0 deletions prototypes/recipe-categories.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ data:extend {
{
type = "recipe-category",
name = "py-venting"
},
{
type = "recipe-category",
name = "py-runoff"
}
}
50 changes: 50 additions & 0 deletions prototypes/void-recipes.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
local Recipe = require("stdlib/data/recipe")

local function make_fluid_recipe(name, locale, icons, category, ing)
Recipe {
name = name,
type = "recipe",
localised_name = locale,
hidden = true,
enabled = true,
flags = {"hidden"},
category = category,
ingredients = {
ing
},
results = {
{type = "fluid", name = "water", amount = 0}
},
icons = icons,
icon_size = 32,
subgroup = "py-void"
}
end

for _, fluid in pairs(data.raw.fluid) do
local name = fluid.name .. "-pyvoid" .. (fluid.gas_temperature and "-gas" or "-fluid")

local icons
if fluid.icons then
icons = table.deepcopy(fluid.icons)
else
icons = {
{icon = fluid.icon, icon_size = fluid.icon_size or 32}
}
end
icons[#icons + 1] = {icon = "__pyindustry__/graphics/icons/no.png", icon_size = 32}

if (fluid.default_temperature or 15) < (fluid.gas_temperature or 999999999999) then
--Make sinkhole
local locale = {"", "Void ", {"fluid-name."..fluid.name}}
local ing = {type = "fluid", name = fluid.name, maximum_temperature = fluid.gas_temperature, amount = 10}
make_fluid_recipe(name, locale, icons, "py-runoff", ing)
end

if fluid.gas_temperature then
--Make burner
local locale = {"", "Void ", {"fluid-name."..fluid.name}}
local ing = {type = "fluid", name = fluid.name, minimum_temperature = fluid.gas_temperature, amount = 10}
make_fluid_recipe(name, locale, icons, "py-venting", ing)
end
end

0 comments on commit 198bd47

Please sign in to comment.