Первый фикс

Пачки некоторых позиций увеличены
This commit is contained in:
2024-03-01 20:53:32 +03:00
commit 7c9c708c92
23653 changed files with 767936 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
// {type:class}
// {direction:topDown}
[Data{bg:red}]->[Recipe]
[Recipe]->[Raw]
[Ingredients]
[Results]
[Products]^[Ingredients]
[Products]^[Results]
[Recipe]->[Ingredients]
[Recipe]->[Results]
[Parent]<->[note: Get the damn parent]
[Ingredients|parent;child]
//[Ingredients]->[Parent]
[Results]->[Parent]
[Parent]->[Recipe]

View File

@@ -0,0 +1,199 @@
local table = require('__stdlib__/stdlib/utils/table')
local groups = {}
groups.category = {
'ammo-category',
'equipment-category',
'fuel-category',
'item-group',
'item-subgroup',
'module-category',
'rail-category',
'recipe-category',
'resource-category',
}
groups.equipment = {
'active-defense-equipment',
'battery-equipment',
'belt-immunity-equipment',
'energy-shield-equipment',
'generator-equipment',
'movement-bonus-equipment',
'night-vision-equipment',
'roboport-equipment',
'solar-panel-equipment',
}
groups.other = {
'ambient-sound',
'autoplace-control',
'combat-robot-count',
'damage-type',
'equipment-grid',
'font',
'gui-style',
'map-gen-presets',
'map-settings',
'market',
'noise-expression',
'noise-layer',
'optimized-decorative',
'recipe',
'technology',
'tile',
'train-path-achievement',
'trivial-smoke',
'tutorial',
}
groups.utility = {
'utility-constants',
'utility-sounds',
'utility-sprites'
}
groups.signal = {
'virtual-signal'
}
groups.achievement = {
'achievement',
'build-entity-achievement',
'construct-with-robots-achievement',
'deconstruct-with-robots-achievement',
'deliver-by-robots-achievement',
'dont-build-entity-achievement',
'dont-craft-manually-achievement',
'dont-use-entity-in-energy-production-achievement',
'finish-the-game-achievement',
'group-attack-achievement',
'kill-achievement',
'player-damaged-achievement',
'produce-achievement',
'produce-per-hour-achievement',
'research-achievement',
}
groups.item = {
'item',
'ammo',
'armor',
'blueprint-book',
'blueprint',
'capsule',
'deconstruction-item',
'gun',
'item-with-entity-data',
'item-with-inventory',
'item-with-label',
'item-with-tags',
'module',
'rail-planner',
'repair-tool',
'selection-tool',
'tool',
}
groups.entity = {
'accumulator',
'ammo-turret',
'arithmetic-combinator',
'arrow',
'artillery-flare',
'artillery-projectile',
'artillery-turret',
'artillery-wagon',
'assembling-machine',
'beacon',
'beam',
'boiler',
'car',
'cargo-wagon',
'character-corpse',
'cliff',
'combat-robot',
'constant-combinator',
'construction-robot',
'container',
'corpse',
'curved-rail',
'decider-combinator',
'deconstructible-tile-proxy',
'decorative',
'electric-energy-interface',
'electric-pole',
'electric-turret',
'entity-ghost',
'explosion',
'fire',
'fish',
'flame-thrower-explosion',
'fluid-turret',
'fluid-wagon',
'flying-text',
'furnace',
'gate',
'generator',
'god-controller',
'heat-pipe',
'infinity-container',
'inserter',
'item-entity',
'item-request-proxy',
'lab',
'lamp',
'land-mine',
'leaf-particle',
'loader',
'locomotive',
'logistic-container',
'logistic-robot',
'mining-drill',
'offshore-pump',
'particle',
'particle-source',
'pipe',
'pipe-to-ground',
'player',
'player-port',
'power-switch',
'programmable-speaker',
'projectile',
'pump',
'radar',
'rail-chain-signal',
'rail-remnants',
'rail-signal',
'reactor',
'resource',
'roboport',
'rocket-silo',
'rocket-silo-rocket',
'rocket-silo-rocket-shadow',
'simple-entity',
'simple-entity-with-force',
'simple-entity-with-owner',
'smoke',
'smoke-with-trigger',
'solar-panel',
'splitter',
'sticker',
'storage-tank',
'straight-rail',
'stream',
'tile-ghost',
'train-stop',
'transport-belt',
'tree',
'turret',
'underground-belt',
'unit',
'unit-spawner',
'wall'
}
groups.fluid = {
'fluid'
}
groups.item_and_fluid = table.array_combine(groups.item, groups.fluid)
return groups

