Integrate lumber mill code into this mod
This commit is contained in:
parent
bb624c1159
commit
11d5f65680
2 changed files with 238 additions and 80 deletions
|
|
@ -4,7 +4,6 @@ local sounds = require("__base__.prototypes.entity.sounds")
|
||||||
local Entity = require("__cf-lib__/data/Entity")
|
local Entity = require("__cf-lib__/data/Entity")
|
||||||
|
|
||||||
local gfx = Lignumis.graphics .. "entity/deep-miner/"
|
local gfx = Lignumis.graphics .. "entity/deep-miner/"
|
||||||
local techGfx = Lignumis.graphics .. "technology/"
|
|
||||||
local name = "deep-miner"
|
local name = "deep-miner"
|
||||||
|
|
||||||
local function animationLayer()
|
local function animationLayer()
|
||||||
|
|
@ -18,12 +17,12 @@ local function animationLayer()
|
||||||
scale = 0.5,
|
scale = 0.5,
|
||||||
stripes = {
|
stripes = {
|
||||||
{
|
{
|
||||||
filename = gfx .. "core-extractor-animation-1.png",
|
filename = gfx .. "deep-miner-animation-1.png",
|
||||||
width_in_frames = 8,
|
width_in_frames = 8,
|
||||||
height_in_frames = 8
|
height_in_frames = 8
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filename = gfx .. "core-extractor-animation-2.png",
|
filename = gfx .. "deep-miner-animation-2.png",
|
||||||
width_in_frames = 8,
|
width_in_frames = 8,
|
||||||
height_in_frames = 7
|
height_in_frames = 7
|
||||||
}
|
}
|
||||||
|
|
@ -35,7 +34,7 @@ data:extend({
|
||||||
{
|
{
|
||||||
type = "mining-drill",
|
type = "mining-drill",
|
||||||
name = name,
|
name = name,
|
||||||
icon = gfx .. "core-extractor-icon.png",
|
icon = Lignumis.graphics .. "icons/deep-miner.png",
|
||||||
flags = { "placeable-neutral", "player-creation" },
|
flags = { "placeable-neutral", "player-creation" },
|
||||||
minable = { mining_time = 0.2, result = name },
|
minable = { mining_time = 0.2, result = name },
|
||||||
fast_replaceable_group = name,
|
fast_replaceable_group = name,
|
||||||
|
|
@ -69,7 +68,7 @@ data:extend({
|
||||||
animation = {
|
animation = {
|
||||||
layers = {
|
layers = {
|
||||||
{
|
{
|
||||||
filename = gfx .. "core-extractor-shadow.png",
|
filename = gfx .. "deep-miner-shadow.png",
|
||||||
priority = "high",
|
priority = "high",
|
||||||
width = 1400,
|
width = 1400,
|
||||||
height = 1400,
|
height = 1400,
|
||||||
|
|
@ -101,12 +100,12 @@ data:extend({
|
||||||
scale = 0.5,
|
scale = 0.5,
|
||||||
stripes = {
|
stripes = {
|
||||||
{
|
{
|
||||||
filename = gfx .. "core-extractor-emission-1.png",
|
filename = gfx .. "deep-miner-emission-1.png",
|
||||||
width_in_frames = 8,
|
width_in_frames = 8,
|
||||||
height_in_frames = 8
|
height_in_frames = 8
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filename = gfx .. "core-extractor-emission-2.png",
|
filename = gfx .. "deep-miner-emission-2.png",
|
||||||
width_in_frames = 8,
|
width_in_frames = 8,
|
||||||
height_in_frames = 7
|
height_in_frames = 7
|
||||||
}
|
}
|
||||||
|
|
@ -149,7 +148,7 @@ data:extend({
|
||||||
{
|
{
|
||||||
type = "item",
|
type = "item",
|
||||||
name = name,
|
name = name,
|
||||||
icon = gfx .. "core-extractor-icon.png",
|
icon = Lignumis.graphics .. "icons/deep-miner.png",
|
||||||
subgroup = "extraction-machine",
|
subgroup = "extraction-machine",
|
||||||
order = "a[items]-d[deep-miner]",
|
order = "a[items]-d[deep-miner]",
|
||||||
inventory_move_sound = item_sounds.mechanical_large_inventory_move,
|
inventory_move_sound = item_sounds.mechanical_large_inventory_move,
|
||||||
|
|
@ -177,7 +176,7 @@ data:extend({
|
||||||
{
|
{
|
||||||
type = "technology",
|
type = "technology",
|
||||||
name = name,
|
name = name,
|
||||||
icon = techGfx .. "core-extractor.png",
|
icon = Lignumis.graphics .. "technology/deep-miner.png",
|
||||||
icon_size = 256,
|
icon_size = 256,
|
||||||
effects = {
|
effects = {
|
||||||
{ type = "unlock-recipe", recipe = name }
|
{ type = "unlock-recipe", recipe = name }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
local Recipe = require("__cf-lib__/data/Recipe")
|
local Recipe = require("__cf-lib__/data/Recipe")
|
||||||
local Technology = require("__cf-lib__/data/Technology")
|
local hit_effects = require("__base__.prototypes.entity.hit-effects")
|
||||||
local LumberMillFactory = require(MF.buildings .. "LumberMill")
|
local item_sounds = require("__base__.prototypes.item_sounds")
|
||||||
local LumberMill = LumberMillFactory()
|
local Entity = require("__cf-lib__/data/Entity")
|
||||||
|
|
||||||
|
local gfx = Lignumis.graphics .. "entity/lumber-mill/"
|
||||||
|
local name = "lumber-mill"
|
||||||
|
|
||||||
data:extend({
|
data:extend({
|
||||||
{
|
{
|
||||||
|
|
@ -18,84 +21,240 @@ if mods["wood-logistics"] then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local lumberMill = LumberMill.EntityBuilder:new()
|
local energy_source = electric_lumber_mill and {
|
||||||
:baseProductivity(0.5)
|
type = "electric",
|
||||||
if electric_lumber_mill then
|
usage_priority = "secondary-input",
|
||||||
lumberMill:electricEnergySource({ emissions_per_minute = { noise = 100 } })
|
emissions_per_minute = { noise = 100 }
|
||||||
else
|
} or {
|
||||||
lumberMill:burnerEnergySource({ emissions_per_minute = { noise = 100 } })
|
type = "burner",
|
||||||
end
|
fuel_categories = { "chemical" },
|
||||||
lumberMill:apply({
|
effectivity = 1,
|
||||||
crafting_categories = { "wood-processing" },
|
fuel_inventory_size = 3,
|
||||||
crafting_speed = 2,
|
emissions_per_minute = { pollution = 10, noise = 100 }
|
||||||
energy_usage = "1000kW",
|
}
|
||||||
surface_conditions = {
|
|
||||||
{
|
data:extend({
|
||||||
property = has_oxygen and "oxygen" or "pressure",
|
{
|
||||||
min = 3
|
type = "assembling-machine",
|
||||||
|
name = name,
|
||||||
|
icon = Lignumis.graphics .. "icons/lumber-mill.png",
|
||||||
|
flags = { "placeable-neutral", "player-creation" },
|
||||||
|
minable = { mining_time = 0.2, result = name },
|
||||||
|
fast_replaceable_group = name,
|
||||||
|
max_health = 500,
|
||||||
|
corpse = "big-remnants",
|
||||||
|
dying_explosion = "medium-explosion",
|
||||||
|
collision_box = Entity.collisionBox(8, 8),
|
||||||
|
selection_box = Entity.selectionBox(8, 8),
|
||||||
|
damaged_trigger_effect = hit_effects.entity(),
|
||||||
|
drawing_box_vertical_extension = 1.3,
|
||||||
|
module_slots = 4,
|
||||||
|
icon_draw_specification = { scale = 2, shift = { 0, -0.3 } },
|
||||||
|
icons_positioning = {
|
||||||
|
{ inventory_index = defines.inventory.assembling_machine_modules, shift = { 0, 1.25 } }
|
||||||
},
|
},
|
||||||
{
|
allowed_effects = { "consumption", "speed", "pollution", "quality" },
|
||||||
property = "gravity",
|
crafting_categories = { "wood-processing" },
|
||||||
min = 1
|
crafting_speed = 2,
|
||||||
|
energy_source = energy_source,
|
||||||
|
energy_usage = "1MW",
|
||||||
|
effect_receiver = { base_effect = { productivity = 0.5 } },
|
||||||
|
surface_conditions = {
|
||||||
|
{
|
||||||
|
property = has_oxygen and "oxygen" or "pressure",
|
||||||
|
min = 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
property = "gravity",
|
||||||
|
min = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
perceived_performance = { minimum = 0.25, performance_to_activity_rate = 0.25, maximum = 4 },
|
||||||
|
graphics_set = {
|
||||||
|
animation = {
|
||||||
|
layers = {
|
||||||
|
{
|
||||||
|
filename = gfx .. "lumber-mill-shadow.png",
|
||||||
|
priority = "high",
|
||||||
|
width = 800,
|
||||||
|
height = 700,
|
||||||
|
frame_count = 1,
|
||||||
|
line_length = 1,
|
||||||
|
repeat_count = 80,
|
||||||
|
animation_speed = 0.32,
|
||||||
|
shift = util.by_pixel(0, -8),
|
||||||
|
draw_as_shadow = true,
|
||||||
|
scale = 0.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
priority = "high",
|
||||||
|
width = 525,
|
||||||
|
height = 557,
|
||||||
|
frame_count = 80,
|
||||||
|
lines_per_file = 8,
|
||||||
|
animation_speed = 0.32,
|
||||||
|
shift = util.by_pixel(0, -8),
|
||||||
|
scale = 0.5,
|
||||||
|
stripes = {
|
||||||
|
{
|
||||||
|
filename = gfx .. "lumber-mill-animation-1.png",
|
||||||
|
width_in_frames = 8,
|
||||||
|
height_in_frames = 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
filename = gfx .. "lumber-mill-animation-2.png",
|
||||||
|
width_in_frames = 8,
|
||||||
|
height_in_frames = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
working_visualisations = {
|
||||||
|
{
|
||||||
|
fadeout = true,
|
||||||
|
animation = {
|
||||||
|
layers = {
|
||||||
|
{
|
||||||
|
priority = "high",
|
||||||
|
width = 525,
|
||||||
|
height = 557,
|
||||||
|
frame_count = 80,
|
||||||
|
lines_per_file = 8,
|
||||||
|
animation_speed = 0.32,
|
||||||
|
shift = util.by_pixel(0, -8),
|
||||||
|
scale = 0.5,
|
||||||
|
stripes = {
|
||||||
|
{
|
||||||
|
filename = gfx .. "lumber-mill-animation-1.png",
|
||||||
|
width_in_frames = 8,
|
||||||
|
height_in_frames = 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
filename = gfx .. "lumber-mill-animation-2.png",
|
||||||
|
width_in_frames = 8,
|
||||||
|
height_in_frames = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
priority = "high",
|
||||||
|
draw_as_glow = true,
|
||||||
|
blend_mode = "additive",
|
||||||
|
width = 525,
|
||||||
|
height = 557,
|
||||||
|
frame_count = 80,
|
||||||
|
lines_per_file = 8,
|
||||||
|
animation_speed = 0.32,
|
||||||
|
shift = util.by_pixel(0, -8),
|
||||||
|
scale = 0.5,
|
||||||
|
stripes = {
|
||||||
|
{
|
||||||
|
filename = gfx .. "lumber-mill-emission-1.png",
|
||||||
|
width_in_frames = 8,
|
||||||
|
height_in_frames = 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
filename = gfx .. "lumber-mill-emission-2.png",
|
||||||
|
width_in_frames = 8,
|
||||||
|
height_in_frames = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
open_sound = { filename = "__base__/sound/open-close/train-stop-open.ogg", volume = 0.6 },
|
||||||
|
close_sound = { filename = "__base__/sound/open-close/train-stop-close.ogg", volume = 0.5 },
|
||||||
|
working_sound = {
|
||||||
|
fade_in_ticks = 4,
|
||||||
|
fade_out_ticks = 20,
|
||||||
|
audible_distance_modifier = 0.6,
|
||||||
|
max_sounds_per_type = 2,
|
||||||
|
sound = { filename = "__space-age__/sound/entity/foundry/foundry.ogg", volume = 0.6 },
|
||||||
|
sound_accents = {
|
||||||
|
{ sound = { filename = Lignumis.sound .. "entity/lumber-mill/lumber-mill-saw-1.ogg", volume = 0.8 }, frame = 26, audible_distance_modifier = 0.5 },
|
||||||
|
{ sound = { filename = Lignumis.sound .. "entity/lumber-mill/lumber-mill-fall.ogg", volume = 1.2 }, frame = 42, audible_distance_modifier = 0.5 },
|
||||||
|
{ sound = { filename = Lignumis.sound .. "entity/lumber-mill/lumber-mill-saw-2.ogg", volume = 0.8 }, frame = 53, audible_distance_modifier = 0.4 },
|
||||||
|
{ sound = { filename = Lignumis.sound .. "entity/lumber-mill/lumber-mill-split.ogg", volume = 0.4 }, frame = 62, audible_distance_modifier = 0.3 },
|
||||||
|
{ sound = { variations = sound_variations(Lignumis.sound .. "entity/lumber-mill/lumber-mill-plank", 3, 0.5) }, frame = 14, audible_distance_modifier = 0.3 },
|
||||||
|
{ sound = { variations = sound_variations(Lignumis.sound .. "entity/lumber-mill/lumber-mill-plank", 3, 0.5) }, frame = 34, audible_distance_modifier = 0.3 },
|
||||||
|
{ sound = { variations = sound_variations(Lignumis.sound .. "entity/lumber-mill/lumber-mill-plank", 3, 0.5) }, frame = 54, audible_distance_modifier = 0.3 },
|
||||||
|
{ sound = { variations = sound_variations(Lignumis.sound .. "entity/lumber-mill/lumber-mill-plank", 3, 0.5) }, frame = 74, audible_distance_modifier = 0.3 },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "item",
|
||||||
|
name = name,
|
||||||
|
icon = Lignumis.graphics .. "icons/lumber-mill.png",
|
||||||
|
subgroup = "production-machine",
|
||||||
|
order = "eb[lumber-mill]",
|
||||||
|
inventory_move_sound = item_sounds.mechanical_large_inventory_move,
|
||||||
|
pick_sound = item_sounds.mechanical_large_inventory_pickup,
|
||||||
|
drop_sound = item_sounds.mechanical_large_inventory_move,
|
||||||
|
place_result = name,
|
||||||
|
stack_size = 20,
|
||||||
|
default_import_location = "lignumis",
|
||||||
|
weight = 200 * kg
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "recipe",
|
||||||
|
name = name,
|
||||||
|
category = "crafting",
|
||||||
|
additional_categories = { "wood-processing" },
|
||||||
|
enabled = false,
|
||||||
|
ingredients = table.trim({
|
||||||
|
{ type = "item", name = "stone-brick", amount = 40 },
|
||||||
|
{ type = "item", name = "lumber", amount = 50 },
|
||||||
|
{ type = "item", name = "wooden-gear-wheel", amount = 50 },
|
||||||
|
{ type = "item", name = "gold-plate", amount = basic_circuit_board and 20 or 40 },
|
||||||
|
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 20 } or nil,
|
||||||
|
{ type = "item", name = "burner-assembling-machine", amount = 2 }
|
||||||
|
}),
|
||||||
|
energy_required = 60,
|
||||||
|
results = { { type = "item", name = name, amount = 1 } }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "technology",
|
||||||
|
name = name,
|
||||||
|
icon = Lignumis.graphics .. "technology/lumber-mill.png",
|
||||||
|
icon_size = 256,
|
||||||
|
prerequisites = electric_lumber_mill and { "automation-science-pack" } or { "steam-science-pack" },
|
||||||
|
unit = {
|
||||||
|
count = 250,
|
||||||
|
ingredients = electric_lumber_mill and {{ "automation-science-pack", 1 }} or {{ "wood-science-pack", 1 }, { "steam-science-pack", 1 }},
|
||||||
|
time = 15
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
local lumber_mill_item = LumberMill.ItemBuilder:new()
|
Recipe:new("lumber-mill")
|
||||||
:apply({
|
:unlockedByTechnology("lumber-mill")
|
||||||
default_import_location = "lignumis",
|
:clone("lumber-mill-copper")
|
||||||
order = "2[lumber-mill]"
|
:assign({
|
||||||
})
|
ingredients = {
|
||||||
|
{ type = "item", name = "stone-brick", amount = 40 },
|
||||||
LumberMill.RecipeBuilder:new()
|
{ type = "item", name = "lumber", amount = 50 },
|
||||||
:ingredients(table.trim({
|
{ type = "item", name = "wooden-gear-wheel", amount = 50 },
|
||||||
{ type = "item", name = "stone-brick", amount = 40 },
|
{ type = "item", name = "copper-plate", amount = basic_circuit_board and 20 or 40 },
|
||||||
{ type = "item", name = "lumber", amount = 50 },
|
{ type = "item", name = basic_circuit_board and "basic-circuit-board" or "electronic-circuit", amount = 20 },
|
||||||
{ type = "item", name = "wooden-gear-wheel", amount = 50 },
|
{ type = "item", name = "assembling-machine-1", amount = 2 }
|
||||||
{ type = "item", name = "gold-plate", amount = basic_circuit_board and 20 or 40 },
|
},
|
||||||
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 20 } or nil,
|
|
||||||
{ type = "item", name = "burner-assembling-machine", amount = 2 }
|
|
||||||
}))
|
|
||||||
:apply({
|
|
||||||
additional_categories = { "wood-processing" }
|
|
||||||
})
|
|
||||||
|
|
||||||
local tech = LumberMill.TechnologyBuilder:new()
|
|
||||||
:count(250)
|
|
||||||
:time(15)
|
|
||||||
if electric_lumber_mill then
|
|
||||||
tech:prerequisites({ "automation-science-pack" })
|
|
||||||
:ingredients({ { "automation-science-pack", 1 } })
|
|
||||||
else
|
|
||||||
tech:prerequisites({ "steam-science-pack" })
|
|
||||||
:ingredients({ { "wood-science-pack", 1 }, { "steam-science-pack", 1 } })
|
|
||||||
end
|
|
||||||
tech:apply()
|
|
||||||
|
|
||||||
LumberMill.RecipeBuilder:new()
|
|
||||||
:ingredients({
|
|
||||||
{ type = "item", name = "stone-brick", amount = 40 },
|
|
||||||
{ type = "item", name = "lumber", amount = 50 },
|
|
||||||
{ type = "item", name = "wooden-gear-wheel", amount = 50 },
|
|
||||||
{ type = "item", name = "copper-plate", amount = basic_circuit_board and 20 or 40 },
|
|
||||||
{ type = "item", name = basic_circuit_board and "basic-circuit-board" or "electronic-circuit", amount = 20 },
|
|
||||||
{ type = "item", name = "assembling-machine-1", amount = 2 }
|
|
||||||
})
|
|
||||||
:apply({
|
|
||||||
name = "lumber-mill-copper",
|
|
||||||
localised_name = { "entity-name.lumber-mill" },
|
localised_name = { "entity-name.lumber-mill" },
|
||||||
additional_categories = { "wood-processing" },
|
|
||||||
icons = {
|
icons = {
|
||||||
{ icon = lumber_mill_item.icon },
|
{ icon = Lignumis.graphics .. "icons/lumber-mill.png" },
|
||||||
{ icon = basic_circuit_board and "__base__/graphics/icons/copper-plate.png" or "__base__/graphics/icons/electronic-circuit.png", scale = 0.25, shift = { 8, 8 } }
|
{ icon = basic_circuit_board and "__base__/graphics/icons/copper-plate.png" or "__base__/graphics/icons/electronic-circuit.png", scale = 0.25, shift = { 8, 8 } }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
:unlockedByTechnology(
|
||||||
Technology:new(
|
electric_lumber_mill and "lumber-mill"
|
||||||
electric_lumber_mill and "lumber-mill"
|
or basic_circuit_board and "copper-processing"
|
||||||
or basic_circuit_board and "copper-processing"
|
or "electronics"
|
||||||
or "electronics"
|
)
|
||||||
):addRecipe("lumber-mill-copper")
|
:apply()
|
||||||
|
|
||||||
Recipe:new("wooden-chest"):addCategory("wood-processing")
|
Recipe:new("wooden-chest"):addCategory("wood-processing")
|
||||||
Recipe:new("small-electric-pole"):addCategory("wood-processing")
|
Recipe:new("small-electric-pole"):addCategory("wood-processing")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue