1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-25 21:29:06 +02:00

Port more modules to 2.0

This commit is contained in:
Gerkiz 2024-10-25 16:15:09 +02:00
parent 0d680e4e9d
commit a9917c93a8
54 changed files with 344 additions and 394 deletions

View File

@ -84,7 +84,7 @@ require 'utils.remote_chunks'
--require 'maps.biter_battles.biter_battles'
--![[Guide a Train through rough terrain, while defending it from the biters]]--
--require 'maps.mountain_fortress_v3.main'
require 'maps.mountain_fortress_v3.main'
--require 'maps.mountain_fortress_v2.main'
--require 'maps.mountain_fortress'

View File

@ -143,6 +143,7 @@ win_conditions=Win conditions
season=[font=default-bold]Season: [/font]
rounds_survived=[font=default-bold]Rounds survived: [/font]
win_streak=[font=default-bold]Current win streak: [/font]
buffs=[font=default-bold]Buffs: [/font]
zone=[font=default-bold]Breach zones: [/font]
wave=[font=default-bold]Survive until wave: [/font]

View File

@ -7,8 +7,6 @@ items.spawn = {
{price = {{'raw-fish', 10}}, offer = {type = 'give-item', item = 'train-stop'}},
{price = {{'raw-fish', 94}}, offer = {type = 'give-item', item = 'locomotive'}},
{price = {{'raw-fish', 35}}, offer = {type = 'give-item', item = 'cargo-wagon'}},
{price = {{'raw-fish', 1}}, offer = {type = 'give-item', item = 'red-wire', count = 1}},
{price = {{'raw-fish', 1}}, offer = {type = 'give-item', item = 'green-wire', count = 1}},
{price = {{'raw-fish', 4}}, offer = {type = 'give-item', item = 'decider-combinator'}},
{price = {{'raw-fish', 4}}, offer = {type = 'give-item', item = 'arithmetic-combinator'}},
{price = {{'raw-fish', 2}}, offer = {type = 'give-item', item = 'constant-combinator'}},

View File

@ -457,7 +457,7 @@ local function treasure_chest(position, distance_to_center)
evolution_min = 0.4,
evolution_max = 1
},
{ { name = 'stack-inserter', count = math.random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math.random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{
{ name = 'small-electric-pole', count = math.random(16, 24) },
weight = 3,
@ -510,8 +510,6 @@ local function treasure_chest(position, distance_to_center)
{ { name = 'decider-combinator', count = math.random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'power-switch', count = math.random(1, 2) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'programmable-speaker', count = math.random(4, 8) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'green-wire', count = math.random(50, 99) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'red-wire', count = math.random(50, 99) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'chemical-plant', count = math.random(1, 3) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{
{ name = 'burner-mining-drill', count = math.random(2, 4) },

View File

@ -86,7 +86,7 @@ local function create_cave_miner_button(player)
if player.gui.top['caver_miner_stats_toggle_button'] then
player.gui.top['caver_miner_stats_toggle_button'].destroy()
end
local b = player.gui.top.add({ type = 'sprite-button', name = 'caver_miner_stats_toggle_button', sprite = 'item/dummy-steel-axe' })
local b = player.gui.top.add({ type = 'sprite-button', name = 'caver_miner_stats_toggle_button', sprite = 'utility/lua_snippet_tool_icon' })
b.style.minimal_height = 38
b.style.minimal_width = 38
b.style.padding = 1
@ -294,7 +294,6 @@ local function treasure_chest(position, distance_to_center)
{ { name = 'long-handed-inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.4 },
{ { name = 'fast-inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 1, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'stack-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'small-electric-pole', count = math_random(16, 24) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'medium-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'big-electric-pole', count = math_random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
@ -322,8 +321,6 @@ local function treasure_chest(position, distance_to_center)
{ { name = 'decider-combinator', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'power-switch', count = math_random(1, 2) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'programmable-speaker', count = math_random(4, 8) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'green-wire', count = math_random(50, 99) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'red-wire', count = math_random(50, 99) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'chemical-plant', count = math_random(1, 3) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'burner-mining-drill', count = math_random(2, 4) }, weight = 3, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'electric-mining-drill', count = math_random(2, 4) }, weight = 3, evolution_min = 0.2, evolution_max = 0.6 },

View File

@ -6,8 +6,6 @@ items.spawn = {
{price = {{'raw-fish', 10}}, offer = {type = 'give-item', item = 'train-stop'}},
{price = {{'raw-fish', 94}}, offer = {type = 'give-item', item = 'locomotive'}},
{price = {{'raw-fish', 35}}, offer = {type = 'give-item', item = 'cargo-wagon'}},
{price = {{'raw-fish', 1}}, offer = {type = 'give-item', item = 'red-wire', count = 1}},
{price = {{'raw-fish', 1}}, offer = {type = 'give-item', item = 'green-wire', count = 1}},
{price = {{'raw-fish', 4}}, offer = {type = 'give-item', item = 'decider-combinator'}},
{price = {{'raw-fish', 4}}, offer = {type = 'give-item', item = 'arithmetic-combinator'}},
{price = {{'raw-fish', 2}}, offer = {type = 'give-item', item = 'constant-combinator'}},

View File

@ -95,8 +95,6 @@ Public.spawn_market_items = {
{price = {{'raw-fish', 8}}, offer = {type = 'give-item', item = 'train-stop'}},
{price = {{'raw-fish', 50}}, offer = {type = 'give-item', item = 'locomotive'}},
{price = {{'raw-fish', 20}}, offer = {type = 'give-item', item = 'cargo-wagon'}},
{price = {{'raw-fish', 1}}, offer = {type = 'give-item', item = 'red-wire', count = 2}},
{price = {{'raw-fish', 1}}, offer = {type = 'give-item', item = 'green-wire', count = 2}},
{price = {{'raw-fish', 3}}, offer = {type = 'give-item', item = 'decider-combinator'}},
{price = {{'raw-fish', 3}}, offer = {type = 'give-item', item = 'arithmetic-combinator'}},
{price = {{'raw-fish', 2}}, offer = {type = 'give-item', item = 'constant-combinator'}},

View File

@ -235,8 +235,6 @@ function Public.market(surface, position)
{ price = { { 'modular-armor', 1 } }, offer = { type = 'give-item', item = 'advanced-circuit', count = math_random(15, 20) } },
{ price = { { 'night-vision-equipment', 1 } }, offer = { type = 'give-item', item = 'steel-plate', count = math_random(3, 4) } },
{ price = { { 'solar-panel-equipment', 1 } }, offer = { type = 'give-item', item = 'copper-plate', count = math_random(15, 25) } },
{ price = { { 'red-wire', 100 } }, offer = { type = 'give-item', item = 'copper-cable', count = math_random(75, 100) } },
{ price = { { 'green-wire', 100 } }, offer = { type = 'give-item', item = 'copper-cable', count = math_random(75, 100) } },
{ price = { { 'barrel', 10 } }, offer = { type = 'give-item', item = 'steel-plate', count = math_random(6, 8) } },
{ price = { { 'arithmetic-combinator', 10 } }, offer = { type = 'give-item', item = 'electronic-circuit', count = math_random(15, 25) } },
{ price = { { 'decider-combinator', 10 } }, offer = { type = 'give-item', item = 'electronic-circuit', count = math_random(15, 25) } },

View File

@ -173,7 +173,7 @@ local all_research = {
{ name = "electric-energy-distribution-1", min = 1, max = 5 },
{ name = "battery", min = 1, max = 5 },
{ name = "electric-energy-accumulators", min = 1, max = 5 },
{ name = "stack-inserter", min = 1, max = 5 },
{ name = "bulk-inserter", min = 1, max = 5 },
{ name = "sulfur-processing", min = 1, max = 5 },
{ name = "advanced-electronics", min = 1, max = 5 },
{ name = "logistics-2", min = 1, max = 5 },

View File

@ -29,7 +29,7 @@ local item_worths = {
['inserter'] = 8,
['long-handed-inserter'] = 16,
['fast-inserter'] = 32,
['stack-inserter'] = 128,
['bulk-inserter'] = 128,
['bulk-inserter'] = 160,
['small-electric-pole'] = 4,
['medium-electric-pole'] = 32,

View File

@ -61,7 +61,6 @@ local function create_shipwreck(surface, position)
{ { name = 'long-handed-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.0, evolution_max = 0.4 },
{ { name = 'fast-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(2, 4) }, weight = 1, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'stack-inserter', count = math_random(2, 4) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'small-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'medium-electric-pole', count = math_random(4, 8) }, weight = 3, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'wooden-chest', count = math_random(16, 24) }, weight = 3, evolution_min = 0.0, evolution_max = 0.2 },
@ -78,8 +77,6 @@ local function create_shipwreck(surface, position)
{ { name = 'decider-combinator', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'power-switch', count = math_random(2, 4) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'programmable-speaker', count = math_random(2, 4) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'green-wire', count = math_random(50, 100) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'red-wire', count = math_random(50, 100) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'burner-mining-drill', count = math_random(2, 4) }, weight = 3, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'electric-mining-drill', count = math_random(2, 4) }, weight = 3, evolution_min = 0.2, evolution_max = 0.6 },
{ { name = 'express-transport-belt', count = math_random(25, 75) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },

View File

@ -696,7 +696,7 @@ function Public.draw_mothership(journey)
only_in_alt_mode = false
}
for k, item_name in pairs({ 'arithmetic-combinator', 'constant-combinator', 'decider-combinator', 'programmable-speaker', 'red-wire', 'green-wire', 'small-lamp', 'substation', 'pipe', 'gate', 'stone-wall', 'transport-belt' }) do
for k, item_name in pairs({ 'arithmetic-combinator', 'constant-combinator', 'decider-combinator', 'programmable-speaker', 'small-lamp', 'substation', 'pipe', 'gate', 'stone-wall', 'transport-belt' }) do
local chest = surface.create_entity({ name = 'infinity-chest', position = { -7 + k, Constants.mothership_radius - 3 }, force = 'player' })
if not chest or not chest.valid then break end
chest.set_infinity_container_filter(1, { name = item_name, count = prototypes.item[item_name].stack_size, index = 1 })

View File

@ -151,7 +151,7 @@ local function create_shipwreck(surface, position)
{ { name = 'long-handed-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.0, evolution_max = 0.4 },
{ { name = 'fast-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(2, 4) }, weight = 1, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'stack-inserter', count = math_random(2, 4) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(2, 4) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'small-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'medium-electric-pole', count = math_random(4, 8) }, weight = 3, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'wooden-chest', count = math_random(16, 24) }, weight = 3, evolution_min = 0.0, evolution_max = 0.2 },
@ -175,8 +175,6 @@ local function create_shipwreck(surface, position)
{ { name = 'decider-combinator', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'power-switch', count = math_random(2, 4) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'programmable-speaker', count = math_random(2, 4) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'green-wire', count = math_random(50, 100) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'red-wire', count = math_random(50, 100) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
--{{name = "chemical-plant", count = math_random(2,4)}, weight = 3, evolution_min = 0.3, evolution_max = 1},
{ { name = 'burner-mining-drill', count = math_random(2, 4) }, weight = 3, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'electric-mining-drill', count = math_random(2, 4) }, weight = 3, evolution_min = 0.2, evolution_max = 0.6 },

View File

@ -83,7 +83,7 @@ function Public.treasure_chest(surface, position, container_name)
{ { name = 'long-handed-inserter', count = math_random(8, 16) }, weight = 3, d_min = 0.0, d_max = 0.4 },
{ { name = 'fast-inserter', count = math_random(8, 16) }, weight = 3, d_min = 0.1, d_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 1, d_min = 0.4, d_max = 1 },
{ { name = 'stack-inserter', count = math_random(4, 8) }, weight = 3, d_min = 0.3, d_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 3, d_min = 0.3, d_max = 1 },
{ { name = 'small-electric-pole', count = math_random(16, 24) }, weight = 3, d_min = 0.0, d_max = 0.3 },
{ { name = 'medium-electric-pole', count = math_random(8, 16) }, weight = 3, d_min = 0.2, d_max = 1 },
{ { name = 'big-electric-pole', count = math_random(4, 8) }, weight = 3, d_min = 0.3, d_max = 1 },
@ -111,8 +111,6 @@ function Public.treasure_chest(surface, position, container_name)
{ { name = 'decider-combinator', count = math_random(4, 8) }, weight = 2, d_min = 0.1, d_max = 1 },
{ { name = 'power-switch', count = 1 }, weight = 2, d_min = 0.1, d_max = 1 },
{ { name = 'programmable-speaker', count = math_random(2, 4) }, weight = 1, d_min = 0.1, d_max = 1 },
{ { name = 'green-wire', count = math_random(50, 99) }, weight = 4, d_min = 0.1, d_max = 1 },
{ { name = 'red-wire', count = math_random(50, 99) }, weight = 4, d_min = 0.1, d_max = 1 },
{ { name = 'chemical-plant', count = math_random(1, 3) }, weight = 3, d_min = 0.3, d_max = 1 },
{ { name = 'burner-mining-drill', count = math_random(2, 4) }, weight = 3, d_min = 0.0, d_max = 0.2 },
{ { name = 'electric-mining-drill', count = math_random(2, 4) }, weight = 3, d_min = 0.2, d_max = 1 },

View File

@ -768,7 +768,7 @@ local function treasure_chest(position, surface)
{ { name = 'long-handed-inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.4 },
{ { name = 'fast-inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 1, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'stack-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'small-electric-pole', count = math_random(16, 32) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'medium-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'big-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
@ -796,8 +796,6 @@ local function treasure_chest(position, surface)
{ { name = 'decider-combinator', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'power-switch', count = math_random(2, 4) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'programmable-speaker', count = math_random(2, 4) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'green-wire', count = math_random(50, 100) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'red-wire', count = math_random(50, 100) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'chemical-plant', count = math_random(2, 4) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'burner-mining-drill', count = math_random(4, 8) }, weight = 3, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'electric-mining-drill', count = math_random(4, 8) }, weight = 3, evolution_min = 0.2, evolution_max = 0.6 },
@ -1220,14 +1218,14 @@ local function on_player_joined_game(event)
create_labyrinth_difficulty_gui(player)
end
local inserter_list = { 'inserter', 'long-handed-inserter', 'burner-inserter', 'fast-inserter', 'bulk-inserter', 'stack-inserter' }
local inserter_list = { 'inserter', 'long-handed-inserter', 'burner-inserter', 'fast-inserter', 'bulk-inserter', 'bulk-inserter' }
local inserters = {
['inserter'] = true,
['long-handed-inserter'] = true,
['burner-inserter'] = true,
['fast-inserter'] = true,
['bulk-inserter'] = true,
['stack-inserter'] = true
['bulk-inserter'] = true
}
local loaders = {
['loader'] = true,

View File

@ -127,7 +127,7 @@ function Public.treasure_chest_old(surface, position, container_name)
{ { name = 'long-handed-inserter', count = math_random(8, 16) }, weight = 3, d_min = 0.0, d_max = 0.4 },
{ { name = 'fast-inserter', count = math_random(8, 16) }, weight = 3, d_min = 0.1, d_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 1, d_min = 0.4, d_max = 1 },
{ { name = 'stack-inserter', count = math_random(4, 8) }, weight = 3, d_min = 0.3, d_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 3, d_min = 0.3, d_max = 1 },
{ { name = 'small-electric-pole', count = math_random(16, 24) }, weight = 3, d_min = 0.0, d_max = 0.3 },
{ { name = 'medium-electric-pole', count = math_random(8, 16) }, weight = 3, d_min = 0.2, d_max = 1 },
{ { name = 'big-electric-pole', count = math_random(4, 8) }, weight = 3, d_min = 0.3, d_max = 1 },
@ -155,8 +155,6 @@ function Public.treasure_chest_old(surface, position, container_name)
{ { name = 'decider-combinator', count = math_random(4, 8) }, weight = 2, d_min = 0.1, d_max = 1 },
{ { name = 'power-switch', count = 1 }, weight = 2, d_min = 0.1, d_max = 1 },
{ { name = 'programmable-speaker', count = math_random(2, 4) }, weight = 1, d_min = 0.1, d_max = 1 },
{ { name = 'green-wire', count = math_random(50, 99) }, weight = 4, d_min = 0.1, d_max = 1 },
{ { name = 'red-wire', count = math_random(50, 99) }, weight = 4, d_min = 0.1, d_max = 1 },
{ { name = 'chemical-plant', count = math_random(1, 3) }, weight = 3, d_min = 0.3, d_max = 1 },
{ { name = 'burner-mining-drill', count = math_random(2, 4) }, weight = 3, d_min = 0.0, d_max = 0.2 },
{ { name = 'electric-mining-drill', count = math_random(2, 4) }, weight = 3, d_min = 0.2, d_max = 1 },

View File

@ -93,7 +93,7 @@ local this = {
['inserter'] = { value = 8, rarity = 1 },
['long-handed-inserter'] = { value = 12, rarity = 2 },
['fast-inserter'] = { value = 16, rarity = 4 },
['stack-inserter'] = { value = 96, rarity = 6 },
['bulk-inserter'] = { value = 96, rarity = 6 },
['bulk-inserter'] = { value = 128, rarity = 7 },
['small-electric-pole'] = { value = 2, rarity = 1 },
['medium-electric-pole'] = { value = 12, rarity = 4 },
@ -125,8 +125,6 @@ local this = {
},
['wire'] = {
['small-lamp'] = { value = 4, rarity = 1 },
['red-wire'] = { value = 4, rarity = 1 },
['green-wire'] = { value = 4, rarity = 1 },
['arithmetic-combinator'] = { value = 16, rarity = 1 },
['decider-combinator'] = { value = 16, rarity = 1 },
['constant-combinator'] = { value = 16, rarity = 1 },

View File

@ -188,7 +188,7 @@ local check_distance_between_player_and_locomotive = function (player)
player.teleport({ position.x, (t_y + gap_between_locomotive.neg_gap - 4) * -1 }, surface)
end
player.print(({ 'breached_wall.hinder' }), Color.warning)
player.print(({ 'breached_wall.hinder' }), { color = Color.warning })
if player.driving then
player.driving = false
end
@ -289,8 +289,6 @@ local compare_player_and_train = function (player, entity)
position = position,
text = msg,
color = color,
time_to_live = 300,
speed = 100
}
)
player.print(msg, color)
@ -301,8 +299,6 @@ local compare_player_and_train = function (player, entity)
position = position,
text = msg,
color = color,
time_to_live = 300,
speed = 100
}
)
player.print(msg, color)
@ -328,6 +324,8 @@ local function distance(player)
local breached_wall = Public.get('breached_wall')
local bonus_xp_on_join = Public.get('bonus_xp_on_join')
local enable_arties = Public.get('enable_arties')
local final_battle = Public.get('final_battle')
local p = player.physical_position
@ -423,7 +421,7 @@ local function distance(player)
end
end
if not Collapse.has_collapse_started() then
if not Collapse.has_collapse_started() or not final_battle then
clear_breach_text_and_render()
Public.set('collapse_started', true)
Collapse.start_now(true)

View File

@ -1428,7 +1428,7 @@ function Public.loco_died(invalid_locomotive)
}
)
surface.spill_item_stack(this.locomotive.position, { name = 'coin', count = 512, quality = 'normal' }, false)
surface.spill_item_stack({ position = this.locomotive.position, stack = { name = 'coin', count = 512, quality = 'normal' } })
this.game_reset_tick = 5400
for _, player in pairs(game.connected_players) do
player.play_sound { path = 'utility/game_lost', volume_modifier = 0.75 }
@ -1490,12 +1490,11 @@ local function on_built_entity(event)
position = entity.position,
text = ({ 'entity.radar_limit' }),
color = { 255, 0, 0 },
time_to_live = 300,
speed = 100
}
)
player.surface.spill_item_stack(position, { name = entity.name, count = 1, true, quality = 'normal' }, false)
player.surface.spill_item_stack({ position = position, stack = { name = entity.name, count = 1, quality = 'normal' } })
entity.destroy()
return
end
@ -1542,8 +1541,6 @@ local function on_built_entity(event)
position = entity.position,
text = upgrades[name].built .. ' / ' .. limit[entity.name] .. ' ' .. entity.name,
color = { r = 0.82, g = 0.11, b = 0.11 },
time_to_live = 300,
speed = 100
}
)
else
@ -1553,8 +1550,6 @@ local function on_built_entity(event)
position = entity.position,
text = ({ 'entity.entity_limit_reached', entity.name }),
color = { r = 0.82, g = 0.11, b = 0.11 },
time_to_live = 300,
speed = 100
}
)
@ -1590,7 +1585,7 @@ local function on_robot_built_entity(event)
}
)
entity.surface.spill_item_stack(position, { name = entity.name, count = 1, true })
entity.surface.spill_item_stack({ position = entity.position, stack = { name = entity.name, count = 1 } })
entity.destroy()
return
end

View File

@ -962,6 +962,16 @@ local function on_wave_created(event)
end
end
local function on_primary_target_missing()
local locomotive = Public.get('locomotive')
if not locomotive or not locomotive.valid then
return
end
WD.set('target', locomotive)
WD.set_main_target(locomotive)
end
local function on_player_cursor_stack_changed(event)
local player = game.get_player(event.player_index)
if not player or not player.valid then
@ -2002,5 +2012,6 @@ Event.add(de.on_pre_player_toggled_map_editor, on_pre_player_toggled_map_editor)
Event.add(de.on_player_cursor_stack_changed, on_player_cursor_stack_changed)
Event.on_nth_tick(10, tick)
Event.add(WD.events.on_wave_created, on_wave_created)
Event.add(WD.events.on_primary_target_missing, on_primary_target_missing)
return Public

View File

@ -41,6 +41,10 @@ local add_chests_to_wagon_token =
local position3 = { cargo_wagon.left_top.x + 4, cargo_wagon.right_bottom.y - 2 }
local position4 = { cargo_wagon.right_bottom.x - 5, cargo_wagon.right_bottom.y - 2 }
if not wagon.entity or not wagon.entity.valid then
return error('Entity was invalid, please check this out!')
end
local left_1 = LinkedChests.add(surface, position1, 'player', 'wagon_' .. wagon.entity.unit_number .. '_1')
if not left_1 then
return error('Surface was invalid, please check this out!')
@ -671,7 +675,8 @@ function Public.create_wagon_room(icw, wagon)
end
if wagon.entity.type == 'cargo-wagon' then
Task.set_timeout_in_ticks(15, add_chests_to_wagon_token, { wagon = wagon, surface = surface })
local task = Task.get(add_chests_to_wagon_token)
task({ wagon = wagon, surface = surface })
end
end

View File

@ -113,8 +113,6 @@ local function death_effects(player)
{
position = p,
text = '☠️',
time_to_live = 300,
speed = 100
}
)
end
@ -286,8 +284,6 @@ local function give_passive_xp(data)
text = '+' .. '',
position = { x = pos.x, y = pos.y - 2 },
color = xp_floating_text_color,
time_to_live = 60,
speed = 3
}
rpg[player.index].xp_since_last_floaty_text = 0
rpg[player.index].last_floaty_text = game.tick + visuals_delay

View File

@ -300,16 +300,16 @@ function Public.reset_map()
if this.adjusted_zones.reversed then
if not surface.is_chunk_generated({ x = -20, y = -22 }) then
surface.request_to_generate_chunks({ x = -20, y = -22 }, 1)
surface.force_generate_chunk_requests()
-- surface.request_to_generate_chunks({ x = -20, y = -22 }, 1)
-- surface.force_generate_chunk_requests()
end
game.forces.player.set_spawn_position({ x = -27, y = -25 }, surface)
WD.set_spawn_position({ x = -16, y = -80 })
WD.enable_inverted(true)
else
if not surface.is_chunk_generated({ x = -20, y = 22 }) then
surface.request_to_generate_chunks({ x = -20, y = 22 }, 1)
surface.force_generate_chunk_requests()
-- surface.request_to_generate_chunks({ x = -20, y = 22 }, 1)
-- surface.force_generate_chunk_requests()
end
game.forces.player.set_spawn_position({ x = -27, y = 25 }, surface)
WD.set_spawn_position({ x = -16, y = 80 })
@ -668,9 +668,9 @@ Event.add(
Event.on_init(function ()
local nauvis = game.surfaces.nauvis
nauvis.clear(true)
nauvis.request_to_generate_chunks({ 0, 0 }, 3)
nauvis.force_generate_chunk_requests()
-- nauvis.clear(true)
-- nauvis.request_to_generate_chunks({ 0, 0 }, 3)
-- nauvis.force_generate_chunk_requests()
end)
return Public

View File

@ -30,8 +30,6 @@ local mining_chance_weights = {
{ name = 'heavy-oil-barrel', chance = 15 },
{ name = 'light-oil-barrel', chance = 15 },
{ name = 'water-barrel', chance = 10 },
{ name = 'green-wire', chance = 10 },
{ name = 'red-wire', chance = 10 },
{ name = 'explosives', chance = 5 },
{ name = 'advanced-circuit', chance = 5 },
{ name = 'nuclear-fuel', chance = 1 },
@ -92,8 +90,6 @@ local scrap_yield_amounts = {
['rocket-fuel'] = 0.3,
['low-density-structure'] = 0.3,
['heat-pipe'] = 1,
['green-wire'] = 8,
['red-wire'] = 8,
['engine-unit'] = 2,
['electric-engine-unit'] = 2,
['logistic-robot'] = 0.3,
@ -278,7 +274,8 @@ function Public.entity_died_randomness(data)
local position = { x = entity.position.x, y = entity.position.y }
surface.spill_item_stack(position, { name = harvest, count = random(1, 5) }, true)
surface.spill_item_stack({ position = position, stack = { name = harvest, count = random(1, 5), quality = 'normal' } })
local particle = particles[harvest]
create_particles(surface, particle, position, 16, { x = entity.position.x, y = entity.position.y })
end
@ -307,8 +304,6 @@ local function randomness(data)
{
position = position,
text = '+' .. harvest_amount .. ' [img=item/' .. harvest .. ']',
time_to_live = 300,
speed = 100
}
)
@ -318,7 +313,7 @@ local function randomness(data)
if harvest_amount > max_spill then
if spill_items_to_surface then
player.surface.spill_item_stack(position, { name = harvest, count = max_spill }, true)
player.surface.spill_item_stack({ position = position, stack = { name = harvest, count = max_spill, quality = 'normal' } })
else
player.insert({ name = harvest, count = max_spill })
end
@ -327,14 +322,14 @@ local function randomness(data)
harvest_amount = harvest_amount - inserted_count
if harvest_amount > 0 then
if spill_items_to_surface then
player.surface.spill_item_stack(position, { name = harvest, count = harvest_amount }, true)
player.surface.spill_item_stack({ position = position, stack = { name = harvest, count = harvest_amount, quality = 'normal' } })
else
player.insert({ name = harvest, count = harvest_amount })
end
end
else
if spill_items_to_surface then
player.surface.spill_item_stack(position, { name = harvest, count = harvest_amount }, true)
player.surface.spill_item_stack({ position = position, stack = { name = harvest, count = harvest_amount, quality = 'normal' } })
else
player.insert({ name = harvest, count = harvest_amount })
end
@ -365,8 +360,6 @@ local function randomness_scrap(data)
{
position = position,
text = '+' .. harvest_amount .. ' [img=item/' .. harvest .. ']',
time_to_live = 300,
speed = 100
}
)
@ -376,7 +369,7 @@ local function randomness_scrap(data)
if harvest_amount > max_spill then
if spill_items_to_surface then
player.surface.spill_item_stack(position, { name = harvest, count = max_spill }, true)
player.surface.spill_item_stack({ position = position, stack = { name = harvest, count = max_spill, quality = 'normal' } })
else
player.insert({ name = harvest, count = max_spill })
end
@ -385,14 +378,14 @@ local function randomness_scrap(data)
harvest_amount = harvest_amount - inserted_count
if harvest_amount > 0 then
if spill_items_to_surface then
player.surface.spill_item_stack(position, { name = harvest, count = harvest_amount }, true)
player.surface.spill_item_stack({ position = position, stack = { name = harvest, count = harvest_amount, quality = 'normal' } })
else
player.insert({ name = harvest, count = harvest_amount })
end
end
else
if spill_items_to_surface then
player.surface.spill_item_stack(position, { name = harvest, count = harvest_amount }, true)
player.surface.spill_item_stack({ position = position, stack = { name = harvest, count = harvest_amount, quality = 'normal' } })
else
player.insert({ name = harvest, count = harvest_amount })
end

View File

@ -43,7 +43,11 @@ local function teleport_players()
for _, player in pairs(game.connected_players) do
local pos = surface.find_non_colliding_position('character', position, 3, 0)
player.teleport({ x = pos.x, y = pos.y }, surface)
if pos then
player.teleport({ x = pos.x, y = pos.y }, surface)
else
player.teleport({ x = position.x, y = position.y }, surface)
end
end
end
@ -134,8 +138,8 @@ function Public.soft_reset_map(old_surface)
local nauvis = game.surfaces.nauvis
nauvis.clear(true)
nauvis.request_to_generate_chunks({ 0, 0 }, 1)
nauvis.force_generate_chunk_requests()
-- nauvis.request_to_generate_chunks({ 0, 0 }, 1)
-- nauvis.force_generate_chunk_requests()
local radius = 512
local area = { { x = -radius, y = -radius }, { x = radius, y = radius } }

View File

@ -1141,7 +1141,7 @@ local function update_raw()
notify_won_to_discord(buff)
local locomotive = Public.get('locomotive')
if locomotive and locomotive.valid then
locomotive.surface.spill_item_stack(locomotive.position, { name = 'coin', count = 512 }, false)
locomotive.surface.spill_item_stack({ position = locomotive.position, stack = { name = 'coin', count = 512, quality = 'normal' } })
end
Public.set('game_reset_tick', 5400)
return
@ -1203,7 +1203,7 @@ local function update_raw()
notify_won_to_discord(buff)
local locomotive = Public.get('locomotive')
if locomotive and locomotive.valid then
locomotive.surface.spill_item_stack(locomotive.position, { name = 'coin', count = 512 }, false)
locomotive.surface.spill_item_stack({ position = locomotive.position, stack = { name = 'coin', count = 512, quality = 'normal' } })
end
Public.set('game_reset_tick', 5400)
return

View File

@ -133,7 +133,6 @@ local function notify_season_over_to_discord()
inline = 'false'
}
}
log(serpent.block(text))
if server_name_matches then
Server.to_discord_named_parsed_embed(send_ping_to_channel, text)
else

View File

@ -20,8 +20,6 @@ local mining_chance_weights = {
{ name = 'heavy-oil-barrel', chance = 15 },
{ name = 'light-oil-barrel', chance = 15 },
{ name = 'water-barrel', chance = 10 },
{ name = 'green-wire', chance = 10 },
{ name = 'red-wire', chance = 10 },
{ name = 'explosives', chance = 5 },
{ name = 'advanced-circuit', chance = 5 },
{ name = 'nuclear-fuel', chance = 1 },
@ -82,8 +80,6 @@ local scrap_yield_amounts = {
['rocket-fuel'] = 0.3,
['low-density-structure'] = 0.3,
['heat-pipe'] = 1,
['green-wire'] = 8,
['red-wire'] = 8,
['engine-unit'] = 2,
['electric-engine-unit'] = 2,
['logistic-robot'] = 0.3,

View File

@ -51,135 +51,133 @@ end
local function spawn_shipwreck(surface, position)
local raffle = {}
local loot = {
{ { name = 'submachine-gun', count = math_random(1, 3) }, weight = 3, evolution_min = 0.0, evolution_max = 0.1 },
{ { name = 'slowdown-capsule', count = math_random(16, 32) }, weight = 1, evolution_min = 0.0, evolution_max = 1 },
{ { name = 'poison-capsule', count = math_random(16, 32) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'uranium-cannon-shell', count = math_random(16, 32) }, weight = 5, evolution_min = 0.6, evolution_max = 1 },
{ { name = 'cannon-shell', count = math_random(16, 32) }, weight = 5, evolution_min = 0.4, evolution_max = 0.7 },
{ { name = 'explosive-uranium-cannon-shell', count = math_random(16, 32) }, weight = 5, evolution_min = 0.6, evolution_max = 1 },
{ { name = 'explosive-cannon-shell', count = math_random(16, 32) }, weight = 5, evolution_min = 0.4, evolution_max = 0.8 },
{ { name = 'shotgun', count = 1 }, weight = 2, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'shotgun-shell', count = math_random(16, 32) }, weight = 5, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'combat-shotgun', count = 1 }, weight = 10, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'piercing-shotgun-shell', count = math_random(16, 32) }, weight = 10, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'flamethrower', count = 1 }, weight = 3, evolution_min = 0.3, evolution_max = 0.6 },
{ { name = 'flamethrower-ammo', count = math_random(16, 32) }, weight = 5, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'rocket-launcher', count = 1 }, weight = 5, evolution_min = 0.2, evolution_max = 0.6 },
{ { name = 'rocket', count = math_random(16, 32) }, weight = 10, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'explosive-rocket', count = math_random(16, 32) }, weight = 10, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'land-mine', count = math_random(16, 32) }, weight = 10, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'grenade', count = math_random(16, 32) }, weight = 10, evolution_min = 0.0, evolution_max = 0.5 },
{ { name = 'cluster-grenade', count = math_random(16, 32) }, weight = 5, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'firearm-magazine', count = math_random(32, 128) }, weight = 10, evolution_min = 0, evolution_max = 0.3 },
{ { name = 'piercing-rounds-magazine', count = math_random(32, 128) }, weight = 10, evolution_min = 0.1, evolution_max = 0.8 },
{ { name = 'uranium-rounds-magazine', count = math_random(32, 128) }, weight = 10, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'railgun', count = 1 }, weight = 1, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'railgun-dart', count = math_random(16, 32) }, weight = 3, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'defender-capsule', count = math_random(8, 16) }, weight = 10, evolution_min = 0.0, evolution_max = 0.7 },
{ { name = 'distractor-capsule', count = math_random(8, 16) }, weight = 10, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'destroyer-capsule', count = math_random(8, 16) }, weight = 10, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'atomic-bomb', count = math_random(8, 16) }, weight = 1, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'light-armor', count = 1 }, weight = 3, evolution_min = 0, evolution_max = 0.1 },
{ { name = 'heavy-armor', count = 1 }, weight = 3, evolution_min = 0.1, evolution_max = 0.3 },
{ { name = 'modular-armor', count = 1 }, weight = 2, evolution_min = 0.2, evolution_max = 0.6 },
{ { name = 'power-armor', count = 1 }, weight = 2, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'power-armor-mk2', count = 1 }, weight = 1, evolution_min = 0.8, evolution_max = 1 },
{ { name = 'battery-equipment', count = 1 }, weight = 2, evolution_min = 0.3, evolution_max = 0.7 },
{ { name = 'battery-mk2-equipment', count = 1 }, weight = 2, evolution_min = 0.6, evolution_max = 1 },
{ { name = 'belt-immunity-equipment', count = 1 }, weight = 1, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'solar-panel-equipment', count = math_random(1, 4) }, weight = 5, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'discharge-defense-equipment', count = 1 }, weight = 1, evolution_min = 0.5, evolution_max = 0.8 },
{ { name = 'energy-shield-equipment', count = math_random(1, 2) }, weight = 2, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'energy-shield-mk2-equipment', count = 1 }, weight = 2, evolution_min = 0.7, evolution_max = 1 },
{ { name = 'exoskeleton-equipment', count = 1 }, weight = 1, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'fusion-reactor-equipment', count = 1 }, weight = 1, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'night-vision-equipment', count = 1 }, weight = 1, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'personal-laser-defense-equipment', count = 1 }, weight = 2, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'exoskeleton-equipment', count = 1 }, weight = 1, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'iron-gear-wheel', count = math_random(80, 100) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'copper-cable', count = math_random(100, 200) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'engine-unit', count = math_random(16, 32) }, weight = 2, evolution_min = 0.1, evolution_max = 0.5 },
{ { name = 'electric-engine-unit', count = math_random(16, 32) }, weight = 2, evolution_min = 0.4, evolution_max = 0.8 },
{ { name = 'battery', count = math_random(100, 200) }, weight = 2, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'advanced-circuit', count = math_random(100, 200) }, weight = 3, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'electronic-circuit', count = math_random(100, 200) }, weight = 3, evolution_min = 0.0, evolution_max = 0.4 },
{ { name = 'processing-unit', count = math_random(100, 200) }, weight = 3, evolution_min = 0.7, evolution_max = 1 },
{ { name = 'explosives', count = math_random(25, 50) }, weight = 1, evolution_min = 0.2, evolution_max = 0.6 },
{ { name = 'lubricant-barrel', count = math_random(4, 10) }, weight = 1, evolution_min = 0.3, evolution_max = 0.5 },
{ { name = 'rocket-fuel', count = math_random(4, 10) }, weight = 2, evolution_min = 0.3, evolution_max = 0.7 },
{ { name = 'steel-plate', count = math_random(50, 100) }, weight = 2, evolution_min = 0.1, evolution_max = 0.3 },
{ { name = 'nuclear-fuel', count = 1 }, weight = 2, evolution_min = 0.7, evolution_max = 1 },
{ { name = 'burner-inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.1 },
{ { name = 'inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.4 },
{ { name = 'long-handed-inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.4 },
{ { name = 'fast-inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 1, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'stack-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'small-electric-pole', count = math_random(16, 32) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'medium-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'big-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'substation', count = math_random(2, 4) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'wooden-chest', count = math_random(25, 50) }, weight = 3, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'iron-chest', count = math_random(4, 8) }, weight = 3, evolution_min = 0.1, evolution_max = 0.4 },
{ { name = 'steel-chest', count = math_random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'small-lamp', count = math_random(8, 16) }, weight = 3, evolution_min = 0.1, evolution_max = 0.3 },
{ { name = 'rail', count = math_random(50, 75) }, weight = 3, evolution_min = 0.1, evolution_max = 0.6 },
{ { name = 'assembling-machine-1', count = math_random(2, 4) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'assembling-machine-2', count = math_random(2, 4) }, weight = 3, evolution_min = 0.2, evolution_max = 0.8 },
{ { name = 'assembling-machine-3', count = math_random(2, 4) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'accumulator', count = math_random(4, 8) }, weight = 3, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'offshore-pump', count = math_random(1, 2) }, weight = 2, evolution_min = 0.0, evolution_max = 0.1 },
{ { name = 'beacon', count = math_random(1, 2) }, weight = 3, evolution_min = 0.7, evolution_max = 1 },
{ { name = 'boiler', count = math_random(2, 4) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'steam-engine', count = math_random(2, 4) }, weight = 3, evolution_min = 0.0, evolution_max = 0.5 },
{ { name = 'steam-turbine', count = math_random(1, 2) }, weight = 2, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'submachine-gun', count = math_random(1, 3) }, weight = 3, evolution_min = 0.0, evolution_max = 0.1 },
{ { name = 'slowdown-capsule', count = math_random(16, 32) }, weight = 1, evolution_min = 0.0, evolution_max = 1 },
{ { name = 'poison-capsule', count = math_random(16, 32) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'uranium-cannon-shell', count = math_random(16, 32) }, weight = 5, evolution_min = 0.6, evolution_max = 1 },
{ { name = 'cannon-shell', count = math_random(16, 32) }, weight = 5, evolution_min = 0.4, evolution_max = 0.7 },
{ { name = 'explosive-uranium-cannon-shell', count = math_random(16, 32) }, weight = 5, evolution_min = 0.6, evolution_max = 1 },
{ { name = 'explosive-cannon-shell', count = math_random(16, 32) }, weight = 5, evolution_min = 0.4, evolution_max = 0.8 },
{ { name = 'shotgun', count = 1 }, weight = 2, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'shotgun-shell', count = math_random(16, 32) }, weight = 5, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'combat-shotgun', count = 1 }, weight = 10, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'piercing-shotgun-shell', count = math_random(16, 32) }, weight = 10, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'flamethrower', count = 1 }, weight = 3, evolution_min = 0.3, evolution_max = 0.6 },
{ { name = 'flamethrower-ammo', count = math_random(16, 32) }, weight = 5, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'rocket-launcher', count = 1 }, weight = 5, evolution_min = 0.2, evolution_max = 0.6 },
{ { name = 'rocket', count = math_random(16, 32) }, weight = 10, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'explosive-rocket', count = math_random(16, 32) }, weight = 10, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'land-mine', count = math_random(16, 32) }, weight = 10, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'grenade', count = math_random(16, 32) }, weight = 10, evolution_min = 0.0, evolution_max = 0.5 },
{ { name = 'cluster-grenade', count = math_random(16, 32) }, weight = 5, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'firearm-magazine', count = math_random(32, 128) }, weight = 10, evolution_min = 0, evolution_max = 0.3 },
{ { name = 'piercing-rounds-magazine', count = math_random(32, 128) }, weight = 10, evolution_min = 0.1, evolution_max = 0.8 },
{ { name = 'uranium-rounds-magazine', count = math_random(32, 128) }, weight = 10, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'railgun', count = 1 }, weight = 1, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'railgun-dart', count = math_random(16, 32) }, weight = 3, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'defender-capsule', count = math_random(8, 16) }, weight = 10, evolution_min = 0.0, evolution_max = 0.7 },
{ { name = 'distractor-capsule', count = math_random(8, 16) }, weight = 10, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'destroyer-capsule', count = math_random(8, 16) }, weight = 10, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'atomic-bomb', count = math_random(8, 16) }, weight = 1, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'light-armor', count = 1 }, weight = 3, evolution_min = 0, evolution_max = 0.1 },
{ { name = 'heavy-armor', count = 1 }, weight = 3, evolution_min = 0.1, evolution_max = 0.3 },
{ { name = 'modular-armor', count = 1 }, weight = 2, evolution_min = 0.2, evolution_max = 0.6 },
{ { name = 'power-armor', count = 1 }, weight = 2, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'power-armor-mk2', count = 1 }, weight = 1, evolution_min = 0.8, evolution_max = 1 },
{ { name = 'battery-equipment', count = 1 }, weight = 2, evolution_min = 0.3, evolution_max = 0.7 },
{ { name = 'battery-mk2-equipment', count = 1 }, weight = 2, evolution_min = 0.6, evolution_max = 1 },
{ { name = 'belt-immunity-equipment', count = 1 }, weight = 1, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'solar-panel-equipment', count = math_random(1, 4) }, weight = 5, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'discharge-defense-equipment', count = 1 }, weight = 1, evolution_min = 0.5, evolution_max = 0.8 },
{ { name = 'energy-shield-equipment', count = math_random(1, 2) }, weight = 2, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'energy-shield-mk2-equipment', count = 1 }, weight = 2, evolution_min = 0.7, evolution_max = 1 },
{ { name = 'exoskeleton-equipment', count = 1 }, weight = 1, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'fusion-reactor-equipment', count = 1 }, weight = 1, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'night-vision-equipment', count = 1 }, weight = 1, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'personal-laser-defense-equipment', count = 1 }, weight = 2, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'exoskeleton-equipment', count = 1 }, weight = 1, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'iron-gear-wheel', count = math_random(80, 100) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'copper-cable', count = math_random(100, 200) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'engine-unit', count = math_random(16, 32) }, weight = 2, evolution_min = 0.1, evolution_max = 0.5 },
{ { name = 'electric-engine-unit', count = math_random(16, 32) }, weight = 2, evolution_min = 0.4, evolution_max = 0.8 },
{ { name = 'battery', count = math_random(100, 200) }, weight = 2, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'advanced-circuit', count = math_random(100, 200) }, weight = 3, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'electronic-circuit', count = math_random(100, 200) }, weight = 3, evolution_min = 0.0, evolution_max = 0.4 },
{ { name = 'processing-unit', count = math_random(100, 200) }, weight = 3, evolution_min = 0.7, evolution_max = 1 },
{ { name = 'explosives', count = math_random(25, 50) }, weight = 1, evolution_min = 0.2, evolution_max = 0.6 },
{ { name = 'lubricant-barrel', count = math_random(4, 10) }, weight = 1, evolution_min = 0.3, evolution_max = 0.5 },
{ { name = 'rocket-fuel', count = math_random(4, 10) }, weight = 2, evolution_min = 0.3, evolution_max = 0.7 },
{ { name = 'steel-plate', count = math_random(50, 100) }, weight = 2, evolution_min = 0.1, evolution_max = 0.3 },
{ { name = 'nuclear-fuel', count = 1 }, weight = 2, evolution_min = 0.7, evolution_max = 1 },
{ { name = 'burner-inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.1 },
{ { name = 'inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.4 },
{ { name = 'long-handed-inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.4 },
{ { name = 'fast-inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 1, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'small-electric-pole', count = math_random(16, 32) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'medium-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'big-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'substation', count = math_random(2, 4) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'wooden-chest', count = math_random(25, 50) }, weight = 3, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'iron-chest', count = math_random(4, 8) }, weight = 3, evolution_min = 0.1, evolution_max = 0.4 },
{ { name = 'steel-chest', count = math_random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'small-lamp', count = math_random(8, 16) }, weight = 3, evolution_min = 0.1, evolution_max = 0.3 },
{ { name = 'rail', count = math_random(50, 75) }, weight = 3, evolution_min = 0.1, evolution_max = 0.6 },
{ { name = 'assembling-machine-1', count = math_random(2, 4) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'assembling-machine-2', count = math_random(2, 4) }, weight = 3, evolution_min = 0.2, evolution_max = 0.8 },
{ { name = 'assembling-machine-3', count = math_random(2, 4) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'accumulator', count = math_random(4, 8) }, weight = 3, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'offshore-pump', count = math_random(1, 2) }, weight = 2, evolution_min = 0.0, evolution_max = 0.1 },
{ { name = 'beacon', count = math_random(1, 2) }, weight = 3, evolution_min = 0.7, evolution_max = 1 },
{ { name = 'boiler', count = math_random(2, 4) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'steam-engine', count = math_random(2, 4) }, weight = 3, evolution_min = 0.0, evolution_max = 0.5 },
{ { name = 'steam-turbine', count = math_random(1, 2) }, weight = 2, evolution_min = 0.5, evolution_max = 1 },
--{{name = "nuclear-reactor", count = 1}, weight = 2, evolution_min = 0.5, evolution_max = 1},
{ { name = 'centrifuge', count = math_random(1, 2) }, weight = 2, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'heat-pipe', count = math_random(8, 12) }, weight = 2, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'heat-exchanger', count = math_random(2, 4) }, weight = 2, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'arithmetic-combinator', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'constant-combinator', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'decider-combinator', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'power-switch', count = math_random(2, 4) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'programmable-speaker', count = math_random(2, 4) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'green-wire', count = math_random(50, 100) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'red-wire', count = math_random(50, 100) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'chemical-plant', count = math_random(2, 4) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'burner-mining-drill', count = math_random(4, 8) }, weight = 3, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'electric-mining-drill', count = math_random(4, 8) }, weight = 3, evolution_min = 0.2, evolution_max = 0.6 },
{ { name = 'express-transport-belt', count = math_random(25, 75) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'express-underground-belt', count = math_random(4, 8) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'express-splitter', count = math_random(2, 4) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'fast-transport-belt', count = math_random(25, 75) }, weight = 3, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'fast-underground-belt', count = math_random(4, 8) }, weight = 3, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'fast-splitter', count = math_random(2, 4) }, weight = 3, evolution_min = 0.2, evolution_max = 0.3 },
{ { name = 'transport-belt', count = math_random(25, 75) }, weight = 3, evolution_min = 0, evolution_max = 0.3 },
{ { name = 'underground-belt', count = math_random(4, 8) }, weight = 3, evolution_min = 0, evolution_max = 0.3 },
{ { name = 'splitter', count = math_random(2, 4) }, weight = 3, evolution_min = 0, evolution_max = 0.3 },
{ { name = 'oil-refinery', count = math_random(1, 2) }, weight = 2, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'pipe', count = math_random(40, 50) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'pipe-to-ground', count = math_random(8, 16) }, weight = 1, evolution_min = 0.2, evolution_max = 0.5 },
{ { name = 'pumpjack', count = math_random(1, 2) }, weight = 1, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'pump', count = math_random(1, 4) }, weight = 1, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'solar-panel', count = math_random(4, 8) }, weight = 3, evolution_min = 0.4, evolution_max = 0.9 },
{ { name = 'electric-furnace', count = math_random(2, 4) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'steel-furnace', count = math_random(4, 8) }, weight = 3, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'stone-furnace', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.1 },
{ { name = 'radar', count = math_random(1, 2) }, weight = 1, evolution_min = 0.1, evolution_max = 0.3 },
{ { name = 'rail-signal', count = math_random(8, 16) }, weight = 2, evolution_min = 0.2, evolution_max = 0.8 },
{ { name = 'rail-chain-signal', count = math_random(8, 16) }, weight = 2, evolution_min = 0.2, evolution_max = 0.8 },
{ { name = 'stone-wall', count = math_random(25, 75) }, weight = 1, evolution_min = 0.1, evolution_max = 0.5 },
{ { name = 'gate', count = math_random(4, 8) }, weight = 1, evolution_min = 0.1, evolution_max = 0.5 },
{ { name = 'storage-tank', count = math_random(2, 4) }, weight = 3, evolution_min = 0.3, evolution_max = 0.6 },
{ { name = 'train-stop', count = math_random(1, 2) }, weight = 1, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'express-loader', count = math_random(1, 2) }, weight = 1, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'fast-loader', count = math_random(1, 2) }, weight = 1, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'loader', count = math_random(1, 2) }, weight = 1, evolution_min = 0.0, evolution_max = 0.5 },
{ { name = 'lab', count = math_random(2, 4) }, weight = 2, evolution_min = 0.0, evolution_max = 0.1 },
{ { name = 'centrifuge', count = math_random(1, 2) }, weight = 2, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'heat-pipe', count = math_random(8, 12) }, weight = 2, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'heat-exchanger', count = math_random(2, 4) }, weight = 2, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'arithmetic-combinator', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'constant-combinator', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'decider-combinator', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'power-switch', count = math_random(2, 4) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'programmable-speaker', count = math_random(2, 4) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'chemical-plant', count = math_random(2, 4) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'burner-mining-drill', count = math_random(4, 8) }, weight = 3, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'electric-mining-drill', count = math_random(4, 8) }, weight = 3, evolution_min = 0.2, evolution_max = 0.6 },
{ { name = 'express-transport-belt', count = math_random(25, 75) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'express-underground-belt', count = math_random(4, 8) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'express-splitter', count = math_random(2, 4) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'fast-transport-belt', count = math_random(25, 75) }, weight = 3, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'fast-underground-belt', count = math_random(4, 8) }, weight = 3, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'fast-splitter', count = math_random(2, 4) }, weight = 3, evolution_min = 0.2, evolution_max = 0.3 },
{ { name = 'transport-belt', count = math_random(25, 75) }, weight = 3, evolution_min = 0, evolution_max = 0.3 },
{ { name = 'underground-belt', count = math_random(4, 8) }, weight = 3, evolution_min = 0, evolution_max = 0.3 },
{ { name = 'splitter', count = math_random(2, 4) }, weight = 3, evolution_min = 0, evolution_max = 0.3 },
{ { name = 'oil-refinery', count = math_random(1, 2) }, weight = 2, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'pipe', count = math_random(40, 50) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'pipe-to-ground', count = math_random(8, 16) }, weight = 1, evolution_min = 0.2, evolution_max = 0.5 },
{ { name = 'pumpjack', count = math_random(1, 2) }, weight = 1, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'pump', count = math_random(1, 4) }, weight = 1, evolution_min = 0.3, evolution_max = 0.8 },
{ { name = 'solar-panel', count = math_random(4, 8) }, weight = 3, evolution_min = 0.4, evolution_max = 0.9 },
{ { name = 'electric-furnace', count = math_random(2, 4) }, weight = 3, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'steel-furnace', count = math_random(4, 8) }, weight = 3, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'stone-furnace', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.1 },
{ { name = 'radar', count = math_random(1, 2) }, weight = 1, evolution_min = 0.1, evolution_max = 0.3 },
{ { name = 'rail-signal', count = math_random(8, 16) }, weight = 2, evolution_min = 0.2, evolution_max = 0.8 },
{ { name = 'rail-chain-signal', count = math_random(8, 16) }, weight = 2, evolution_min = 0.2, evolution_max = 0.8 },
{ { name = 'stone-wall', count = math_random(25, 75) }, weight = 1, evolution_min = 0.1, evolution_max = 0.5 },
{ { name = 'gate', count = math_random(4, 8) }, weight = 1, evolution_min = 0.1, evolution_max = 0.5 },
{ { name = 'storage-tank', count = math_random(2, 4) }, weight = 3, evolution_min = 0.3, evolution_max = 0.6 },
{ { name = 'train-stop', count = math_random(1, 2) }, weight = 1, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'express-loader', count = math_random(1, 2) }, weight = 1, evolution_min = 0.5, evolution_max = 1 },
{ { name = 'fast-loader', count = math_random(1, 2) }, weight = 1, evolution_min = 0.2, evolution_max = 0.7 },
{ { name = 'loader', count = math_random(1, 2) }, weight = 1, evolution_min = 0.0, evolution_max = 0.5 },
{ { name = 'lab', count = math_random(2, 4) }, weight = 2, evolution_min = 0.0, evolution_max = 0.1 },
--{{name = "roboport", count = math_random(2,4)}, weight = 2, evolution_min = 0.6, evolution_max = 1},
--{{name = "flamethrower-turret", count = math_random(4,8)}, weight = 3, evolution_min = 0.5, evolution_max = 1},
--{{name = "laser-turret", count = math_random(4,8)}, weight = 3, evolution_min = 0.5, evolution_max = 1},
{ { name = 'gun-turret', count = math_random(2, 4) }, weight = 3, evolution_min = 0.2, evolution_max = 0.9 }
{ { name = 'gun-turret', count = math_random(2, 4) }, weight = 3, evolution_min = 0.2, evolution_max = 0.9 }
}
local distance_to_center = math.sqrt(position.x ^ 2 + position.y ^ 2)

