mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2024-12-30 23:17:53 +02:00
minor fixes
This commit is contained in:
parent
6a505cb85a
commit
7e2215ee3b
@ -11,12 +11,16 @@ local spaghett_entity_blacklist = {
|
||||
['logistic-chest-active-provider'] = true
|
||||
}
|
||||
|
||||
local function get_actor(event, prefix, msg)
|
||||
local function get_actor(event, prefix, msg, admins_only)
|
||||
local player = game.get_player(event.player_index)
|
||||
if not player or not player.valid then
|
||||
return
|
||||
end
|
||||
Utils.action_warning(prefix, player.name .. ' ' .. msg)
|
||||
if admins_only then
|
||||
Utils.print_admins(msg, player.name)
|
||||
else
|
||||
Utils.action_warning(prefix, player.name .. ' ' .. msg)
|
||||
end
|
||||
end
|
||||
|
||||
local function spaghett_deny_building(event)
|
||||
@ -157,10 +161,10 @@ local antigrief_functions = {
|
||||
local AG = Antigrief.get()
|
||||
if event.element.switch_state == 'left' then
|
||||
AG.enabled = true
|
||||
get_actor(event, '{Antigrief}', 'has enabled the antigrief function.')
|
||||
get_actor(event, '{Antigrief}', 'has enabled the antigrief function.', true)
|
||||
else
|
||||
AG.enabled = false
|
||||
get_actor(event, '{Antigrief}', 'has disabled the antigrief function.')
|
||||
get_actor(event, '{Antigrief}', 'has disabled the antigrief function.', true)
|
||||
end
|
||||
trust_connected_players()
|
||||
end
|
||||
@ -262,6 +266,7 @@ local build_config_gui = (function(player, frame)
|
||||
local label
|
||||
|
||||
local admin = player.admin
|
||||
frame.clear()
|
||||
|
||||
local scroll_pane =
|
||||
frame.add {
|
||||
@ -275,8 +280,6 @@ local build_config_gui = (function(player, frame)
|
||||
scroll_style.right_padding = 2
|
||||
scroll_style.top_padding = 2
|
||||
|
||||
scroll_pane.clear()
|
||||
|
||||
label = scroll_pane.add({type = 'label', caption = 'Player Settings'})
|
||||
label.style.font = 'default-bold'
|
||||
label.style.padding = 0
|
||||
|
@ -576,7 +576,7 @@ local remove_car =
|
||||
function(data)
|
||||
local player = data.player
|
||||
local car = data.car
|
||||
player.remove_item({name = car.name, count = 9999})
|
||||
player.remove_item({name = car.name, count = 1})
|
||||
end
|
||||
)
|
||||
|
||||
@ -667,7 +667,7 @@ function Public.validate_owner(ic, player, entity)
|
||||
if validate_entity(car.entity) then
|
||||
local p = game.players[car.owner]
|
||||
local list = get_trusted_system(ic, p)
|
||||
if p and p.valid then
|
||||
if p and p.valid and p.connected then
|
||||
if list[player.name] then
|
||||
return
|
||||
end
|
||||
@ -1076,8 +1076,8 @@ function Public.use_door_with_entity(ic, player, door)
|
||||
|
||||
local owner = game.players[car.owner]
|
||||
local list = get_trusted_system(ic, owner)
|
||||
if owner and owner.valid then
|
||||
if not list[player.name] then
|
||||
if owner and owner.valid and player.connected then
|
||||
if not list[player.name] and not player.admin then
|
||||
player.driving = false
|
||||
return player.print(
|
||||
'You have not been approved by ' .. owner.name .. ' to enter their vehicle.',
|
||||
|
@ -2002,43 +2002,70 @@ function Public.get_items()
|
||||
upgrade = false,
|
||||
static = true
|
||||
}
|
||||
main_market_items['tank-cannon'] = {
|
||||
stack = 1,
|
||||
value = 'coin',
|
||||
price = 25000,
|
||||
tooltip = 'Tank Cannon\nAvailable after wave 650.',
|
||||
upgrade = false,
|
||||
static = true,
|
||||
enabled = false
|
||||
}
|
||||
main_market_items['tank-machine-gun'] = {
|
||||
stack = 1,
|
||||
value = 'coin',
|
||||
price = 7000,
|
||||
tooltip = 'Tank Machine Gun\nAvailable after wave 400.',
|
||||
upgrade = false,
|
||||
static = true,
|
||||
enabled = false
|
||||
}
|
||||
main_market_items['vehicle-machine-gun'] = {
|
||||
stack = 1,
|
||||
value = 'coin',
|
||||
price = 2000,
|
||||
tooltip = 'Car Machine Gun\nAvailable after wave 200.',
|
||||
upgrade = false,
|
||||
static = true,
|
||||
enabled = false
|
||||
}
|
||||
local wave_number = WD.get_wave()
|
||||
|
||||
if wave_number >= 650 then
|
||||
main_market_items['tank-cannon'] = {
|
||||
stack = 1,
|
||||
value = 'coin',
|
||||
price = 25000,
|
||||
tooltip = 'Tank Cannon',
|
||||
upgrade = false,
|
||||
static = true,
|
||||
enabled = true
|
||||
}
|
||||
else
|
||||
main_market_items['tank-cannon'] = {
|
||||
stack = 1,
|
||||
value = 'coin',
|
||||
price = 25000,
|
||||
tooltip = 'Tank Cannon\nAvailable after wave 650.',
|
||||
upgrade = false,
|
||||
static = true,
|
||||
enabled = false
|
||||
}
|
||||
end
|
||||
if wave_number >= 400 then
|
||||
main_market_items['tank-machine-gun'] = {
|
||||
stack = 1,
|
||||
value = 'coin',
|
||||
price = 7000,
|
||||
tooltip = 'Tank Machine Gun',
|
||||
upgrade = false,
|
||||
static = true,
|
||||
enabled = true
|
||||
}
|
||||
else
|
||||
main_market_items['tank-machine-gun'] = {
|
||||
stack = 1,
|
||||
value = 'coin',
|
||||
price = 7000,
|
||||
tooltip = 'Tank Machine Gun\nAvailable after wave 400.',
|
||||
upgrade = false,
|
||||
static = true,
|
||||
enabled = false
|
||||
}
|
||||
end
|
||||
if wave_number >= 200 then
|
||||
main_market_items['vehicle-machine-gun'].enabled = true
|
||||
main_market_items['vehicle-machine-gun'].tooltip = 'Car Machine Gun'
|
||||
elseif wave_number >= 400 then
|
||||
main_market_items['tank-machine-gun'].enabled = true
|
||||
main_market_items['tank-machine-gun'].tooltip = 'Tank Machine Gune'
|
||||
elseif wave_number >= 650 then
|
||||
main_market_items['tank-cannon'].enabled = true
|
||||
main_market_items['tank-cannon'].tooltip = 'Tank Cannon'
|
||||
main_market_items['vehicle-machine-gun'] = {
|
||||
stack = 1,
|
||||
value = 'coin',
|
||||
price = 2000,
|
||||
tooltip = 'Car Machine Gun',
|
||||
upgrade = false,
|
||||
static = true,
|
||||
enabled = true
|
||||
}
|
||||
else
|
||||
main_market_items['vehicle-machine-gun'] = {
|
||||
stack = 1,
|
||||
value = 'coin',
|
||||
price = 2000,
|
||||
tooltip = 'Car Machine Gun\nAvailable after wave 200.',
|
||||
upgrade = false,
|
||||
static = true,
|
||||
enabled = false
|
||||
}
|
||||
end
|
||||
|
||||
return main_market_items
|
||||
|
@ -742,11 +742,12 @@ local boost_difficulty = function()
|
||||
WPT.set().coin_amount = 2
|
||||
WPT.set('upgrades').flame_turret.limit = 25
|
||||
WPT.set('upgrades').landmine.limit = 100
|
||||
WPT.set().locomotive_health = 20000
|
||||
WPT.set().locomotive_max_health = 20000
|
||||
WPT.set().locomotive_health = 15000
|
||||
WPT.set().locomotive_max_health = 15000
|
||||
WPT.set().bonus_xp_on_join = 700
|
||||
WD.set().next_wave = game.tick + 3600 * 20
|
||||
WPT.set().spidertron_unlocked_at_wave = 11
|
||||
WPT.set().math_difficulty = 4096
|
||||
WPT.set().difficulty_set = true
|
||||
elseif name == 'Normal' then
|
||||
rpg_extra.difficulty = 0.5
|
||||
@ -762,6 +763,7 @@ local boost_difficulty = function()
|
||||
WPT.set().bonus_xp_on_join = 300
|
||||
WD.set().next_wave = game.tick + 3600 * 15
|
||||
WPT.set().spidertron_unlocked_at_wave = 16
|
||||
WPT.set().math_difficulty = 3072
|
||||
WPT.set().difficulty_set = true
|
||||
elseif name == 'Hard' then
|
||||
rpg_extra.difficulty = 0
|
||||
@ -777,6 +779,7 @@ local boost_difficulty = function()
|
||||
WPT.set().bonus_xp_on_join = 50
|
||||
WD.set().next_wave = game.tick + 3600 * 10
|
||||
WPT.set().spidertron_unlocked_at_wave = 21
|
||||
WPT.set().math_difficulty = 2048
|
||||
WPT.set().difficulty_set = true
|
||||
elseif name == 'Insane' then
|
||||
rpg_extra.difficulty = 0
|
||||
@ -792,6 +795,7 @@ local boost_difficulty = function()
|
||||
WPT.set().bonus_xp_on_join = 0
|
||||
WD.set().next_wave = game.tick + 3600 * 5
|
||||
WPT.set().spidertron_unlocked_at_wave = 26
|
||||
WPT.set().math_difficulty = 1024
|
||||
WPT.set().difficulty_set = true
|
||||
end
|
||||
end
|
||||
@ -912,7 +916,7 @@ local on_init = function()
|
||||
}
|
||||
|
||||
local tooltip = {
|
||||
[1] = 'Wave Defense is based on amount of players.\nXP Extra reward points = 1.\nMining speed boosted = 1.5.\nRunning speed boosted = 0.2.\nCrafting speed boosted = 0.4.\nCoin amount per harvest = 2.\nFlame Turret limit = 25.\nLandmine limit = 100.\nLocomotive health = 20000.\nHidden Treasure has higher chance to spawn.\nGrace period: 20 minutes\nSpidertrons unlocks at zone 10.',
|
||||
[1] = 'Wave Defense is based on amount of players.\nXP Extra reward points = 1.\nMining speed boosted = 1.5.\nRunning speed boosted = 0.2.\nCrafting speed boosted = 0.4.\nCoin amount per harvest = 2.\nFlame Turret limit = 25.\nLandmine limit = 100.\nLocomotive health = 15000.\nHidden Treasure has higher chance to spawn.\nGrace period: 20 minutes\nSpidertrons unlocks at zone 10.',
|
||||
[2] = 'Wave Defense is based on amount of players.\nXP Extra reward points = 0.5.\nMining speed boosted = 1.\nRunning speed boosted = 0.1.\nCrafting speed boosted = 0.2.\nCoin amount per harvest = 1.\nFlame Turret limit = 10.\nLandmine limit = 50.\nLocomotive health = 10000.\nHidden Treasure has normal chance to spawn.\nGrace period: 15 minutes\nSpidertrons unlocks at zone 15.',
|
||||
[3] = 'Wave Defense is based on amount of players.\nXP Extra reward points = 0.\nMining speed boosted = 0.\nRunning speed boosted = 0.\nCrafting speed boosted = 0.\nCoin amount per harvest = 1.\nFlame Turret limit = 3.\nLandmine limit = 10.\nLocomotive health = 5000.\nHidden Treasure has lower chance to spawn.\nGrace period: 10 minutes\nSpidertrons unlocks at zone 20.',
|
||||
[4] = 'Wave Defense is based on amount of players.\nXP Extra reward points = 0.\nMining speed boosted = 0.\nRunning speed boosted = 0.\nCrafting speed boosted = 0.\nCoin amount per harvest = 1.\nFlame Turret limit = 0.\nLandmine limit = 0.\nLocomotive health = 1000.\nHidden Treasure has lower chance to spawn.\nGrace period: 5 minutes\nBiters are way more aggressive.\nCollapse starts after difficulty poll has ended.\nCollapse is much faster.\nSpidertrons unlocks at zone 25.'
|
||||
|
@ -100,7 +100,10 @@ function Public.reset_table()
|
||||
this.explosive_bullets = false
|
||||
this.locomotive_biter = nil
|
||||
this.disconnect_wagon = false
|
||||
this.math_difficulty = 9999
|
||||
this.spidertron_unlocked_at_wave = 11
|
||||
-- this.void_or_tile = 'lab-dark-2'
|
||||
this.void_or_tile = 'out-of-map'
|
||||
end
|
||||
|
||||
function Public.get(key)
|
||||
|
@ -66,7 +66,12 @@ local scrap_entities = {
|
||||
'medium-ship-wreck',
|
||||
'small-ship-wreck',
|
||||
'medium-ship-wreck',
|
||||
'small-ship-wreck',
|
||||
'small-ship-wreck'
|
||||
}
|
||||
|
||||
local scrap_entities_index = #scrap_entities
|
||||
|
||||
local scrap_entities_friendly = {
|
||||
'crash-site-chest-1',
|
||||
'crash-site-chest-2',
|
||||
'crash-site-chest-1',
|
||||
@ -75,7 +80,7 @@ local scrap_entities = {
|
||||
'crash-site-chest-2'
|
||||
}
|
||||
|
||||
local scrap_entities_index = #scrap_entities
|
||||
local scrap_entities_friendly_index = #scrap_entities_friendly
|
||||
|
||||
local spawner_raffle = {
|
||||
'biter-spawner',
|
||||
@ -435,7 +440,9 @@ local function process_level_14_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -504,7 +511,9 @@ local function process_level_13_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -558,7 +567,7 @@ local function process_level_13_position(x, y, data)
|
||||
tiles[#tiles + 1] = {name = 'water-shallow', position = p}
|
||||
end
|
||||
|
||||
local function process_level_12_position(x, y, data)
|
||||
local function process_level_12_position(x, y, data, void_or_lab)
|
||||
local p = {x = x, y = y}
|
||||
local seed = data.seed
|
||||
local tiles = data.tiles
|
||||
@ -592,7 +601,9 @@ local function process_level_12_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -606,7 +617,7 @@ local function process_level_12_position(x, y, data)
|
||||
if success then
|
||||
return
|
||||
end
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
if random(1, 100) > 88 then
|
||||
entities[#entities + 1] = {name = 'tree-0' .. random(1, 9), position = p}
|
||||
end
|
||||
@ -687,7 +698,9 @@ local function process_level_11_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -782,7 +795,9 @@ local function process_level_10_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -916,7 +931,9 @@ local function process_level_9_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -947,7 +964,7 @@ local function process_level_9_position(x, y, data)
|
||||
end
|
||||
|
||||
--SCRAPYARD
|
||||
local function process_level_8_position(x, y, data)
|
||||
local function process_level_8_position(x, y, data, void_or_lab)
|
||||
local p = {x = x, y = y}
|
||||
local seed = data.seed
|
||||
local tiles = data.tiles
|
||||
@ -962,17 +979,19 @@ local function process_level_8_position(x, y, data)
|
||||
local small_caves = get_noise('small_caves', p, seed)
|
||||
if noise_cave_ponds < 0.15 and noise_cave_ponds > -0.15 then
|
||||
if small_caves > 0.35 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
|
||||
if small_caves < -0.35 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -1012,6 +1031,13 @@ local function process_level_8_position(x, y, data)
|
||||
force = 'enemy'
|
||||
}
|
||||
end
|
||||
if random(1, 96) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = scrap_entities_friendly[random(1, scrap_entities_friendly_index)],
|
||||
position = p,
|
||||
force = 'player'
|
||||
}
|
||||
end
|
||||
if random(1, 5) > 1 then
|
||||
entities[#entities + 1] = {name = 'mineable-wreckage', position = p}
|
||||
end
|
||||
@ -1060,7 +1086,7 @@ local function process_level_8_position(x, y, data)
|
||||
end
|
||||
end
|
||||
|
||||
local function process_level_7_position(x, y, data)
|
||||
local function process_level_7_position(x, y, data, void_or_lab)
|
||||
local p = {x = x, y = y}
|
||||
local seed = data.seed
|
||||
local tiles = data.tiles
|
||||
@ -1149,12 +1175,12 @@ local function process_level_7_position(x, y, data)
|
||||
local small_caves = get_noise('small_caves', p, seed)
|
||||
if noise_cave_ponds < 0.25 and noise_cave_ponds > -0.25 then
|
||||
if small_caves > 0.55 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
|
||||
if small_caves < -0.55 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
|
||||
return
|
||||
end
|
||||
@ -1176,7 +1202,7 @@ local function process_level_7_position(x, y, data)
|
||||
end
|
||||
end
|
||||
|
||||
local function process_level_6_position(x, y, data)
|
||||
local function process_level_6_position(x, y, data, void_or_lab)
|
||||
local p = {x = x, y = y}
|
||||
local seed = data.seed
|
||||
local tiles = data.tiles
|
||||
@ -1194,12 +1220,12 @@ local function process_level_6_position(x, y, data)
|
||||
local small_caves = get_noise('small_caves', p, seed)
|
||||
if noise_cave_ponds < 0.45 and noise_cave_ponds > -0.45 then
|
||||
if small_caves > 0.45 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
|
||||
if small_caves < -0.45 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
end
|
||||
@ -1212,7 +1238,9 @@ local function process_level_6_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -1300,7 +1328,7 @@ local function process_level_6_position(x, y, data)
|
||||
end
|
||||
end
|
||||
|
||||
local function process_level_5_position(x, y, data)
|
||||
local function process_level_5_position(x, y, data, void_or_lab)
|
||||
local p = {x = x, y = y}
|
||||
local seed = data.seed
|
||||
local tiles = data.tiles
|
||||
@ -1345,7 +1373,9 @@ local function process_level_5_position(x, y, data)
|
||||
end
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -1380,10 +1410,10 @@ local function process_level_5_position(x, y, data)
|
||||
end
|
||||
end
|
||||
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
end
|
||||
|
||||
local function process_level_4_position(x, y, data)
|
||||
local function process_level_4_position(x, y, data, void_or_lab)
|
||||
local p = {x = x, y = y}
|
||||
local seed = data.seed
|
||||
local tiles = data.tiles
|
||||
@ -1444,12 +1474,12 @@ local function process_level_4_position(x, y, data)
|
||||
--Chasms
|
||||
if noise_cave_ponds < 0.15 and noise_cave_ponds > -0.15 then
|
||||
if small_caves > 0.75 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
|
||||
if small_caves < -0.75 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
end
|
||||
@ -1493,10 +1523,10 @@ local function process_level_4_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
end
|
||||
|
||||
local function process_level_3_position(x, y, data)
|
||||
local function process_level_3_position(x, y, data, void_or_lab)
|
||||
local p = {x = x, y = y}
|
||||
local seed = data.seed
|
||||
local tiles = data.tiles
|
||||
@ -1535,7 +1565,9 @@ local function process_level_3_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -1557,13 +1589,13 @@ local function process_level_3_position(x, y, data)
|
||||
--Chasms
|
||||
if noise_cave_ponds < 0.12 and noise_cave_ponds > -0.12 then
|
||||
if small_caves > 0.85 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if small_caves < -0.85 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
|
||||
return
|
||||
end
|
||||
@ -1649,10 +1681,10 @@ local function process_level_3_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
end
|
||||
|
||||
local function process_level_2_position(x, y, data)
|
||||
local function process_level_2_position(x, y, data, void_or_lab)
|
||||
local p = {x = x, y = y}
|
||||
local seed = data.seed
|
||||
local tiles = data.tiles
|
||||
@ -1678,12 +1710,12 @@ local function process_level_2_position(x, y, data)
|
||||
--Chasms
|
||||
if noise_cave_ponds < 0.15 and noise_cave_ponds > -0.15 then
|
||||
if small_caves > 0.32 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
|
||||
return
|
||||
end
|
||||
if small_caves < -0.32 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
end
|
||||
@ -1714,7 +1746,9 @@ local function process_level_2_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -1788,10 +1822,10 @@ local function process_level_2_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
end
|
||||
|
||||
local function process_level_1_2_position(x, y, data)
|
||||
local function process_level_1_2_position(x, y, data, void_or_lab)
|
||||
local p = {x = x, y = y}
|
||||
local seed = data.seed
|
||||
local buildings = data.buildings
|
||||
@ -1814,11 +1848,11 @@ local function process_level_1_2_position(x, y, data)
|
||||
--Chasms
|
||||
if noise_cave_ponds < 0.101 and noise_cave_ponds > -0.102 then
|
||||
if small_caves > 0.52 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
if small_caves < -0.52 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
end
|
||||
@ -1844,7 +1878,9 @@ local function process_level_1_2_position(x, y, data)
|
||||
end
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -1971,7 +2007,7 @@ local function process_level_1_2_position(x, y, data)
|
||||
end
|
||||
end
|
||||
|
||||
local function process_level_1_position(x, y, data)
|
||||
local function process_level_1_position(x, y, data, void_or_lab)
|
||||
local p = {x = x, y = y}
|
||||
local seed = data.seed
|
||||
local buildings = data.buildings
|
||||
@ -1994,11 +2030,11 @@ local function process_level_1_position(x, y, data)
|
||||
--Chasms
|
||||
if noise_cave_ponds < 0.111 and noise_cave_ponds > -0.112 then
|
||||
if small_caves > 0.53 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
if small_caves < -0.53 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
end
|
||||
@ -2012,7 +2048,9 @@ local function process_level_1_position(x, y, data)
|
||||
return
|
||||
end
|
||||
|
||||
if random(1, 2048) == 1 then
|
||||
local value = WPT.get('math_difficulty')
|
||||
|
||||
if random(1, value) == 1 then
|
||||
entities[#entities + 1] = {
|
||||
name = spawner[random(1, size_of_spawner)],
|
||||
position = p,
|
||||
@ -2135,7 +2173,7 @@ local function process_level_1_position(x, y, data)
|
||||
end
|
||||
end
|
||||
|
||||
local function process_level_0_position(x, y, data)
|
||||
local function process_level_0_position(x, y, data, void_or_lab)
|
||||
local p = {x = x, y = y}
|
||||
local seed = data.seed
|
||||
local buildings = data.buildings
|
||||
@ -2158,11 +2196,11 @@ local function process_level_0_position(x, y, data)
|
||||
--Chasms
|
||||
if noise_cave_ponds < 0.101 and noise_cave_ponds > -0.102 then
|
||||
if small_caves > 0.52 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
if small_caves < -0.52 then
|
||||
tiles[#tiles + 1] = {name = 'lab-dark-2', position = p}
|
||||
tiles[#tiles + 1] = {name = void_or_lab, position = p}
|
||||
return
|
||||
end
|
||||
end
|
||||
@ -2296,8 +2334,8 @@ end
|
||||
|
||||
Public.levels = {
|
||||
process_level_0_position,
|
||||
process_level_1_2_position,
|
||||
process_level_1_position,
|
||||
process_level_1_2_position,
|
||||
process_level_3_position,
|
||||
process_level_5_position,
|
||||
process_level_8_position,
|
||||
@ -2335,7 +2373,9 @@ local function process_bits(x, y, data)
|
||||
process_level = levels[#levels]
|
||||
end
|
||||
|
||||
process_level(x, y, data)
|
||||
local void_or_tile = WPT.get('void_or_tile')
|
||||
|
||||
process_level(x, y, data, void_or_tile)
|
||||
end
|
||||
|
||||
local function border_chunk(data)
|
||||
|
@ -142,7 +142,7 @@ local function get_nearby_chests(player)
|
||||
else
|
||||
type = {'container', 'logistic-container'}
|
||||
end
|
||||
for _, e in pairs(player.surface.find_entities_filtered({type = type, area = area})) do
|
||||
for _, e in pairs(player.surface.find_entities_filtered({type = type, area = area, force = 'player'})) do
|
||||
if ((player.position.x - e.position.x) ^ 2 + (player.position.y - e.position.y) ^ 2) <= r_square then
|
||||
i = i + 1
|
||||
containers[i] = e
|
||||
|
@ -155,6 +155,9 @@ local function poll_difficulty(player)
|
||||
b.style.font = 'heading-2'
|
||||
b.style.minimal_width = 160
|
||||
b.tooltip = this.tooltip[i]
|
||||
if this.difficulties[i].disabled then
|
||||
b.enabled = false
|
||||
end
|
||||
end
|
||||
local b = frame.add({type = 'label', caption = '- - - - - - - - - - - - - - - - - -'})
|
||||
local b =
|
||||
@ -223,6 +226,12 @@ end
|
||||
|
||||
local function on_player_joined_game(event)
|
||||
local player = game.players[event.player_index]
|
||||
local player_count = #game.connected_players
|
||||
if player_count >= 20 then
|
||||
this.difficulties[1].disabled = true
|
||||
this.tooltip[1] = 'Too many players connected!'
|
||||
end
|
||||
|
||||
if game.tick < this.difficulty_poll_closing_timeout then
|
||||
if not this.difficulty_player_votes[player.name] then
|
||||
poll_difficulty(player)
|
||||
|
@ -664,6 +664,7 @@ Gui.on_click(
|
||||
|
||||
if reset_gui_input and reset_gui_input.valid and reset_gui_input.state then
|
||||
if not rpg_t[player.index].reset then
|
||||
rpg_t[player.index].allocate_index = 1
|
||||
rpg_t[player.index].reset = true
|
||||
Functions.rpg_reset_player(player, true)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user