View File

@@ -0,0 +1,93 @@
render layers
"tile-transition", "resource", "decorative", "remnants", "floor", "transport-belt-endings", "corpse",
"floor-mechanics", "item", "lower-object", "object", "higher-object-above", "higher-object-under",
"wires", "lower-radius-visualization", "radius-visualization", "entity-info-icon", "explosion",
"projectile", "smoke", "air-object", "air-entity-info-con", "light-effect", "selection-box", "arrow", "cursor"
collision masks
"ground-tile", "water-tile", "resource-layer", "floor-layer", "item-layer",
"object-layer", "player-layer", "ghost-layer", "doodad-layer", "not-colliding-with-itself"
-------------------------------------------------------------------------------
Data(name, type) Data:Get()
Data:valid(type)
Data:copy()
Data:Flags()
Data:extend()
Data:continue()
Data:continue_if(func)
Data:subgroup_order()
Data:run_function(func) Data:execute()
Data:get_function_results(func)
Recipe:set_field()
Recipe:set_fields()
Recipe:remove_field()
Recipe:remove_fields()
------------------------------------------------------------------------------
Recipe()
Recipe:Ingredients() -- wrapper to Products(type)
Recipe:Results() -- wrapper to Products(type)
Recipe:Products(recipe, type, difficulty)
:get(recipe, type, difficulty)
:add()
:remove()
:replace()
:convert()
:clear()
:recipe() -- return recipe object
:make_difficult()
:make_simple()
-- affects top level
:change_category()
.crafting_machine_tint
-- Wrappers to recipe difficulty data (set_field)
-- Maybe override set_field/s()
.ingredients, -- table
.results, -- table
.result, -- string
.result_count, -- number
-- string fields
.main_product,
-- number fields
.energy_required,
.requester_paste_multiplier,
.overload_multiplier,
.emissions_multiplier,
-- bool fields
.enabled,
.hidden,
.hide_from_stats,
.allow_decomposition,
.allow_as_intermediate,
.allow_intermediates,
.always_show_made_in,
.show_amount_in_title,
.always_show_products,
:set_hidden()
:set_enabled()
-- Wrappers to Products()
:clear_ingredients()
:replace_ingredients()
:replace_ingredient()
:add_ingredient()
:remove_ingredient()
:clear_results()
:replace_results()
:replace_result()
:add_result()
:remove_result()
-- Wrappers to Technology()
:add_unlock()
:remove_unlock()

View File

