Integrate deep miner code into this mod
This commit is contained in:
parent
15a857e689
commit
b56f662a65
1 changed files with 168 additions and 41 deletions
|
|
@ -1,44 +1,171 @@
|
||||||
local DeepMinerFactory = require(MF.buildings .. "CoreExtractor")
|
local hit_effects = require("__base__.prototypes.entity.hit-effects")
|
||||||
local DeepMiner = DeepMinerFactory("deep-miner")
|
local item_sounds = require("__base__.prototypes.item_sounds")
|
||||||
|
local sounds = require("__base__.prototypes.entity.sounds")
|
||||||
|
local Entity = require("__cf-lib__/data/Entity")
|
||||||
|
|
||||||
local entity = DeepMiner.EntityBuilder:new():build({
|
local gfx = Lignumis.graphics .. "entity/deep-miner/"
|
||||||
resource_searching_radius = 0.49,
|
local techGfx = Lignumis.graphics .. "technology/"
|
||||||
energy_usage = "25MW",
|
local name = "deep-miner"
|
||||||
mining_speed = 7.5,
|
|
||||||
energy_source = {
|
local function animationLayer()
|
||||||
emissions_per_minute = { noise = 2000 }
|
return {
|
||||||
|
priority = "high",
|
||||||
|
width = 704,
|
||||||
|
height = 704,
|
||||||
|
frame_count = 120,
|
||||||
|
lines_per_file = 8,
|
||||||
|
animation_speed = 0.15,
|
||||||
|
scale = 0.5,
|
||||||
|
stripes = {
|
||||||
|
{
|
||||||
|
filename = gfx .. "core-extractor-animation-1.png",
|
||||||
|
width_in_frames = 8,
|
||||||
|
height_in_frames = 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
filename = gfx .. "core-extractor-animation-2.png",
|
||||||
|
width_in_frames = 8,
|
||||||
|
height_in_frames = 7
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
data:extend({
|
||||||
|
{
|
||||||
|
type = "mining-drill",
|
||||||
|
name = name,
|
||||||
|
icon = gfx .. "core-extractor-icon.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(11, 11),
|
||||||
|
selection_box = Entity.selectionBox(11, 11),
|
||||||
|
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", "productivity" },
|
||||||
|
mining_speed = 7.5,
|
||||||
|
resource_categories = { "deep-mining" },
|
||||||
|
drops_full_belt_stacks = true,
|
||||||
|
resource_searching_radius = 0.49,
|
||||||
|
vector_to_place_result = { 0, -5.85 },
|
||||||
|
resource_drain_rate_percent = 75,
|
||||||
|
energy_source = {
|
||||||
|
type = "electric",
|
||||||
|
usage_priority = "secondary-input",
|
||||||
|
emissions_per_minute = { noise = 2000 }
|
||||||
|
},
|
||||||
|
energy_usage = "25MW",
|
||||||
|
perceived_performance = { minimum = 0.25, performance_to_activity_rate = 2.0, maximum = 20 },
|
||||||
|
graphics_set = {
|
||||||
|
animation = {
|
||||||
|
layers = {
|
||||||
|
{
|
||||||
|
filename = gfx .. "core-extractor-shadow.png",
|
||||||
|
priority = "high",
|
||||||
|
width = 1400,
|
||||||
|
height = 1400,
|
||||||
|
frame_count = 1,
|
||||||
|
line_length = 1,
|
||||||
|
repeat_count = 120,
|
||||||
|
animation_speed = 0.15,
|
||||||
|
draw_as_shadow = true,
|
||||||
|
scale = 0.5
|
||||||
|
},
|
||||||
|
animationLayer()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
working_visualisations = {
|
||||||
|
{
|
||||||
|
fadeout = true,
|
||||||
|
animation = {
|
||||||
|
layers = {
|
||||||
|
animationLayer(),
|
||||||
|
{
|
||||||
|
priority = "high",
|
||||||
|
draw_as_glow = true,
|
||||||
|
blend_mode = "additive",
|
||||||
|
width = 704,
|
||||||
|
height = 704,
|
||||||
|
frame_count = 120,
|
||||||
|
lines_per_file = 8,
|
||||||
|
animation_speed = 0.15,
|
||||||
|
scale = 0.5,
|
||||||
|
stripes = {
|
||||||
|
{
|
||||||
|
filename = gfx .. "core-extractor-emission-1.png",
|
||||||
|
width_in_frames = 8,
|
||||||
|
height_in_frames = 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
filename = gfx .. "core-extractor-emission-2.png",
|
||||||
|
width_in_frames = 8,
|
||||||
|
height_in_frames = 7
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
open_sound = sounds.drill_open,
|
||||||
|
close_sound = sounds.drill_close
|
||||||
},
|
},
|
||||||
resource_drain_rate_percent = 75
|
{
|
||||||
})
|
type = "item",
|
||||||
entity.resource_categories = { "deep-mining" }
|
name = name,
|
||||||
data:extend({ entity })
|
icon = gfx .. "core-extractor-icon.png",
|
||||||
|
|
||||||
DeepMiner.ItemBuilder:new()
|
|
||||||
:itemsPerRocket(1)
|
|
||||||
:apply({
|
|
||||||
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,
|
||||||
|
pick_sound = item_sounds.mechanical_large_inventory_pickup,
|
||||||
DeepMiner.RecipeBuilder:new()
|
drop_sound = item_sounds.mechanical_large_inventory_move,
|
||||||
:ingredients({
|
place_result = name,
|
||||||
{ type = "item", name = "processing-unit", amount = 100 },
|
stack_size = 20,
|
||||||
{ type = "item", name = "electric-engine-unit", amount = 100 },
|
default_import_location = "nauvis",
|
||||||
{ type = "item", name = "steel-plate", amount = 200 },
|
weight = 1000 * kg
|
||||||
{ type = "item", name = "concrete", amount = 50 }
|
},
|
||||||
})
|
{
|
||||||
:apply({
|
type = "recipe",
|
||||||
category = "metallurgy-or-assembling"
|
name = name,
|
||||||
})
|
category = "metallurgy-or-assembling",
|
||||||
|
enabled = false,
|
||||||
DeepMiner.TechnologyBuilder:new()
|
ingredients = {
|
||||||
:prerequisites({ "space-science-pack" })
|
{ type = "item", name = "processing-unit", amount = 100 },
|
||||||
:count(500)
|
{ type = "item", name = "electric-engine-unit", amount = 100 },
|
||||||
:ingredients({
|
{ type = "item", name = "steel-plate", amount = 200 },
|
||||||
{ "automation-science-pack", 1 },
|
{ type = "item", name = "concrete", amount = 50 }
|
||||||
{ "logistic-science-pack", 1 },
|
},
|
||||||
{ "chemical-science-pack", 1 },
|
energy_required = 60,
|
||||||
{ "space-science-pack", 1 }
|
results = { { type = "item", name = name, amount = 1 } }
|
||||||
})
|
},
|
||||||
:time(60)
|
{
|
||||||
:apply()
|
type = "technology",
|
||||||
|
name = name,
|
||||||
|
icon = techGfx .. "core-extractor.png",
|
||||||
|
icon_size = 256,
|
||||||
|
effects = {
|
||||||
|
{ type = "unlock-recipe", recipe = name }
|
||||||
|
},
|
||||||
|
prerequisites = { "space-science-pack" },
|
||||||
|
unit = {
|
||||||
|
count = 500,
|
||||||
|
ingredients = {
|
||||||
|
{ "automation-science-pack", 1 },
|
||||||
|
{ "logistic-science-pack", 1 },
|
||||||
|
{ "chemical-science-pack", 1 },
|
||||||
|
{ "space-science-pack", 1 }
|
||||||
|
},
|
||||||
|
time = 60
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
Loading…
Add table
Add a link
Reference in a new issue