View File

@ -489,7 +489,6 @@ Public.resourcecount_quest_data_raw = {
{ 0.5, 0, 1, false, 'electronic-circuit', 1400 },
{ 1.1, 0, 1, false, 'transport-belt', 1600 },
{ 0.8, 0, 1, false, 'repair-pack', 350 },
-- {0.1, 0, 1, false, 'red-wire', 500},
{ 0.4, 0, 1, false, 'barrel', 200 },
{ 0.7, 0, 0.5, false, 'underground-belt', 200 },
{ 0.7, 0, 0.5, false, 'splitter', 150 },

View File

@ -397,7 +397,7 @@ Public.technologies = {
['refined-flammables-7'] = false,
['rocketry'] = false,
['solar-panel-equipment'] = false,
['stack-inserter'] = false,
['bulk-inserter'] = false,
['stronger-explosives-2'] = false,
['stronger-explosives-3'] = false,
['stronger-explosives-4'] = false,
@ -758,7 +758,7 @@ Public.merchant_offer = {
},
offer = {
type = 'unlock-recipe',
recipe = 'stack-inserter'
recipe = 'bulk-inserter'
}
},
{

View File

@ -156,8 +156,6 @@ local function set_offers(market, player)
table_insert(market_items, { price = { { 'advanced-circuit', 1 } }, offer = { type = 'give-item', item = 'coin', count = 5 } })
table_insert(market_items, { price = { { 'processing-unit', 1 } }, offer = { type = 'give-item', item = 'coin', count = 10 } })
table_insert(market_items, { price = { { 'plastic-bar', 1 } }, offer = { type = 'give-item', item = 'coin', count = 1 } })
table_insert(market_items, { price = { { 'green-wire', 5 } }, offer = { type = 'give-item', item = 'coin', count = 1 } })
table_insert(market_items, { price = { { 'red-wire', 5 } }, offer = { type = 'give-item', item = 'coin', count = 1 } })
table_insert(market_items, { price = { { 'battery', 1 } }, offer = { type = 'give-item', item = 'coin', count = 1 } })
table_insert(market_items, { price = { { 'heat-pipe', 1 } }, offer = { type = 'give-item', item = 'coin', count = 1 } })
table_insert(market_items, { price = { { 'pipe', 8 } }, offer = { type = 'give-item', item = 'coin', count = 1 } })

View File

@ -117,7 +117,6 @@ local container_loot_amounts = {
--["explosive-rocket"] = 2,
--["explosive-uranium-cannon-shell"] = 2,
['explosives'] = 4,
['green-wire'] = 8,
['grenade'] = 6,
['heat-pipe'] = 1,
['heavy-oil-barrel'] = 3,
@ -135,7 +134,6 @@ local container_loot_amounts = {
['pipe-to-ground'] = 1,
['plastic-bar'] = 4,
['processing-unit'] = 2,
['red-wire'] = 8,
--["rocket"] = 2,
--["rocket-fuel"] = 0.3,
['solid-fuel'] = 4,

View File

@ -61,7 +61,6 @@ local entity_loot_amounts = {
['engine-unit'] = 2,
['explosive-cannon-shell'] = 1,
['explosives'] = 4,
['green-wire'] = 8,
['grenade'] = 6,
['heat-pipe'] = 1,
['heavy-oil-barrel'] = 3,
@ -77,7 +76,6 @@ local entity_loot_amounts = {
['pipe-to-ground'] = 1,
['plastic-bar'] = 4,
['processing-unit'] = 2,
['red-wire'] = 8,
['rocket-fuel'] = 0.3,
['solid-fuel'] = 4,
['steel-plate'] = 4,

View File

@ -83,7 +83,7 @@ local function treasure_chest(position, surface)
{ { name = 'long-handed-inserter', count = math_random(16, 32) }, weight = 3, evolution_min = 0.0, evolution_max = 0.4 },
{ { name = 'fast-inserter', count = math_random(16, 32) }, weight = 3, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 1, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'stack-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'small-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'medium-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'big-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
@ -111,8 +111,6 @@ local function treasure_chest(position, surface)
{ { name = 'decider-combinator', count = math_random(25, 50) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'power-switch', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'programmable-speaker', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'green-wire', count = math_random(100, 200) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'red-wire', count = math_random(100, 200) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'chemical-plant', count = math_random(2, 4) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'burner-mining-drill', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'electric-mining-drill', count = math_random(4, 8) }, weight = 3, evolution_min = 0.2, evolution_max = 0.6 },

View File

@ -152,7 +152,7 @@ function get_loot_item_stack()
{ { name = 'long-handed-inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.0, evolution_max = 0.4 },
{ { name = 'fast-inserter', count = math_random(8, 16) }, weight = 3, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 1, evolution_min = 0.4, evolution_max = 1 },
{ { name = 'stack-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'bulk-inserter', count = math_random(4, 8) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'small-electric-pole', count = math_random(16, 32) }, weight = 3, evolution_min = 0.0, evolution_max = 0.3 },
{ { name = 'medium-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.2, evolution_max = 1 },
{ { name = 'big-electric-pole', count = math_random(8, 16) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
@ -180,8 +180,6 @@ function get_loot_item_stack()
{ { name = 'decider-combinator', count = math_random(8, 16) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'power-switch', count = math_random(2, 4) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'programmable-speaker', count = math_random(2, 4) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'green-wire', count = math_random(50, 100) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'red-wire', count = math_random(50, 100) }, weight = 1, evolution_min = 0.1, evolution_max = 1 },
{ { name = 'chemical-plant', count = math_random(2, 4) }, weight = 3, evolution_min = 0.3, evolution_max = 1 },
{ { name = 'burner-mining-drill', count = math_random(4, 8) }, weight = 3, evolution_min = 0.0, evolution_max = 0.2 },
{ { name = 'electric-mining-drill', count = math_random(4, 8) }, weight = 3, evolution_min = 0.2, evolution_max = 0.6 },

View File

@ -68,9 +68,9 @@ end
local function set_boss_healthbar(health, max_health, healthbar_id)
local m = health / max_health
local x_scale = rendering.get_y_scale(healthbar_id) * 15
rendering.set_x_scale(healthbar_id, x_scale * m)
rendering.set_color(healthbar_id, { math_floor(255 - 255 * m), math_floor(200 * m), 0 })
local x_scale = healthbar_id.y_scale * 15
healthbar_id.x_scale = x_scale * m
healthbar_id.color = { math.floor(255 - 255 * m), math.floor(200 * m), 0 }
end
function Public.add_unit(unit, health_multiplier)

View File

@ -247,9 +247,9 @@ local function set_boss_healthbar(health, max_health, healthbar_id)
if m < 0 then
return
end
local x_scale = rendering.get_y_scale(healthbar_id) * 15
rendering.set_x_scale(healthbar_id, x_scale * m)
rendering.set_color(healthbar_id, { floor(255 - 255 * m), floor(200 * m), 0 })
local x_scale = healthbar_id.y_scale * 15
healthbar_id.x_scale = x_scale * m
healthbar_id.color = { floor(255 - 255 * m), floor(200 * m), 0 }
end
local function extra_projectiles(cause, target)

View File

@ -19,8 +19,6 @@ local mining_chance_weights = {
{ name = 'heavy-oil-barrel', chance = 15 },
{ name = 'light-oil-barrel', chance = 15 },
{ name = 'water-barrel', chance = 10 },
{ name = 'green-wire', chance = 10 },
{ name = 'red-wire', chance = 10 },
{ name = 'explosives', chance = 5 },
{ name = 'advanced-circuit', chance = 5 },
{ name = 'nuclear-fuel', chance = 1 },
@ -81,8 +79,6 @@ local scrap_yield_amounts = {
['rocket-fuel'] = 0.3,
['low-density-structure'] = 0.3,
['heat-pipe'] = 1,
['green-wire'] = 8,
['red-wire'] = 8,
['engine-unit'] = 2,
['electric-engine-unit'] = 2,
['logistic-robot'] = 0.3,

View File

@ -25,7 +25,7 @@ local item_worths = {
['inserter'] = 4,
['long-handed-inserter'] = 8,
['fast-inserter'] = 16,
['stack-inserter'] = 128,
['bulk-inserter'] = 128,
['bulk-inserter'] = 160,
['small-electric-pole'] = 2,
['medium-electric-pole'] = 32,
@ -53,8 +53,6 @@ local item_worths = {
['logistic-chest-requester'] = 512,
['roboport'] = 2048,
['small-lamp'] = 4,
['red-wire'] = 4,
['green-wire'] = 4,
['arithmetic-combinator'] = 16,
['decider-combinator'] = 16,
['constant-combinator'] = 8,

View File

@ -46,6 +46,19 @@ local restore_crafting_boost_token =
end
)
local create_level_text_token =
Token.register(
function (event)
local player_index = event.player_index
local player = game.get_player(player_index)
if not player or not player.valid then
return
end
Public.draw_level_text(player)
end
)
local function create_healthbar(player, size)
return rendering.draw_sprite(
{
@ -709,8 +722,8 @@ function Public.update_tidal_wave()
local next_offset_y = cause_position.y + wave.direction[2] * (i + 1) - j * wave.direction[1]
local next_position = { next_offset_x, next_offset_y }
surface.create_entity({ name = 'big-demolisher-fissure', position = position })
-- surface.create_entity({ name = 'water-splash', position = position })
-- surface.create_entity({ name = 'big-demolisher-fissure', position = position })
surface.create_entity({ name = 'water-splash', position = position })
-- surface.create_trivial_smoke({name = 'poison-capsule-smoke', position = position})
local sound = 'utility/build_small'
wave_player.play_sound { path = sound, volume_modifier = 1 }
@ -734,8 +747,8 @@ function Public.update_tidal_wave()
local next_offset_y = cause_position.y + wave.direction[2] * (i + 1) - j * wave.direction[1]
local next_position = { next_offset_x, next_offset_y }
-- surface.create_trivial_smoke({name = 'poison-capsule-smoke', position = position})
-- surface.create_entity({ name = 'water-splash', position = position })
surface.create_entity({ name = 'big-demolisher-fissure', position = position })
surface.create_entity({ name = 'water-splash', position = position })
-- surface.create_entity({ name = 'big-demolisher-fissure', position = position })
local sound = 'utility/build_small'
wave_player.play_sound { path = sound, volume_modifier = 1 }
@ -828,8 +841,6 @@ function Public.level_up_effects(player)
position = position,
text = '+LVL',
color = level_up_floating_text_color,
time_to_live = 300,
speed = 100
}
)
local b = 0.75
@ -843,8 +854,6 @@ function Public.level_up_effects(player)
position = p,
text = '',
color = { 255, random(0, 100), 0 },
time_to_live = 300,
speed = 100
}
)
end
@ -865,8 +874,6 @@ function Public.cast_spell(player, failed)
position = p,
text = '✔️',
color = { 255, random(0, 100), 0 },
time_to_live = 300,
speed = 100
}
)
end
@ -882,8 +889,6 @@ function Public.cast_spell(player, failed)
position = p,
text = '',
color = { 255, random(0, 100), 0 },
time_to_live = 300,
speed = 100
}
)
end
@ -898,8 +903,6 @@ function Public.xp_effects(player)
position = position,
text = '+XP',
color = level_up_floating_text_color,
time_to_live = 300,
speed = 100
}
)
local b = 0.75
@ -913,7 +916,6 @@ function Public.xp_effects(player)
position = p,
text = '',
color = { 255, random(0, 100), 0 },
time_to_live = 300,
speed = 100
}
)
@ -934,8 +936,6 @@ function Public.boost_effects(player)
position = p,
text = '♻️',
color = { random(0, 100), random(0, 100), 0 },
time_to_live = 300,
speed = 100
}
)
end
@ -1106,8 +1106,6 @@ function Public.get_heal_modifier_from_using_fish(player)
position = { position.x, position.y + 0.6 },
text = '+' .. rng,
color = color,
time_to_live = 300,
speed = 100
}
)
char.health = char.health + rng
@ -1484,6 +1482,7 @@ function Public.rpg_reset_player(player, one_time_reset)
Public.draw_gui_char_button(player)
Public.draw_level_text(player)
Task.set_timeout_in_ticks(5, create_level_text_token, { player_index = player.index })
Public.update_char_button(player)
Public.update_player_stats(player)
end
@ -1577,8 +1576,6 @@ function Public.gain_xp(player, amount, added_to_pool, text)
text = text_to_draw,
position = player.physical_position,
color = xp_floating_text_color,
time_to_live = 340,
speed = 2
}
rpg_t.xp_since_last_floaty_text = 0

View File

@ -123,8 +123,6 @@ function Public.reset_table(migrate)
this.rpg_extra.enable_aoe_punch_globally = false
this.rpg_extra.disable_get_heal_modifier_from_using_fish = false
this.rpg_extra.tweaked_crafting_items = {
['red-wire'] = true,
['green-wire'] = true,
['stone-furnace'] = true,
['wooden-chest'] = true,
['copper-cable'] = true,

View File

@ -372,7 +372,6 @@ local player_force_enabled_recipes = {
'cargo-wagon',
'constant-combinator',
'engine-unit',
'green-wire',
'locomotive',
'rail',
'train-stop',

View File

@ -1,8 +1,7 @@
-- track state of units by Gerkiz
local Event = require 'utils.event'
local Global = require 'utils.global'
local Task = require 'utils.task'
local Token = require 'utils.token'
local Task = require 'utils.task_token'
local Public = require 'modules.wave_defense.table'
local Difficulty = require 'modules.difficulty_vote_by_amount'
local Beams = require 'modules.render_beam'
@ -21,7 +20,7 @@ local this = {
frenzy_burst_length = 160,
update_rate = 120,
enabled = true,
track_bosses_only = true,
track_bosses_only = false,
wave_number = 0,
unit_limit = 300,
},
@ -87,31 +86,31 @@ local commands = {
--- A token to register tasks that entities are given
local work_token
work_token =
Token.register(
Task.register(
function (event)
if not event then
return
end
local state = Public.get_unit(event.unit_number)
local self = Public.get_unit(event.unit_number)
local tick = game.tick
if not state then
if not self then
return
end
if state:validate() then
state:work(tick)
state.command = commands[state.command]
set_timeout_in_ticks(state:get_update_rate(), work_token, event)
if self:validate() then
self:work(tick)
self.command = commands[self.command]
set_timeout_in_ticks(self:get_update_rate(), work_token, event)
else
state:remove()
self:remove()
end
end
)
--- Restores a given entity to their original force
local restore_force_token =
Token.register(
Task.register(
function (event)
if not event then
return
@ -129,6 +128,40 @@ local restore_force_token =
end
)
local function create_forces()
local aggressors = game.forces.aggressors
local aggressors_frenzy = game.forces.aggressors_frenzy
local enemy = game.forces.enemy
if not aggressors then
aggressors = game.create_force('aggressors')
end
if not aggressors_frenzy then
aggressors_frenzy = game.create_force('aggressors_frenzy')
end
aggressors.set_friend('aggressors_frenzy', true)
aggressors.set_cease_fire('aggressors_frenzy', true)
aggressors.set_friend('enemy', true)
aggressors.set_cease_fire('enemy', true)
aggressors_frenzy.set_friend('aggressors', true)
aggressors_frenzy.set_cease_fire('aggressors', true)
aggressors_frenzy.set_friend('enemy', true)
aggressors_frenzy.set_cease_fire('enemy', true)
enemy.set_friend('aggressors', true)
enemy.set_cease_fire('aggressors', true)
enemy.set_friend('aggressors_frenzy', true)
enemy.set_cease_fire('aggressors_frenzy', true)
end
local create_forces_token =
Task.register(
function ()
create_forces()
end
)
local function has_unit_limit_reached()
local uid = Public.get_count()
if uid >= (this.settings.unit_limit and this.settings.unit_limit) then
@ -289,33 +322,6 @@ local function shoot_laser(surface, source, enemy)
enemy.damage(20 * (1 + force.get_ammo_damage_modifier('laser') + force.get_gun_speed_modifier('laser')), force, 'laser', source)
end
local function set_forces()
local aggressors = game.forces.aggressors
local aggressors_frenzy = game.forces.aggressors_frenzy
local enemy = game.forces.enemy
if not aggressors then
aggressors = game.create_force('aggressors')
end
if not aggressors_frenzy then
aggressors_frenzy = game.create_force('aggressors_frenzy')
end
aggressors.set_friend('aggressors_frenzy', true)
aggressors.set_cease_fire('aggressors_frenzy', true)
aggressors.set_friend('enemy', true)
aggressors.set_cease_fire('enemy', true)
aggressors_frenzy.set_friend('aggressors', true)
aggressors_frenzy.set_cease_fire('aggressors', true)
aggressors_frenzy.set_friend('enemy', true)
aggressors_frenzy.set_cease_fire('enemy', true)
enemy.set_friend('aggressors', true)
enemy.set_cease_fire('aggressors', true)
enemy.set_friend('aggressors_frenzy', true)
enemy.set_cease_fire('aggressors_frenzy', true)
end
local function on_init()
this.states = {}
this.settings.spawned_units = 0
@ -324,7 +330,8 @@ local function on_init()
this.settings.update_rate = 120
this.target_settings = {}
this.settings.final_battle = false
set_forces()
create_forces()
Task.set_timeout_in_ticks(30, create_forces_token)
end
local function on_wave_created(event)
@ -368,7 +375,7 @@ local function on_unit_group_created(event)
for _, entity in pairs(unit_group.members) do
if not Public.get_unit(entity.unit_number) then
local data = {
entity = entity
entity = entity,
}
local state = Public.new(data)
if not state then
@ -531,6 +538,7 @@ function Public.new(data)
state.id = state.entity.unit_number
state.update_rate = this.settings.update_rate + (10 * state.uid)
state.ttl = data.ttl or tick + (5 * 3600) -- 5 minutes duration
state:check_unit_group()
state:validate()
set_timeout_in_ticks(state.update_rate, work_token, { unit_number = state.unit_number })
@ -712,20 +720,6 @@ function Public._esp:spawn_children()
end
end
-- Sets unit_group for the given unit if any
function Public._esp:unit_group(unit_group)
local entity = self.entity
if not entity or not entity.valid then
return
end
if not unit_group then
return
end
self.unit_group = unit_group
end
--- Creates a beam.
function Public._esp:beam()
local entity = self.entity
@ -866,7 +860,7 @@ function Public._esp:find_targets()
self.commands[#self.commands + 1] = {
type = defines.command.attack,
target = obstacles[ii],
distraction = defines.distraction.by_anything
distraction = defines.distraction.none
}
end
end
@ -907,6 +901,26 @@ function Public._esp:switch_position()
return position
end
--- Validates if this unit has a unit_group.
---@return boolean|integer
function Public._esp:check_unit_group()
if not self:validate() then return false end
if not self.group or not self.group.valid then
local surface = self.surface_id and game.get_surface(self.surface_id) and game.get_surface(self.surface_id).valid and game.get_surface(self.surface_id)
local unit_group = surface.create_unit_group({ position = self.entity.position, force = self.force })
self.group = unit_group
end
if not self.group or not self.group.valid then
log('EnemyStates::CheckUnitGroup - Unit group is invalid')
return false
end
self.group.add_member(self.entity)
return true
end
--- Validates if a state is valid.
---@return boolean|integer
function Public._esp:validate()
@ -965,17 +979,15 @@ function Public._esp:go_to_location_command()
return
end
local entity = self.entity
if not entity or not entity.valid then
return
if not self.group or not self.group.valid then
self:check_unit_group()
end
pcall(entity.set_command, {
self.group.set_command {
type = defines.command.go_to_location,
destination_entity = unit,
radius = 3
})
}
end
function Public._esp:attack_command()
@ -984,16 +996,14 @@ function Public._esp:attack_command()
return
end
local entity = self.entity
if not entity or not entity.valid then
return
if not self.group or not self.group.valid then
self:check_unit_group()
end
pcall(entity.set_command, {
self.group.set_command {
type = defines.command.attack,
target = unit
})
}
end
function Public._esp:attack_area_command()
@ -1002,18 +1012,16 @@ function Public._esp:attack_area_command()
return
end
local entity = self.entity
if not entity or not entity.valid then
return
if not self.group or not self.group.valid then
self:check_unit_group()
end
pcall(entity.set_command, {
self.group.set_command {
type = defines.command.attack_area,
destination = { x = unit.position.x, y = unit.position.y },
radius = 15,
distraction = defines.distraction.by_anything
})
radius = 30,
distraction = defines.distraction.none
}
end
function Public._esp:flee_command()
@ -1022,16 +1030,14 @@ function Public._esp:flee_command()
return
end
local entity = self.entity
if not entity or not entity.valid then
return
if not self.group or not self.group.valid then
self:check_unit_group()
end
pcall(entity.set_command, {
self.group.set_command {
type = defines.command.flee,
from = unit,
})
}
end
function Public._esp:work(tick)

View File

@ -29,7 +29,7 @@ local function normalize_spawn_position()
Public.set_spawn_position(new_pos)
return new_pos
else
local new_pos = { x = 0, y = collapse_spawn_position.y - 40 }
local new_pos = { x = 0, y = collapse_spawn_position.y }
Public.set_spawn_position(new_pos)
return new_pos
end
@ -163,11 +163,10 @@ local function get_spawn_pos()
local inverted = Public.get('inverted')
if inverted then
if initial_position.y - target.position.y < -10 then
initial_position = { x = initial_position.x, y = initial_position.y }
initial_position = { x = initial_position.x, y = initial_position.y + 50 }
end
else
if initial_position.y - target.position.y > 10 then
initial_position = { x = initial_position.x, y = initial_position.y }
initial_position = { x = initial_position.x, y = initial_position.y - 10 }
end
end
@ -1106,6 +1105,7 @@ local function spawn_unit_group(fs, only_bosses)
local target = Public.get('target')
if not valid(target) then
Public.debug_print('spawn_unit_group - Target was not valid?')
Event.raise(Public.events.on_primary_target_missing)
return
end
@ -1261,6 +1261,7 @@ local function spawn_unit_group_simple(fs)
local target = Public.get('target')
if not valid(target) then
Public.debug_print('spawn_unit_group_simple - Target was not valid?')
Event.raise(Public.events.on_primary_target_missing)
return
end

View File

@ -14,6 +14,7 @@ Public.events = {
on_evolution_factor_changed = Event.generate_event_name('on_evolution_factor_changed'),
on_game_reset = Event.generate_event_name('on_game_reset'),
on_target_aquired = Event.generate_event_name('on_target_aquired'),
on_primary_target_missing = Event.generate_event_name('on_primary_target_missing'),
on_entity_created = Event.generate_event_name('on_entity_created'),
on_biters_evolved = Event.generate_event_name('on_biters_evolved'),
on_spawn_unit_group = Event.generate_event_name('on_spawn_unit_group'),
@ -423,6 +424,12 @@ function Public.set_pause_wave_in_ticks(int)
this.pause_wave_in_ticks = int or 18000
end
--- Sets the main target.
-- @param <target_type> userdata
function Public.set_main_target(target)
this.target = target
end
--- Pauses the wave defense module
-- @param null
function Public.pause(boolean)

View File

@ -99,7 +99,7 @@ market.logistic = {
['inserter'] = { value = 8, rarity = 1 },
['long-handed-inserter'] = { value = 12, rarity = 2 },
['fast-inserter'] = { value = 16, rarity = 4 },
['stack-inserter'] = { value = 96, rarity = 6 },
['bulk-inserter'] = { value = 96, rarity = 6 },
['bulk-inserter'] = { value = 128, rarity = 7 },
['small-electric-pole'] = { value = 2, rarity = 1 },
['medium-electric-pole'] = { value = 12, rarity = 4 },
@ -133,8 +133,6 @@ market.vehicles = {
market.wire = {
['small-lamp'] = { value = 4, rarity = 1 },
['red-wire'] = { value = 4, rarity = 1 },
['green-wire'] = { value = 4, rarity = 1 },
['arithmetic-combinator'] = { value = 16, rarity = 1 },
['decider-combinator'] = { value = 16, rarity = 1 },
['constant-combinator'] = { value = 16, rarity = 1 },

View File

@ -18,9 +18,9 @@
end ]]
local function set_healthbar(boss_unit)
local m = boss_unit.health / boss_unit.max_health
local x_scale = rendering.get_y_scale(boss_unit.healthbar_id) * 15
rendering.set_x_scale(boss_unit.healthbar_id, x_scale * m)
rendering.set_color(boss_unit.healthbar_id, { math.floor(255 - 255 * m), math.floor(200 * m), 0 })
local x_scale = boss_unit.healthbar_id.y_scale * 15
boss_unit.healthbar_id.x_scale = x_scale * m
boss_unit.healthbar_id.color = { math.floor(255 - 255 * m), math.floor(200 * m), 0 }
end
--[[ local function add_boss_unit(entity, health_factor, size)

View File

@ -32,7 +32,7 @@ local item_worths = {
['inserter'] = 4,
['long-handed-inserter'] = 8,
['fast-inserter'] = 16,
['stack-inserter'] = 128,
['bulk-inserter'] = 128,
['bulk-inserter'] = 160,
['small-electric-pole'] = 2,
['medium-electric-pole'] = 32,
@ -60,8 +60,6 @@ local item_worths = {
['requester-chest'] = 512,
['roboport'] = 2048,
['small-lamp'] = 4,
['red-wire'] = 4,
['green-wire'] = 4,
['arithmetic-combinator'] = 16,
['decider-combinator'] = 16,
['constant-combinator'] = 8,
@ -254,8 +252,6 @@ local tech_tier_list = {
'assembling-machine-2',
'explosives',
'advanced-circuit',
'red-wire',
'green-wire',
'arithmetic-combinator',
'decider-combinator',
'constant-combinator',
@ -285,7 +281,7 @@ local tech_tier_list = {
'train-stop',
'rail-signal',
'rail-chain-signal',
'stack-inserter',
'bulk-inserter',
'bulk-inserter',
'pumpjack',
'oil-refinery',

View File

@ -44,6 +44,9 @@ function Public.init_player_table(player, reset)
if not player then
return
end
if not this.score_table then return end
if not this.score_table[player.force.name] then return end
if not this.score_table[player.force.name].players then return end
if reset then
this.score_table[player.force.name].players[player.name] = {
built_entities = 0,

View File

@ -99,9 +99,9 @@ Public.ranks = {
'item/distractor-capsule',
'item/distractor-capsule',
'item/distractor-capsule',
'item/stack-inserter',
'item/stack-inserter',
'item/stack-inserter',
'item/bulk-inserter',
'item/bulk-inserter',
'item/bulk-inserter',
'item/electric-furnace',
'item/electric-furnace',
'item/electric-furnace',

View File

@ -40,8 +40,8 @@ local primitives = {
}
Global.register(
{callbacks = callbacks, task_queue = task_queue, primitives = primitives},
function(tbl)
{ callbacks = callbacks, task_queue = task_queue, primitives = primitives },
function (tbl)
callbacks = tbl.callbacks
task_queue = tbl.task_queue
primitives = tbl.primitives
@ -52,20 +52,20 @@ Global.register(
local delay_print_token =
Token.register(
function(event)
local text = event.text
if not text then
return
end
function (event)
local text = event.text
if not text then
return
end
local color = event.color
if not color then
color = Color.info
end
local color = event.color
if not color then
color = Color.info
end
game.print(text, color)
end
)
game.print(text, color)
end
)
local function handler_error(err)
log('\n\t' .. trace(err))
@ -126,7 +126,7 @@ function Task.set_timeout_in_ticks(ticks, func_token, params)
error('cannot call when game is not available', 2)
end
local time = game.tick + ticks
local callback = {time = time, func_token = func_token, params = params}
local callback = { time = time, func_token = func_token, params = params }
PriorityQueue_push(callbacks, callback)
end
@ -139,7 +139,7 @@ function Task.set_timeout_in_ticks_text(ticks, params)
error('cannot call when game is not available', 2)
end
local time = game.tick + ticks
local callback = {time = time, func_token = delay_print_token, params = params}
local callback = { time = time, func_token = delay_print_token, params = params }
PriorityQueue_push(callbacks, callback)
end
@ -165,7 +165,7 @@ end
function Task.queue_task(func_token, params, weight)
weight = weight or 1
primitives.total_task_weight = primitives.total_task_weight + weight
Queue_push(task_queue, {func_token = func_token, params = params, weight = weight})
Queue_push(task_queue, { func_token = func_token, params = params, weight = weight })
end
function Task.get_queue_speed()

View File

@ -38,8 +38,6 @@ local mining_chance_weights = {
{ name = 'heavy-oil-barrel', chance = 15 },
{ name = 'light-oil-barrel', chance = 15 },
{ name = 'water-barrel', chance = 10 },
{ name = 'green-wire', chance = 10 },
{ name = 'red-wire', chance = 10 },
{ name = 'explosives', chance = 5 },
{ name = 'advanced-circuit', chance = 5 },
{ name = 'nuclear-fuel', chance = 1 },
@ -100,8 +98,6 @@ local scrap_yield_amounts = {
['rocket-fuel'] = 0.3,
['low-density-structure'] = 0.3,
['heat-pipe'] = 1,
['green-wire'] = 8,
['red-wire'] = 8,
['engine-unit'] = 2,
['electric-engine-unit'] = 2,
['logistic-robot'] = 0.3,

View File

@ -72,8 +72,6 @@ local mining_chance_weights = {
{ name = 'heavy-oil-barrel', chance = 15 },
{ name = 'light-oil-barrel', chance = 15 },
{ name = 'water-barrel', chance = 10 },
{ name = 'green-wire', chance = 10 },
{ name = 'red-wire', chance = 10 },
{ name = 'explosives', chance = 5 },
{ name = 'advanced-circuit', chance = 5 },
{ name = 'nuclear-fuel', chance = 1 },
@ -134,8 +132,6 @@ local scrap_yield_amounts = {
['rocket-fuel'] = 0.3,
['low-density-structure'] = 0.3,
['heat-pipe'] = 1,
['green-wire'] = 8,
['red-wire'] = 8,
['engine-unit'] = 2,
['electric-engine-unit'] = 2,
['logistic-robot'] = 0.3,