@@ -0,0 +1,208 @@
--- Pipes
-- @module Data.Pipes
local Pipes = {}
local Sprites = require('__stdlib__/stdlib/data/modules/sprites')
--Define pipe connection pipe pictures, not all entities use these. This function needs some work though.
function Pipes.pictures(pictures, shift_north, shift_south, shift_west, shift_east, replacements)
local new_pictures = {
north = shift_north and
{
filename = '__base__/graphics/entity/' .. pictures .. '/' .. pictures .. '-pipe-N.png',
priority = 'extra-high',
width = 35,
height = 18,
shift = shift_north
} or
Sprites.empty_picture(),
south = shift_south and
{
filename = '__base__/graphics/entity/' .. pictures .. '/' .. pictures .. '-pipe-S.png',
priority = 'extra-high',
width = 44,
height = 31,
shift = shift_south
} or
Sprites.empty_picture(),
west = shift_west and
{
filename = '__base__/graphics/entity/' .. pictures .. '/' .. pictures .. '-pipe-W.png',
priority = 'extra-high',
width = 19,
height = 37,
shift = shift_west
} or
Sprites.empty_picture(),
east = shift_east and
{
filename = '__base__/graphics/entity/' .. pictures .. '/' .. pictures .. '-pipe-E.png',
priority = 'extra-high',
width = 20,
height = 38,
shift = shift_east
} or
Sprites.empty_picture()
}
for direction, image in pairs(replacements or {}) do
if not (new_pictures[direction].filename == '__core__/graphics/empty.png') then
new_pictures[direction].filename = image.filename
new_pictures[direction].width = image.width
new_pictures[direction].height = image.height
new_pictures[direction].priority = image.priority or new_pictures[direction].priority
end
end
return new_pictures
end
--return pipe covers for true directions.
function Pipes.covers(n, s, w, e)
if (n == nil and s == nil and w == nil and e == nil) then
n, s, e, w = true, true, true, true
end
n =
n and
{
layers = {
{
filename = '__base__/graphics/entity/pipe-covers/pipe-cover-north.png',
priority = 'extra-high',
width = 64,
height = 64,
hr_version = {
filename = '__base__/graphics/entity/pipe-covers/hr-pipe-cover-north.png',
priority = 'extra-high',
width = 128,
height = 128,
scale = 0.5
}
},
{
filename = '__base__/graphics/entity/pipe-covers/pipe-cover-north-shadow.png',
priority = 'extra-high',
width = 64,
height = 64,
draw_as_shadow = true,
hr_version = {
filename = '__base__/graphics/entity/pipe-covers/hr-pipe-cover-north-shadow.png',
priority = 'extra-high',
width = 128,
height = 128,
scale = 0.5,
draw_as_shadow = true
}
}
}
} or
Sprites.empty_picture()
e =
e and
{
layers = {
{
filename = '__base__/graphics/entity/pipe-covers/pipe-cover-east.png',
priority = 'extra-high',
width = 64,
height = 64,
hr_version = {
filename = '__base__/graphics/entity/pipe-covers/hr-pipe-cover-east.png',
priority = 'extra-high',
width = 128,
height = 128,
scale = 0.5
}
},
{
filename = '__base__/graphics/entity/pipe-covers/pipe-cover-east-shadow.png',
priority = 'extra-high',
width = 64,
height = 64,
draw_as_shadow = true,
hr_version = {
filename = '__base__/graphics/entity/pipe-covers/hr-pipe-cover-east-shadow.png',
priority = 'extra-high',
width = 128,
height = 128,
scale = 0.5,
draw_as_shadow = true
}
}
}
} or
Sprites.empty_picture()
s =
s and
{
layers = {
{
filename = '__base__/graphics/entity/pipe-covers/pipe-cover-south.png',
priority = 'extra-high',
width = 64,
height = 64,
hr_version = {
filename = '__base__/graphics/entity/pipe-covers/hr-pipe-cover-south.png',
priority = 'extra-high',
width = 128,
height = 128,
scale = 0.5
}
},
{
filename = '__base__/graphics/entity/pipe-covers/pipe-cover-south-shadow.png',
priority = 'extra-high',
width = 64,
height = 64,
draw_as_shadow = true,
hr_version = {
filename = '__base__/graphics/entity/pipe-covers/hr-pipe-cover-south-shadow.png',
priority = 'extra-high',
width = 128,
height = 128,
scale = 0.5,
draw_as_shadow = true
}
}
}
} or
Sprites.empty_picture()
w =
w and
{
layers = {
{
filename = '__base__/graphics/entity/pipe-covers/pipe-cover-west.png',
priority = 'extra-high',
width = 64,
height = 64,
hr_version = {
filename = '__base__/graphics/entity/pipe-covers/hr-pipe-cover-west.png',
priority = 'extra-high',
width = 128,
height = 128,
scale = 0.5
}
},
{
filename = '__base__/graphics/entity/pipe-covers/pipe-cover-west-shadow.png',
priority = 'extra-high',
width = 64,
height = 64,
draw_as_shadow = true,
hr_version = {
filename = '__base__/graphics/entity/pipe-covers/hr-pipe-cover-west-shadow.png',
priority = 'extra-high',
width = 128,
height = 128,
scale = 0.5,
draw_as_shadow = true
}
}
}
} or
Sprites.empty_picture()
return { north = n, south = s, east = e, west = w }
end
return Pipes

View File

@@ -0,0 +1,56 @@
type, name
localised_name[opt]
localised_description[opt]
subgroup, order (needed when no main product)
recipe
category
icon/icons[opt] (or has main_product)
crafting_machine_tint = {
primary, secondary, tertiary
}
normal/expensive = {
ingredients
results, result, result_count[opt=1] (result ignored if results present) at least 1 result
main_product
energy_required > 0.001
emissions_multiplier
requester_paste_multiplier
overload_multiplier
enabled <boolean>
hidden <boolean>
hide_from_stats <boolean>
allow_decomposition <boolean>
allow_as_intermediate <boolean>
allow_intermediates <boolean>
always_show_made_in <boolean>
show_amount_in_title <boolean>
always_show_products <boolean>
}
Ingredients
{"name", amount} -- Assumes a type of "item"
{
type :: string: "item" or "fluid".
name :: string: Prototype name of the required item or fluid.
amount :: uint: Amount of the item or fluid.
minimum_temperature :: uint (optional): The minimum fluid temperature required. Has no effect if type is '"item"'.
maximum_temperature :: uint (optional): The maximum fluid temperature allowed. Has no effect if type is '"item"'.
}
Results
{
type :: string: "item" or "fluid".
name :: string: Prototype name of the result.
amount :: float (optional): If not specified, amount_min, amount_max and probability must all be specified.
temperature :: uint (optional): The fluid temperature of this product. Has no effect if type is '"item"'.
amount_min :: uint (optional):
amount_max :: uint (optional):
probability :: double (optional): A value in range [0, 1].
}
{
"name", amount -- assumes a type of item
}
result -- assumes type of item
result_count[opt = 1]

