1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-02-21 19:20:07 +02:00

Merge pull request #1440 from RedRafe/updates/cs

Updates normal cs to 2.0
This commit is contained in:
grilledham 2024-11-09 20:42:00 +00:00 committed by GitHub
commit 87957e2bbe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
79 changed files with 221 additions and 223 deletions

View File

@ -500,7 +500,7 @@ handler = function(event)
tick = tick
}
debug_print('Waypoint_index ' .. waypoint_index .. ' (waypoint #' .. waypoint_index + 1 .. ') callback in ' .. ticks .. ' ticks')
debug_print('Waypoint_index ' .. waypoint_index .. ' (waypoint #' .. (waypoint_index + 1) .. ') callback in ' .. ticks .. ' ticks')
set_timeout_in_ticks(ticks, callback_function, {func = running_cutscene.func, player_index = player_index, waypoint_index = waypoint_index - 1, params = params})
end
@ -590,7 +590,7 @@ Gui.on_click(
forward_btn_name,
function(event)
local player_index = event.player_index
if Public.goTo(event.player_index, running_cutscenes[player_index].current_index + 1) == false then
if Public.goTo(player_index, running_cutscenes[player_index].current_index + 1) == false then
game.get_player(player_index).print("Cutscene: You're already at the end")
end
end

View File

@ -6,7 +6,6 @@ local register_on_object_destroyed = script.register_on_object_destroyed
local Public = {}
local turrets_map = {}
local register_map = {}
local primitives = { index = nil }
local Artillery = {
enabled = true,
@ -47,13 +46,11 @@ local Artillery = {
Global.register(
{
turrets_map = turrets_map,
register_map = register_map,
primitives = primitives,
artillery = Artillery,
},
function(tbl)
turrets_map = tbl.turrets_map
register_map = tbl.register_map
primitives = tbl.primitives
Artillery = tbl.artillery
end)
@ -87,7 +84,7 @@ function Public.register(entity, refill_name)
return
end
local destroy_id = register_on_object_destroyed(entity)
register_on_object_destroyed(entity)
local unit_id = entity.unit_number
local data = {
@ -95,7 +92,6 @@ function Public.register(entity, refill_name)
refill = refill_name,
is_fluid = is_fluid,
is_artillery = is_artillery,
destroy_id = destroy_id
}
if data.is_artillery then
@ -113,25 +109,20 @@ function Public.register(entity, refill_name)
}
end
register_map[destroy_id] = unit_id
turrets_map[unit_id] = data
end
function Public.remove(entity)
local unit_id = entity.unit_number
local destroy_id = turrets_map[unit_id].destroy_id
register_map[destroy_id] = nil
turrets_map[unit_id] = nil
if not entity.unit_number then
return
end
turrets_map[entity.unit_number] = nil
end
function Public.reset()
for k, _ in pairs(turrets_map) do
turrets_map[k] = nil
end
for k, _ in pairs(register_map) do
register_map[k] = nil
end
end
local artillery_projectile_token = Token.register(function(data)
@ -194,11 +185,10 @@ local function simulate_automatic_artillery(data)
end
local function on_object_destroyed(event)
local destroy_id = event.registration_number
local unit_id = event.unit_number
register_map[destroy_id] = nil
turrets_map[unit_id] = nil
if not event.useful_id then
return
end
turrets_map[event.useful_id] = nil
end
Event.add(defines.events.on_object_destroyed, on_object_destroyed)

View File

@ -41,11 +41,11 @@ if storage.config.market.enabled then
{price = 5, name = 'construction-robot'},
{price = 15, name = 'logistic-robot'},
{price = 50, name = 'roboport'},
{price = 5, name = 'logistic-chest-passive-provider'},
{price = 5, name = 'logistic-chest-active-provider'},
{price = 5, name = 'logistic-chest-buffer'},
{price = 5, name = 'logistic-chest-requester'},
{price = 5, name = 'logistic-chest-storage'},
{price = 5, name = 'passive-provider-chest'},
{price = 5, name = 'active-provider-chest'},
{price = 5, name = 'buffer-chest'},
{price = 5, name = 'requester-chest'},
{price = 5, name = 'storage-chest'},
}
local market_items = require 'resources.market_items'
@ -121,8 +121,8 @@ Command.add('lazy-bastard-bootstrap', {
local templates = {
{name = 'medium-electric-pole', force = force, position = {x = pos.x - 2, y = pos.y - 1}},
{name = 'roboport', force = force, position = {x = pos.x, y = pos.y}},
{name = 'logistic-chest-storage', force = force, position = {x = pos.x + 1, y = pos.y + 1}},
{name = 'logistic-chest-storage', force = force, position = {x = pos.x - 2, y = pos.y + 1}},
{name = 'storage-chest', force = force, position = {x = pos.x + 1, y = pos.y + 1}},
{name = 'storage-chest', force = force, position = {x = pos.x - 2, y = pos.y + 1}},
}
for i = 1, #templates do

View File

@ -90,7 +90,7 @@ local function is_allowed_deconstruction_planner(cursor_stack)
end
local filters = cursor_stack.entity_filters
if #filters ~= 1 or filters[1] ~= 'sand-rock-big' then
if #filters ~= 1 or filters[1] ~= 'big-rock' then
return false
end

View File

@ -77,9 +77,9 @@ local item_worths = {
['destroyer-capsule'] = 256,
['discharge-defense-equipment'] = 2048,
['distractor-capsule'] = 128,
['effectivity-module-2'] = 512,
['effectivity-module-3'] = 2048,
['effectivity-module'] = 128,
['efficiency-module-2'] = 512,
['efficiency-module-3'] = 2048,
['efficiency-module'] = 128,
['electric-engine-unit'] = 64,
['electric-furnace'] = 256,
['electric-mining-drill'] = 32,
@ -128,11 +128,11 @@ local item_worths = {
['light-armor'] = 32,
['light-oil-barrel'] = 16,
['locomotive'] = 512,
['logistic-chest-active-provider'] = 256,
['logistic-chest-buffer'] = 512,
['logistic-chest-passive-provider'] = 256,
['logistic-chest-requester'] = 512,
['logistic-chest-storage'] = 256,
['active-provider-chest'] = 256,
['buffer-chest'] = 512,
['passive-provider-chest'] = 256,
['requester-chest'] = 512,
['storage-chest'] = 256,
['logistic-robot'] = 256,
['logistic-science-pack'] = 16,
['long-handed-inserter'] = 16,
@ -195,7 +195,7 @@ local item_worths = {
['speed-module-3'] = 2048,
['speed-module'] = 128,
['splitter'] = 16,
['stack-inserter'] = 128,
['bulk-inserter'] = 128,
['steam-engine'] = 32,
['steam-turbine'] = 256,
['steel-chest'] = 64,

View File

@ -38,7 +38,7 @@ end)
-- If placed from a bp and the bp has restrictions on the chest, it takes priority.
local restrict_chest = Token.register(function(event)
local entity = event.entity
if entity and entity.valid and (entity.name == 'logistic-chest-passive-provider' or entity.type == 'container') then
if entity and entity.valid and (entity.name == 'passive-provider-chest' or entity.type == 'container') then
local chest_inventory = entity.get_inventory(defines.inventory.chest)
if #chest_inventory + 1 == chest_inventory.getbar() then
chest_inventory.setbar(2)

View File

@ -26,7 +26,7 @@ local function is_targetting_deconstruction_planner(cursor_stack)
end
local filters = cursor_stack.entity_filters
if #filters ~= 1 or filters[1] ~= 'sand-rock-big' then
if #filters ~= 1 or filters[1] ~= 'big-rock' then
return false
end

View File

@ -365,7 +365,7 @@ water = b.change_tile(water, true, 'water')
water = b.any {b.rectangle(16, 4), b.rectangle(4, 16), water}
local start = b.if_else(water, b.full_shape)
start = b.change_map_gen_collision_tile(start, 'water-tile', 'grass-1')
start = b.change_map_gen_collision_tile(start, 'water_tile', 'grass-1')
local map = b.choose(ore_circle, start, b.full_shape)

View File

@ -50,7 +50,7 @@ local function build_map()
wave_islands = b.rotate(wave_islands, degrees(45))
local map = b.change_map_gen_collision_tile(wave_islands, 'water-tile', 'grass-1')
local map = b.change_map_gen_collision_tile(wave_islands, 'water_tile', 'grass-1')
map = b.scale(map, 2)
pig = b.scale(pig, 64 / 320)

View File

@ -133,12 +133,12 @@ local entity_tiers = {
['electric-furnace'] = 3,
['substation'] = 3,
['laser-turret'] = 3,
['stack-inserter'] = 3,
['logistic-chest-active-provider'] = 3,
['logistic-chest-passive-provider'] = 3,
['logistic-chest-buffer'] = 3,
['logistic-chest-storage'] = 3,
['logistic-chest-requester'] = 3
['bulk-inserter'] = 3,
['active-provider-chest'] = 3,
['passive-provider-chest'] = 3,
['buffer-chest'] = 3,
['storage-chest'] = 3,
['requester-chest'] = 3
}
--Creates rich text icons of the tiered entities

View File

@ -302,7 +302,7 @@ local map = b.if_else(shape_islands, shape2_islands)
map = b.choose(mediumn_dot, start, map)
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
map = b.fish(map, 0.0025)

View File

@ -653,7 +653,7 @@ function Public.control(config)
cursor_stack.label = 'Poison strike targetting remote'
cursor_stack.preview_icons = {{index = 1, signal = {type = 'item', name = 'poison-capsule'}}}
cursor_stack.tile_selection_mode = defines.deconstruction_item.tile_selection_mode.never
cursor_stack.entity_filters = {'sand-rock-big'}
cursor_stack.entity_filters = {'big-rock'}
end
end
@ -712,7 +712,7 @@ function Public.control(config)
cursor_stack.label = 'Barrage targetting remote'
cursor_stack.preview_icons = {{index = 1, signal = {type = 'item', name = 'explosive-rocket'}}}
cursor_stack.tile_selection_mode = defines.deconstruction_item.tile_selection_mode.never
cursor_stack.entity_filters = {'sand-rock-big'}
cursor_stack.entity_filters = {'big-rock'}
end
end
if item.type == 'spidertron' and item.name=='spidertron_planner' then
@ -723,7 +723,7 @@ function Public.control(config)
cursor_stack.label = "Select a group of spidertrons that belong to you! 0 selected."
cursor_stack.preview_icons = {{index = 1, signal = {type = 'item', name = 'spidertron'}}}
cursor_stack.tile_selection_mode = defines.deconstruction_item.tile_selection_mode.never
cursor_stack.entity_filters = {'sand-rock-big'}
cursor_stack.entity_filters = {'big-rock'}
end
end)

View File

@ -245,7 +245,7 @@ local function do_pole(entity)
return
end
local supply_area_distance = entity.prototype.supply_area_distance
local supply_area_distance = entity.prototype.get_supply_area_distance(entity.quality)
if not supply_area_distance then
return
end

View File

@ -1,7 +1,11 @@
-- This module allows to auto target enemy structures with a deconstruction planner in hand.
-- To correctly set it up, the planner has to be in player's inventory (not just a shortcut from player's blueprints)
-- Deconstruction planner has to be set to deconstruct only "Big Rock", and must have either exp. rockets or poison capsules as 1st icon in preview
-- The decons planner are available for free at the spawn market
local Event = require 'utils.event'
local Commands = require 'map_gen.maps.crash_site.commands'
local function is_targetting_deconstruction_planner(cursor_stack)
local function is_targeting_deconstruction_planner(cursor_stack)
if not cursor_stack or not cursor_stack.valid or not cursor_stack.valid_for_read then
return false
end
@ -15,22 +19,22 @@ local function is_targetting_deconstruction_planner(cursor_stack)
end
local filters = cursor_stack.entity_filters
if #filters ~= 1 or filters[1] ~= 'sand-rock-big' then
if #filters ~= 1 or filters[1].name ~= 'big-rock' then
return false
end
return true
end
Event.add(defines.events. on_player_deconstructed_area , function(event)
Event.add(defines.events.on_player_deconstructed_area, function(event)
local player = game.get_player(event.player_index)
local cursor_stack = player.cursor_stack
if not player or not player.valid then
return
end
-- check they actually have a decon planner in their cursor that is setup to be a targetting deconstruction planner.
if not is_targetting_deconstruction_planner(cursor_stack) then
-- check they actually have a decon planner in their cursor that is setup to be a targeting deconstruction planner.
if not is_targeting_deconstruction_planner(cursor_stack) then
return
end
@ -42,15 +46,14 @@ Event.add(defines.events. on_player_deconstructed_area , function(event)
local icon_name = player.cursor_stack.preview_icons[1].signal.name
local left_top = event.area.left_top
local right_bottom = event.area.right_bottom
-- only continue if they do a small click. We don't want them selecting a huge area
if (math.abs(left_top.x - right_bottom.x) < 1) and (math.abs(left_top.y - right_bottom.y) < 1) then
local args = {}
args.location = "[gps="..math.floor(left_top.x)..","..math.floor(left_top.y)..","..player.surface.name.."]"
if icon_name == "poison-capsule" then
Commands.call_strike(args,player)
Commands.call_strike(args, player)
elseif icon_name == "explosive-rocket" then
Commands.call_barrage(args,player)
Commands.call_barrage(args, player)
end
end
end)

View File

@ -23,12 +23,15 @@ local function register_tank(entity)
if entity.name ~= 'tank' then
return
end
tank_entities[entity.unit_number] = entity
script.register_on_object_destroyed(entity)
tank_entities[entity.unit_number] = entity
end
Event.add(defines.events.on_object_destroyed, function(event)
tank_entities[event.unit_number] = nil
if not event.useful_id then
return
end
tank_entities[event.useful_id] = nil
end)
Event.add(defines.events.on_robot_built_entity, function(event)

View File

@ -9,7 +9,10 @@ Global.register({car_entities = car_entities}, function(tbl)
end)
Event.add(defines.events.on_object_destroyed, function(event)
car_entities[event.unit_number] = nil
if not event.useful_id then
return
end
car_entities[event.useful_id] = nil
end)
Event.add(defines.events.on_player_driving_changed_state, function(event)
@ -25,8 +28,8 @@ Event.add(defines.events.on_player_driving_changed_state, function(event)
if player ~= driver.player then -- if the player that got in the vehicle is not the driver then return
return
else
car_entities[entity.unit_number] = entity
script.register_on_object_destroyed(entity)
car_entities[entity.unit_number] = entity
end
end
end)

View File

@ -758,7 +758,7 @@ local function to_shape(blocks, part_size, on_init)
return tile
end
return b.change_map_gen_collision_hidden_tile(shape, 'water-tile', 'grass-1')
return b.change_map_gen_collision_hidden_tile(shape, 'water_tile', 'grass-1')
end
Public.to_shape = to_shape
@ -872,9 +872,9 @@ function Public.make_4_way(data)
local dir = entity.direction or 0
set_entity(north, i, entity)
set_entity(east, i2, change_direction(entity, (dir + 2) % 8))
set_entity(south, i3, change_direction(entity, (dir + 4) % 8))
set_entity(west, i4, change_direction(entity, (dir + 6) % 8))
set_entity(east, i2, change_direction(entity, (dir + 4) % 16))
set_entity(south, i3, change_direction(entity, (dir + 8) % 16))
set_entity(west, i4, change_direction(entity, (dir + 12) % 16))
end
end
end
@ -1670,7 +1670,7 @@ local function turret_died(event)
turret_to_outpost[registration_number] = nil
local number = event.unit_number
local number = event.useful_id
if not number then
return
end

View File

@ -12,7 +12,7 @@ return ob.make_1_way {
[8] = {entity = {name = 'artillery-turret', callback = 'turret'}, tile = 'refined-concrete'},
[9] = {tile = 'refined-concrete'},
[10] = {tile = 'refined-concrete'},
[11] = {entity = {name = 'artillery-turret', callback = 'turret', direction = 2}, tile = 'refined-concrete'},
[11] = {entity = {name = 'artillery-turret', callback = 'turret', direction = 4}, tile = 'refined-concrete'},
[12] = {tile = 'refined-concrete'},
[13] = {tile = 'refined-concrete'},
[14] = {tile = 'refined-concrete'},
@ -27,10 +27,10 @@ return ob.make_1_way {
[23] = {tile = 'refined-concrete'},
[24] = {tile = 'refined-concrete'},
[25] = {tile = 'refined-concrete'},
[26] = {entity = {name = 'artillery-turret', callback = 'turret', direction = 6}, tile = 'refined-concrete'},
[26] = {entity = {name = 'artillery-turret', callback = 'turret', direction = 12}, tile = 'refined-concrete'},
[27] = {tile = 'refined-concrete'},
[28] = {tile = 'refined-concrete'},
[29] = {entity = {name = 'artillery-turret', callback = 'turret', direction = 4}, tile = 'refined-concrete'},
[29] = {entity = {name = 'artillery-turret', callback = 'turret', direction = 8}, tile = 'refined-concrete'},
[30] = {tile = 'refined-concrete'},
[31] = {tile = 'refined-concrete'},
[32] = {tile = 'refined-concrete'},

View File

@ -59,7 +59,7 @@ local level3 =
[12] = {tile = 'refined-concrete'},
[13] = {tile = 'refined-concrete'},
[14] = {tile = 'refined-concrete'},
[15] = {entity = {name = 'oil-refinery', direction = 4, callback = 'factory'}, tile = 'refined-concrete'},
[15] = {entity = {name = 'oil-refinery', direction = 8, callback = 'factory'}, tile = 'refined-concrete'},
[16] = {tile = 'refined-concrete'},
[17] = {tile = 'refined-concrete'},
[18] = {tile = 'refined-concrete'},

View File

@ -87,7 +87,7 @@ return ob.make_walls{
[25] = {entity = {name = 'stone-wall'}},
[26] = {tile = 'refined-hazard-concrete-left'},
[27] = {
entity = {name = 'flamethrower-turret', callback = 'flame_turret', direction = 6, offset = 2},
entity = {name = 'flamethrower-turret', callback = 'flame_turret', direction = 12, offset = 2},
tile = 'refined-hazard-concrete-left'
},
[28] = {tile = 'refined-hazard-concrete-left'},
@ -114,7 +114,7 @@ return ob.make_walls{
[9] = {tile = 'refined-hazard-concrete-left'},
[10] = {tile = 'refined-hazard-concrete-left'},
[11] = {
entity = {name = 'flamethrower-turret', callback = 'flame_turret', direction = 6, offset = 2},
entity = {name = 'flamethrower-turret', callback = 'flame_turret', direction = 12, offset = 2},
tile = 'refined-hazard-concrete-left'
},
[12] = {tile = 'refined-hazard-concrete-left'},

View File

@ -78,7 +78,7 @@ return ob.make_walls{
},
[16] = {tile = 'refined-hazard-concrete-left'},
[17] = {
entity = {name = 'laser-turret', callback = 'turret', direction = 2, offset = 3},
entity = {name = 'laser-turret', callback = 'turret', direction = 4, offset = 3},
tile = 'refined-hazard-concrete-left'
},
[18] = {tile = 'refined-hazard-concrete-left'},
@ -91,7 +91,7 @@ return ob.make_walls{
[25] = {entity = {name = 'stone-wall'}},
[26] = {entity = {name = 'stone-wall'}},
[27] = {
entity = {name = 'laser-turret', callback = 'turret', direction = 2, offset = 3},
entity = {name = 'laser-turret', callback = 'turret', direction = 4, offset = 3},
tile = 'refined-hazard-concrete-left'
},
[28] = {tile = 'refined-hazard-concrete-left'},
@ -109,12 +109,12 @@ return ob.make_walls{
[1] = {entity = {name = 'stone-wall'}},
[2] = {entity = {name = 'stone-wall'}},
[3] = {
entity = {name = 'laser-turret', callback = 'turret', direction = 2, offset = 3},
entity = {name = 'laser-turret', callback = 'turret', direction = 4, offset = 3},
tile = 'refined-hazard-concrete-left'
},
[4] = {tile = 'refined-hazard-concrete-left'},
[5] = {
entity = {name = 'laser-turret', callback = 'turret', direction = 2, offset = 3},
entity = {name = 'laser-turret', callback = 'turret', direction = 4, offset = 3},
tile = 'refined-hazard-concrete-left'
},
[6] = {tile = 'refined-hazard-concrete-left'},
@ -125,17 +125,17 @@ return ob.make_walls{
[11] = {tile = 'refined-hazard-concrete-left'},
[12] = {tile = 'refined-hazard-concrete-left'},
[13] = {
entity = {name = 'laser-turret', callback = 'turret', direction = 2, offset = 3},
entity = {name = 'laser-turret', callback = 'turret', direction = 4, offset = 3},
tile = 'refined-hazard-concrete-left'
},
[14] = {tile = 'refined-hazard-concrete-left'},
[15] = {
entity = {name = 'laser-turret', callback = 'turret', direction = 2, offset = 3},
entity = {name = 'laser-turret', callback = 'turret', direction = 4, offset = 3},
tile = 'refined-hazard-concrete-left'
},
[16] = {tile = 'refined-hazard-concrete-left'},
[17] = {
entity = {name = 'laser-turret', callback = 'turret', direction = 2, offset = 3},
entity = {name = 'laser-turret', callback = 'turret', direction = 4, offset = 3},
tile = 'refined-hazard-concrete-left'
},
[18] = {tile = 'refined-hazard-concrete-left'},
@ -146,12 +146,12 @@ return ob.make_walls{
[23] = {tile = 'refined-hazard-concrete-left'},
[24] = {tile = 'refined-hazard-concrete-left'},
[25] = {
entity = {name = 'laser-turret', callback = 'turret', direction = 2, offset = 3},
entity = {name = 'laser-turret', callback = 'turret', direction = 4, offset = 3},
tile = 'refined-hazard-concrete-left'
},
[26] = {tile = 'refined-hazard-concrete-left'},
[27] = {
entity = {name = 'laser-turret', callback = 'turret', direction = 2, offset = 3},
entity = {name = 'laser-turret', callback = 'turret', direction = 4, offset = 3},
tile = 'refined-hazard-concrete-left'
},
[28] = {tile = 'refined-hazard-concrete-left'},

View File

@ -75,7 +75,7 @@ return ob.make_walls{
[25] = {entity = {name = 'stone-wall'}},
[26] = {tile = 'hazard-concrete-left'},
[27] = {
entity = {name = 'flamethrower-turret', callback = 'flame_turret', direction = 6, offset = 2},
entity = {name = 'flamethrower-turret', callback = 'flame_turret', direction = 12, offset = 2},
tile = 'hazard-concrete-left'
},
[28] = {tile = 'hazard-concrete-left'},
@ -102,7 +102,7 @@ return ob.make_walls{
[9] = {tile = 'hazard-concrete-left'},
[10] = {tile = 'concrete'},
[11] = {
entity = {name = 'flamethrower-turret', callback = 'flame_turret', direction = 6, offset = 2},
entity = {name = 'flamethrower-turret', callback = 'flame_turret', direction = 12, offset = 2},
tile = 'concrete'
},
[12] = {tile = 'concrete'},

View File

@ -59,7 +59,7 @@ local level3 =
[12] = {tile = 'concrete'},
[13] = {tile = 'refined-concrete'},
[14] = {tile = 'refined-concrete'},
[15] = {entity = {name = 'oil-refinery', direction = 4, callback = 'factory'}, tile = 'refined-concrete'},
[15] = {entity = {name = 'oil-refinery', direction = 8, callback = 'factory'}, tile = 'refined-concrete'},
[16] = {tile = 'refined-concrete'},
[17] = {tile = 'refined-concrete'},
[18] = {tile = 'concrete'},

View File

@ -4,7 +4,7 @@ local Token = require 'utils.token'
local loot = {
{weight = 10},
{stack = {name = 'coin', count = 50, distance_factor = 1 / 20}, weight = 5},
{stack = {name = 'effectivity-module', count = 7, distance_factor = 1 / 20}, weight = 5},
{stack = {name = 'efficiency-module', count = 7, distance_factor = 1 / 20}, weight = 5},
{stack = {name = 'speed-module', count = 5, distance_factor = 1 / 20}, weight = 5},
{stack = {name = 'productivity-module', count = 2, distance_factor = 1 / 20}, weight = 5}
}
@ -21,8 +21,8 @@ local loot_callback =
local factory_loot = {
{
stack = {
recipe = 'effectivity-module',
output = {item = 'effectivity-module', min_rate = 0.5 / 15 / 60, distance_factor = 0.5 / 15 / 60 / 512}
recipe = 'efficiency-module',
output = {item = 'efficiency-module', min_rate = 0.5 / 15 / 60, distance_factor = 0.5 / 15 / 60 / 512}
},
weight = 5
},

View File

@ -7,11 +7,11 @@ local loot = {
{stack = {name = 'logistic-robot', count = 50, distance_factor = 1 / 16}, weight = 4},
{stack = {name = 'construction-robot', count = 50, distance_factor = 1 / 16}, weight = 7},
{stack = {name = 'roboport', count = 5, distance_factor = 1 / 64}, weight = 2},
{stack = {name = 'logistic-chest-storage', count = 20, distance_factor = 1 / 48}, weight = 4},
{stack = {name = 'logistic-chest-requester', count = 20, distance_factor = 1 / 48}, weight = 4},
{stack = {name = 'logistic-chest-passive-provider', count = 20, distance_factor = 1 / 48}, weight = 4},
{stack = {name = 'logistic-chest-buffer', count = 20, distance_factor = 1 / 48}, weight = 4},
{stack = {name = 'logistic-chest-active-provider', count = 20, distance_factor = 1 / 48}, weight = 4}
{stack = {name = 'storage-chest', count = 20, distance_factor = 1 / 48}, weight = 4},
{stack = {name = 'requester-chest', count = 20, distance_factor = 1 / 48}, weight = 4},
{stack = {name = 'passive-provider-chest', count = 20, distance_factor = 1 / 48}, weight = 4},
{stack = {name = 'buffer-chest', count = 20, distance_factor = 1 / 48}, weight = 4},
{stack = {name = 'active-provider-chest', count = 20, distance_factor = 1 / 48}, weight = 4}
}
local weights = ob.prepare_weighted_loot(loot)

View File

@ -4,7 +4,7 @@ local Token = require 'utils.token'
local loot = {
{weight = 10},
{stack = {name = 'coin', count = 50, distance_factor = 1 / 20}, weight = 5},
{stack = {name = 'effectivity-module-2', count = 7, distance_factor = 1 / 20}, weight = 5},
{stack = {name = 'efficiency-module-2', count = 7, distance_factor = 1 / 20}, weight = 5},
{stack = {name = 'speed-module-2', count = 5, distance_factor = 1 / 20}, weight = 5},
{stack = {name = 'productivity-module-2', count = 5, distance_factor = 1 / 20}, weight = 5}
}
@ -21,8 +21,8 @@ local loot_callback =
local factory_loot = {
{
stack = {
recipe = 'effectivity-module-2',
output = {item = 'effectivity-module-2', min_rate = 0.5 / 30 / 60, distance_factor = 0.5 / 30 / 60 / 512}
recipe = 'efficiency-module-2',
output = {item = 'efficiency-module-2', min_rate = 0.5 / 30 / 60, distance_factor = 0.5 / 30 / 60 / 512}
},
weight = 5
},

View File

@ -7,7 +7,7 @@ local loot = {
{stack = {name = 'express-transport-belt', count = 100, distance_factor = 1 / 8}, weight = 5},
{stack = {name = 'express-underground-belt', count = 20, distance_factor = 1 / 16}, weight = 5},
{stack = {name = 'express-splitter', count = 10, distance_factor = 1 / 32}, weight = 5},
{stack = {name = 'stack-inserter', count = 50, distance_factor = 1 / 32}, weight = 5},
{stack = {name = 'bulk-inserter', count = 50, distance_factor = 1 / 32}, weight = 5},
{stack = {name = 'assembling-machine-3', count = 25, distance_factor = 1 / 32}, weight = 2}
}
@ -44,8 +44,8 @@ local factory_loot = {
},
{
stack = {
recipe = 'stack-inserter',
output = {item = 'stack-inserter', min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512}
recipe = 'bulk-inserter',
output = {item = 'bulk-inserter', min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512}
},
weight = 5
},

View File

@ -4,7 +4,7 @@ local Token = require 'utils.token'
local loot = {
{weight = 10},
{stack = {name = 'coin', count = 50, distance_factor = 1 / 20}, weight = 5},
{stack = {name = 'effectivity-module-3', count = 4, distance_factor = 1 / 64}, weight = 5},
{stack = {name = 'efficiency-module-3', count = 4, distance_factor = 1 / 64}, weight = 5},
{stack = {name = 'speed-module-3', count = 2, distance_factor = 1 / 64}, weight = 5},
{stack = {name = 'productivity-module-3', count = 2, distance_factor = 1 / 64}, weight = 5}
}
@ -21,8 +21,8 @@ local loot_callback =
local factory_loot = {
{
stack = {
recipe = 'effectivity-module-3',
output = {item = 'effectivity-module-3', min_rate = 0.5 / 60 / 60, distance_factor = 0.5 / 60 / 60 / 512}
recipe = 'efficiency-module-3',
output = {item = 'efficiency-module-3', min_rate = 0.5 / 60 / 60, distance_factor = 0.5 / 60 / 60 / 512}
},
weight = 5
},

View File

@ -59,7 +59,7 @@ local level3 =
[12] = {tile = 'stone-path'},
[13] = {tile = 'concrete'},
[14] = {tile = 'concrete'},
[15] = {entity = {name = 'oil-refinery', direction = 4, callback = 'factory'}, tile = 'concrete'},
[15] = {entity = {name = 'oil-refinery', direction = 8, callback = 'factory'}, tile = 'concrete'},
[16] = {tile = 'concrete'},
[17] = {tile = 'concrete'},
[18] = {tile = 'stone-path'},

View File

@ -50,8 +50,8 @@ Event.add(defines.events.on_research_finished,
return
end
game.forces.player.recipes['roboport'].enabled = false
game.forces.player.recipes['logistic-chest-passive-provider'].enabled = false
game.forces.player.recipes['logistic-chest-storage'].enabled = false
game.forces.player.recipes['passive-provider-chest'].enabled = false
game.forces.player.recipes['storage-chest'].enabled = false
end
)

View File

@ -215,6 +215,9 @@ local function init(config)
game.surfaces.cutscene.always_day = true
game.surfaces.cutscene.request_to_generate_chunks({0, 0}, 2)
game.surfaces.cutscene.force_generate_chunk_requests()
for _, f in pairs(game.forces) do
f.set_surface_hidden('cutscene', true)
end
cutscene_outpost()
Cutscene.on_init()
else
@ -429,7 +432,7 @@ local function init(config)
local start_outpost = outpost_builder:do_outpost(thin_walls, on_init)
start_outpost = b.change_tile(start_outpost, false, true)
start_outpost = b.change_map_gen_collision_tile(start_outpost, 'water-tile', 'grass-1')
start_outpost = b.change_map_gen_collision_tile(start_outpost, 'water_tile', 'grass-1')
local start_patch = b.circle(9)
local start_iron_patch =
@ -927,24 +930,24 @@ local function init(config)
[1] = {
market = market,
chest = chest,
[4] = {entity = {name = 'logistic-chest-requester', force = 'player', callback = 'chest'}},
[4] = {entity = {name = 'requester-chest', force = 'player', callback = 'chest'}},
[29] = {entity = {name = 'market', force = 'neutral', callback = 'market'}},
[32] = {entity = {name = 'logistic-chest-requester', force = 'player', callback = 'chest'}}
[32] = {entity = {name = 'requester-chest', force = 'player', callback = 'chest'}}
},
[2] = {
force = 'player',
factory = factory,
inserter = inserter,
chest = chest,
[4] = {entity = {name = 'logistic-chest-requester', force = 'player', callback = 'chest'}},
[25] = {entity = {name = 'burner-inserter', direction = 2, callback = 'inserter'}},
[4] = {entity = {name = 'requester-chest', force = 'player', callback = 'chest'}},
[25] = {entity = {name = 'burner-inserter', direction = 4, callback = 'inserter'}},
[27] = {entity = {name = 'electric-furnace', callback = 'factory'}},
}
}
local spawn_shape = outpost_builder.to_shape(spawn, 8, on_init)
spawn_shape = b.change_tile(spawn_shape, false, 'stone-path')
spawn_shape = b.change_map_gen_collision_hidden_tile(spawn_shape, 'water-tile', 'grass-1')
spawn_shape = b.change_map_gen_collision_hidden_tile(spawn_shape, 'water_tile', 'grass-1')
map = b.choose(b.rectangle(16, 16), spawn_shape, map)
@ -968,6 +971,8 @@ Global.register_init(
local surface = game.surfaces[1]
surface.map_gen_settings = {width = 2, height = 2}
surface.clear()
game.forces.player.set_surface_hidden('nauvis', true)
game.forces.player.lock_space_location('nauvis')
local seed = RS.get_surface().map_gen_settings.seed
tbl.outpost_seed = outpost_seed or seed

View File

@ -16,6 +16,6 @@ local pattern =
local map = b.grid_pattern(pattern, 2, 2, pic.width * scale_factor, pic.height * scale_factor)
map = b.translate(map, 128 * scale_factor, 26 * scale_factor)
map = b.change_map_gen_collision_tile(map, "water-tile", "grass-1")
map = b.change_map_gen_collision_tile(map, "water_tile", "grass-1")
return map

View File

@ -17,7 +17,7 @@ pic = b.decompress(pic)
local shape = b.picture(pic)
--map = b.change_map_gen_collision_tile(map, "water-tile", "grass-1")
--map = b.change_map_gen_collision_tile(map, "water_tile", "grass-1")
local pattern = {
{shape, b.flip_x(shape)},

View File

@ -42,7 +42,7 @@ return {
'inserter',
'long-handed-inserter',
'fast-inserter',
'stack-inserter',
'bulk-inserter',
-- Py drills
'aluminium-mine',
'antimonium-drill-mk01',

View File

@ -257,7 +257,7 @@ return function(config)
end
local function process_chest(entity, budget)
if entity.name ~= 'logistic-chest-requester' then
if entity.name ~= 'requester-chest' then
return
end
if not chest_data[entity.unit_number] then
@ -363,7 +363,7 @@ return function(config)
local chests = {}
for _, position in pairs(positions) do
if is_container_position_valid(position) then
local e = surface.create_entity({ name = 'logistic-chest-requester', position = position, force = 'neutral' })
local e = surface.create_entity({ name = 'requester-chest', position = position, force = 'neutral' })
e.destructible = false
e.minable = false
table.insert(chests, e)
@ -381,7 +381,7 @@ return function(config)
end
-- first, remove all adjacent chests & destroy those
local old_chests = surface.find_entities_filtered{name = 'logistic-chest-requester', force = 'neutral', area = {
local old_chests = surface.find_entities_filtered{name = 'requester-chest', force = 'neutral', area = {
left_top = {
x = left_top.x-1,
y = left_top.y-1,
@ -455,7 +455,7 @@ return function(config)
local delay_cost = Token.register(function()
local rs = RS.get_surface()
local chests = rs.find_entities_filtered{name = 'logistic-chest-requester', force = 'neutral'}
local chests = rs.find_entities_filtered{name = 'requester-chest', force = 'neutral'}
for _, chest in pairs(chests) do
if chest_data[chest.unit_number] then
remove_old_renders(chest_data[chest.unit_number])

View File

@ -155,7 +155,7 @@ return function(config)
local main_ores_shape = b.any {raw_spawn_shape, ores_part}
main_ores_shape = b.choose(tree, main_ores_shape, b.empty_shape)
main_ores_shape = b.any {star, baubel_ore, main_ores_shape, sea}
main_ores_shape = b.change_map_gen_collision_tile(main_ores_shape, 'water-tile', 'grass-2')
main_ores_shape = b.change_map_gen_collision_tile(main_ores_shape, 'water_tile', 'grass-2')
return main_ores_shape
end

View File

@ -22,7 +22,7 @@ local function spawn_builder(config)
local start = b.if_else(water, spawn_circle)
start = b.change_tile(start, true, spawn_tile)
return b.change_map_gen_collision_tile(start, 'water-tile', spawn_tile)
return b.change_map_gen_collision_tile(start, 'water_tile', spawn_tile)
end
local function tile_builder_factory(config)

View File

@ -156,7 +156,7 @@ end)
end
local name = effect.recipe
if name == 'logistic-chest-requester' then -- TODO: This doesn't prevent later tier requester chests.
if name == 'requester-chest' then -- TODO: This doesn't prevent later tier requester chests.
game.forces.player.recipes[name].enabled = false
end

View File

@ -30,7 +30,7 @@ ScenarioInfo.add_map_extra_info([[
The map size is restricted by the Hungry Chests. Provide the requested materials to unlock new chunks.
Use the Elder Tree [entity=tree-01], the Infinity Rock [entity=huge-rock], and the Precious Oil patch [entity=crude-oil] located at spawn [gps=0,0.redmew]
to draw more resources when in need, but always favor Danger Ores first if you can.
If you find yourself stuck with the requests, insert a Coin [item=coin] into the Hungry Chest [item=logistic-chest-requester] to reroll the request.
If you find yourself stuck with the requests, insert a Coin [item=coin] into the Hungry Chest [item=requester-chest] to reroll the request.
You can fulfill part of the request & then reroll to change the remaining part (it will always reroll based on its remaining content to be fulfilled).
Unlocking new land may or may not reward you with another Coin.
]])

View File

@ -18,7 +18,7 @@ You may not build the factory on ore patches. Exceptions:
[item=transport-belt] [item=fast-transport-belt] [item=express-transport-belt] [item=underground-belt] [item=fast-underground-belt] [item=express-underground-belt] [item=splitter] [item=fast-splitter] [item=express-splitter]
[item=pipe] [item=pipe-to-ground] [item=small-electric-pole] [item=medium-electric-pole] [item=big-electric-pole] [item=substation]
[item=electric-mining-drill] [item=burner-mining-drill] [item=pumpjack] [item=mo-mine] [item=diamond-mine] [item=regolite-mine] [item=borax-mine] [item=niobium-mine] [item=car] [item=tank] [item=spidertron]
[item=burner-inserter] [item=inserter] [item=long-handed-inserter] [item=fast-inserter] [item=stack-inserter]
[item=burner-inserter] [item=inserter] [item=long-handed-inserter] [item=fast-inserter] [item=bulk-inserter]
[item=rail] [item=rail-chain-signal] [item=train-stop] [item=locomotive] [item=cargo-wagon] [item=fluid-wagon] [item=artillery-wagon]
[item=mk02-locomotive] [item=mk02-wagon] [item=mk02-fluid-wagon] [item=niobium-pipe] [item=niobium-pipe-to-ground] [item=pipe] [item=pipe-to-ground]

View File

@ -76,7 +76,7 @@ local function update_robot_mining_damage()
robot_mining.damage = old_modifier + robot_mining.active_modifier
end
---Triggers a diggy diggy hole for a given sand-rock-big, rock-big or huge-rock.
---Triggers a diggy diggy hole for a given big-rock, rock-big or huge-rock.
---@param entity LuaEntity
local function diggy_hole(entity)
local tiles = {}
@ -117,7 +117,7 @@ local function diggy_hole(entity)
elseif predicted < 0.6 then
rocks[i] = {name = 'rock-big', position = void_position}
else
rocks[i] = {name = 'sand-rock-big', position = void_position}
rocks[i] = {name = 'big-rock', position = void_position}
end
end

View File

@ -206,7 +206,7 @@ local function on_player_mined_entity(event)
local force = game.get_player(player_index).force
local level = get_force_data(force).current_level
local exp = 0
if name == 'sand-rock-big' then
if name == 'big-rock' then
exp = sand_rock_xp + floor(level / 5)
elseif name == 'rock-big' then
exp = rock_big_xp + floor(level / 5)
@ -292,7 +292,7 @@ local function on_entity_died(event)
floating_text_position = cause.position
else
local level = get_force_data(force).current_level
if entity_name == 'sand-rock-big' then
if entity_name == 'big-rock' then
exp = floor((sand_rock_xp + level * 0.2) * 0.5)
elseif entity_name == 'rock-big' then
exp = floor((rock_big_xp + level * 0.2) * 0.5)
@ -612,7 +612,7 @@ function Experience.register(cfg)
Event.on_nth_tick(61, update_gui)
-- Prevents table lookup thousands of times
sand_rock_xp = config.XP['sand-rock-big']
sand_rock_xp = config.XP['big-rock']
rock_big_xp = config.XP['rock-big']
rock_huge_xp = config.XP['huge-rock']
end

View File

@ -92,7 +92,7 @@ local config = {
['market'] = 9,
['nuclear-reactor'] = 4,
['stone-wall'] = 3,
['sand-rock-big'] = 2,
['big-rock'] = 2,
['rock-big'] = 2,
['huge-rock'] = 2.5,
['out-of-map'] = 1,
@ -164,8 +164,8 @@ local config = {
['piercing-rounds-magazine'] = {chance = 0.10, min = 15, max = 35},
['gun-turret'] = {chance = 0.3, min = 1, max = 2},
['beacon'] = {chance = 0.01, min = 1, max = 2},
['effectivity-module'] = {chance = 0.03, min = 1, max = 2},
['effectivity-module-2'] = {chance = 0.01, min = 1, max = 2},
['efficiency-module'] = {chance = 0.03, min = 1, max = 2},
['efficiency-module-2'] = {chance = 0.01, min = 1, max = 2},
['productivity-module'] = {chance = 0.03, min = 1, max = 2},
['productivity-module-2'] = {chance = 0.01, min = 1, max = 2},
['speed-module'] = {chance = 0.03, min = 1, max = 2},
@ -358,7 +358,7 @@ local config = {
-- percentage * mining productivity level gets added to mining speed
mining_speed_productivity_multiplier = 5,
XP = {
['sand-rock-big'] = 5,
['big-rock'] = 5,
['rock-big'] = 5,
['huge-rock'] = 10,
['rocket_launch'] = 0.05, -- XP reward in percentage of total experience when a rocket launches (Diggy default: 0.05 which equals 5%)

View File

@ -92,7 +92,7 @@ local config = {
['market'] = 9,
['nuclear-reactor'] = 4,
['stone-wall'] = 3,
['sand-rock-big'] = 2,
['big-rock'] = 2,
['rock-big'] = 2,
['huge-rock'] = 2.5,
['out-of-map'] = 1,
@ -164,8 +164,8 @@ local config = {
['piercing-rounds-magazine'] = {chance = 0.10, min = 15, max = 35},
['gun-turret'] = {chance = 0.3, min = 1, max = 2},
['beacon'] = {chance = 0.01, min = 1, max = 2},
['effectivity-module'] = {chance = 0.03, min = 1, max = 2},
['effectivity-module-2'] = {chance = 0.01, min = 1, max = 2},
['efficiency-module'] = {chance = 0.03, min = 1, max = 2},
['efficiency-module-2'] = {chance = 0.01, min = 1, max = 2},
['productivity-module'] = {chance = 0.03, min = 1, max = 2},
['productivity-module-2'] = {chance = 0.01, min = 1, max = 2},
['speed-module'] = {chance = 0.03, min = 1, max = 2},
@ -358,7 +358,7 @@ local config = {
-- percentage * mining productivity level gets added to mining speed
mining_speed_productivity_multiplier = 5,
XP = {
['sand-rock-big'] = 5,
['big-rock'] = 5,
['rock-big'] = 5,
['huge-rock'] = 10,
['rocket_launch'] = 0.05, -- XP reward in percentage of total experience when a rocket launches (Diggy default: 0.05 which equals 5%)

View File

@ -92,7 +92,7 @@ local config = {
['market'] = 9,
['nuclear-reactor'] = 4,
['stone-wall'] = 3,
['sand-rock-big'] = 2,
['big-rock'] = 2,
['rock-big'] = 2,
['huge-rock'] = 2.5,
['out-of-map'] = 1,
@ -164,8 +164,8 @@ local config = {
['piercing-rounds-magazine'] = {chance = 0.10, min = 15, max = 35},
['gun-turret'] = {chance = 0.3, min = 1, max = 2},
['beacon'] = {chance = 0.01, min = 1, max = 2},
['effectivity-module'] = {chance = 0.03, min = 1, max = 2},
['effectivity-module-2'] = {chance = 0.01, min = 1, max = 2},
['efficiency-module'] = {chance = 0.03, min = 1, max = 2},
['efficiency-module-2'] = {chance = 0.01, min = 1, max = 2},
['productivity-module'] = {chance = 0.03, min = 1, max = 2},
['productivity-module-2'] = {chance = 0.01, min = 1, max = 2},
['speed-module'] = {chance = 0.03, min = 1, max = 2},
@ -358,7 +358,7 @@ local config = {
-- percentage * mining productivity level gets added to mining speed
mining_speed_productivity_multiplier = 5,
XP = {
['sand-rock-big'] = 5,
['big-rock'] = 5,
['rock-big'] = 5,
['huge-rock'] = 10,
['rocket_launch'] = 0.05, -- XP reward in percentage of total experience when a rocket launches (Diggy default: 0.05 which equals 5%)

View File

@ -182,12 +182,12 @@ function Template.resources(surface, resources)
end
end
Template.diggy_rocks = {'sand-rock-big', 'rock-big', 'huge-rock'}
Template.diggy_rocks = {'big-rock', 'rock-big', 'huge-rock'}
---Returns true if the entity name is that of a diggy rock.
---@param entity_name string
function Template.is_diggy_rock(entity_name)
return entity_name == 'sand-rock-big' or entity_name == 'rock-big' or entity_name == 'huge-rock'
return entity_name == 'big-rock' or entity_name == 'rock-big' or entity_name == 'huge-rock'
end
return Template

View File

@ -34,7 +34,7 @@ RestrictEntities.add_banned(
'inserter',
'long-handed-inserter',
'fast-inserter',
'stack-inserter',
'bulk-inserter',
'electric-mining-drill'
}
)
@ -52,7 +52,7 @@ Event.add(
for _, e in pairs(effects) do
local t = e.type
if t == 'stack-inserter-capacity-bonus' then
if t == 'bulk-inserter-capacity-bonus' then
f.inserter_stack_size_bonus = f.inserter_stack_size_bonus + e.modifier
end
end

View File

@ -90,7 +90,7 @@ for i = 1, count - 1 do
local c = lines_circle
c = b.apply_entity(c, resources[i])
c = b.change_map_gen_collision_tile(c, 'water-tile', 'grass-1')
c = b.change_map_gen_collision_tile(c, 'water_tile', 'grass-1')
c = b.translate(c, x, 0)
table.insert(lines, c)
@ -156,7 +156,7 @@ local start =
start = b.any {start, big_circle}
map = b.choose(big_circle, start, map)
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
map = b.scale(map, 5, 5)

View File

@ -244,7 +244,7 @@ start = b.apply_entity(start, b.any {start_iron, start_copper, start_stone, star
map = b.if_else(start, map)
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
local sea = b.tile('water')
sea = b.fish(sea, 0.0025)

View File

@ -78,12 +78,12 @@ local coal = b.resource(b.circle(6), 'coal', value(600, 0.6))
local uranium = b.resource(b.circle(4), 'uranium-ore', value(400, 1))
local oil = b.resource(b.throttle_world_xy(b.circle(6), 1, 4, 1, 4), 'crude-oil', value(100000, 50))
--[[ local iron_ball = b.change_map_gen_collision_tile(b.apply_entity(ball, iron), 'water-tile', 'grass-1')
local copper_ball = b.change_map_gen_collision_tile(b.apply_entity(ball, copper), 'water-tile', 'grass-1')
local stone_ball = b.change_map_gen_collision_tile(b.apply_entity(ball, stone), 'water-tile', 'grass-1')
local coal_ball = b.change_map_gen_collision_tile(b.apply_entity(ball, coal), 'water-tile', 'grass-1')
local uranium_ball = b.change_map_gen_collision_tile(b.apply_entity(ball, uranium), 'water-tile', 'grass-1')
local oil_ball = b.change_map_gen_collision_tile(b.apply_entity(ball, oil), 'water-tile', 'grass-1') ]]
--[[ local iron_ball = b.change_map_gen_collision_tile(b.apply_entity(ball, iron), 'water_tile', 'grass-1')
local copper_ball = b.change_map_gen_collision_tile(b.apply_entity(ball, copper), 'water_tile', 'grass-1')
local stone_ball = b.change_map_gen_collision_tile(b.apply_entity(ball, stone), 'water_tile', 'grass-1')
local coal_ball = b.change_map_gen_collision_tile(b.apply_entity(ball, coal), 'water_tile', 'grass-1')
local uranium_ball = b.change_map_gen_collision_tile(b.apply_entity(ball, uranium), 'water_tile', 'grass-1')
local oil_ball = b.change_map_gen_collision_tile(b.apply_entity(ball, oil), 'water_tile', 'grass-1') ]]
local iron_ball = b.apply_entity(ball, iron)
local copper_ball = b.apply_entity(ball, copper)
local stone_ball = b.apply_entity(ball, stone)
@ -177,7 +177,7 @@ end
map = b.translate(map, 0, -19669)
map = b.scale(map, 2, 2)
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
map = b.change_tile(map, false, 'water')
map = b.fish(map, 0.0025)

View File

@ -318,10 +318,10 @@ end
Event.add(defines.events.on_entity_damaged, on_entity_damaged)
local function on_object_destroyed(event)
local unit_number = event.unit_number
--local registration_number = event.registration_number
Enemy.stop_tracking({ unit_number = unit_number })
if not event.useful_id then
return
end
Enemy.stop_tracking({ unit_number = event.useful_id })
end
Event.add(defines.events.on_object_destroyed, on_object_destroyed)

View File

@ -91,7 +91,7 @@ local function sprinkle(_, _, world)
}
end
local rock_names = {'rock-big', 'huge-rock', 'sand-rock-big'}
local rock_names = {'rock-big', 'huge-rock', 'big-rock'}
local function rocks_func()
local rock = rock_names[math.random(#rock_names)]
return {name = rock}
@ -230,7 +230,7 @@ end
local map = b.grid_pattern_full_overlap(pattern, p_cols, p_rows, 128, 128)
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
local sea = b.change_tile(b.full_shape, true, 'water')
sea = b.fish(sea, 0.00125)

View File

@ -42,6 +42,6 @@ map = b.translate(map, -20, 20)
map = b.scale(map, 4, 4)
map = b.change_tile(map, false, "water")
map = b.change_map_gen_collision_tile(map, "water-tile", "grass-1")
map = b.change_map_gen_collision_tile(map, "water_tile", "grass-1")
return map

View File

@ -114,6 +114,6 @@ local pattern =
}
local map = b.grid_pattern(pattern, 2, 2, pic.width, pic.height + t - 105)
map = b.change_map_gen_collision_tile(map,"water-tile", "water-green")
map = b.change_map_gen_collision_tile(map, "water_tile", "water-green")
return map

View File

@ -316,7 +316,7 @@ map = b.apply_entity(map, enemy)
map = b.any {map, paths, resource_islands, sea}
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
local function on_init()
local surface = RS.get_surface()
@ -373,10 +373,10 @@ local function on_init()
Retailer.set_item('items', {price = 10, name = 'construction-robot'})
Retailer.set_item('items', {price = 2, name = 'logistic-robot'})
Retailer.set_item('items', {price = 75, name = 'roboport'})
Retailer.set_item('items', {price = 50, name = 'logistic-chest-active-provider'})
Retailer.set_item('items', {price = 50, name = 'logistic-chest-passive-provider'})
Retailer.set_item('items', {price = 50, name = 'logistic-chest-requester'})
Retailer.set_item('items', {price = 50, name = 'logistic-chest-storage'})
Retailer.set_item('items', {price = 50, name = 'active-provider-chest'})
Retailer.set_item('items', {price = 50, name = 'passive-provider-chest'})
Retailer.set_item('items', {price = 50, name = 'requester-chest'})
Retailer.set_item('items', {price = 50, name = 'storage-chest'})
Retailer.set_item('items', {price = 6, name = 'big-electric-pole'})
Retailer.set_item('items', {price = 3, name = 'medium-electric-pole'})
Retailer.set_item('items', {price = 50, name = 'substation'})

View File

@ -194,7 +194,7 @@ local paths =
local sea = b.tile('deepwater')
sea = b.fish(sea, 0.0025)
map = b.any {map, paths, sea}
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
-- Disable landfill technology
local function on_init()

View File

@ -194,7 +194,7 @@ sea = b.fish(sea, 0.0025)
map = b.any {map, paths, sea}
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
map = b.rotate(map,degrees(45))

View File

@ -176,7 +176,7 @@ map = b.scale(map, scale_factor, scale_factor)
-- make starting area
local start_region = b.rectangle(block_length * scale_factor, block_width * scale_factor)
map = b.subtract(map, start_region)
start_region = b.change_map_gen_collision_tile(start_region, 'water-tile', 'landfill')
start_region = b.change_map_gen_collision_tile(start_region, 'water_tile', 'landfill')
start_region = b.remove_map_gen_resources(start_region)
local start_water = b.change_tile(b.circle(5), true, 'water')
map = b.any {start_water, start_region, map}

View File

@ -41,15 +41,15 @@ walk_spiral2 = b.choose(b.circle(72), b.empty_shape, walk_spiral2)
local map = b.circular_spiral_grow_pattern(16, 32, 512, {tree, iron, stone, coal, rock, copper, uranium, oil})
local start_cirle = b.circle(64)
start_cirle = b.change_map_gen_collision_tile(start_cirle, 'water-tile', 'grass-1')
local start_circle = b.circle(64)
start_circle = b.change_map_gen_collision_tile(start_circle, 'water_tile', 'grass-1')
local spawn_water = b.circle(4)
spawn_water = b.translate(spawn_water, 0, 6)
spawn_water = b.change_tile(spawn_water, true, 'water')
spawn_water = b.fish(spawn_water, 1)
start_cirle = b.any {spawn_water, start_cirle}
start_circle = b.any {spawn_water, start_circle}
map = b.any {start_cirle, walk_spiral1, map, walk_spiral2}
map = b.any {start_circle, walk_spiral1, map, walk_spiral2}
local worm_names = {
'small-worm-turret',

View File

@ -141,9 +141,9 @@ local function map(x, y, world)
end
if tile_to_insert == 'red-desert-0' then
if random(1, 3) == 1 then
tree = 'sand-rock-big'
tree = 'big-rock'
else
tree = 'sand-rock-big'
tree = 'big-rock'
end
end
if random(1, 8) == 1 then

View File

@ -155,7 +155,7 @@ start_circle = b.translate(start_circle, -32, -0)
map = b.any {start_circle, map}
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
map = b.scale(map, 3, 3)

View File

@ -191,7 +191,7 @@ local function build_map()
local start_coal = b.resource(small_circle, ores[4].resource, constant(700))
local start_segmented = b.segment_pattern({start_iron, start_copper, start_stone, start_coal})
local start_shape = b.change_map_gen_collision_tile(small_circle, 'water-tile', 'grass-1')
local start_shape = b.change_map_gen_collision_tile(small_circle, 'water_tile', 'grass-1')
start_shape = b.apply_entity(start_shape, start_segmented)
start_shape = b.translate(start_shape, 0, 48)
start_shape = b.any {start_shape, b.full_shape}

View File

@ -328,7 +328,7 @@ for _ = 1, number_blocks do
end
local map = b.grid_pattern(blocks_pattern, number_blocks, number_blocks, blocks_size, blocks_size)
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
map = b.fish(map, 0.00125)
map = b.translate(map, 191, -1825)

View File

@ -15,7 +15,7 @@ pic = b.decompress(pic)
local shape = b.picture(pic)
local map = b.single_pattern(shape, pic.width, pic.height)
map = b.change_map_gen_collision_tile(map, "water-tile", "grass-1")
map = b.change_map_gen_collision_tile(map, "water_tile", "grass-1")
map = b.change_tile(map, false, "water")
map = b.scale(map, 5, 5)

View File

@ -137,9 +137,9 @@ local recipes = {
['speed-module'] = true,
['speed-module-2'] = true,
['speed-module-3'] = true,
['effectivity-module'] = true,
['effectivity-module-2'] = true,
['effectivity-module-3'] = true,
['efficiency-module'] = true,
['efficiency-module-2'] = true,
['efficiency-module-3'] = true,
['productivity-module'] = true,
['productivity-module-2'] = true,
['productivity-module-3'] = true,
@ -199,7 +199,7 @@ local recipes = {
['inserter'] = true,
['long-handed-inserter'] = true,
['fast-inserter'] = true,
['stack-inserter'] = true,
['bulk-inserter'] = true,
['big-electric-pole'] = true,
['substation'] = true,
['rail'] = true,
@ -211,11 +211,11 @@ local recipes = {
['logistic-robot'] = true,
['construction-robot'] = true,
['flying-robot-frame'] = true,
['logistic-chest-active-provider'] = true,
['logistic-chest-passive-provider'] = true,
['logistic-chest-storage'] = true,
['logistic-chest-buffer'] = true,
['logistic-chest-requester'] = true,
['active-provider-chest'] = true,
['passive-provider-chest'] = true,
['storage-chest'] = true,
['buffer-chest'] = true,
['requester-chest'] = true,
['roboport'] = true,
['electric-mining-drill'] = true,
['steel-furnace'] = true,

View File

@ -383,7 +383,7 @@ end
local map = b.grid_pattern_full_overlap(pattern, p_cols, p_rows, 500, 500)
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
local sea = b.change_tile(apple, false, 'water')
sea = b.fish(sea, 0.005)

View File

@ -50,9 +50,9 @@ RecipeLocker.lock_recipes(
'fast-underground-belt',
'express-underground-belt',
'pipe-to-ground',
'logistic-chest-requester',
'logistic-chest-buffer',
'logistic-chest-active-provider'
'requester-chest',
'buffer-chest',
'active-provider-chest'
}
)
@ -75,8 +75,8 @@ local function no_rocks(_, _, world, tile)
end
local start = b.full_shape
start = b.change_map_gen_collision_tile(start, 'ground-tile', 'refined-concrete')
start = b.change_map_gen_collision_hidden_tile(start, 'ground-tile', 'lab-dark-2')
start = b.change_map_gen_collision_tile(start, 'ground_tile', 'refined-concrete')
start = b.change_map_gen_collision_hidden_tile(start, 'ground_tile', 'lab-dark-2')
local map = b.if_else(start, b.full_shape)
map = b.apply_effect(map, no_rocks)

View File

@ -99,7 +99,7 @@ landfill_water = b.translate(landfill_water, -(width_2 / 2 + width_3 / 2), 0)
landfill_water = b.remove_map_gen_enemies(landfill_water)
landfill_water = b.change_map_gen_collision_tile(landfill_water, 'water-tile', 'landfill')
landfill_water = b.change_map_gen_collision_tile(landfill_water, 'water_tile', 'landfill')
landfill_water = b.subtract(landfill_water, b.translate(b.rectangle(256, 256), -256, 0))
-- landfill_water = b.change_tile(landfill_water, true, 'lab-white')

View File

@ -17,7 +17,7 @@ landfill_water = b.translate(landfill_water, safe_zone_width/2, 0)
landfill_water = b.remove_map_gen_enemies(landfill_water)
landfill_water = b.change_map_gen_collision_tile(landfill_water, 'water-tile', 'landfill')
landfill_water = b.change_map_gen_collision_tile(landfill_water, 'water_tile', 'landfill')
-- landfill_water = b.change_tile(landfill_water, true, 'lab-white')
@ -53,7 +53,7 @@ water = b.translate(water, -35, 0)
start_resources = b.add(start_resources, water)
start_resources = b.translate(start_resources, (safe_zone_width/2 - 60), 0)
start_resources = b.change_map_gen_collision_tile(start_resources, 'water-tile', 'landfill')
start_resources = b.change_map_gen_collision_tile(start_resources, 'water_tile', 'landfill')
start_resources = b.remove_map_gen_enemies(start_resources)
limited_safe_zone = b.add(start_resources, limited_safe_zone)

View File

@ -183,7 +183,7 @@ end
map = b.apply_entity(map, resources_shape)
map = b.apply_entity(map, worms)
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
map = b.change_tile(map, false, 'water')
map = b.fish(map, 0.0025)

View File

@ -103,7 +103,7 @@ start_spiral = b.translate(start_spiral, 0, -5)
map = b.choose(b.rectangle(96), start_spiral, map)
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
local sea = b.tile('water')
sea = b.fish(sea, 0.00125)

View File

@ -84,7 +84,7 @@ local centre =b.circle(18)
--local centre = b.rectangle(5,5)
--local centre = b.scale(chamfer, 0.08,0.08)
map = b.if_else(centre, map)
centre = b.change_map_gen_collision_tile(centre, 'ground-tile', 'stone-path')
centre = b.change_map_gen_collision_tile(centre, 'ground_tile', 'stone-path')
-- the coordinates at which the standard market and spawn will be created
local startx = 0
local starty = 0

View File

@ -260,7 +260,7 @@ water = b.change_tile(water, true, 'water-green')
water = b.any {b.rectangle(16, 4), b.rectangle(4, 16), water}
local start = b.if_else(water, b.full_shape)
start = b.change_map_gen_collision_tile(start, 'water-tile', 'grass-1')
start = b.change_map_gen_collision_tile(start, 'water_tile', 'grass-1')
local map = b.choose(ore_circle, start, b.full_shape)

View File

@ -363,6 +363,6 @@ map = b.apply_entity(map, ore_shape)
map = b.apply_entity(map, loot)
map = b.apply_entity(map, enemy)
map = b.change_map_gen_collision_tile(map, 'water-tile', 'grass-1')
map = b.change_map_gen_collision_tile(map, 'water_tile', 'grass-1')
return map

View File

@ -249,9 +249,9 @@ function Public.create_rock_cluster(pos, amount)
entity.pos = pos
for i = 1, amount, 1 do
if 1 == math.random(1,3) then
entity.name = "sand-rock-big"
entity.name = "big-rock"
else
entity.name = "sand-rock-big"
entity.name = "big-rock"
end
local b, e = auto_place_entity_around_target(entity, scan_radius, mode)
if b == true then

View File

@ -71,11 +71,11 @@ return {
'laser-turret',
'light-oil-barrel',
'loader',
'logistic-chest-active-provider',
'logistic-chest-buffer',
'logistic-chest-passive-provider',
'logistic-chest-requester',
'logistic-chest-storage',
'active-provider-chest',
'buffer-chest',
'passive-provider-chest',
'requester-chest',
'storage-chest',
'logistic-robot',
'long-handed-inserter',
'low-density-structure',
@ -116,7 +116,7 @@ return {
'solar-panel-equipment',
'solid-fuel',
'splitter',
'stack-inserter',
'bulk-inserter',
'steam-engine',
'steam-turbine',
'steel-chest',

View File

@ -31,7 +31,7 @@ return {
'item/accumulator',
'item/construction-robot',
'item/distractor-capsule',
'item/stack-inserter',
'item/bulk-inserter',
'item/electric-furnace',
'item/express-transport-belt',
'item/express-underground-belt',

View File

@ -45,7 +45,7 @@ end
---@param params table
---@field surface LuaSurfaceIdentification will create the text only for those on the same surface
function Game.create_local_flying_text(params)
local surface = game.get_surface(params.surface)
local surface = game.get_surface(params.surface.name or params.surface.index or params.surface)
if not surface then
return
end

View File

@ -10,13 +10,7 @@ local rendering = rendering
local draw_polygon = rendering.draw_polygon
function Public.draw_polygon(positions, options)
local vertices = {}
for i = 1, #positions do
vertices[i] = {target = positions[i]}
end
local args = {vertices = vertices}
local args = { vertices = positions }
for k, v in pairs(options) do
args[k] = v
end