View File

@@ -0,0 +1,83 @@
--- Sprites
-- @module Data.Sprites
local Sprites = {}
function Sprites.extract_monolith(filename, x, y, w, h)
return {
type = 'monolith',
top_monolith_border = 0,
right_monolith_border = 0,
bottom_monolith_border = 0,
left_monolith_border = 0,
monolith_image = {
filename = filename,
priority = 'extra-high-no-scale',
width = w,
height = h,
x = x,
y = y
}
}
end
--- Quick to use empty picture.
-- @treturn table an empty pictures table
function Sprites.empty_picture()
return {
filename = '__core__/graphics/empty.png',
priority = 'extra-high',
width = 1,
height = 1
}
end
Sprites.empty_sprite = Sprites.empty_picture
--- Quick to use empty pictures.
-- @treturn table an empty pictures table
function Sprites.empty_pictures()
local empty = Sprites.empty_picture()
return {
filename = empty.filename,
width = empty.width,
height = empty.height,
line_length = 1,
frame_count = 1,
shift = { 0, 0 },
animation_speed = 1,
direction_count = 1
}
end
Sprites.empty_animation = Sprites.empty_pictures
--- Quick to use empty animation.
-- @treturn table an empty animations table
function Sprites.empty_animations()
return {
Sprites.empty_pictures()
}
end
--- Quick to use empty connections table.
-- @tparam int count how many connection points are needed
-- @treturn table an empty pictures table
function Sprites.empty_connection_points(count)
local points = {}
for i = 1, count or 1, 1 do
points[i] = {
shadow = {
copper = { 0, 0 },
green = { 0, 0 },
red = { 0, 0 }
},
wire = {
copper = { 0, 0 },
green = { 0, 0 },
red = { 0, 0 }
}
}
end
return points
end
return Sprites

View File

@@ -0,0 +1,73 @@
--- Data Utilities
-- @module Data.Util
local Util = {
__class = 'Util',
__index = require('__stdlib__/stdlib/core')
}
setmetatable(Util, Util)
local Is = require('__stdlib__/stdlib/utils/is')
local table = require('__stdlib__/stdlib/utils/table')
function Util.extend(proto_array)
Is.Assert.Table(proto_array, 'Missing table or array to extend')
data:extend(#proto_array > 0 and proto_array or { proto_array })
end
function Util.disable_control(control)
if data.raw['custom-input'] and data.raw['custom-input'][control] then
data.raw['custom-input'][control].enabled = false
end
end
function Util.extend_style(style)
data.raw['gui-style'].default[style.name] = style
end
function Util.extend_style_by_name(name, style)
data.raw['gui-style'].default[name] = style
end
--- Quickly duplicate an existing prototype into a new one.
-- @tparam string data_type The type of the object to duplicate
-- @tparam string orig_name The name of the object to duplicate
-- @tparam string new_name The new name to use.
-- @tparam[opt] string|boolean mining_result If true set mining_result to new_name, if truthy set mining_result to value
function Util.duplicate(data_type, orig_name, new_name, mining_result)
mining_result = type(mining_result) == 'boolean' and new_name or mining_result
if data.raw[data_type] and data.raw[data_type][orig_name] then
local proto = table.deep_copy(data.raw[data_type][orig_name])
proto.name = new_name
if mining_result then
if proto.minable and proto.minable.result then
proto.minable.result = mining_result
end
end
if proto.place_result then
proto.place_result = new_name
end
if proto.result then
proto.result = new_name
end
return (proto)
else
error('Unknown Prototype ' .. data_type .. '/' .. orig_name)
end
end
-- load the data portion of stdlib into globals, by default it loads everything into an ALLCAPS name.
-- Alternatively you can pass a dictionary of `[global names] -> [require path]`.
-- @tparam[opt] table files
-- @treturn Data
-- @usage
-- require('__stdlib__/stdlib/data/data).util.create_data_globals()
function Util.create_data_globals(files)
_ENV.STDLIB.create_stdlib_data_globals(files)
end
return Util